Stocking processing method and device, computer storage medium, and electronic equipment
By combining the transaction volume and error prediction models, the target model is selected to determine the final prediction value, which solves the problem of low accuracy in the inventory of items in the existing technology, and achieves more efficient inventory processing and system optimization.
Patent Information
- Application Number
- CN202011355597.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-26
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2040-11-26
AI Technical Summary
In the prior art, the accuracy of item stocking prediction is low, and the model selection rules cannot be explained, resulting in out-of-stock items or stock accumulation, increasing the cost of stocking and system processing burden.
By pre-training multiple transaction volume prediction models and error prediction models, selecting the target model based on the prediction error, determining the final prediction value, and sending it to the stocking end for processing.
It improves the accuracy of item stocking, reduces stocking costs, optimizes system processing performance, avoids unnecessary data reading and writing processes, and improves business processing speed.
Smart Images

Figure CN114549032B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a stocking processing method, a stocking processing device, a computer storage medium, and an electronic device. Background Art
[0002] With the rapid development of the internet and computer technology, forecasting technology is becoming increasingly important in many business scenarios. For example, in the production process, it's often necessary to predict future transaction volumes and, based on inventory, formulate production and raw material procurement plans. Inaccurate forecasts often lead to product backlogs or shortages, severely impacting the healthy development of manufacturers.
[0003] Currently, the typical approach is to collect historical trading volume, train multiple forecasting models based on this historical volume, and then use these models to predict future trading volume, generating multiple predicted values. Finally, one of these predicted values (or an average of multiple values) is selected as the final forecast result. However, this approach lacks interpretability when determining the final forecast result, making it impossible to explain the data selection rules to users, and the forecast accuracy is low.
[0004] In view of this, there is an urgent need to develop a new stocking processing method and device in this field.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this disclosure. Summary of the Invention
[0006] The purpose of the present disclosure is to provide a stocking processing method, a stocking processing device, a computer storage medium and an electronic device, thereby avoiding the defect of low prediction accuracy in the related art at least to a certain extent.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0008] According to a first aspect of the present disclosure, a stocking processing method is provided, comprising: predicting the transaction volume of a target item in a future time period by using a plurality of pre-trained transaction volume prediction models to obtain a plurality of preliminary prediction values; predicting the prediction errors of the plurality of transaction volume prediction models in the future time period by using a pre-trained error prediction model to obtain a plurality of prediction errors; selecting a target model from the plurality of transaction volume prediction models according to the plurality of prediction errors, and determining a final prediction value according to the preliminary prediction value corresponding to the target model; and sending the final prediction value to a stocking end, so that the stocking end performs stocking processing on the target item according to the final prediction value.
[0009] In an exemplary embodiment of the present disclosure, the transaction volume prediction model is trained in the following manner: obtaining historical transaction data samples of the target item based on a time series; using the historical transaction data samples to train multiple preset machine learning models to obtain the pre-trained multiple transaction volume prediction models.
[0010] In an exemplary embodiment of the present disclosure, the error prediction model is trained in the following manner: predicting the transaction volume of the target item in a historical time period by using the pre-trained multiple transaction volume prediction models to obtain multiple historical prediction values; determining the prediction error corresponding to each of the transaction volume prediction models based on the actual transaction volume of the target item in the historical time period and the historical prediction value; selecting prediction error samples from the prediction errors corresponding to the multiple transaction volume prediction models; and using the prediction error samples to train a preset machine learning model to obtain the error prediction model.
[0011] In an exemplary embodiment of the present disclosure, the prediction error corresponding to each of the transaction volume prediction models is determined based on the actual transaction volume of the target item within the historical time period and the historical prediction value, including: comparing the historical prediction value with the actual transaction volume to obtain a numerical comparison result; and determining the prediction error corresponding to each of the transaction volume prediction models based on the numerical comparison result.
[0012] In an exemplary embodiment of the present disclosure, the selecting of prediction error samples from the prediction errors corresponding to the multiple transaction volume prediction models includes: determining the contribution value of each of the prediction errors to the processing result of the error prediction model based on a cooperative game algorithm; and selecting prediction error samples from the prediction errors corresponding to the multiple transaction volume prediction models according to the numerical value of the contribution value.
[0013] In an exemplary embodiment of the present disclosure, selecting a target model from the multiple transaction volume prediction models based on the multiple prediction errors includes: determining the transaction volume prediction model with the smallest prediction error as the target model.
[0014] In an exemplary embodiment of the present disclosure, selecting a target model from the multiple transaction volume prediction models based on the multiple prediction errors, and determining a final prediction value based on the preliminary prediction values corresponding to the target models, includes: determining multiple transaction volume prediction models whose prediction errors are less than an error threshold as the target model; and performing weighted summation on the preliminary prediction values corresponding to the target models to obtain the final prediction value.
[0015] According to a second aspect of the present disclosure, a stocking processing device is provided, including: a transaction volume prediction module, used to predict the transaction volume of a target item in a future time period by using a plurality of pre-trained transaction volume prediction models, and obtain a plurality of preliminary prediction values; an error prediction module, used to predict the prediction errors of the plurality of transaction volume prediction models in the future time period by using a pre-trained error prediction model, and obtain a plurality of prediction errors; a prediction result determination module, used to select a target model from the plurality of transaction volume prediction models according to the plurality of prediction errors, and determine a final prediction value according to the preliminary prediction value corresponding to the target model; a sending module, used to send the final prediction value to a stocking end, so that the stocking end performs stocking processing on the target item according to the final prediction value.
[0016] According to a third aspect of the present disclosure, a computer storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the stocking processing method described in the first aspect is implemented.
[0017] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the stocking processing method described in the first aspect above by executing the executable instructions.
[0018] As can be seen from the above technical solutions, the stocking processing method, stocking processing device, computer storage medium, and electronic device in the exemplary embodiments of the present disclosure have at least the following advantages and positive effects:
[0019] In the technical solutions provided by some embodiments of the present disclosure, on the one hand, the transaction volume of the target item in the future time period is predicted by using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values, and the prediction errors of the multiple transaction volume prediction models in the future time period are predicted by using a pre-trained error prediction model to obtain multiple prediction errors. A target model is selected from the multiple transaction volume prediction models based on the multiple prediction errors, and a final prediction value is determined based on the preliminary prediction value corresponding to the target model. This not only can determine the final prediction value based on the future prediction error of the model, but also solve the technical problem in the related art that the final prediction value is determined only based on the historical error of the model (and the historical performance of the model has no necessary relationship with the future performance), resulting in inaccurate prediction results, and improve the accuracy of the final prediction value, but also makes the selection of the target model linked to the prediction error of each model, solving the problem in the related art that the model selection rules cannot be explained. On the other hand, sending the final prediction value to the stocking end so that the stocking end can stock the target items according to the final prediction value can improve the stocking accuracy of the items, solve the problem of out-of-stock or inventory accumulation caused by inaccurate stocking quantity in related technologies, reduce stocking costs, and solve the problem of inaccurate stocking quantity in related technologies that causes the system to frequently allocate quotas of items between different orders and different warehouses, optimize the system's performance in handling normal business, avoid unnecessary data reading and writing processes, and improve business processing speed.
[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0022] Figure 1 A schematic flow chart showing a method for preparing inventory in this exemplary embodiment is shown;
[0023] Figure 2 A schematic diagram showing a process of training a transaction volume prediction model in this exemplary embodiment is shown;
[0024] Figure 3 A schematic diagram of a process for training an error prediction model in this exemplary embodiment is shown;
[0025] Figure 4 A schematic diagram of a process for determining a final prediction value in this exemplary embodiment is shown;
[0026] Figure 5 An overall flow chart of a stocking processing method in an exemplary embodiment of the present disclosure is shown;
[0027] Figure 6 A schematic structural diagram of a stock preparation processing device in an exemplary embodiment of the present disclosure is shown;
[0028] Figure 7 A schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0029] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0030] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0031] In addition, the accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the drawings represent identical or similar parts, and thus repeated descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically separate entities.
[0032] Prediction technology is required in many scenarios, such as product demand forecasting, traffic flow forecasting, and ad click-through rate prediction. In some cases, due to the numerous business scenarios and complex data distribution, the prediction system must utilize multiple prediction models, fusing and selecting the outputs of these models to determine the final prediction value.
[0033] Related technologies generally use the following two methods to predict the transaction volume of items:
[0034] ① Use all models to predict all time series samples and generate multiple prediction values. However, this method requires training multiple models on a large amount of data, which consumes too many resources and slows down model training.
[0035] ② Calculate the historical errors corresponding to the historical prediction data of all models. Based on these historical errors, the prediction values of multiple models are combined according to certain weights. However, there is no necessary correlation between the historical performance of a model and its future performance, which leads to inaccurate prediction results.
[0036] In the embodiments of the present disclosure, a stocking processing method is first provided, which at least to some extent overcomes the defect of low prediction accuracy in the prior art.
[0037] Figure 1 A flow chart of a method for preparing goods in this exemplary embodiment is shown. The execution subject of the method for preparing goods may be a server for preparing goods.
[0038] refer to Figure 1 According to an embodiment of the present disclosure, a method for preparing inventory includes the following steps:
[0039] Step S110 , predicting the transaction volume of the target item in a future time period using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values;
[0040] Step S120, predicting the prediction errors of multiple transaction volume prediction models in future time periods using a pre-trained error prediction model to obtain multiple prediction errors;
[0041] Step S130 , selecting a target model from the multiple transaction volume prediction models based on the multiple prediction errors, and determining a final prediction value based on the preliminary prediction value corresponding to the target model;
[0042] Step S140: sending the final prediction value to the stocking end so that the stocking end prepares the target item according to the final prediction value.
[0043] exist Figure 1In the technical solution provided by the illustrated embodiment, on the one hand, the transaction volume of the target item in the future time period is predicted by using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values, and the prediction errors of the multiple transaction volume prediction models in the future time period are predicted by using a pre-trained error prediction model to obtain multiple prediction errors. A target model is selected from the multiple transaction volume prediction models based on the multiple prediction errors, and a final prediction value is determined based on the preliminary prediction value corresponding to the target model. This not only enables the final prediction value to be determined based on the future prediction error of the model, but also solves the technical problem in the related art that the final prediction value is determined only based on the historical error of the model (and the historical performance of the model has no necessary relationship with the future performance), resulting in inaccurate prediction results, and improves the accuracy of the final prediction value. In addition, the selection of the target model is linked to the prediction error of each model, solving the problem in the related art that the model selection rules cannot be explained. On the other hand, sending the final prediction value to the stocking end so that the stocking end can stock the target items according to the final prediction value can improve the stocking accuracy of the items, solve the problem of out-of-stock or inventory accumulation caused by inaccurate stocking quantity in related technologies, reduce stocking costs, and solve the problem of inaccurate stocking quantity in related technologies that causes the system to frequently allocate quotas of items between different orders and different warehouses, optimize the system's performance in handling normal business, avoid unnecessary data reading and writing processes, and improve business processing speed.
[0044] The following Figure 1 The specific implementation process of each step is described in detail:
[0045] For example, you can refer to Figure 2 , Figure 2 A schematic diagram of a process for training a transaction volume prediction model in this exemplary embodiment is shown, including steps S201 and S202:
[0046] In step S201, a sample of historical transaction data of a target item based on a time series is obtained.
[0047] In this step, the historical transaction data sample can be massive transaction data based on time series (for example, all transaction data from 2016 to 2019), or partial transaction data obtained by random sampling of the above massive transaction data (for example, transaction data of certain dates or time periods from 2016 to 2019). This can effectively reduce resource consumption and improve model training efficiency.
[0048] For example, the transaction data samples may also include historical transaction volume trends, such as weekly trends (weekly growth or decline rate relative to the previous week), monthly trends (monthly growth or decline rate relative to the previous month), and annual trends (yearly growth or decline rate relative to the previous year). The transaction data samples may also include important time markers, such as holidays, weekends, major promotional events (e.g., Singles' Day), and regular promotional periods.
[0049] For example, historical transaction volume can also be considered a random variable. Thus, the historical transaction data samples can be: the mean, variance (measure of the degree of deviation between transaction volume and its mean), skewness (measure of the asymmetry of the probability distribution of a random variable), kurtosis (characteristic number that characterizes the peak height of the probability density distribution curve at the mean value) of the historical transaction volume of the target item within a preset time period. These can be set according to actual circumstances and are all within the scope of protection of this disclosure. Given that the above data all have clear business meanings, they have good "interpretability" and can explain the rules of model training and output.
[0050] In step S202, multiple preset machine learning models are trained using historical transaction data samples to obtain multiple pre-trained transaction volume prediction models.
[0051] In this step, the model accuracy can be used as a label, and the above-mentioned multiple preset machine learning models can be trained using the above-mentioned historical transaction data samples until the loss function of each machine learning model tends to converge, thereby obtaining multiple pre-trained transaction volume prediction models (time series transaction volume prediction models).
[0052] Among them, the above-mentioned preset machine learning model can be a regression model, such as: linear regression (a regression analysis that uses the least square function called the linear regression equation to model the relationship between one or more independent variables and dependent variables), polynomial regression, support vector regression, quantile regression, robust regression, etc. The preset machine learning model can also be Arima (Autoregressive Integrated Moving Average model, differential integrated moving average autoregressive model, also known as integrated moving average autoregressive model, is one of the time series prediction analysis methods. In ARIMA (p, d, q), AR is "autoregression", p is the number of autoregressive terms, MA is "sliding average", q is the number of sliding average terms, and d is the difference order made to make it a stationary series), GBDT (Gradient Boosting Decision Tree, also known as MART (Multiple Additive Regression Tree, is to solve the optimization problem of the general loss function. The method is to use the negative gradient of the loss function in the current model to simulate the approximate value of the residual in the regression problem). The preset machine learning model can also be a deep learning model, such as a multi-layer neural network, LSTM (Long Short-Term Memory, long short-term memory network, is a time recurrent neural network, which is specially designed to solve the long-term dependency problem of general RNN (recurrent neural network). All RNNs have a chain form of repeated neural network modules), WaveNet (Google DeepMind's latest speech generation model based on deep learning, which can directly model raw speech data), Transformer (a classic natural language processing model proposed by Google's team in 2017), DeepAR (DeepAR is a supervised learning algorithm suitable for time series prediction. The algorithm uses recursive neural networks to generate point predictions and probability predictions), etc., which can be set by themselves according to actual conditions and fall within the scope of protection of this disclosure.
[0053] After training the above transaction volume prediction model, you can refer to Figure 3 , Figure 3 A flow chart of a training error prediction model in this exemplary embodiment is shown, including steps S301 to S304:
[0054] In step S301, the transaction volume of the target item in a historical time period is predicted using multiple pre-trained transaction volume prediction models to obtain multiple historical prediction values.
[0055] In this step, the transaction volume of the target item in the historical time period (for example, January to October 2020) can be predicted using the above-mentioned pre-trained multiple transaction volume prediction models to obtain multiple historical prediction values.
[0056] In step S302, the prediction error corresponding to each transaction volume prediction model is determined based on the actual transaction volume and historical prediction value of the target item in the historical time period.
[0057] In this step, the actual transaction volume of the target item during the aforementioned historical time period can be obtained. The historical prediction value is then compared with the actual transaction volume to obtain a numerical comparison result. Based on this numerical comparison result, the prediction error corresponding to each historical prediction value is determined. For example, if transaction volume prediction model A outputs a historical prediction value of 30 for January 2020, and the actual transaction volume for January 2020 is 35, then the prediction error corresponding to the historical prediction value output by prediction model A for January 2020 can be determined to be -5. Similarly, the prediction error corresponding to each transaction volume prediction model can be obtained.
[0058] In step S303, prediction error samples are selected from the prediction errors corresponding to the multiple transaction volume prediction models.
[0059] In this step, the contribution value of each prediction error to the processing result of the error prediction model can be determined based on the cooperative game algorithm, and prediction error samples (i.e., the prediction error sequence of each model at different times) are selected from the prediction errors corresponding to multiple trading volume prediction models according to the numerical value of the contribution value.
[0060] Specifically, each prediction error can be considered a feature, and the "Shapley value" of each feature can be generated through the Shap analyzer. The main idea is to calculate the marginal contribution of a feature when added to the model, and then take into account the different marginal contributions of the feature in all feature sequences and take the average, which is the Shapley value of the feature. "Shapley value" is abbreviated as Shap value, which represents the contribution of each feature to the model processing result. Shap values can be positive or negative. A positive value indicates that the feature has a positive impact on the model result, while a negative value indicates that the feature has a negative impact on the model result. For example, a prediction error whose absolute value of the Shap value is greater than a threshold can be selected as a prediction error sample.
[0061] Shap considers not only the impact of individual variables but also the impact of groups of variables, as well as potential synergies between variables. Using the Shap analyzer to filter and streamline features not only reduces resource consumption and improves model training efficiency, but also selects features that are highly relevant to the results, ensuring model effectiveness and interpretability.
[0062] In step S304, the preset machine learning model is trained using the prediction error samples to obtain an error prediction model.
[0063] In this step, the preset machine learning model can be trained based on the above-mentioned prediction error samples so that the loss function of each machine learning model tends to converge, thereby obtaining the above-mentioned time series-based error prediction model (time series error prediction model).
[0064] Among them, the above-mentioned preset machine learning models can be regression models (linear regression, polynomial regression, support vector regression, quantile regression, robust regression), Arima, GBDT (Gradient Boosting Decision Tree) also called MART (Multiple Additive Regression Tree) and other models, and also include multiple deep learning, such as multi-layer neural networks, LSTM, waveNet; transfomer, deepAR, etc.
[0065] It should be noted that after obtaining the prediction error corresponding to each transaction volume prediction model through step S302, the above-mentioned preset machine learning model can also be directly trained according to the obtained prediction error to obtain the above-mentioned error prediction model, which falls within the scope of protection of this disclosure.
[0066] Next reference Figure 1 In step S110, the transaction volume of the target item in the future time period is predicted using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values.
[0067] In this step, the transaction volume of the target item in a future time period (e.g., January 2021) can be predicted using the pre-trained transaction volume prediction models to obtain multiple preliminary prediction values. Specifically, the future time period can be input as an input parameter into the pre-trained transaction volume prediction models, and multiple preliminary prediction values can be obtained based on the output of each model.
[0068] In step S120, the prediction errors of multiple transaction volume prediction models in future time periods are predicted using a pre-trained error prediction model to obtain multiple prediction errors.
[0069] In this step, the pre-trained error prediction model can be used to predict the prediction errors of the multiple trading volume prediction models for future time periods to obtain multiple prediction errors. Specifically, the future time periods can be input as input parameters into the error prediction model, and the prediction errors corresponding to the respective trading volume prediction models can be obtained based on the outputs of the error prediction model.
[0070] In step S130 , a target model is selected from a plurality of transaction volume prediction models according to the plurality of prediction errors, and a final prediction value is determined according to the preliminary prediction value corresponding to the target model.
[0071] In this step, the transaction volume prediction model with the smallest absolute value of the prediction error can be determined as the target model, and the preliminary prediction value corresponding to the target model can be determined as the final prediction value.
[0072] In this step, you can also refer to Figure 4 , Figure 4 A schematic diagram of a process for determining a final prediction value in this exemplary embodiment is shown, including steps S401-S402:
[0073] In step S401 , a plurality of transaction volume prediction models whose absolute values of prediction errors are smaller than an error threshold are determined as target models.
[0074] For example, when the prediction error of trading volume prediction model A is -5, the prediction error of trading volume prediction model B is -6, the prediction error of trading volume prediction model B is -8, and the prediction error of trading volume prediction model B is 11, and the above error threshold is 10, then trading volume prediction models A, B, and C can be determined as target models.
[0075] In step S402, a weighted sum is performed on the preliminary prediction values corresponding to the target model to obtain a final prediction value.
[0076] Thus, when the output result of the trading volume prediction model A is 32, the output result of the trading volume prediction model B is 36, and the output result of the trading volume prediction model C is 22, then, for example, the final prediction value can be (32+36+22) / 3=30.
[0077] For example, after determining the target model, the weights corresponding to different target models can be determined based on the prediction error corresponding to the target model. Furthermore, the product of the preliminary prediction value of each target model and the weight is obtained, and the ratio of the sum of the multiple products to the sum of the multiple weights is determined as the final prediction value. For example, when the output result of trading volume prediction model A is 32, the output result of trading volume prediction model B is 36, and the output result of trading volume prediction model C is 22, it can be determined that the weight of trading volume prediction model A is 5, the weight of trading volume prediction model B is 3, and the weight of trading volume prediction model C is 2. Thus, the final prediction value can be (32*5+36*3+22*2) / 10=31.2. Thus, the robustness and accuracy of the prediction results can be guaranteed.
[0078] Based on step S130, the present disclosure can not only determine the final prediction value based on the future prediction error of the model, but also solve the technical problem in related technologies that the final prediction value is determined only based on the historical error of the model (while the historical performance of the model has no necessary relationship with the future performance), resulting in inaccurate prediction results, and improve the accuracy of the final prediction value, but also link the selection of the target model with the prediction error of each model, solving the problem in related technologies that the model selection rules cannot be explained.
[0079] In step S140, the final prediction value is sent to the stocking end, so that the stocking end prepares the target item according to the final prediction value.
[0080] In this step, after calculating the above-mentioned final prediction value, the final prediction value can be sent to the stocking end (for example, the item warehouse) so that the stocking end can prepare the target item according to the final prediction value. For example, when the received final prediction value is 31.2, the stocking end can determine the stocking quantity as 32 pieces, or the stocking end can also add or subtract a preset value (for example, 3) based on the above-mentioned final prediction value to determine the final stocking quantity. Thus, it is possible to improve the stocking accuracy of items, solve the technical problems of high cost caused by inaccurate stocking quantity of items in related technologies, and solve the problem of frequent allocation of item quotas between different orders and different warehouses due to inaccurate stocking quantity in related technologies, optimize the performance of the system in handling normal business, avoid unnecessary data reading and writing processes, and improve business processing speed.
[0081] Figure 5 The overall flow chart of a stocking processing method in this exemplary embodiment is shown, including steps S501-S508:
[0082] In step S501, historical transaction data samples are input into a regression model to train and obtain multiple transaction volume prediction models;
[0083] In step S502, the transaction volume of the historical time period is predicted using the transaction volume prediction model to obtain a prediction result;
[0084] In step S503, the prediction result is compared with the actual transaction volume to obtain the prediction error;
[0085] In step S504, the prediction error is screened by the Shap analyzer;
[0086] In step S505, an error prediction model is obtained by training based on the screened prediction error samples;
[0087] In step S506, a preliminary forecast value for the future time period is obtained through the transaction volume forecast model, and the forecast error of each transaction volume forecast model is predicted through the error forecast model;
[0088] In step S507, a target model is selected based on the transaction error;
[0089] In step S508, a final prediction value is determined based on the preliminary prediction value of the target model.
[0090] Based on the above technical solutions, the present disclosure can not only reduce the consumption of algorithm resources through random data sampling; by using the prediction error samples selected from the prediction error and having a large contribution value to the model output result to train the error prediction model, the output result of the model is made interpretable; by combining the prediction errors of each transaction volume prediction model to determine the final prediction value, the accuracy of the final prediction value obtained can be improved, thereby ensuring the accuracy of the subsequent stocking quantity and reducing the stocking cost of items.
[0091] It should be noted that, in different business scenarios, the method disclosed herein can also be used to predict different business data. For example, it can be used to predict item demand, traffic flow, advertising click-through rate, etc., which can be set according to actual conditions and fall within the scope of protection of the present disclosure. Taking traffic flow prediction as an example, multiple traffic flow prediction models can be pre-trained, and a traffic error prediction model can be pre-trained. Traffic flow in future time periods can be predicted using the above-mentioned traffic prediction models to obtain multiple traffic flow prediction values. Traffic prediction errors of multiple traffic flow prediction models in future time periods can be predicted using the above-mentioned traffic error prediction model to obtain multiple traffic flow prediction errors. A target traffic flow prediction model can be selected from the multiple traffic flow prediction models based on the multiple traffic flow prediction errors, and a traffic flow prediction result can be determined based on the traffic flow prediction values corresponding to the target traffic flow prediction model.
[0092] The present disclosure also provides a stock preparation processing device, Figure 6 A schematic structural diagram of a stocking processing device in an exemplary embodiment of the present disclosure is shown; Figure 6 As shown, the stock preparation processing device 600 may include a transaction volume prediction module 601, an error prediction module 602, a prediction result determination module 603, and a sending module 604.
[0093] The transaction volume prediction module 601 is used to predict the transaction volume of the target item in the future time period by using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values.
[0094] In an exemplary embodiment of the present disclosure, the transaction volume prediction model is trained in the following manner: obtaining historical transaction data samples of the target item based on a time series; using the historical transaction data samples to train multiple preset machine learning models to obtain multiple pre-trained transaction volume prediction models.
[0095] The error prediction module 602 is used to predict the prediction errors of multiple transaction volume prediction models in future time periods using a pre-trained error prediction model to obtain multiple prediction errors.
[0096] In an exemplary embodiment of the present disclosure, the error prediction model is trained in the following manner: the transaction volume of the target item in a historical time period is predicted by using multiple pre-trained transaction volume prediction models to obtain multiple historical prediction values; the prediction error corresponding to each transaction volume prediction model is determined based on the actual transaction volume and historical prediction value of the target item in the historical time period; prediction error samples are selected from the prediction errors corresponding to multiple transaction volume prediction models; and the preset machine learning model is trained using the prediction error samples to obtain the error prediction model.
[0097] In an exemplary embodiment of the present disclosure, the error prediction module is further used to compare the historical prediction value with the actual transaction volume to obtain a numerical comparison result; based on the numerical comparison result, the prediction error corresponding to each transaction volume prediction model is determined.
[0098] In an exemplary embodiment of the present disclosure, the error prediction module is also used to determine the contribution value of each prediction error to the processing result of the error prediction model based on a cooperative game algorithm; and select prediction error samples from the prediction errors corresponding to multiple trading volume prediction models according to the numerical value of the contribution value.
[0099] The prediction result determination module 603 is used to select a target model from multiple transaction volume prediction models based on multiple prediction errors, and determine a final prediction value based on the preliminary prediction value corresponding to the target model.
[0100] In an exemplary embodiment of the present disclosure, the prediction result determination module is used to determine the transaction volume prediction model with the smallest prediction error as the target model.
[0101] In an exemplary embodiment of the present disclosure, the prediction result determination module is used to determine multiple transaction volume prediction models whose prediction errors are less than an error threshold as target models; and perform weighted summation on the preliminary prediction values corresponding to the target models to obtain the final prediction value.
[0102] The sending module 604 is used to send the final prediction value to the stocking end, so that the stocking end prepares the target item according to the final prediction value.
[0103] The specific details of each module in the above-mentioned stocking processing device have been described in detail in the corresponding stocking processing method, so they will not be repeated here.
[0104] It should be noted that although several modules or units of the device for action execution are mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0105] Furthermore, although the steps of the method of the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in this particular order, or that all steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0106] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0107] The present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.
[0108] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, 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), optical fiber, 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 can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device.
[0109] Computer-readable storage media can transmit, propagate, or transfer programs for use by or in conjunction with an instruction execution system, apparatus, or device. Program code contained on a computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wireline, optical cable, RF, or any suitable combination thereof.
[0110] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method in the above embodiment.
[0111] In addition, an electronic device capable of implementing the above method is also provided in an embodiment of the present disclosure.
[0112] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods, or program products. Therefore, various aspects of the present disclosure may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0113] Refer to the following Figure 7 700 according to this embodiment of the present disclosure will be described. Figure 7 The electronic device 700 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.
[0114] like Figure 7 As shown, electronic device 700 is implemented as a general-purpose computing device. Components of electronic device 700 may include, but are not limited to, the aforementioned at least one processing unit 710, the aforementioned at least one storage unit 720, a bus 730 connecting various system components (including storage unit 720 and processing unit 710), and a display unit 740.
[0115] The storage unit stores program codes, which can be executed by the processing unit 710, so that the processing unit 710 performs the steps described in the "Exemplary Method" section of the present disclosure according to various exemplary embodiments. For example, the processing unit 710 can perform the following steps: Figure 1As shown in: Step S110, predicting the transaction volume of the target item in the future time period through multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values; Step S120, predicting the prediction errors of multiple transaction volume prediction models in the future time period through the pre-trained error prediction model to obtain multiple prediction errors; Step S130, selecting a target model from the multiple transaction volume prediction models according to the multiple prediction errors, and determining the final prediction value according to the preliminary prediction value corresponding to the target model; Step S140, sending the final prediction value to the stocking end, so that the stocking end prepares the target item according to the final prediction value.
[0116] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 7201 and / or a cache memory unit 7202 , and may further include a read-only memory unit (ROM) 7203 .
[0117] The storage unit 720 may also include a program / utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0118] Bus 730 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0119] The electronic device 700 can also communicate with one or more external devices 800 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 700, and / or any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 750. Furthermore, the electronic device 700 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 760. As shown, the network adapter 760 communicates with other modules of the electronic device 700 via a bus 730. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 700, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0120] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
[0121] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0122] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow from the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
Claims
1. A stocking processing method, characterized in that: include: Predict the transaction volume of the target item in the future time period using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values; Predicting the prediction errors of the multiple transaction volume prediction models in the future time period using a pre-trained error prediction model to obtain multiple prediction errors; selecting a target model from the multiple transaction volume prediction models based on the multiple prediction errors, and determining a final prediction value based on a preliminary prediction value corresponding to the target model; Sending the final prediction value to the stocking end, so that the stocking end prepares the target item according to the final prediction value; The error prediction model is trained in the following way: Predicting the transaction volume of the target item in a historical time period using the pre-trained multiple transaction volume prediction models to obtain multiple historical prediction values; Determining the prediction error corresponding to each of the transaction volume prediction models based on the actual transaction volume of the target item in the historical time period and the historical prediction value; Selecting a prediction error sample from the prediction errors corresponding to the plurality of transaction volume prediction models; The prediction error samples are used to train a preset machine learning model to obtain the error prediction model.
2. The method according to claim 1, characterized in that The transaction volume prediction model is trained in the following way: Obtain historical transaction data samples of the target item based on time series; The historical transaction data samples are used to train multiple preset machine learning models to obtain the pre-trained multiple transaction volume prediction models.
3. The method according to claim 1, characterized in that Determining the prediction error corresponding to each of the transaction volume prediction models based on the actual transaction volume of the target item within the historical time period and the historical prediction value includes: Comparing the historical forecast value with the actual transaction volume to obtain a numerical comparison result; According to the numerical comparison results, the prediction errors corresponding to the transaction volume prediction models are determined.
4. The method according to claim 1, wherein The selecting of prediction error samples from the prediction errors corresponding to the plurality of transaction volume prediction models includes: Determining a contribution value of each prediction error to a processing result of the error prediction model based on a cooperative game algorithm; A prediction error sample is selected from the prediction errors corresponding to the multiple transaction volume prediction models according to the numerical value of the contribution value.
5. The method according to any one of claims 1 to 4, characterized in that The selecting a target model from the multiple transaction volume prediction models according to the multiple prediction errors includes: The transaction volume prediction model with the smallest prediction error is determined as the target model.
6. The method according to any one of claims 1 to 4, characterized in that The selecting a target model from the multiple transaction volume prediction models according to the multiple prediction errors, and determining a final prediction value according to a preliminary prediction value corresponding to the target model, includes: Determining multiple transaction volume prediction models whose prediction errors are less than an error threshold as the target models; The preliminary prediction values corresponding to the target model are weighted and summed to obtain the final prediction value.
7. A stocking processing device, characterized in that: include: The transaction volume prediction module is used to predict the transaction volume of the target item in the future time period using multiple pre-trained transaction volume prediction models to obtain multiple preliminary prediction values; an error prediction module, configured to predict the prediction errors of the multiple transaction volume prediction models in the future time period using a pre-trained error prediction model to obtain multiple prediction errors; a prediction result determination module, configured to select a target model from the multiple transaction volume prediction models based on the multiple prediction errors, and determine a final prediction value based on a preliminary prediction value corresponding to the target model; a sending module, configured to send the final prediction value to a stocking terminal, so that the stocking terminal prepares the target item according to the final prediction value; Wherein, the error prediction module is further used for: Predicting the transaction volume of the target item in a historical time period using the pre-trained multiple transaction volume prediction models to obtain multiple historical prediction values; Determining the prediction error corresponding to each of the transaction volume prediction models based on the actual transaction volume of the target item in the historical time period and the historical prediction value; Selecting a prediction error sample from the prediction errors corresponding to the plurality of transaction volume prediction models; The prediction error samples are used to train a preset machine learning model to obtain the error prediction model.
8. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the stocking processing method according to any one of claims 1 to 6 is implemented.
9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the stocking processing method according to any one of claims 1 to 6 by executing the executable instructions.
Citation Information
Patent Citations
Goods volume measuring method and device and electronic equipment
CN111507542A
Commodity sales prediction method and device, electronic equipment and readable storage medium
CN111652655A
Data processing method, device and equipment, and storage medium
CN111797320A