Method and device for constructing sales volume prediction model and sales volume prediction, equipment and medium
By building a sales forecast model, using sales scenario attribute data and basic model performance data for prediction learning, and optimizing network parameters based on reinforcement learning, realizing intelligent weighted fusion of multiple basic models, solving the performance limitations of sales forecast model in the existing technology Problems that are difficult to explore in nature and internal logic improve the accuracy and stability of predictions.
Patent Information
- Application Number
- CN202311036485.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-16
- Publication Date
- 2025-02-21
AI Technical Summary
In the sales forecast of e-commerce products, the existing technology relies on the rule configuration selection model, which leads to the large limitations in the performance of the prediction result when facing complex influencing factors, and it is difficult to deeply explore the internal logic between the product and sales.
By obtaining the sales scenario attribute data of item samples and the sales forecast performance data of multiple basic models, a sample feature matrix is constructed, and an initial action strategy network is obtained using prediction learning. Then, the network parameters are optimized and adjusted based on the reinforcement learning method, and the target action strategy network is obtained, and the intelligent weighted fusion of multiple basic models is achieved by combining the fusion model.
It improves the accuracy and stability of sales forecasts, reduces the prediction deviation and variance of artificially specified models, and realizes automated and intelligent sales forecasts for different input items.
Smart Images

Figure CN119494676A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method, device, equipment and medium for building a sales forecasting model and sales forecasting. Background Art
[0002] In the intelligent prediction scenario, many models such as classic statistical models, machine learning models, and deep learning models are widely used. When making intelligent predictions, most models are selected based on their advantages. Since each model has its own limitations, when faced with a prediction problem with many influencing factors and more complex predictions, almost no single model can achieve good prediction results.
[0003] Take the sales forecast of e-commerce products as an example. Since there are many factors that affect the sales of e-commerce products and they are relatively complex, in the relevant technologies, when selecting the prediction algorithm model, most of them are based on pre-configured rules to select the prediction model. For example, for high-selling products, the hot product prediction model is used to predict sales, and for low-selling products, the long-tail prediction model is used to predict sales. However, the above-mentioned strategy of selecting the prediction model based on rules requires preliminary exploration to determine the appropriate rules. Faced with a large number of commodities, the number of rules needs to be sorted out and adjusted, which requires more expert experience and consumes a lot of time and cost. Moreover, the strategy of selecting the prediction model based on rule information is difficult to deeply explore the internal logic between products and sales for hundreds of millions of commodities on large e-commerce platforms, and the model performance corresponding to this strategy has great limitations. Summary of the invention
[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the embodiments of the present disclosure provide a method, apparatus, device and medium for building a sales forecasting model and sales forecasting.
[0005] In the first aspect, the embodiments of the present disclosure provide a method for constructing a sales prediction model. The method for constructing a sales prediction model includes: obtaining sales scenario attribute data of an item sample and sales prediction performance data of multiple basic models for the item sample; constructing a sample feature matrix of the item sample based on the sales scenario attribute data and the sales prediction performance data; performing predictive learning on the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network; optimizing and adjusting the parameters of the initial action strategy network based on a reinforcement learning method to obtain a target action strategy network after parameter optimization; connecting the output end of the target action strategy network to the fusion weight input end of a fusion model, the fusion model being a prediction model in which the multiple basic models are fused based on the fusion weights, and the target action strategy network and the fusion model constitute a sales prediction model.
[0006] According to an embodiment of the present disclosure, a mapping relationship between the above-mentioned sample feature matrix and the basic model weights is predicted and learned to obtain an initial action strategy network, including: taking the above-mentioned sample feature matrix as the input of a pre-trained model, training the above-mentioned pre-trained model, the output of the above-mentioned pre-trained model is the weight prediction probability corresponding to the above-mentioned multiple basic models, and the training label is the basic model with the best sales prediction performance data corresponding to the input; the trained pre-trained model is used as the above-mentioned initial action strategy network.
[0007] According to an embodiment of the present disclosure, based on a reinforcement learning method, the parameters of the above-mentioned initial action policy network are optimized and adjusted to obtain a target action policy network with optimized parameters, including: based on a deep deterministic policy gradient (DDPG) algorithm, the parameters of the above-mentioned initial action policy network are optimized and adjusted to obtain the above-mentioned target action policy network; wherein, the sample feature matrix input by the above-mentioned initial action policy network is used as the state, and the basic model weights output by the above-mentioned initial action policy network are used as the action, and the goal of the optimization adjustment is to minimize the temporal difference learning (TD) error between the respective benefits of the above-mentioned target action policy network and the above-mentioned initial action policy network.
[0008] According to an embodiment of the present disclosure, the expression of the above-mentioned timing difference learning error is:
[0009]
[0010] Among them, R j+1 Indicates state S j+1 and action A j+1 The corresponding reward information, j represents the time sequence number of the iteration round; γ represents the discount factor, which is used to represent the relative proportion of the delayed reward to the current reward; Q j+1 (S j+1 , A j+1 ) indicates state S j+1 and action A j+1 The corresponding value function; Q j (S j , A j ) indicates state S j and action A j The corresponding value function, min represents the minimization function, and θ below min represents the minimization of the temporal difference learning error by adjusting the parameters of the initial action strategy network.
[0011] According to an embodiment of the present disclosure, in the process of optimizing and adjusting the parameters of the above-mentioned initial action policy network based on the above-mentioned deep deterministic policy gradient algorithm, for each round in each iteration cycle, the weight of the basic model corresponding to the action of the current round is weighted and calculated with the sales forecast results of the above-mentioned multiple basic models to obtain the fused sales forecast result of the current round; and reward information is generated according to the evaluation index of the fused sales forecast result of the above-mentioned current round. Wherein, generating reward information according to the evaluation index of the above-mentioned fused sales forecast result includes: determining the error index between the above-mentioned fused sales forecast result and the true value of sales; determining the ranking information of the sales forecast performance data corresponding to the above-mentioned fused sales result in the model set, and the above-mentioned model set includes the above-mentioned multiple basic models; wherein the above-mentioned sales forecast performance data is the error index between the historical forecast value and the true value within the replenishment cycle; and calculating according to the above-mentioned ranking information and the above-mentioned error index to obtain the reward information.
[0012] According to an embodiment of the present disclosure, the sales scenario attribute data includes: the historical sales time series data and scenario attribute data of the item sample; the scenario attribute data includes at least one of the following: item basic attribute data, warehouse location data, demand attribute data, and sales attribute data. Based on the sales scenario attribute data and the sales forecast performance data, a feature matrix of the item sample is constructed, including: inputting the first historical sales time series data into the first coding and feature recognition model for processing to obtain the first feature data corresponding to the preset dimension; inputting the scenario attribute data into the second coding and feature recognition model for processing to obtain the second feature data under the preset dimension; inputting the sales forecast performance data into the third coding and feature recognition model for processing to obtain the third feature data under the preset dimension; splicing the first feature data, the second feature data, and the third feature data to obtain the feature matrix of the item sample.
[0013] According to an embodiment of the present disclosure, the basic attribute data of the above-mentioned items include at least one of the following: item category, item brand, and item newness label; the demand attribute data include at least one of the following: user type of the demander, activity-driven label data, and temperature-driven label data; the sales attribute data include at least one of the following: item popularity label data, item sales volatility label data, promotion-sensitive label data, activity-sensitive label data, and plan-driven label data. The above-mentioned sales scenario attribute data and the above-mentioned sales forecast performance data are divided into the following variable categories: static category variables, static numerical variables, dynamic category variables, dynamic numerical variables, historically observed dynamic category variables, and historically observed dynamic numerical variables; for the category variables in the above-mentioned sales scenario attribute data, based on the above-mentioned second encoding and feature recognition model, the multiple category variables corresponding to each item sample in the first time period are converted into floating-point variables of the same dimension; the above-mentioned first time period is the time period corresponding to the above-mentioned first historical sales time series.
[0014] According to an embodiment of the present disclosure, the sales scenario attribute data includes: first historical sales time series data and scenario attribute data for training. The first historical sales time series data satisfies the following conditions: the first historical sales time series data is input into the multiple basic models for prediction, and the accuracy difference between the best and the second best basic models in the sales prediction performance data obtained is above the set difference value.
[0015] In the second aspect, an embodiment of the present disclosure provides a method for sales forecasting. The above-mentioned sales forecasting method includes: obtaining target sales scenario attribute data of the item to be predicted and target sales forecasting performance data of multiple basic models for the above-mentioned item to be predicted; constructing the target feature matrix of the above-mentioned item to be predicted based on the above-mentioned target sales scenario attribute data and the above-mentioned target sales forecasting performance data; inputting the above-mentioned target feature matrix into the sales forecasting model for processing, and outputting the sales forecast result corresponding to the item to be predicted. The above-mentioned sales forecasting model is constructed by the method for constructing the sales forecasting model as described above; wherein, the target fusion weight corresponding to the target feature matrix is output by the above-mentioned target action strategy network to the above-mentioned fusion model, and the above-mentioned fusion model outputs the sales forecast result corresponding to the above-mentioned item to be predicted.
[0016] In a third aspect, an embodiment of the present disclosure provides a device for constructing a sales forecast model. The device for constructing a sales forecast model includes: a data acquisition module, a feature matrix construction module, a first processing module, a second processing module and a model construction module. The data acquisition module is used to obtain the sales scenario attribute data of the item sample and the sales forecast performance data of multiple basic models for the item sample. The feature matrix construction module is used to construct the sample feature matrix of the item sample according to the sales scenario attribute data and the sales forecast performance data. The first processing module is used to predict and learn the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network. The second processing module is used to optimize and adjust the parameters of the initial action strategy network based on a reinforcement learning method to obtain a target action strategy network after parameter optimization. The model construction module is used to connect the output end of the target action strategy network to the fusion weight input end of the fusion model. The fusion model is a prediction model in which the multiple basic models are fused based on the fusion weights. The target action strategy network and the fusion model constitute a sales forecast model.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a device for sales prediction. The sales prediction device includes: a data acquisition module, a feature matrix construction module and a prediction module. The data acquisition module is used to obtain the target sales scenario attribute data of the item to be predicted and the target sales prediction performance data of multiple basic models for the item to be predicted. The feature matrix construction module is used to construct a target feature matrix of the item to be predicted based on the target sales scenario attribute data and the target sales prediction performance data. The prediction module is used to input the target feature matrix into the sales prediction model for processing, and output the sales prediction result corresponding to the item to be predicted. The sales prediction model is constructed by the method or device for constructing the sales prediction model as described above; wherein, the target action strategy network outputs the target fusion weight corresponding to the target feature matrix to the fusion model, and the fusion model outputs the sales prediction result corresponding to the item to be predicted.
[0018] In a fifth aspect, an embodiment of the present disclosure provides an electronic device. The electronic device includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory is used to store computer programs; and the processor is used to implement the method for constructing a sales forecast model or the method for sales forecasting as described above when executing the program stored in the memory.
[0019] In a sixth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for constructing a sales forecast model or the method for sales forecasting as described above is implemented.
[0020] The above technical solution provided by the embodiments of the present disclosure has at least some or all of the following advantages:
[0021] By utilizing the correlation between the attribute data (such as scene label data, historical time series sales data, etc.) in the item sales scene and the performance of each basic model, the sample feature matrix of the item sample is constructed based on the sales scene attribute data of the item sample and the sales prediction performance data of multiple basic models, and the basic model weights corresponding to the above sample feature matrix are predicted and learned to obtain the initial action strategy network; the process of predictive learning can dig out the correlation between the item sales scene and the prediction performance of multiple basic models; further based on the reinforcement learning method, the parameters of the above initial action strategy network are optimized and adjusted, and the delayed feedback mechanism of reinforcement learning is used to guide the initial action strategy network to optimize the prediction of the fusion weights of multiple basic models based on limited observations when the model performance information is lagging, so as to realize the intelligent weighted fusion of multiple basic models, thereby improving the accuracy and stability of sales prediction; effectively reducing the prediction deviation and variance corresponding to the artificial specification of a single model or the specification of a certain prediction model based on rules. When the above sales prediction model is used to predict the sales of the item to be predicted, the corresponding target fusion weight can be output according to the feature matrix of the item to be predicted, so as to realize the automatic and intelligent sales prediction matching different input items. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0024] Figure 1 The method for constructing a sales forecasting model and the system architecture of the sales forecasting method applicable to the embodiments of the present disclosure are schematically shown;
[0025] Figure 2 A flowchart of a method for constructing a sales forecasting model according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 3 The following schematically shows the implementation process of steps S220 and S230 according to an embodiment of the present disclosure;
[0027] Figure 4 The following schematically shows an implementation process diagram of step S240 according to an embodiment of the present disclosure;
[0028] Figure 5 A flowchart of a sales volume forecasting method according to an embodiment of the present disclosure is schematically shown;
[0029] Figure 6 The structure block diagram of the device for building a sales forecasting model according to an embodiment of the present disclosure is schematically shown;
[0030] Figure 7 A structural block diagram of a device for sales forecasting according to an embodiment of the present disclosure is schematically shown; and
[0031] Figure 8 The structural block diagram of the electronic device provided by the embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
[0033] Figure 1 The system architecture of the method for constructing a sales forecasting model and the method for sales forecasting applicable to the embodiments of the present disclosure is schematically shown.
[0034] Reference Figure 1 As shown, the system architecture 100 of the method for building a sales forecast model and the method for sales forecasting applicable to the embodiment of the present disclosure includes: terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is a medium that provides a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0035] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 may be installed with shopping applications, and may also be installed with other communication client applications, such as web browser applications, picture playback applications, video playback applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0036] The terminal devices 101, 102, and 103 may be various electronic devices with display screens, such as, but not limited to, smart phones, tablet computers, laptop computers, desktop computers, smart watches, smart bracelets, smart robots, in-vehicle smart terminals, and the like.
[0037] The server 105 may be a server that provides various services, such as a background management server (only as an example) that processes data and provides service support for shopping applications used by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received shopping request and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device.
[0038] It should be noted that the method for constructing a sales forecast model and the method for sales forecasting provided in the embodiments of the present disclosure can generally be executed by the server 105 or a terminal device with a certain computing capability. Accordingly, the device for constructing a sales forecast model and the device for sales forecasting provided in the embodiments of the present disclosure can generally be set in the server 105 or in the above-mentioned terminal device with a certain computing capability. The method for constructing a sales forecast model and the method for sales forecasting provided in the embodiments of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the device for constructing a sales forecast model and the device for sales forecasting provided in the embodiments of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0040] A first exemplary embodiment of the present disclosure provides a method for constructing a sales volume prediction model.
[0041] Figure 2 A flowchart of a method for constructing a sales forecasting model according to an embodiment of the present disclosure is schematically shown.
[0042] Reference Figure 2 As shown, the method for constructing a sales forecasting model provided by the embodiment of the present disclosure includes the following steps: S210, S220, S230, S240 and S250. The above steps S210 to S250 can be executed by a server or a terminal device with certain computing capabilities.
[0043] In step S210, sales scenario attribute data of the item sample and sales prediction performance data of multiple basic models for the item sample are obtained.
[0044] Item samples refer to the items used in the training phase, and there can be multiple item samples. These items can be various types of tangible goods, intellectual property goods, or experience service goods, such as electronic devices, clothes, shoes, bags, household goods, skin care products, books (e-books or paper books, etc.), equity products (such as membership products, movie tickets, attraction tickets, event tickets, bus tickets, etc.), etc.
[0045] In some embodiments, the sales scenario attribute data of the item sample includes: the first historical sales time series data and scenario attribute data of the item sample; the above scenario attribute data includes at least one of the following: basic attribute data of the item, geographical data of the warehouse (for example, province, city, region, etc.), demand attribute data, and sales attribute data.
[0046] In some embodiments, the above-mentioned basic attribute data of the items include at least one of the following: item category, item brand, and item newness label; the above-mentioned demand attribute data include at least one of the following: user type of the demander, activity-driven label data, and temperature-driven label data; the above-mentioned sales attribute data include at least one of the following: item popularity label data, item sales volatility label data, promotion-sensitive label data, activity-sensitive label data, and plan-driven label data.
[0047] For example, based on the difference between the time when a product is first listed and the time when it is first sold, the label for the newness of the item can correspond to: new product label or second-hand product label, etc. The user types on the demand side can be individual customers (toC type) or institutional users (toB type). In some sales scenarios, the sudden increase in sales of a product is closely related to marketing activities, so such products will be labeled as activity-driven. In some sales scenarios, the sudden increase in sales of a product is closely related to changes in temperature (sometimes also related to seasons), so such products will be labeled as temperature-driven. Based on the difference in sales ranking (indicating the corresponding sales percentage ranking of an item under the same category of products over a period of time in history) and the average sales information of historical N days, the label data for the popularity of an item can correspond to: hot products, regular products, long-tail products, etc. According to the square of the coefficient of variation of historical sales (CV 2 , Square of Coefficient of Variation, the coefficient of variation squared, is calculated by calculating the quotient of the historical sales standard deviation and the historical sales mean and then squaring it. This parameter CV 2 Indicates the degree of fluctuation of historical demand, used to quantify the uncertainty of demand for items) data, the sales volatility label data of items can be determined as: sales fluctuation, stable sales. According to the Pearson correlation coefficient between price and sales, the corresponding items can be labeled with promotion-sensitive labels. According to the sales explosion ratio during historical marketing activities (average during the activity / average of regular days before the activity), activity-sensitive labels are marked. According to business input, plan-driven labels are marked. The sales of some categories (especially hot products) in some activity time periods are strongly plan-driven rather than demand-driven. For example, assuming that the plan for the stationery category on a shopping activity day is: year-on-year sales / sales volume requirements increase by 10%, then various marketing means will be used to try to achieve this goal during the activity day. The algorithm needs to use this overall plan to determine which specific products under the category the 10% sales increase should be allocated to, how to allocate sales values, etc. These specific products will be labeled with plan-driven labels.
[0048] In some implementation scenarios, in order to more accurately explore the intrinsic relationship between items and the prediction performance of the basic model and improve the stability of subsequent prediction results, the types of sales scenario attribute data used in the training phase can be more comprehensive.
[0049] For example, when determining the sales scenario data of several dimensions (such as price sensitivity, sales volume, sensitivity to marketing activities, seasonal dependence, temperature dependence, etc.) for item samples, each item sample must obtain the sales scenario attribute data on these dimensions. If the data of an item sample on individual dimensions is missing, it must be filled with default values.
[0050] The first historical sales time series data of the item sample refers to the historical sales time series data of the item sample used for training. For multiple items in the training stage, the starting time of the historical time period used by the corresponding historical sales time series data can be the same or different. For multiple training inputs in the same round, the total length of the time period can be kept consistent to facilitate feature extraction. For training inputs of different rounds, they can generally cover different types of goods, or the covered goods may have cross-goods. The historical sales time series data of these cross-goods can have different total time period lengths or the same total time period lengths in different training rounds.
[0051] For example, in the training phase, there are 10 kinds of commodities in the sample. By obtaining the historical sales data of each commodity within 15 days (an example of the total length of the time period), the data in the future prediction unit (which can be divided into days, months, or larger or smaller granular time units (such as half a day, 4 hours, etc.)) is predicted. Taking the time point T0 (for example, May 12, 2023) of model construction as the time reference, the historical period can use the data of any historical period before T0. Generally speaking, in order to obtain the sales forecast performance data of multiple basic models for the sample, the training data of the historical period used can be separated from the time point T0 by some known time periods, and the data of these time periods can be used as labels for the sales forecast performance data.
[0052] For example, for product X, the corresponding first historical sales data can be the following multiple time series curves: sales data curve C from T0-23 (indicating data 23 days before May 12, 2023) to T0-8 (indicating data 8 days before May 12, 2023, and the same meanings can be understood similarly in the following). X1 (as input data for the first round of training), sales data curve C from T0-22 to T0-7 X2 、Sales data curve C from T0-21 to T0-6 X3 (as input data for the first round of training), sales data curve C from T0-20 to T0-5 X4 (as input data for the first round of training), sales data curve C from T0-31 to T0-1 X5 (as input data for the second round of training); future prediction units are in weeks.
[0053] For commodity Y, the corresponding first historical sales data may be the following multiple time series curves: sales data curve C from T0-40 to T0-25 Y1 (as input data for the first round of training), sales data curve C from T0-30 to T0-15 Y2(as input data for the first round of training), sales data curve C from T0-20 to T0-5 Y3 (as input data for the first round of training), sales data curve C from T0-31 to T0-1 Y4 (as input data for the second round of training); future prediction units are in weeks.
[0054] The time period corresponding to the future prediction unit is longer (for example, predicting the sales volume of an item in the following week starting from May 12), and from the prediction base time (May 11) close to the future prediction unit, if the historical sales time series of the item sample covers the historical data of any day between May 5 and May 10, the length of the subsequent prediction is less than 7 days, that is, from the current prediction base time May 11, the sales forecast performance data of the basic model only covers part of the duration of the prediction unit. In this case, the sales forecast performance data of the basic model only calculates the indicators corresponding to the results within the covered prediction range. For example, the first historical sales data is the sales time series data corresponding to May 1 to May 8, then the prediction range corresponding to the sales forecast performance data corresponding to the basic model is: May 9 to May 10, and the corresponding true value also adopts the true sales value of these two days.
[0055] The basic model used can be one or more of the classical statistical models, machine learning models, deep learning models, etc. For example, the statistical models for time series data prediction include ARIMA (autoregressive integrated moving average model), TBATS (a time series prediction model integrating seasonal features, Box-Cox (a generalized inverse transformation method), ARMA error, trend and seasonal components), WMA (weighted moving average model), etc. The machine learning models include Xgboost (a distributed gradient boosting machine learning algorithm optimized under the gradient boosting framework), LightGBM (a machine learning model that uses decision trees for ranking, classification and regression tasks), GBDT (a model for classification and regression prediction based on a forest of decision trees), etc. The deep learning models include TFT (a Transformer model for multi-step prediction tasks), MQCNN (a convolutional neural network model under the Seq2Seq framework), etc.
[0056] The sales forecast performance data of the plurality of basic models represent the sales forecast evaluation results of the above basic models for the above item samples.
[0057] In some embodiments, the sales forecast evaluation value may be MAPE (mean absolute percentage error), or may be MSE (mean square error), RMSE (root mean square error) or MAE (mean absolute error), etc. Among the above indicators, for the historical forecast versions of multiple basic models, the difference between the forecast value and the actual value corresponding to different time points within a replenishment cycle is measured.
[0058] For example, the calculation formula of the MAPE indicator corresponding to the sales forecast evaluation value is as follows:
[0059]
[0060] Where L represents the replenishment cycle, i represents the i-th day in the replenishment cycle, and F i represents the sales forecast result for the i-th day, R i Represents the actual sales volume on the i-th day.
[0061] For example, when calculating the sales forecast performance data of product X based on multiple basic models, the sales data curve C X1 The first prediction value uses the prediction results of multiple basic models corresponding to the T0-8 date: the sales data of the week from T0-7 to T0-1, and the first true value uses the actual sales from T0-7 to T0-1. Generally speaking, the sales prediction performance data of the basic model can be obtained based on the difference between the prediction results and the actual sales of each day in a week.
[0062] In step S220, a sample feature matrix of the item sample is constructed based on the sales scenario attribute data and the sales forecast performance data.
[0063] Figure 3 The schematic diagram schematically shows the implementation process of steps S220 and S230 according to an embodiment of the present disclosure.
[0064] In some embodiments, reference Figure 3 As shown, in the above step S220, a sample feature matrix of the above item sample is constructed according to the above sales scenario attribute data and the above sales forecast performance data, including the following steps: S220a, S220b, S220c and S220d.
[0065] According to an embodiment of the present disclosure, the above-mentioned sales scenario attribute data and the above-mentioned sales forecast performance data are divided into the following variable categories: static category variables, static numerical variables, dynamic category variables, dynamic numerical variables, historically observed dynamic category variables, and historically observed dynamic numerical variables.
[0066] For example, static categorical variables include: product department, category, brand, region (an example of the region where the warehouse is located), city (an example of the region where the warehouse is located), procurement channel (toB or ToC), promotion sensitivity label data, activity sensitivity label data, season sensitivity label data, etc.
[0067] Dynamic category variables include: new product label data, whether there is a planned input (the plan does not need to determine sensitivity, and planned input is considered sensitive), whether there is a promotion, whether there is an event, whether it is a high-selling month for seasonal products, etc.
[0068] Examples of historical observation dynamic category variables include: sales popularity labeling (hot products, regular products, long-tail products).
[0069] Historically observed dynamic numerical variables include, for example: average sales over multiple historical days, historical sales fluctuations, average demand interval (ADI: Average Demands Interval, obtained by historical sales days / historical sales days, used to predict the time when the next demand will occur), historical model performance, etc.
[0070] By converting these variables into a tensor structure recognizable by a computer and mining the implicit features, we can obtain floating-point variables of N×T×L×f dimensions, where N represents the total number of samples, T represents the time length, L represents the number of categorical variables, and f represents the implicit meta-dimension. For example, the categorical variables can be labeled as a unit matrix based on OneHot encoding, and then the variables can be reduced to f dimensions based on the similarity between categories.
[0071] In step S220a, the first historical sales time series data is input into a first encoding and feature recognition model for processing to obtain first feature data corresponding to a preset dimension.
[0072] For example, refer to Figure 3 As shown, the first historical sales time series data corresponding to the item sample is input into the first coding and feature recognition model 310 for processing to obtain the first feature data 311 of a preset dimension (for example, f dimension, where f=3 is used as an example). In some embodiments, the first coding and feature recognition model 310 is a 3-layer dilated convolutional neural network.
[0073] In step S220b, the scene attribute data is input into a second encoding and feature recognition model for processing to obtain second feature data under the preset dimension.
[0074] Reference Figure 3 As shown, the above scene attribute data is input into the second encoding and feature recognition model 320 for processing to obtain f-dimensional second feature data 321.
[0075] For the categorical variables in the sales scenario attribute data, based on the second encoding and feature recognition model 320, the multiple categorical variables corresponding to each item sample (a total of N items) in a first time period (for example, a time period length of T) are converted into floating-point variables of the same dimension; the first time period is the time period corresponding to the first historical sales time series. In some embodiments, the second encoding and feature recognition model 320 is a feature embedding model, which is used to map a large sparse vector to a low-dimensional space that retains semantic relationships.
[0076] In step S220c, the sales forecast performance data is input into a third encoding and feature recognition model for processing to obtain third feature data under the above preset dimension.
[0077] Reference Figure 3 As shown, the sales forecast performance data is briefly described as historical model performance, and is input into the third encoding and feature recognition model 330 for processing to obtain f-dimensional third feature data 331. In some embodiments, the third encoding and feature recognition model 330 is a feature embedding model.
[0078] In step S220d, the first feature data, the second feature data and the third feature data are concatenated to obtain a sample feature matrix of the object sample.
[0079] For example, Figure 3 The diagram illustrates a scenario in which the first feature data 311 , the second feature data 321 , and the third feature data 331 are spliced.
[0080] In step S230, a prediction learning is performed on the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network.
[0081] By utilizing the correlation between the attribute data in the item sales scenario (such as scenario label data, historical time series sales data, etc.) and the performance of each basic model, a sample feature matrix of the item sample is constructed based on the sales scenario attribute data of the item sample and the sales prediction performance data of multiple basic models, and predictive learning is performed on the basic model weights corresponding to the above sample feature matrix to obtain an initial action strategy network; the process of predictive learning can mine the correlation between the item sales scenario and the prediction performance of multiple basic models.
[0082] According to the embodiments of the present disclosure, referring to Figure 3As shown, the mapping relationship between the above-mentioned sample feature matrix and the basic model weight is predicted and learned to obtain the initial action strategy network, including: taking the above-mentioned sample feature matrix as the input of the pre-trained model 340, training the above-mentioned pre-trained model 340, the output of the above-mentioned pre-trained model is the weight prediction probability corresponding to the above-mentioned multiple basic models, and the training label is the basic model with the best sales prediction performance data corresponding to the input; the trained pre-trained model is used as the above-mentioned initial action strategy network.
[0083] For example, the pre-trained model 340 includes a three-layer linear layer and a soft maximization layer. The three-layer linear layer (using a weight matrix to map an input feature space to an output feature space, and the number of implicit elements in each layer of the network in the three-layer linear layer gradually decreases) is used to process the input feature matrix and output the implicit features under a preset dimension, which is then normalized through the soft maximization layer to obtain a weight prediction probability in the interval [0, 1]. This weight prediction probability [P1, P2, P3, P4] is the basic model weight corresponding to the above-mentioned multiple basic models.
[0084] Take the four basic models: Models 1 to 4 as an example. For example, the input is the sales data curve C of product X. X1 , the scene attribute data of the product X and the sample feature matrix corresponding to the sales prediction performance data of the four basic models for the product X, the corresponding training label is the basic model with the best sales prediction performance data for the product X among the four basic models, for example, if model 1 has the best performance, then the training label is [1 0 0 0], and the parameters of the pre-trained model 340 are trained according to the training label. The trained pre-trained model is used as the initial action strategy network, and the input of the initial action strategy network is the state S, and the output is the action A.
[0085] During the training of the pre-trained model, the loss function Loss1 uses the cross entropy loss, which satisfies the following expression:
[0086]
[0087] Where N represents the total number of samples; y i Indicates whether the i-th model is the training label of the optimal model. The training label of the optimal model corresponds to 1, and the others are 0; p i Represents the matrix p i The i-th item of represents the probability of predicting that the i-th model is the optimal model. The training is considered to be completed by optimizing and adjusting the parameters of the pre-trained model so that the pre-trained model is trained for the set number of times or the cross entropy loss reaches the minimum value.
[0088] In step S240, based on the reinforcement learning method, the parameters of the initial action strategy network are optimized and adjusted to obtain a target action strategy network with optimized parameters.
[0089] Reinforcement learning is a learning method in which an agent learns by trial and error, and the rewards obtained by interacting with the environment guide behavior. The goal is to enable the agent to obtain the maximum reward. Reinforcement learning is different from supervised learning in connectionist learning, mainly in the reinforcement signal. The reinforcement signal provided by the environment in reinforcement learning is an evaluation of the quality of the action, rather than telling the reinforcement learning system how to generate the correct action. Since the external environment provides little information, the reinforcement learning system must rely on its own experience to learn. In this way, the reinforcement learning system acquires knowledge in an action-evaluation environment and improves the action plan to adapt to the environment.
[0090] Since reinforcement learning is a way to explore the optimal solution without much prior information, optimizing and adjusting the parameters of the initial action strategy network based on reinforcement learning can effectively utilize the delayed feedback mechanism of reinforcement learning to guide the initial action strategy network to optimize the prediction of the fusion weights of multiple basic models based on limited observations when the model performance information is lagging, thereby realizing intelligent weighted fusion of multiple basic models, thereby improving the accuracy and stability of sales forecasts.
[0091] In the embodiments of the present disclosure, a reinforcement learning method is introduced to optimize and adjust the parameters of the initial action strategy network. The reinforcement learning algorithm can be various algorithms that can be adapted to the input and output of the initial action strategy network. The input state S in the initial action strategy is the feature matrix of the item sample, and the output action A is the basic model weight corresponding to the input. In the reinforcement learning algorithm, the corresponding immediate reward information is determined by the error index between the fused sales forecast result and the actual result calculated by the output basic model weight and the corresponding basic model sales forecast result.
[0092] The above error index is, for example, mean absolute percentage error (MAPE), or other error indicators, such as RMSE, MSE, etc.
[0093] In step S250, the output end of the target action strategy network is connected to the fusion weight input end of the fusion model. The fusion model is a prediction model obtained by fusing the multiple basic models based on the fusion weights. The target action strategy network and the fusion model constitute a sales prediction model.
[0094] Reference Figure 2As shown, taking the fusion model including k basic models as an example, the output end of the target action strategy network is connected to the fusion weight input end of the fusion model. For example, the target action strategy network outputs the weight prediction probability [P1, P2, ..., P k ], the fusion weights corresponding to each basic model are expressed as w1, w1, …, w k , then in the training phase, the fusion weights w1, w1, …, w k The weighted predicted probability [P1, P2, ..., P k ], in the use stage of the sales forecasting model, when the feature matrix of the item to be predicted is input into the target action strategy network, the corresponding output will become the target fusion weight, then the target fusion weight will be assigned to w1, w1, …, w k , thereby the sales prediction result of the item to be predicted can be output. Therefore, in the embodiment of the present disclosure, the target action strategy network and the fusion model constitute a sales prediction model for the item sample.
[0095] It is understandable that in sales prediction scenarios of different items, the number of corresponding basic models and the specific types of basic models can be changed dynamically.
[0096] In an embodiment including steps S210 to S250, by utilizing the correlation between attribute data in the item sales scenario (such as scenario label data, historical time series sales data, etc.) and the performance of each basic model, a sample feature matrix of the item sample is constructed based on the sales scenario attribute data of the item sample and the sales forecast performance data of multiple basic models, and predictive learning is performed on the basic model weights corresponding to the above sample feature matrix to obtain an initial action strategy network; the process of predictive learning can mine the correlation between the item sales scenario and the forecast performance of multiple basic models, and the interpretability of the corresponding fusion model is improved; further based on the reinforcement learning method, the parameters of the above initial action strategy network are optimized and adjusted, and the delayed feedback mechanism of reinforcement learning is used to guide the initial action strategy network to optimize the prediction of the fusion weights of multiple basic models based on limited observations when the model performance information is lagging, so as to realize intelligent weighted fusion of multiple basic models, thereby improving the accuracy and stability of sales forecasts; effectively reducing the prediction deviation and variance corresponding to the artificial specification of a single model or the specification of a certain prediction model based on rules. When the sales forecasting model is used to forecast the sales of items to be forecasted, the corresponding target fusion weight can be output according to the feature matrix of the items to be forecasted, thereby realizing automated and intelligent sales forecasting that matches different input items.
[0097] In some embodiments of the present disclosure, the sales scenario attribute data of the above-mentioned item samples include: first historical sales time series data and scenario attribute data used for training.
[0098] The above-mentioned first historical sales time series data meets the following conditions: the above-mentioned first historical sales time series data is input into the above-mentioned multiple basic models for prediction, and the accuracy difference between the optimal and suboptimal basic models in the obtained sales prediction performance data is above the set difference value.
[0099] In this embodiment, considering that for some commodities in some time periods, the difference between the basic model with the best prediction performance and the suboptimal basic model may not be large, it is easy for the pre-trained model to be difficult to converge or fall into a local optimal solution during the process of predictive learning of the mapping relationship between the sample feature matrix and the basic model weights in step S230. Therefore, at this stage, only time series sample points whose accuracy difference between the optimal model and the suboptimal model is above the set difference value (for example, 5%, 6%, 7% or 8%, etc.) are selected (the historical sales data in different time periods can be input into each basic model for comparison to select), so as to help the pre-trained model find the connection between the commodity scenario and the optimal model performance more quickly and accurately.
[0100] In some embodiments of the present disclosure, in order to further improve the effect of reinforcement learning and make the process of iterating parameter adjustment from the initial action policy network to the target action policy network have better stability and convergence, the deep deterministic policy gradient (DDPG) algorithm is used to optimize and adjust the parameters of the above-mentioned initial action policy network to obtain the above-mentioned target action policy network. Among them, the sample feature matrix input by the above-mentioned initial action policy network is used as the state S, and the basic model weight output by the above-mentioned initial action policy network is used as the action A. The goal of the optimization adjustment is to minimize the temporal difference learning (TD) error between the respective benefits of the above-mentioned target action policy network and the above-mentioned initial action policy network.
[0101] Figure 4 The schematic diagram schematically shows the implementation process of step S240 according to an embodiment of the present disclosure.
[0102] In some embodiments of the present disclosure, referring to Figure 4 As shown, in the above step S240, based on the deep deterministic policy gradient algorithm, the parameters of the above initial action policy network are optimized and adjusted, including:
[0103] Constructing a target action strategy network 430 and a target evaluation network 440 corresponding to the initial action strategy network 410; the initial network parameters of the target action strategy network 430 are the same as the network parameters of the initial action strategy network 410; the initial network parameters of the target evaluation network 440 are the same as the network parameters of the evaluation network 420;
[0104] Initialize exploration noise (for example, initialize a random process for action exploration), and obtain the initial state for input to the above-mentioned initial action strategy network 410; for the t-th round in each iteration cycle, t represents the round number, t ranges from 1 to T, T is the total rounds, and the input in each round is the state under the prediction reference time point (for example, the prediction reference time point of the first round is April 20, taking the prediction of sales in a certain time unit in the future (for example, one day or one week) as an example, after executing the action of the current round, the corresponding prediction reference time point of the next round is incremented according to the above-mentioned time unit (day or week) or the smaller granularity time divided into the time unit (for example, according to day), for example, corresponding to the situation of predicting the sales in the next day or one week, April 21 can be determined as the prediction reference time point of the second round, and accordingly, the sales data of April 20 in the input time series data in the second round is a known true value), perform the following operations:
[0105] Set the current round state S t The output of the initial action strategy network 410 is added to the exploration noise of this round to obtain the current round action A. t ; At t = 1, the current round state is the above initial state;
[0106] Perform weighted sum calculation on the basic model weight corresponding to the current round action and the sales forecast results of the above multiple basic models to obtain the fused sales forecast result of the current round;
[0107] Generate reward information R based on the evaluation index of the above-mentioned current round of fusion sales forecast results t+1 ; Here, the reward information is used to guide the next round of actions, so the superscript t+1 is used to represent the reward information;
[0108] The actual state at the next prediction reference time point after the current round is determined as the next round state S t+1 ;
[0109] The data group corresponding to the current round {S t , A t , R t+1 , S t+1}Store to experience replay pool;
[0110] For each data group in a batch of data groups selected from the above experience replay pool {S j , A j , R j+1 , S j+1}, j is the index number of the selected data group, and the following iterative operations are performed:
[0111] The input S of the above initial action strategy network j and output A j At the same time, it serves as the input of the evaluation network 420, which is used to output and input state S j and input action A j The corresponding value function value, which is used as the benefit evaluation value Q j For example, Figure 4 In the figure, the value function value output by the evaluation network 420 is represented as Q;
[0112] The state S j+1 The target action strategy network 430 outputs action A. j+1 For example, Figure 4 The output action of the target action strategy network is represented as A′; it can be understood that the target action strategy network and the target evaluation network described in the embodiment of the present disclosure include different stages in the iterative process and after the final iterative optimization;
[0113] The input S of the above target action strategy network j+1 and output A j+1 At the same time, as the input of the target evaluation network, the target evaluation network 440 is used to output the input state S j+1 and input action A j+1 The corresponding value function value Q j+1 For example, Figure 4 In the example, the value function value output by the target evaluation network 440 is represented as Q′;
[0114] According to the above value function value Q j+1 And the corresponding reward information R j+1 Determine the expected value of return y j ;
[0115] The parameters of the evaluation network 420 are optimized and adjusted so that the expected value of the profit y j And the above income evaluation value Q j The deviation between them is minimal; for example, the parameters of the evaluation network 420 may be optimized and adjusted based on a gradient descent algorithm;
[0116] The parameters of the initial action strategy network 410 are optimized and adjusted so that the benefit evaluation value Qj Achieve maximization; for example, the parameters of the initial action strategy network 410 may be optimized and adjusted based on a gradient ascent algorithm;
[0117] Based on the exponential moving average method, the parameters of the target action strategy network 430 and the target evaluation network 440 are updated;
[0118] Among them, the above-mentioned initial action strategy network 410 obtains the target action strategy network with optimized parameters after iteration.
[0119] The above-mentioned prediction reference time point means that if you want to predict future sales, then the current moment based on it is the prediction reference time point. For example, if you want to predict the sales corresponding to May 12, then May 11 is used as the prediction reference time point, and the time series data on and before May 11 can be used as input. It can be understood that in the training stage, May 12 can be a time point that exists in history, so that it is convenient to find the sales prediction performance data of the basic model from the historical time. In some embodiments, to predict the moment T1, the sales time series data, scene attribute data and sales prediction performance data of the basic model before the moment T1 can be used as input together; wherein the sales time series data before the moment T1 can be a time series data segment containing the moment T1-1 (adjacent time series), or it can also be a time series data segment with an interval between T1; from improving the training effect and avoiding the decrease in prediction accuracy caused by possible emergencies (such as natural disasters or some emergencies, etc.), the time series data segment containing the moment T1-1 can be included in the input to improve the prediction accuracy in various real-life scenarios.
[0120] According to an embodiment of the present disclosure, the expression of the above-mentioned timing difference learning error is:
[0121]
[0122] Among them, R j+1 Indicates state S j+1 and action A j+1 The corresponding reward information, j represents the time sequence number of the iteration round; γ represents the discount factor, which is used to represent the relative proportion of the delayed reward to the current reward; Q j+1 (S j+1 ,A j+1 ) indicates state S j+1 and action A j+1 The corresponding value function; Q j (S j ,A j ) indicates state S j and action A jThe corresponding value function, min represents the minimization function, and θ below min represents the minimization of the temporal difference learning error by adjusting the parameters of the initial action strategy network.
[0123] According to the embodiments of the present disclosure, referring to Figure 4 As shown in FIG. 4 , it illustrates the method of obtaining the fused sales forecast result. The weights of the basic models output by the initial action strategy model 410 in each round are weighted and calculated correspondingly with the sales forecast results of the k basic models to obtain the fused sales forecast result for the sales time series data in the current round. Figure 4 The circles filled with diagonal lines in the figure illustrate the fused sales forecast results at the forecast time.
[0124] Reference Figure 4 As shown, based on the evaluation index of the above-mentioned fusion sales forecast result, reward information is generated, including: determining the error index between the above-mentioned fusion sales forecast result and the actual sales value (for example, the mean absolute percentage error MAPE, or other error indicators, such as RMSE, MSE, SMAPE, etc.); determining the ranking information of the sales forecast performance data corresponding to the above-mentioned fusion sales result in the model set, and the above-mentioned model set includes the above-mentioned multiple basic models; wherein the above-mentioned sales forecast performance data is the error index between the historical prediction value and the actual value within the replenishment cycle; and calculating according to the above-mentioned ranking information and the above-mentioned error index to obtain the reward information.
[0125] For example, refer to Figure 4 As shown, the reward information R t+1 =β1R t smape +β2R t rank , where R t smape Represents the SMAPE (symmetric mean absolute percentage error) error index value between the fusion sales forecast result of the tth round and the actual sales value; R t rank Indicates the ranking information of the sales forecast performance data corresponding to the fusion sales result of the tth round in the model set; β1 represents the weight coefficient of the error index, and β2 represents the weight coefficient of the ranking information. β1 and β2 are used to allocate the proportion of the error index value and the ranking information to the reward information. The smaller the error index, the higher the corresponding reward information; the higher the ranking information, the higher the corresponding reward information.
[0126] A second exemplary embodiment of the present disclosure provides a sales volume forecasting method.
[0127] Figure 5 The flowchart of the sales volume forecasting method according to an embodiment of the present disclosure is schematically shown.
[0128] Participate Figure 5 As shown, the sales forecasting method provided by the embodiment of the present disclosure includes the following steps: S510, S520 and S530.
[0129] In step S510, target sales scenario attribute data of the item to be predicted and target sales volume prediction performance data of multiple basic models for the item to be predicted are obtained.
[0130] In step S520, a target feature matrix of the above-mentioned item to be predicted is constructed according to the above-mentioned target sales scenario attribute data and the above-mentioned target sales volume prediction performance data.
[0131] In step S530, the target feature matrix is input into the sales prediction model for processing, and the sales prediction result corresponding to the item to be predicted is output. The sales prediction model is constructed by the method for constructing the sales prediction model as described above. The target action strategy network outputs the target fusion weight corresponding to the target feature matrix to the fusion model, and the fusion model outputs the sales prediction result corresponding to the item to be predicted.
[0132] Other details of this embodiment, or the ways in which it can be expanded, the beneficial effects, etc., can all refer to the description of the first embodiment, and will not be repeated here.
[0133] A third exemplary embodiment of the present disclosure provides an apparatus for constructing a sales volume prediction model.
[0134] Figure 6 The structural block diagram of a device for building a sales forecasting model according to an embodiment of the present disclosure is schematically shown.
[0135] Reference Figure 6 As shown, the device 600 for constructing a sales prediction model includes: a data acquisition module 601, a feature matrix construction module 602, a first processing module 603, a second processing module 604 and a model construction module 605.
[0136] The data acquisition module 601 is used to acquire sales scenario attribute data of item samples and sales prediction performance data of multiple basic models for the item samples.
[0137] The feature matrix construction module 602 is used to construct a sample feature matrix of the item sample according to the sales scenario attribute data and the sales volume prediction performance data.
[0138] The first processing module 603 is used to perform predictive learning on the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network.
[0139] The second processing module 604 is used to optimize and adjust the parameters of the initial action strategy network based on a reinforcement learning method to obtain a target action strategy network with optimized parameters.
[0140] The above-mentioned model construction module 605 is used to connect the output end of the above-mentioned target action strategy network to the fusion weight input end of the fusion model. The above-mentioned fusion model is a prediction model in which the above-mentioned multiple basic models are fused based on the fusion weight. The above-mentioned target action strategy network and the above-mentioned fusion model constitute a sales prediction model.
[0141] The specific functional implementation details of each module in this embodiment can be referred to the description of the first embodiment, and will not be repeated here.
[0142] A fourth exemplary embodiment of the present disclosure provides a device for sales volume prediction.
[0143] Figure 7 The structural block diagram of a sales volume forecasting device according to an embodiment of the present disclosure is schematically shown.
[0144] Reference Figure 7 As shown, the sales volume prediction device 700 provided in the embodiment of the present disclosure includes: a data acquisition module 701, a feature matrix construction module 702 and a prediction module 703.
[0145] The data acquisition module 701 is used to acquire target sales scenario attribute data of the item to be predicted and target sales volume prediction performance data of multiple basic models for the item to be predicted.
[0146] The feature matrix construction module 702 is used to construct the target feature matrix of the item to be predicted according to the target sales scenario attribute data and the target sales volume prediction performance data.
[0147] The prediction module 703 is used to input the target feature matrix into the sales prediction model for processing, and output the sales prediction result corresponding to the item to be predicted. The sales prediction model is constructed by the method or device for constructing the sales prediction model as described above. The target action strategy network outputs the target fusion weight corresponding to the target feature matrix to the fusion model, and the fusion model outputs the sales prediction result corresponding to the item to be predicted.
[0148] In some embodiments, the device 700 has a sales forecast model, or is able to obtain a sales forecast model from an external device or call a sales forecast model; in other embodiments, the device 700 itself can build a sales forecast model.
[0149] For more details of this embodiment, please refer to the detailed description of the first embodiment, which will not be repeated here.
[0150] Any number of the functional modules included in the above-mentioned device 600 or device 700 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. At least one of the functional modules included in the device 600 or device 700 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, at least one of the functional modules included in the device 600 or device 700 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be executed.
[0151] A fifth exemplary embodiment of the present disclosure provides an electronic device.
[0152] Figure 8 The structural block diagram of the electronic device provided by the embodiment of the present disclosure is schematically shown.
[0153] Reference Figure 8 As shown, the electronic device 800 provided by the embodiment of the present disclosure includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802 and the memory 803 communicate with each other through the communication bus 804; the memory 803 is used to store computer programs; the processor 801 is used to implement the method of constructing a sales forecasting model or the method of sales forecasting as described above when executing the program stored in the memory.
[0154] The sixth exemplary embodiment of the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for constructing a sales forecast model or the method for sales forecasting as described above is implemented.
[0155] The computer-readable storage medium may be included in the device or apparatus described in the above embodiment; or it may exist independently without being assembled into the device or apparatus. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0156] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0157] It should be noted that the collection, collection, update, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution provided by the embodiments of the present disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.
[0158] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0159] The foregoing is merely a specific embodiment of the present disclosure, which enables those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A method for constructing a sales forecasting model, characterized in that: include: Acquire sales scenario attribute data of an item sample and sales forecast performance data of multiple basic models for the item sample; Constructing a sample feature matrix of the item sample according to the sales scenario attribute data and the sales volume forecast performance data; Predictively learn the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network; Based on the reinforcement learning method, the parameters of the initial action strategy network are optimized and adjusted to obtain the target action strategy network after parameter optimization; The output end of the target action strategy network is connected to the fusion weight input end of the fusion model. The fusion model is a prediction model obtained by fusing the multiple basic models based on the fusion weight. The target action strategy network and the fusion model constitute a sales prediction model.
2. The method according to claim 1, characterized in that The mapping relationship between the sample feature matrix and the basic model weight is predicted and learned to obtain an initial action strategy network, including: The sample feature matrix is used as the input of the pre-trained model to train the pre-trained model. The output of the pre-trained model is the weighted prediction probability corresponding to the multiple basic models. The training label is the basic model with the best sales forecast performance data corresponding to the input. The trained pre-trained model is used as the initial action strategy network.
3. The method according to claim 1, characterized in that Based on the reinforcement learning method, the parameters of the initial action strategy network are optimized and adjusted to obtain the target action strategy network after parameter optimization, including: Based on the deep deterministic policy gradient algorithm, the parameters of the initial action policy network are optimized and adjusted to obtain the target action policy network; wherein, the sample feature matrix input by the initial action policy network is used as the state, and the basic model weights output by the initial action policy network are used as the action, and the goal of the optimization adjustment is to minimize the temporal difference learning error between the respective benefits of the target action policy network and the initial action policy network.
4. The method according to claim 3, characterized in that: The expression of the temporal difference learning error is: Among them, R j+1 Indicates state S j+1 and action A j+1 Corresponding reward information, j represents the time sequence number of the iteration round; γ represents the discount factor, which is used to represent the relative proportion of the delayed reward to the current reward; Q j+1 (S j+1 ,A j+1 ) indicates state S j+1 and action A j+1 The corresponding value function; Q j (S j ,A j ) indicates state S j and action A j The corresponding value function, min represents the minimization function, and θ below min represents the minimization of the temporal difference learning error by adjusting the parameters of the initial action strategy network.
5. The method according to claim 3, characterized in that: In the process of optimizing and adjusting the parameters of the initial action strategy network based on the deep deterministic policy gradient algorithm, for each round in each iteration cycle, the weight of the basic model corresponding to the action of the current round and the sales prediction results of the multiple basic models are weighted and calculated to obtain the fused sales prediction result of the current round; and reward information is generated according to the evaluation index of the fused sales prediction result of the current round; According to the evaluation index of the integrated sales forecast result, reward information is generated, including: Determine an error index between the fused sales forecast result and the actual sales value; Determine ranking information of sales forecast performance data corresponding to the fused sales result in a model set, wherein the model set includes the multiple basic models; wherein the sales forecast performance data is an error indicator between a historical forecast value and an actual value within a replenishment cycle; Calculation is performed based on the ranking information and the error index to obtain reward information.
6. The method according to any one of claims 1 to 5, characterized in that The sales scenario attribute data includes: first historical sales time series data of the item sample and scenario attribute data; the scenario attribute data includes at least one of the following: basic item attribute data, warehouse location data, demand attribute data, and sales attribute data; According to the sales scenario attribute data and the sales volume forecast performance data, a feature matrix of the item sample is constructed, including: Inputting the first historical sales time series data into a first coding and feature recognition model for processing to obtain first feature data corresponding to a preset dimension; Inputting the scene attribute data into a second encoding and feature recognition model for processing to obtain second feature data under the preset dimension; Inputting the sales forecast performance data into a third coding and feature recognition model for processing to obtain third feature data under the preset dimension; The first feature data, the second feature data and the third feature data are concatenated to obtain a feature matrix of the object sample.
7. The method according to claim 6, characterized in that The basic attribute data of the item includes at least one of the following: item category, item brand, and item newness label; the demand attribute data includes at least one of the following: user type of the demander, activity-driven label data, and temperature-driven label data; the sales attribute data includes at least one of the following: item popularity label data, item sales volatility label data, promotion-sensitive label data, activity-sensitive label data, and plan-driven label data; The sales scenario attribute data and the sales forecast performance data are divided into the following variable categories: static category variables, static numerical variables, dynamic category variables, dynamic numerical variables, historically observed dynamic category variables, and historically observed dynamic numerical variables; For the categorical variables in the sales scenario attribute data, based on the second encoding and feature recognition model, multiple categorical variables corresponding to each item sample in the first time period are converted into floating-point variables of the same dimension; the first time period is the time period corresponding to the first historical sales time series.
8. The method according to claim 1, characterized in that The sales scene attribute data includes: first historical sales time series data and scene attribute data used for training; The first historical sales time series data meets the following conditions: The first historical sales time series data is input into the multiple basic models for prediction, and the accuracy difference between the optimal and suboptimal basic models in the obtained sales forecast performance data is above the set difference value.
9. A sales forecasting method, characterized in that: include: Acquire target sales scenario attribute data of the item to be predicted and target sales volume prediction performance data of multiple basic models for the item to be predicted; Constructing a target feature matrix of the item to be predicted based on the target sales scenario attribute data and the target sales volume forecast performance data; The target feature matrix is input into the sales prediction model for processing, and the sales prediction result corresponding to the item to be predicted is output; the sales prediction model is constructed by the method described in any one of claims 1-8; wherein the target action strategy network outputs the target fusion weight corresponding to the target feature matrix to the fusion model, and the fusion model outputs the sales prediction result corresponding to the item to be predicted.
10. A device for constructing a sales forecasting model, characterized in that: include: A data acquisition module, used to acquire sales scenario attribute data of an item sample and sales forecast performance data of multiple basic models for the item sample; A feature matrix construction module, used to construct a sample feature matrix of the item sample according to the sales scenario attribute data and the sales volume forecast performance data; A first processing module is used to predict and learn the mapping relationship between the sample feature matrix and the basic model weights to obtain an initial action strategy network; A second processing module is used to optimize and adjust the parameters of the initial action strategy network based on a reinforcement learning method to obtain a target action strategy network after parameter optimization; A model building module is used to connect the output end of the target action strategy network to the fusion weight input end of the fusion model, wherein the fusion model is a prediction model in which the multiple basic models are fused based on the fusion weight, and the target action strategy network and the fusion model constitute a sales prediction model.
11. A sales forecasting device, characterized in that: The device comprises: A data acquisition module, used to acquire target sales scenario attribute data of the item to be predicted and target sales volume prediction performance data of multiple basic models for the item to be predicted; A feature matrix construction module, used to construct a target feature matrix of the item to be predicted according to the target sales scenario attribute data and the target sales volume prediction performance data; A prediction module, used to input the target feature matrix into a sales prediction model for processing, and output the sales prediction result corresponding to the item to be predicted; the sales prediction model is constructed using the method described in any one of claims 1 to 8 or the device described in claim 10; wherein the target action strategy network outputs the target fusion weight corresponding to the target feature matrix to the fusion model, and the fusion model outputs the sales prediction result corresponding to the item to be predicted.
12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 9 when executing a program stored in a memory.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.