Prediction correction method and device, model training method and device, stocking method and device and storage medium

By introducing uncertainty estimates and optimization of prediction intervals in sales volume prediction, combined with the satisfaction rate indicator and the loss function adjustment of interval width, the problem of inaccurate sales prediction in the prior art is solved, and higher prediction accuracy and better stocking management are achieved.

CN120020770APending Publication Date: 2025-05-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311550554.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-20
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

In the prior art, the sales volume prediction method is not accurate enough, resulting in too wide prediction intervals, which are prone to problems of predictions being higher than the real value or extreme value.

Method used

A training method for predictive correction model is proposed. By determining the uncertainty estimate and prediction interval, combining the satisfaction rate index and interval width, the loss function is optimized to adjust the model parameters and generate a more accurate prediction correction model.

Benefits of technology

Improve the accuracy of sales forecasts, reduce the problem of excessive or insufficient stocking due to uncertainty, and ensure tolerance for uncertainty results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020770A_ABST
    Figure CN120020770A_ABST
Patent Text Reader

Abstract

The invention provides a prediction correction method and device, a model training method and device, a stocking method and device and a storage medium, and relates to the technical field of artificial intelligence. The training method of the prediction correction model comprises the steps that an uncertainty estimation value is determined according to a prediction model and training sample data, and the training sample data comprises historical sales training data and associated training features of historical sales; determining a prediction interval according to the uncertainty estimation value and a prediction value of the prediction model, and determining a satisfaction rate index according to the historical sales training data and the prediction interval; a loss function is determined according to the satisfaction rate index and the width of the prediction interval, the prediction correction model to be trained adjusts model parameters according to the loss function until training is completed, the prediction correction model is generated, and the prediction correction model comprises a prediction model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and particularly to a method and device for prediction correction, model training and stock preparation, and a storage medium. Background Art

[0002] In the supply chain industry, maintaining a certain in-stock rate, reducing the probability of out-of-stock, and at the same time avoiding inventory backlogs can meet consumer demand while avoiding excessive warehousing and capital pressure. By using sales forecasting technology, reference data for stock preparation can be provided.

[0003] In supply chain algorithms, the sales volume outputs the average demand. When applied to the replenishment system, the probability of not being out of stock is about 50%; by using the method of distribution forecasting, the forecast quantity is increased on the basis of the mean forecast to improve the probability of not being out of stock, such as increasing the probability to 90%, to meet the supply demand for items such as e-commerce. Summary of the Invention

[0004] An object of the present disclosure is to improve the accuracy of prediction.

[0005] According to one aspect of some embodiments of the present disclosure, a method for training a prediction correction model is proposed, including: determining an uncertainty estimate value according to a prediction model and training sample data, wherein the training sample data includes historical sales volume training data and associated training features of historical sales volume; determining a prediction interval according to the uncertainty estimate value and the prediction value of the prediction model, and determining a satisfaction rate index according to the historical sales volume training data and the prediction interval; determining a loss function according to the satisfaction rate index and the width of the prediction interval, wherein the prediction correction model to be trained adjusts the model parameters according to the loss function until the training is completed, generating a prediction correction model, and the prediction correction model includes the prediction model.

[0006] In some embodiments, determining an uncertainty estimate value according to a prediction model and training sample data includes: determining a prediction value and a prediction error according to the prediction model and training sample data, and determining an uncertainty parameter of the error according to the prediction error; determining an uncertainty parameter of the model according to the training sample data and the prediction model; determining the uncertainty estimate value according to the uncertainty parameter of the error and the uncertainty parameter of the model.

[0007] In some embodiments, determining an uncertainty parameter of the model according to the training sample data and the prediction model includes: obtaining a predetermined first number of sample subsets according to the training sample data; respectively training the prediction model through each sample subset to obtain a predetermined first number of sub-prediction models; determining the uncertainty parameter of the model according to the prediction results of each sub-prediction model for the same training sample data.

[0008] In some embodiments, obtaining a predetermined first number of sample subsets according to training sample data includes: obtaining a predetermined first number of sample subsets by sampling with replacement from the training sample data, where each sample subset includes multiple pieces of sample data.

[0009] In some embodiments, determining the uncertainty parameter of the model according to the prediction results of each sub-prediction model for the same sample data includes: sampling from the training sample data to obtain data to be predicted; inputting the data to be predicted into each sub-prediction model to obtain the prediction results of each sub-prediction model; determining the standard deviation of the prediction results of each sub-prediction model as the uncertainty parameter of the model.

[0010] In some embodiments, determining the predicted value and the prediction error according to the training sample data based on the prediction model includes: processing the training sample data through the prediction model to obtain the predicted value; extracting a predetermined second number of predicted sales data from the predicted value and determining the corresponding historical time points of the predicted sales data; obtaining the historical sales training data at the historical time points; determining the prediction error according to the predicted sales data and the historical sales training data at the same historical time point.

[0011] In some embodiments, determining the uncertainty parameter of the error according to the prediction error includes: obtaining the standard deviation of the prediction error as the uncertainty parameter of the error.

[0012] In some embodiments, determining the uncertainty estimate according to the uncertainty parameter of the error and the uncertainty parameter of the model includes: obtaining the sum of the squares of the uncertainty parameter of the error and the uncertainty parameter of the model as the uncertainty estimate.

[0013] In some embodiments, determining the prediction interval according to the uncertainty estimate and the predicted value of the prediction model includes: taking the difference between the predicted value and a predetermined multiple of the uncertainty estimate as the lower limit of the prediction interval, taking the sum of the predicted value and a predetermined multiple of the uncertainty estimate as the upper limit of the prediction interval, and obtaining the prediction interval.

[0014] In some embodiments, determining the satisfaction rate index according to the historical sales training data and the prediction interval includes: determining the proportion of the historical sales training data within the prediction interval among a predetermined third number of sample data as the satisfaction rate index.

[0015] In some embodiments, determining the loss function according to the satisfaction rate index and the width of the prediction interval includes: obtaining the weighted sum of the satisfaction rate index and the width of the prediction interval as the value of the loss function.

[0016] According to one aspect of some embodiments of the present disclosure, a prediction correction method is proposed, including: obtaining historical sales data of a target item and associated features of the historical sales of the target item; processing the historical sales data and the associated features of the historical sales through a prediction calibration model to obtain a predicted sales correction value of the target item, where the prediction calibration model is trained and generated according to any one of the prediction correction model training methods described above.

[0017] In some embodiments, processing the historical sales data and the associated features of the historical sales of the target item through a prediction calibration model to obtain a predicted sales correction value of the target item includes: determining an uncertainty estimate value according to the prediction model, the historical sales data, and the associated features of the historical sales in the prediction calibration model; determining the predicted sales correction value of the target item according to the uncertainty estimate value and the predicted sales of the prediction model.

[0018] In some embodiments, determining an uncertainty estimate value according to the prediction model, the historical sales data, and the associated features of the historical sales in the prediction calibration model includes: determining the predicted sales and the predicted sales error of the target item according to the prediction model, the historical sales data, and the associated features of the historical sales, and determining the uncertainty parameter of the error according to the predicted sales error; determining the uncertainty parameter of the model according to the prediction model, the historical sales data, and the associated features of the historical sales; determining the uncertainty estimate value according to the uncertainty parameter of the error and the uncertainty parameter of the model.

[0019] In some embodiments, determining the predicted sales correction value of the target item according to the uncertainty estimate value and the predicted sales of the prediction model includes: obtaining the sum of the predicted sales of the prediction model and the uncertainty estimate value of a predetermined multiple as the predicted sales correction value of the target item.

[0020] According to one aspect of some embodiments of the present disclosure, a stocking method is proposed, including: determining the predicted sales correction value of the target item according to any one of the prediction correction methods described above; determining the stocking quantity of the target item according to the predicted sales correction value.

[0021] According to one aspect of some embodiments of the present disclosure, a training device for a prediction correction model is provided, including: an uncertainty estimation value determination unit configured to determine an uncertainty estimation value according to a prediction model and training sample data, wherein the training sample data includes historical sales volume training data and associated training features of the historical sales volume; a satisfaction rate determination unit configured to determine a prediction interval according to the uncertainty estimation value and the prediction value of the prediction model, and determine a satisfaction rate index according to the historical sales volume training data and the prediction interval; a loss function determination unit configured to determine a loss function according to the satisfaction rate index and the width of the prediction interval, wherein the prediction correction model to be trained adjusts model parameters according to the loss function until the training is completed to generate a prediction correction model, and the prediction correction model includes a prediction model.

[0022] According to one aspect of some embodiments of the present disclosure, a prediction correction device is provided, including: a data acquisition unit configured to acquire historical sales volume data of a target item and associated features of the historical sales volume of the target item; a prediction and calibration unit configured to process the historical sales volume data and the associated features of the historical sales volume through a prediction calibration model to obtain a predicted sales volume correction value of the target item, wherein the prediction calibration model is trained and generated according to any one of the training methods of the prediction correction models described above.

[0023] According to one aspect of some embodiments of the present disclosure, a stocking device is provided, including: a prediction unit configured to determine a predicted sales volume correction value of a target item according to any one of the prediction correction methods described above; and a stocking processing unit configured to determine a stocking quantity of the target item according to the predicted sales volume correction value.

[0024] According to one aspect of some embodiments of the present disclosure, a data processing device is provided, including: a memory; and a processor coupled to the memory, the processor being configured to execute any one of the methods described above based on instructions stored in the memory.

[0025] According to one aspect of some embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the steps of any one of the methods described above are implemented. Description of the Drawings

[0026] The drawings described herein are used to provide a further understanding of the present disclosure, and constitute a part of the present disclosure. The illustrative embodiments and descriptions thereof of the present disclosure are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:

[0027] Figure 1 It is a flowchart of some embodiments of the training method of the prediction correction model of the present disclosure.

[0028] Figure 2Schematic diagrams of some embodiments of the prediction-correction model of the present disclosure.

[0029] Figure 3 Schematic diagrams of some embodiments of the prediction model in the prediction-correction model of the present disclosure.

[0030] Figure 4 Flowcharts of some embodiments of obtaining uncertainty parameters in the training method of the prediction-correction model of the present disclosure.

[0031] Figure 5 Flowcharts of some embodiments of determining the loss function in the training method of the prediction-correction model of the present disclosure.

[0032] Figure 6 Flowcharts of some embodiments of the prediction-correction method of the present disclosure.

[0033] Figure 7 Flowcharts of some embodiments of the stocking method of the present disclosure.

[0034] Figure 8 Schematic diagrams of some embodiments of the training device of the prediction-correction model of the present disclosure.

[0035] Figure 9 Schematic diagrams of some embodiments of the prediction-correction device of the present disclosure.

[0036] Figure 10 Schematic diagrams of some embodiments of the stocking device of the present disclosure.

[0037] Figure 11 Schematic diagrams of some embodiments of the data processing device of the present disclosure.

[0038] Figure 12 Schematic diagrams of some other embodiments of the data processing device of the present disclosure. Detailed implementation manners

[0039] The technical solutions of the present disclosure will be further described in detail below with reference to the accompanying drawings and embodiments.

[0040] The inventors found that the sales volume prediction methods in the related art are not accurate. The reference technologies of the prediction distribution correction framework in e-commerce sales volume prediction mainly include:

[0041] 1. Based on the quantile regression method, different quantile predictions are output to meet the in-stock rate required for replenishment, such as xgboost.

[0042] 2. Based on the assumed distribution, a deep learning model is used to estimate the distribution parameters of the model, so as to obtain predictions at different confidence levels of the distribution, such as DEEPAR.

[0043] However, in traditional methods such as quantile regression used as a common loss function, only distribution prediction is performed by specifying quantiles in the loss function. Although the distribution does not need to be specified, the uncertainty factors in the prediction are ignored, resulting in a relatively wide overall prediction interval. In actual application, there will be a risk that the prediction is much higher than the true value and extreme prediction values. In the method based on the assumed distribution of data, since the distribution of data is often unknown, incorrect distribution assumptions will cause obvious prediction errors.

[0044] In view of the above problems, the present disclosure proposes a method and apparatus for prediction correction, model training, and stock preparation, as well as a storage medium, to improve the accuracy of sales volume prediction.

[0045] The flowchart of some embodiments of the training method of the prediction correction model of the present disclosure is as Figure 1 shown.

[0046] In step S11, based on the prediction model in the prediction correction model, the training sample data is processed to obtain an uncertainty estimate value. In some embodiments, the training sample data includes historical sales volume training data and associated training features of historical sales volume.

[0047] In some embodiments, the uncertainty factors in the prediction include model uncertainty and error uncertainty. Since model training is affected by the sample space, the prediction models obtained by training under different samples will be different. Model uncertainty can reflect the stability of the model under the influence of samples. The accuracy of the processing results of the model for different input samples is different, and error uncertainty can reflect the stability of the prediction accuracy of the model. By obtaining the model uncertainty and error uncertainty, the uncertainty factors in the prediction can be analyzed from two aspects: the stability of the model under the influence of samples and the stability of the prediction accuracy of the model. Furthermore, this uncertainty factor can be taken into account during training to improve the tolerance of the trained prediction model to model and error uncertainties.

[0048] In some embodiments, the uncertainty parameter of the model and the uncertainty parameter of the error can be determined separately, and then the uncertainty parameter of the model and the uncertainty parameter of the error are combined as the uncertainty estimate value in the prediction, so as to improve the accuracy of the uncertainty estimate.

[0049] In some embodiments, the model uncertainty can be determined by the similarity of the prediction results of multiple models used for sales volume prediction; in some embodiments, the error uncertainty can be determined by the fluctuation of the error of the prediction result compared with the true sales volume. Through such a method, the uncertainties of the model and the error can be quantified based on the prediction results of the prediction model, improving the reliability of subsequent uncertainty estimation and facilitating the improvement of the accuracy of the model.

[0050] In some embodiments, the training sample data can be generated based on the historical sales data of different items in each period, so as to increase the number of training samples and improve the accuracy of the trained model.

[0051] In some embodiments, the associated training features of the historical sales volume may include the average sales volume feature of the item based on which the training samples are generated. In some embodiments, the average sales volume feature can be determined by obtaining the average sales volume or the mean square sales volume of the item. By this method, the training sample data can provide the average level information of the item sales volume for the prediction model, provide effective information for the prediction model, and is conducive to improving the model convergence speed and training efficiency.

[0052] In some embodiments, the associated training features of the historical sales volume may include the sales volume stability feature of the item based on which the training samples are generated. In some embodiments, the sales volume stability feature can be determined by obtaining the sales volume variance or the sales volume standard deviation of the item. By this method, the training sample data can provide the stability information of the item sales volume for the prediction model, provide effective information for the prediction model, and is conducive to improving the accuracy of model training and further improving the accuracy of subsequent predictions.

[0053] In some embodiments, the sales volume-related features can be determined by referring to the sales volume prediction methods in related technologies, and then the sales volume-related features of the item based on which the training samples are generated can be used as the associated training features of the historical sales volume, so as to improve the comprehensiveness of the feature information that can be provided in the training data and improve the convergence speed and training accuracy of the prediction model.

[0054] In step S13, a prediction interval is determined according to the uncertainty estimate value and the prediction value of the prediction model, and a satisfaction rate index is determined according to the historical sales volume training data and the prediction interval.

[0055] In some embodiments, on the basis of the prediction value, the uncertainty estimate value can be used as the tolerance to determine the prediction interval, so as to reduce the problem of overstocking or understocking caused by inaccurate prediction due to uncertainty and improve the accuracy of the prediction result.

[0056] In some embodiments, based on the historical sales volume training data, the proportion of the parameters of the historical sales volume that satisfy the prediction interval can be determined as the satisfaction rate index, so as to be able to evaluate the rationality of the prediction data corrected by using the uncertainty estimate value, which is conducive to improving the accuracy of the trained prediction correction model.

[0057] In step S15, a loss function is determined according to the satisfaction rate index and the width of the prediction interval. Among them, the prediction correction model to be trained adjusts the model parameters according to the loss function until the training is completed to generate a prediction correction model.

[0058] In some embodiments, the loss function value can be the weighted average of the satisfaction rate index and the width of the prediction interval. During training, the parameters of the prediction correction model are adjusted according to the loss function. Through a predetermined number of trainings, or by setting a loss function threshold as the termination condition for training, the training of the prediction correction model is completed.

[0059] Based on the method in the embodiments shown above, it is possible to fully consider uncertainty in sales volume prediction, make adjustments using the uncertainty estimate value based on the predicted sales volume, thereby improving the tolerance of the prediction result to uncertain factors, enhancing the accuracy of sales volume prediction, and avoiding overstocking of items caused by excessive stocking while avoiding the out-of-stock probability being higher than the required threshold.

[0060] In some embodiments, a schematic diagram of the data processing flow of the prediction correction model is as Figure 2 shown, and the prediction correction model includes a prediction model.

[0061] In the input layer, the data used to predict the sales volume of an item is input into the prediction correction model. In some embodiments, the item identifier is denoted as i, and the input data includes the historical sales volume data y t-m of item i and the associated features X t-m corresponding to the historical sales volume, where X t-m is a feature of multiple dimensions, including (x 1,t-m , x 2,t-m , … x n,t-m ), and each dimension is a kind of relevant feature, such as the mean square sales volume and sales volume variance of item i. Here, n is the identifier of the type quantity of relevant features, and n is a positive integer greater than or equal to 1; t is the current moment identifier, and m is the interval identifier between the historical sales volume data and the current moment. For example, t - 1 is the historical sales volume data within a predetermined time length closest to the current moment in the historical data. The larger the value of m, the longer the time of the corresponding historical sales volume data from the current moment. In some embodiments, m is a positive integer greater than or equal to 1. In some embodiments, considering the operation efficiency, m is taken as 1, so as to use the latest historical sales volume data for prediction and improve the response speed to sales volume changes.

[0062] Furthermore, the first prediction 211 and the second prediction 211 are performed in the prediction stage. In some embodiments, in the step of the first prediction 211, the calculation can be performed in any way of predicting future sales volume based on historical sales volume data in related technologies.

[0063] In some embodiments, such as Figure 3As shown, the MQ-CNN framework can be used to output the mean prediction based on historical sales and related feature decoders. Wavenet is used for time series prediction to encode historical features. MLP (Multilayer Perceptron) outputs predicted sales, where ht is the hidden layer state, ct is the local state of each hidden layer state after linear transformation, and ca is the global state of the hidden layer state after linear transformation. Mean prediction is used as a baseline prediction method. By building uncertainty to estimate the interval of mean prediction, the effect of predictive distribution correction is achieved. By predicting k historical moments, the prediction error sequence is obtained, as shown in the following formula.

[0064]

[0065] is the sequence of predicted values ​​from tk to t-1, is the sequence of true values ​​from tk to t-1, then ∈ (t-k,t-1) is the sequence of prediction errors from tk to t-1.

[0066] Furthermore, in step prediction error 212, by randomly selecting k historical time point samples, inputting the sales volume and features of the historical time point and outputting k historical time point sample predictions, the difference between the historical reality and the prediction is output as the historical prediction error, k is a positive integer. The historical prediction error will be used as the raw data of step calculation error uncertainty estimation 213.

[0067] In step 221, the prediction model is trained by extracting different sub-sample sets from the historical data to obtain multiple sub-prediction models, and then the prediction effect of each sub-prediction model is determined as the original data for step 222 of the uncertainty estimation of the calculation model.

[0068] The uncertainty estimates of the data in step 213 and step 222 are used to determine the prediction interval in step 230. In some embodiments, the uncertainty estimate is divided into three parts, and the uncertainty parameter σ of the model is obtained in step 221 model is estimated, and the uncertainty parameter σ of the error is obtained by estimating the uncertainty of the step error 213 noise . Assuming that the data error is estimated under the assumption of normal distribution, the standard deviation is estimated. However, since there are sufficient samples when calculating the historical error, in the case of large samples, the standard deviation can be directly calculated, that is, there is no need to estimate the distribution. The sum of the two parts is used as the final uncertainty estimate, and finally optimized by the new loss function wqd.

[0069] In step 230, the prediction interval of item i within a predetermined time period in the future (e.g., one month, three months, or six months) is output The parameter k here is a hyperparameter that controls the standard deviation. In some embodiments, k is set to 1. is the upper prediction limit. is the lower prediction limit. In some embodiments, the time length corresponding to the predicted sales volume can be determined based on the time length corresponding to the sales volume in the historical sales data. For example, the sales volume within 91 days can be predicted, which can not only guide short-term replenishment but also make long-term demand plans for goods, facilitating popularization and application. In some embodiments, when collecting historical sales data, sales data with a cycle of 91 days can be collected, thereby improving the accuracy of predicting the sales volume in the next 91 days.

[0070] Based on the method in the above embodiments, it is possible to predict the next sales volume of an item based on its historical data, taking into account both the uncertainty of the model and the uncertainty of the error, making the distribution prediction more accurate, and thus the prediction accuracy higher. In the design of the distribution loss, the interval width is used as a constraint considering the satisfaction rate, optimizing the interval width while ensuring prediction accuracy.

[0071] The flowchart of some embodiments for obtaining the uncertainty parameter in the training method of the prediction correction model of the present disclosure is as Figure 4 shown.

[0072] In step 411, the predicted value and the prediction error are determined according to the prediction model and the training sample data, and the uncertainty parameter of the error is determined according to the prediction error.

[0073] In some embodiments, the training sample data is processed by the prediction model to obtain the predicted value; a predetermined second number of predicted sales volume data is extracted from the predicted value, and the historical time points corresponding to the predicted sales volume data are determined, and the historical sales volume training data at the historical time points is obtained. Then, based on the predicted sales volume data and the historical sales volume training data at the same historical time point, the prediction error is determined. In some embodiments, a predetermined second number of prediction errors can be generated based on the method mentioned in step 211 above. In some embodiments, the extracted predicted sales volume data can be data at adjacent time points or data at random time points.

[0074] In some embodiments, the standard deviation of the prediction error can be obtained as the uncertainty parameter of the error. For example, for r prediction errors for item i, calculate their mean where j is a positive integer between t - r and t - 1, and then the square of the uncertainty parameter of the error is determined based on the following formula

[0075]

[0076] In step 412, based on the training sample data and the prediction model, the uncertainty parameter of the model is determined.

[0077] In some embodiments, samples are randomly drawn based on the training sample data to obtain a sample subset. In some embodiments, the sample drawing operation is a sampling operation with replacement. In some embodiments, subsampling with replacement can be performed through bootstrap sample to obtain M sample subsets of a first predetermined number. Further, the prediction model is trained respectively through each sample subset to obtain a predetermined first number of sub-prediction models. Samples are drawn again from the training sample data, and the drawn samples are processed respectively by each sub-prediction model, so that different sub-training models process the same sample data, and the prediction results of each sub-training model are obtained. where j is the identifier of the sub-prediction network, which is a positive integer between 1 and M. The uncertainty parameter of the model is obtained by using the prediction results of multiple sub-training models based on the same sample data. In some embodiments, the mean value of the prediction results can be calculated. where, Further, the square of the uncertainty parameter of the model is determined based on the following formula.

[0078]

[0079] In step 413, based on the uncertainty parameter of the error and the uncertainty parameter of the model, an uncertainty estimate value is determined. In some embodiments, the uncertainty estimate value is the sum of the squares of the uncertainty parameter of the error and the uncertainty parameter of the model, that is, the uncertainty estimate value is determined according to the following formula.

[0080]

[0081] Based on the method in the above embodiments, on the basis of the same prediction model, differences can be generated in the prediction model by using the training of different sample subsets, and then the differences of the model can be quantified by using the same sample data, so as to realize the evaluation of the uncertainty of the model, reduce the influence of the uncertainty of the model on the prediction accuracy, and improve the subsequent prediction accuracy.

[0082] The flowchart of some embodiments for determining the loss function in the training method of the prediction correction model of the present disclosure is as Figure 5 shown.

[0083] In step 531, based on the uncertainty parameter of the model and the uncertainty parameter of the error, an uncertainty estimate value is obtained. In some embodiments, the uncertainty estimate value can be obtained based on any of the above-mentioned methods, such as according to formula (4) above.

[0084] In step 532, the difference between the predicted value and the uncertainty estimate value multiplied by a predetermined multiple is used as the lower limit of the prediction interval, and the sum of the predicted value and the uncertainty estimate value multiplied by the predetermined multiple is used as the upper limit of the prediction interval to obtain the prediction interval.

[0085] In some embodiments, the predicted value is Then the prediction interval is where k is the predetermined multiple, which can be set or adjusted as needed. For example, k is increased when it is necessary to reduce the out-of-stock rate, and k is decreased when it is necessary to save costs. In some embodiments, k is set to 1.

[0086] In step 533, determine the proportion of the historical sales training data within the prediction interval among the predetermined third quantity of sample data as the fulfillment rate index. In some embodiments, assume the sample size is n. When the true value y at time t t falls within the interval, record c = 1. If y t does not fall within the prediction interval, then c = 0. In some embodiments, the fulfillment rate index picp (Prediction Interval Coverage Probability, the fulfillment rate of the prediction interval) can be calculated by the following formula (5).

[0087]

[0088] In step 551, obtain the weighted sum of the fulfillment rate index and the width of the prediction interval as the value of the loss function.

[0089] In some embodiments, based on the prediction interval, the interval width index, the lower limit of the interval is the upper limit of the interval is Then the interval width index mp*w (Mean Prediction Interval Width, average prediction width) is obtained according to the following formula (5).

[0090]

[0091] Determine the loss function according to the following formula (7).

[0092] loss QD = λ 1 *.ic. + λ 2 m.iw (7)

[0093] In the above formula, λ 1 and λ 2 are hyperparameters used to control the weights of picp and mpiw, which can be set or adjusted as needed.

[0094] Through the method in the above embodiments, the satisfaction rate and the interval width can be considered simultaneously in the loss function, and the satisfaction rate and the interval width are related to the error and the uncertainty of the model. Therefore, through multiple trainings, the prediction correction model can take into account both the error and the uncertainty brought by the model, reduce the prediction deviation, and improve the prediction accuracy.

[0095] The flowchart of some embodiments of the prediction correction method of the present disclosure is as Figure 6 shown.

[0096] In step S61, historical sales data of the target item and associated features of the historical sales of the target item are obtained. In some embodiments, based on determining the target item to be predicted, its historical sales data and associated features can be obtained based on the identifier of the target item.

[0097] In some embodiments, the associated features of the historical sales may include the average sales feature of the target item. In some embodiments, the average sales feature can be determined by obtaining, for example, the average sales volume or the mean square sales volume of the target item. By such a method, information on the average level of the sales volume of the target item can be provided for the prediction model, improving the prediction accuracy and operation efficiency.

[0098] In some embodiments, the associated features of the historical sales may include the sales volume stability feature of the target item. In some embodiments, the sales volume stability feature can be determined by obtaining, for example, the sales volume variance or the sales volume standard deviation of the target item. By such a method, information on the stability of the sales volume of the target item can be provided for the prediction model, providing effective information for the prediction model and being conducive to improving the prediction accuracy.

[0099] In some embodiments, the feature dimensions included in the associated features of the historical sales are the same as those included in the associated training features of the historical sales during model training, and the acquisition methods of the data with the same feature dimensions are similar, thereby improving the matching degree between the data provided for the prediction and the prediction model and improving the prediction accuracy. In some embodiments, according to the time length corresponding to the sales volume to be predicted, historical sales data in units of the corresponding time length can be statistically obtained, thereby improving the matching pair between the sample and the prediction result. In some embodiments, starting from the current moment, the latest historical sales data can be obtained, thereby improving the sensitivity of the prediction to the change in sales volume.

[0100] In step S62, the historical sales data and the associated features of the historical sales are processed by the prediction calibration model to obtain a predicted sales volume correction value of the target item, where the prediction calibration model is trained and generated according to any one of the training methods of the prediction correction models described above.

[0101] In some embodiments, historical sales data and associated features of the historical sales data can be input into a prediction model in a prediction calibration model to obtain corresponding predicted sales volumes. Furthermore, the predicted sales volumes can be corrected using uncertainty estimates, and the sum of the predicted sales volumes and the uncertainty estimates of a predetermined multiple is used as the corrected predicted sales volume of the target item.

[0102] In some embodiments, the uncertainty estimate can be a fixed value, i.e., the latest uncertainty estimate when the model training is completed. In some embodiments, the historical sales data of the target item and the associated features can be input into a prediction model to obtain the predicted sales volume at a historical moment of the target item. Among them, the generation moment of the historical sales data used to predict the predicted sales volume at the historical moment is earlier than the historical moment corresponding to the predicted sales volume. Furthermore, the prediction error for the target item is obtained, and the uncertainty parameter of the error of the target item is determined. The historical sales data of the target item is input into a sub-prediction model generated during model training, and the uncertainty parameter of the model is generated according to the prediction result of the sub-prediction model. Using the error and the uncertainty parameter of the model, the uncertainty estimate is determined, thereby improving the matching degree between the uncertainty estimate and the target item and further improving the accuracy.

[0103] In some embodiments, methods such as those in the Figure 2 illustrated embodiments can be used to determine the corrected predicted sales volume.

[0104] Based on the methods in the above illustrated embodiments, it is possible to fully consider uncertainty in sales volume prediction, and use uncertainty estimates to adjust on the basis of the predicted sales volume, thereby improving the tolerance of the prediction result to uncertain factors, improving the accuracy of sales volume prediction, and avoiding overstocking of items caused by excessive stocking while avoiding the out-of-stock probability being higher than the required threshold.

[0105] The flowchart of some embodiments of the inventory preparation method of the present disclosure is as Figure 7 illustrated.

[0106] In step S71, the corrected predicted sales volume of the target item is determined according to any one of the prediction correction methods described above.

[0107] In step S72, the inventory quantity of the target item is determined according to the corrected predicted sales volume. In some embodiments, the current inventory quantity of the target item can be determined, and the difference between the two is determined as the purchase quantity according to the corrected predicted sales volume, so as to ensure meeting the sales demand.

[0108] Through such a method, it is possible to fully consider uncertainties in sales volume prediction, make adjustments using the uncertainty estimation value based on the predicted sales volume, thereby improving the tolerance of the prediction result to uncertain factors, enhancing the accuracy of sales volume prediction, and conducting inventory preparation based on the calibrated prediction value, while avoiding a stockout probability higher than the required threshold and avoiding overstocking of items caused by excessive inventory preparation.

[0109] A schematic diagram of some embodiments of the training device 81 of the prediction correction model of the present disclosure is as Figure 8 shown.

[0110] The uncertainty estimation value determination unit 811 processes the training sample data based on the prediction model in the prediction correction model to obtain the uncertainty estimation value. In some embodiments, the training sample data includes historical sales volume training data and associated training features of the historical sales volume.

[0111] In some embodiments, the uncertain factors in the prediction include the uncertainty of the model and the uncertainty of the error. The uncertainty parameter of the model and the uncertainty parameter of the error can be determined respectively, and then the uncertainty parameter of the model and the uncertainty parameter of the error are combined as the uncertainty estimation value in the prediction, thereby improving the accuracy of the uncertainty estimation.

[0112] In some embodiments, the uncertainty of the model can be determined by the similarity of the prediction results of multiple models used for sales volume prediction; in some embodiments, the uncertainty of the error can be determined by the fluctuation of the error compared between the prediction result and the actual sales volume. Through such a method, it is possible to quantify the uncertainties of the model and the error based on the prediction result of the prediction model, improve the reliability of subsequent uncertainty estimation, and contribute to improving the accuracy of the model.

[0113] In some embodiments, the training sample data can be generated based on the historical sales volume data of different items in each period, thereby increasing the number of training samples and improving the accuracy of the trained model.

[0114] In some embodiments, the uncertainty estimation value determination unit 811 can execute any one of the methods for calculating the uncertainty estimation value described above, such as Figure 4 the method in the corresponding shown embodiment.

[0115] The satisfaction rate determination unit 812 can determine the prediction interval according to the uncertainty estimation value and the prediction value of the prediction model, and determine the satisfaction rate index according to the historical sales volume training data and the prediction interval.

[0116] In some embodiments, based on the predicted value, an uncertainty estimate value can be used as a tolerance to determine a prediction interval, thereby reducing the problem of overstocking or understocking caused by inaccurate prediction due to uncertainty and improving the accuracy of the prediction result.

[0117] In some embodiments, based on historical sales training data, the proportion of parameters for which the historical sales satisfy the prediction interval can be determined as a satisfaction rate indicator, so as to be able to evaluate the rationality of the prediction data corrected using the uncertainty estimate value, which is beneficial to improving the accuracy of the trained prediction correction model.

[0118] In some embodiments, the satisfaction rate determination unit 812 can execute any one of the methods for calculating the satisfaction rate indicator described above, such as the method in steps 532 - 533.

[0119] The loss function determination unit 813 can determine a loss function according to the satisfaction rate indicator and the width of the prediction interval. Among them, the prediction correction model to be trained adjusts the model parameters according to the loss function until the training is completed to generate a prediction correction model.

[0120] In some embodiments, the loss function value can be the weighted average of the satisfaction rate indicator and the width of the prediction interval, and the parameters of the prediction correction model are adjusted according to the loss function during training. Through a predetermined number of trainings, or by setting a loss function threshold as the cut-off condition for training, the training of the prediction correction model is completed. In some embodiments, the loss function determination unit 813 can determine the loss function value by the method shown in step 551.

[0121] Such a device can fully consider uncertainty in sales prediction, make adjustments using the uncertainty estimate value based on the predicted sales volume, thereby improving the tolerance of the prediction result to uncertain factors, improving the accuracy of sales prediction, and avoiding both the probability of out-of-stock being higher than the required threshold and the backlog of items caused by overstocking.

[0122] A schematic diagram of some embodiments of the prediction correction device 92 of the present disclosure is as Figure 9 shown.

[0123] The data acquisition unit 921 can acquire the historical sales data of the target item and the associated features of the historical sales of the target item. In some embodiments, based on determining the target item to be predicted, its historical sales data and associated features can be acquired based on the identifier of the target item.

[0124] In some embodiments, historical sales data in units of the corresponding time length can be statistically obtained according to the time length corresponding to the sales volume to be predicted, so as to improve the matching degree between the sample and the prediction result. In some embodiments, starting from the current moment, the latest historical sales data can be obtained, so as to improve the sensitivity of the prediction to changes in sales volume.

[0125] The prediction and calibration unit 922 can process the historical sales data and the associated features of the historical sales volume through a prediction calibration model to obtain a predicted sales volume correction value of the target item, where the prediction calibration model is trained and generated according to any one of the prediction correction model training methods described above.

[0126] In some embodiments, the historical sales data and the associated features of the historical sales data can be input into the prediction model in the prediction calibration model to obtain the corresponding predicted sales volume, and then the predicted sales volume can be corrected by using the uncertainty estimate value to obtain the sum of the predicted sales volume and the uncertainty estimate value of a predetermined multiple as the predicted sales volume correction value of the target item.

[0127] In some embodiments, the uncertainty estimate value can be a fixed value, that is, the latest uncertainty estimate value when the model training is completed. In some embodiments, the historical sales data and the associated features of the historical sales volume of the target item can be input into the prediction model to obtain the predicted sales volume value at the historical moment of the target item, where the generation moment of the historical sales data used to predict the predicted sales volume value at the historical moment is earlier than the historical moment corresponding to the predicted sales volume value, and then the prediction error for the target item can be obtained, and the uncertainty parameter of the error of the target item can be determined. The historical sales data of the target item is input into the sub-prediction model generated during model training, and the uncertainty parameter of the model is generated according to the prediction result of the sub-prediction model. Using the error and the uncertainty parameter of the model, the uncertainty estimate value is determined, so as to improve the matching degree between the uncertainty estimate value and the target item and further improve the accuracy.

[0128] Such a device can fully consider the uncertainty in sales volume prediction, and use the uncertainty estimate value to make adjustments on the basis of the predicted sales volume, so as to improve the tolerance of the prediction result to uncertain factors, improve the accuracy of sales volume prediction, avoid the out-of-stock probability being higher than the required threshold, and avoid the backlog of items caused by excessive stocking.

[0129] A schematic diagram of some embodiments of the stocking device 1030 of the present disclosure is as Figure 10 shown.

[0130] The prediction unit 1031 can determine the predicted sales volume correction value of the target item according to any one of the prediction correction methods described above.

[0131] The stock preparation processing unit 1032 can determine the stock quantity of the target item according to the predicted sales correction value. In some embodiments, the current inventory quantity of the target item can be determined, and the difference between the two can be determined as the purchase quantity according to the predicted sales correction value, so as to ensure meeting the sales demand.

[0132] Such a device can fully consider the uncertainty in sales forecasting, and make adjustments based on the uncertainty estimate value on the basis of the predicted sales volume, so as to improve the tolerance of the prediction result to uncertain factors, improve the accuracy of sales forecasting, and conduct stock preparation based on the calibrated prediction value during stock preparation, while avoiding the probability of out-of-stock being higher than the required threshold and avoiding the backlog of items caused by excessive stock preparation.

[0133] A schematic structural diagram of an embodiment of the data processing device of the present disclosure is as Figure 11 shown. The data processing device includes a memory 1101 and a processor 1102. Among them: The memory 1101 can be a magnetic disk, a flash memory or any other non-volatile storage medium. The memory is used to store the instructions in the corresponding embodiments of the training method, prediction correction method or stock preparation method of the prediction correction model described above. The processor 1102 is coupled to the memory 1101 and can be implemented as one or more integrated circuits, such as a microprocessor or a microcontroller. The processor 1102 is used to execute the instructions stored in the memory and can improve the accuracy of sales forecasting.

[0134] In one embodiment, it can also be as Figure 12 shown. The data processing device 1200 includes a memory 1201 and a processor 1202. The processor 1202 is coupled to the memory 1201 through the BUS bus 1203. The data processing device 1200 can also be connected to an external storage device 1205 through a storage interface 1204 to call external data, and can also be connected to a network or another computer system (not shown) through a network interface 1206. Details are not described here.

[0135] In this embodiment, by storing data instructions in the memory and then processing the above instructions through the processor, the accuracy of sales forecasting can be improved.

[0136] In another embodiment, a computer-readable storage medium stores computer program instructions which, when executed by a processor, implement the steps of the methods corresponding to the training method, prediction correction method, or stock preparation method of the prediction correction model. Those skilled in the art should understand that the embodiments of the present disclosure may be provided as methods, apparatuses, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable non-transitory storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.

[0137] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks

[0138] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks

[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or a plurality of flows and / or blocks

[0140] So far, the present disclosure has been described in detail. To avoid obscuring the concept of the present disclosure, some details known in the art have not been described. Those skilled in the art can fully understand how to implement the technical solutions disclosed herein based on the above description.

[0141] The methods and apparatuses of the present disclosure can be implemented in many ways. For example, the methods and apparatuses of the present disclosure can be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the methods is for illustration only. The steps of the methods of the present disclosure are not limited to the specific order described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure can also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the methods according to the present disclosure.

[0142] It should be noted that the terms "first", "second", etc. in the specification, claims, and drawings of the present disclosure are used to distinguish similar objects and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure and not to limit them; although the present disclosure has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that: it is still possible to modify the specific implementation manners of the present disclosure or perform equivalent replacements for some technical features; without departing from the spirit of the technical solutions of the present disclosure, they should all be covered within the scope of the technical solutions claimed in the present disclosure.

Claims

1. A method for training a prediction correction model, comprising: Determining an uncertainty estimate based on the prediction model and the training sample data, wherein the training sample data includes historical sales training data and associated training features of the historical sales; Determining a prediction interval according to the uncertainty estimate and the prediction value of the prediction model, and determining a satisfaction rate indicator according to the historical sales training data and the prediction interval; A loss function is determined according to the satisfaction rate index and the width of the prediction interval, wherein the prediction correction model to be trained adjusts model parameters according to the loss function until the training is completed, and the prediction correction model is generated, and the prediction correction model includes the prediction model.

2. The method according to claim 1, wherein: Determining the uncertainty estimate value according to the prediction model and the training sample data includes: Determine a prediction value and a prediction error according to the prediction model and the training sample data, and determine an uncertainty parameter of the error according to the prediction error; Determining uncertainty parameters of the model based on the training sample data and the prediction model; An uncertainty estimate is determined based on the uncertainty parameter of the error and the uncertainty parameter of the model.

3. The method according to claim 2, wherein: Determining the uncertainty parameter of the model according to the training sample data and the prediction model includes: Acquire a predetermined first number of sample subsets according to the training sample data; Training the prediction model using each of the sample subsets respectively to obtain a predetermined first number of sub-prediction models; The uncertainty parameter of the model is determined according to the prediction results of each sub-prediction model on the same training sample data.

4. The method according to claim 3, wherein: The acquiring a predetermined first number of sample subsets according to the training sample data comprises: A predetermined first number of sample subsets are obtained by sampling with replacement in the training sample data, each of which includes a plurality of sample data.

5. The method according to claim 3, wherein: Determining the uncertainty parameter of the model according to the prediction results of each sub-prediction model for the same sample data includes: Sampling the training sample data to obtain data to be predicted; Inputting the data to be predicted into each of the sub-prediction models to obtain a prediction result of each of the sub-prediction models; The standard deviation of the prediction results of each of the sub-prediction models is determined as the uncertainty parameter of the model.

6. The method according to claim 2, wherein: Determining the prediction value and the prediction error based on the prediction model and the training sample data includes: Processing the training sample data through the prediction model to obtain the prediction value; Extracting a predetermined second quantity of predicted sales data from the predicted values, and determining the historical time points corresponding to the predicted sales data; Obtain historical sales training data at the historical time point; The prediction error is determined based on the predicted sales data and the historical sales training data at the same historical time point.

7. The method according to claim 2, wherein: The uncertainty parameter of the error determined according to the prediction error comprises: The standard deviation of the prediction error is obtained as an uncertainty parameter of the error.

8. The method according to any one of claims 2 to 7, wherein: Determining the uncertainty estimate according to the uncertainty parameter of the error and the uncertainty parameter of the model comprises: The square sum of the uncertainty parameter of the error and the uncertainty parameter of the model is obtained as the uncertainty estimate.

9. The method according to any one of claims 1 to 7, wherein: Determining the prediction interval according to the uncertainty estimate and the prediction value of the prediction model includes: The prediction interval is obtained by taking the difference between the predicted value and the uncertainty estimate value of a predetermined multiple as the lower limit of the prediction interval, and taking the sum of the predicted value and the uncertainty estimate value of a predetermined multiple as the upper limit of the prediction interval.

10. The method according to any one of claims 1 to 7, wherein: Determining the satisfaction rate index according to the historical sales training data and the prediction interval includes: The proportion of the historical sales training data within the prediction interval in the predetermined third amount of sample data is determined as the satisfaction rate indicator.

11. The method according to any one of claims 1 to 7, wherein: The determining of the loss function according to the satisfaction rate index and the width of the prediction interval includes: A weighted sum of the satisfaction rate index and the width of the prediction interval is obtained as the value of the loss function.

12. A prediction and correction method, comprising: Acquire historical sales data of a target item and associated features of the historical sales of the target item; Processing the historical sales data and the associated features of the historical sales through a prediction calibration model to obtain a predicted sales correction value of the target item, Wherein, the prediction calibration model is generated by training according to the method according to any one of claims 1 to 11.

13. The method according to claim 12, wherein: The step of processing the historical sales data and the associated features of the historical sales of the target item through the prediction calibration model to obtain the predicted sales correction value of the target item includes: determining an uncertainty estimate based on a prediction model in the prediction calibration model, the historical sales data, and associated features of the historical sales; A predicted sales correction value of the target item is determined based on the uncertainty estimate and the predicted sales of the prediction model.

14. The method according to claim 13, wherein: The determining of the uncertainty estimate according to the prediction model in the prediction calibration model, the historical sales data and the associated features of the historical sales comprises: Determine the predicted sales volume and predicted sales volume error of the target item according to the prediction model, the historical sales volume data and the associated features of the historical sales volume, and determine the uncertainty parameter of the error according to the predicted sales volume error; Determining uncertainty parameters of the model according to the prediction model, the historical sales data, and the associated features of the historical sales; An uncertainty estimate is determined based on the uncertainty parameter of the error and the uncertainty parameter of the model.

15. The method according to claim 13 or 14, wherein: The step of determining the predicted sales volume correction value of the target item according to the uncertainty estimation value and the predicted sales volume of the prediction model comprises: The sum of the predicted sales volume of the prediction model and the uncertainty estimate value of a predetermined multiple is obtained as a predicted sales volume correction value of the target item.

16. A method for preparing stock, comprising: Determining a predicted sales correction value of a target item according to the method of any one of claims 12 to 15; The stock quantity of the target item is determined according to the predicted sales volume correction value.

17. A training device for a prediction and correction model, comprising: An uncertainty estimation value determination unit is configured to determine an uncertainty estimation value according to a prediction model and training sample data, wherein the training sample data includes historical sales training data and associated training features of historical sales; a satisfaction rate determination unit, configured to determine a prediction interval according to the uncertainty estimate and the prediction value of the prediction model, and to determine a satisfaction rate indicator according to the historical sales training data and the prediction interval; A loss function determination unit is configured to determine a loss function based on the satisfaction rate index and the width of the prediction interval, wherein the prediction correction model to be trained adjusts model parameters according to the loss function until the training is completed to generate the prediction correction model, which includes the prediction model.

18. A prediction and correction device, comprising: A data acquisition unit, configured to acquire historical sales data of a target item and associated features of the historical sales of the target item; The prediction and calibration unit is configured to process the historical sales data and the associated features of the historical sales through a prediction calibration model to obtain a predicted sales correction value of the target item, wherein the prediction calibration model is trained and generated according to the method described in any one of claims 1 to 11.

19. A stocking device, comprising: A prediction unit, configured to determine a predicted sales correction value of a target item according to the method according to any one of claims 12 to 15; and The stocking processing unit is configured to determine the stocking quantity of the target item according to the predicted sales volume correction value.

20. A data processing device, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the method according to any one of claims 1 to 16 based on instructions stored in the memory.

21. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 16.