Search

CN-122022893-A - Sales prediction method and system based on self-adaptive multi-core convolution space-time attention

CN122022893ACN 122022893 ACN122022893 ACN 122022893ACN-122022893-A

Abstract

The invention discloses a sales volume predicting method and a system based on self-adaptive multi-core convolution space-time attention, which relate to the technical field of sales volume predicting of electronic commerce platforms, and the invention combines a timestamp embedding and a relative position coding by enhancing a position coding mechanism, improves the perception capability of a model on commodity sales volume position characteristics, the self-adaptive multi-core convolution-cross attention module is provided, the multi-scale convolution kernel group design is utilized, the relation of spatial features in commodity sales and the local dependency relation of single spatial features are captured, the fusion of space-time dependency is realized, and the sales prediction model of the electronic commerce platform is provided based on the self-adaptive multi-core convolution-cross attention. The model can capture the relationship of the time sequence local dependency relationship, the long-term dependency relationship and the space dimension in the data and perform fusion output.

Inventors

  • JIN BO
  • XU XIAOLONG

Assignees

  • 南京邮电大学

Dates

Publication Date
20260512
Application Date
20260208

Claims (10)

  1. 1. The sales prediction method based on the self-adaptive multi-core convolution space-time attention is characterized by comprising the following steps of: Acquiring commodity sales data in a historical time period, and performing embedded coding on the commodity sales data in the historical time period to obtain commodity historical sales characteristic parameters; Carrying out pooling and multi-core one-dimensional convolution operation on the commodity historical sales characteristic parameters based on the plurality of one-dimensional convolution cores to obtain time characteristic data of a plurality of scales, weighting the time characteristic data of the plurality of scales to obtain time attention weights, and applying the time attention weights to the commodity historical sales characteristic parameters to obtain historical sales data with time characteristics; Performing convolution calculation on the two-dimensional space dimension data to obtain the weight of the space feature, and applying the weight of the space feature to the history sales data with the time feature to obtain the history feature data with the time dimension and the space dimension; And obtaining commodity sales data with global features by using an attention mechanism on historical feature data with time dimension and space dimension, inputting the commodity sales data with global features into a pre-established feedforward neural network model, and outputting to obtain commodity sales prediction results.
  2. 2. The adaptive multi-core convolution spatiotemporal attention based sales prediction method of claim 1, wherein the process of embedded encoding commodity sales data over historical time periods is as follows: fusing the characteristics of commodity historical data with date characteristics, increasing the position codes of time characteristic dimensions, and realizing the calculation of mapping from a low-dimensional space to a high-dimensional space; Setting the commodity sales input data size as Wherein For the sequence of sales of the commodity, In the case of a batch size of the product, As a function of the number of time features, Converting date attribute in commodity sales to sequence length The commodity sales sequence after the date scale expansion is the feature dimension , The commodity sales sequence after high-dimensional mapping is that the expanded time feature dimension is As characteristic parameters of the historical sales volume of the commodity, Dimension for high-dimensional mapping; 。
  3. 3. The adaptive multi-core convolution spatiotemporal attention based sales prediction method of claim 1, wherein the process of generating a plurality of one-dimensional convolution kernels based on the number of commodity history sales characteristic parameters is as follows: calculating a plurality of one-dimensional convolution kernels to form a set of convolution kernels and initialize a multi-core one-dimensional convolution layer, wherein the calculation formula of the one-dimensional convolution kernel group is as follows: Wherein the method comprises the steps of Is the first The size of the one-dimensional convolution kernel, In order to expand the dimension of the temporal feature, The nearest odd number is rounded up with square root.
  4. 4. The sales prediction method based on adaptive multi-core convolution space-time attention according to claim 1, wherein the process of pooling and multi-core one-dimensional convolution operation based on the commodity history sales feature parameters by a plurality of one-dimensional convolution checks is as follows: commodity sales sequence And for X, carrying out average pooling operation on the time dimension of the historical sales volume data X to obtain data of time feature dimension, wherein a calculation formula is as follows: Wherein, the Item number representing input commodity sales characteristics The number of feature vectors is chosen to be the same, In the case of a batch size of the product, For the dimension of the high-dimensional map, For the tensor after pooling, carrying out one-dimensional global average pooling operation to obtain ; For a pair of Different convolution kernels are calculated to obtain time characteristic data of a plurality of scales, and a calculation formula of the multi-core one-dimensional convolution is as follows: Wherein, the As a one-dimensional convolution function, the convolution kernel has the size of , In the case of a batch size of the product, Is the dimension of the high-dimensional map.
  5. 5. The adaptive multi-core convolution spatiotemporal attention based sales prediction method of claim 1, wherein the historical sales data with temporal characteristics is calculated as follows: calculating the maximum value of a plurality of time feature data in a time feature dimension, calculating the weight of the time feature calculated by the time feature dimension, and calculating historical sales data with the time feature ; Wherein, the As a function of the current, In order to take the function of the maximum value, The time feature weights are obtained for the activation function, For the multi-core one-dimensional convolution feature vector, Taking maximum value in time feature dimension for multi-core one-dimensional convolution feature vector, For the sequence of sales of the commodity, A sequence of commodity sales for learning temporal characteristics.
  6. 6. The adaptive multi-core convolution spatiotemporal attention based sales prediction method according to claim 1, wherein the process of maximum pooling and average pooling of historical sales data with temporal characteristics based on a preset two-dimensional spatial convolution layer is as follows: Initializing a two-dimensional space convolution layer according to the size of the space dimension convolution kernel; The calculation formula is as follows: Wherein, the Item number representing input commodity sales characteristics The feature vector of each moment in time, In the case of a batch size of the product, In order to expand the dimension of the temporal feature, For the tensor after pooling, completing one-dimensional global average pooling operation to obtain ; Respectively carrying out average pooling according to the time dimension data to obtain Maximum pooling to obtain And connecting to obtain two-dimensional time dimension data, wherein the calculation formula is as follows: Wherein, the Item number representing input commodity sales characteristics The feature vector of each moment in time, In the case of a batch size of the product, Is that 、 The connected tensor, max, is the maximum function, Is a join function.
  7. 7. The adaptive multi-core convolution spatiotemporal attention based sales prediction method of claim 1, wherein the processing of the historical feature data with temporal and spatial dimensions is as follows: performing space convolution calculation and gating calculation on the two-dimensional time dimension data to obtain the weight of the space feature, and applying the weight of the space feature to the history sales volume data with the time feature to obtain the history feature data with the time dimension and the space dimension The calculation is as follows: Wherein, the As a function of the convolution, The activation function is used to obtain the time feature weights.
  8. 8. The adaptive multi-core convolution spatiotemporal attention-based sales prediction method according to claim 1, wherein the process of deriving commodity sales data with global features using an attention mechanism on historical feature data with time dimension and space dimension is as follows: forming three full-connection calculation for historical characteristic data with time dimension and space dimension to obtain three characteristic tensors , , Self-attention calculation is carried out on the three characteristic tensors to obtain The calculation formula is as follows: Wherein, the To activate a function to obtain global feature weights, Is the value of the dimension length.
  9. 9. The adaptive multi-core convolution spatiotemporal attention-based sales prediction method according to claim 1, characterized in that the pre-established feedforward neural network model is as follows: Wherein, the Is a full-connection layer, and is formed by the following steps, For the history feature data learned by self-attention, Y is a predicted result of sales of the commodity.
  10. 10. The sales prediction system based on the adaptive multi-core convolution space-time attention, which adopts the sales prediction method based on the adaptive multi-core convolution space-time attention as claimed in any one of claims 1 to 9, is characterized by comprising the following steps: The feature coding module is used for acquiring commodity sales data in a historical time period, and carrying out embedded coding on the commodity sales data in the historical time period to obtain commodity historical sales feature parameters; The feature processing module is used for carrying out pooling and multi-core one-dimensional convolution operation on the commodity historical sales feature parameters based on the plurality of one-dimensional convolution cores to obtain time feature data of a plurality of scales, weighting the time feature data of the plurality of scales to obtain time attention weights, and applying the time attention weights to the commodity historical sales feature parameters to obtain historical sales data with time features; The space-time fusion module is used for carrying out maximum pooling and average pooling on the history sales data with time characteristics based on a preset two-dimensional space convolution layer to obtain two-dimensional space dimension data; And the sales volume prediction module is used for obtaining commodity sales volume data with global characteristics by using an attention mechanism on the historical characteristic data with time dimension and space dimension, inputting the commodity sales volume data with global characteristics into a pre-established feedforward neural network model, and outputting and obtaining commodity sales volume prediction results.

Description

Sales prediction method and system based on self-adaptive multi-core convolution space-time attention Technical Field The invention relates to the technical field of sales prediction of an e-commerce platform, in particular to a sales prediction method and a sales prediction system based on self-adaptive multi-core convolution space-time attention. Background The commodity sales prediction problem has great value for all industries, can help enterprises to better know future trends of the industries, makes more intelligent decisions, and has positive influence on the development of society. The core characteristics of the time sequence data are time sequence dependency and non-stationarity, the traditional statistical model is stable in short-term prediction, but is difficult to capture multi-scale space-time dependency by a linear assumption and fixed parameter mechanism facing to a complex and changeable long-term prediction task. In view of the critical role of commodity sales data in real-world applications, as well as the challenges of complex data features and model design, long commodity sales prediction remains a challenging research area. However, in the current research work, there are still a number of problems to be solved. First, previous studies have focused more on modifying components or architecture in models, nor can a purely self-attention component fully characterize commodity sales. Secondly, space-time coupling defects exist, and the traditional self-attention mixes time dimension and space dimension dependence into one-dimensional sequence processing, so that the confusion of local fine granularity characteristics and global characteristics is caused. Thirdly, the multi-scale perception is insufficient, the existing work is dependent on fixed windows or posterior decomposition (such as season-trend separation), and the problems of data characteristic difference, long-short time period difference and the like caused by different data sets are difficult to adapt. Resulting in lower accuracy of prediction of sales of the good. Disclosure of Invention In order to solve the above-mentioned shortcomings in the background art, the present invention aims to provide a sales prediction method and system based on adaptive multi-core convolution space-time attention. In a first aspect, the object of the present invention is achieved by a method for predicting sales based on adaptive multi-core convolution spatio-temporal attention, the method comprising the steps of: Acquiring commodity sales data in a historical time period, and performing embedded coding on the commodity sales data in the historical time period to obtain commodity historical sales characteristic parameters; Carrying out pooling and multi-core one-dimensional convolution operation on the commodity historical sales characteristic parameters based on the plurality of one-dimensional convolution cores to obtain time characteristic data of a plurality of scales, weighting the time characteristic data of the plurality of scales to obtain time attention weights, and applying the time attention weights to the commodity historical sales characteristic parameters to obtain historical sales data with time characteristics; Performing convolution calculation on the two-dimensional space dimension data to obtain the weight of the space feature, and applying the weight of the space feature to the history sales data with the time feature to obtain the history feature data with the time dimension and the space dimension; And obtaining commodity sales data with global features by using an attention mechanism on historical feature data with time dimension and space dimension, inputting the commodity sales data with global features into a pre-established feedforward neural network model, and outputting to obtain commodity sales prediction results. With reference to the first aspect, in certain implementation manners of the first aspect, the method further includes the process of performing embedded encoding on commodity sales data in a historical time period, where: The features of commodity historical data are fused with date features, so that the position coding of the time feature dimension is increased, and the calculation of mapping from a low-dimensional space to a high-dimensional space is realized. Setting the commodity sales input data size asWhereinFor the sequence of sales of the commodity,In the case of a batch size of the product,As a function of the number of time features,Converting date attribute in commodity sales to sequence lengthThe commodity sales sequence after the date scale expansion is the feature dimension,The commodity sales sequence after high-dimensional mapping is that the expanded time feature dimension isAs characteristic parameters of the historical sales volume of the commodity,Dimension for high-dimensional mapping; 。 with reference to the first aspect, in certain implementation manners of the first aspect, the m