Replenishment prediction model training method and replenishment method and device
By introducing iterative training methods of prediction units and simulation units into the replenishment prediction model, the problem of low efficiency and accuracy of replenishment decisions in the prior art is solved, and more accurate and efficient replenishment decisions are achieved.
Patent Information
- Application Number
- CN202311464832.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
The prior art has low efficiency and accuracy in replenishment decisions, making it difficult to effectively balance holding costs and out-of-stock costs, and decision-making depends on too many factors, resulting in complex decision-making processes.
A replenishment prediction model training method is proposed. By obtaining training samples and initial replenishment prediction model, using prediction units and simulation units for prediction and simulation, iterative training until it is completed, the model is adjusted based on the loss value, and the target replenishment prediction model is output.
Through prediction and simulation, the intermediate process is reduced, decision error is reduced, and the theoretically optimal replenishment decision is directly generated, while reducing the generation cost of replenishment decisions.
Smart Images

Figure CN119939239A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of intelligent supply chain technology, and in particular to a replenishment prediction model training method and a replenishment method and device. Background Art
[0002] The inventory volume and inventory distribution of the retail industry directly affect its order fulfillment rate and spot rate. On the supply chain side, the decisive behavior that affects inventory levels is procurement. If the timing and quantity of purchasing massive quantities of goods are entirely based on manual experience, the low efficiency and accuracy will affect the overall cost and profitability, and the capabilities cannot be accumulated and reused.
[0003] The problem that smart replenishment needs to solve is to decide the timing and quantity of replenishment. The decision is based on the balance between holding cost and out-of-stock cost; the decision depends on factors such as sales information, promotion information, inventory level, supplier delivery time, spot requirements, minimum order quantity, etc. The current mainstream solution in the industry is a "step-by-step" decision-making process, that is, first predict the key variables and then optimize according to the goals. The forecasting stage includes sales forecasts, supplier delivery market forecasts, etc.; the optimization stage combines forecasts, safety stock models and parameterized replenishment strategies to output suggestions; and the feasibility is verified again through simulation of the replenishment results. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, an object of the present disclosure is to propose a replenishment prediction model training method.
[0006] The second object of the present disclosure is to provide a replenishment method.
[0007] The third objective of the present disclosure is to provide a replenishment prediction model training device.
[0008] A fourth objective of the present disclosure is to provide a replenishment device.
[0009] A fifth objective of the present disclosure is to provide an electronic device.
[0010] A sixth object of the present disclosure is to provide a non-transitory computer-readable storage medium.
[0011] A seventh objective of the present disclosure is to provide a computer program product.
[0012] To achieve the above-mentioned purpose, a first aspect of the present disclosure proposes a replenishment prediction model training method, comprising: obtaining training samples and an initial replenishment prediction model, the initial replenishment prediction model comprising a prediction unit and a simulation unit; inputting training data into the replenishment prediction model, and predicting predicted replenishment data through the prediction unit; simulating the predicted replenishment data through the simulation unit to obtain simulated replenishment data, and inputting the simulated replenishment data into the prediction unit for iterative prediction; repeating the above-mentioned prediction and simulation steps until the training is completed, determining a loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjusting the initial replenishment prediction model based on the loss value, and outputting a target replenishment prediction model.
[0013] According to one embodiment of the present disclosure, determining the loss value of the initial replenishment forecasting model based on the predicted replenishment data and the simulated replenishment data includes: calculating a predicted loss value based on real replenishment data and the predicted replenishment data, and calculating a simulated loss value based on the real replenishment data and the simulated replenishment data; and determining the loss value of the initial replenishment forecasting model based on the predicted loss value and the simulated loss value.
[0014] According to an embodiment of the present disclosure, the predicted replenishment data includes data at multiple moments, the actual replenishment data includes data corresponding one-to-one to the predicted replenishment data at multiple moments, and the calculating the predicted loss value based on the actual replenishment data and the predicted replenishment data includes: acquiring preset calculation parameters; for the predicted replenishment data at any moment, comparing the predicted replenishment data with the corresponding actual replenishment data; and determining, based on the comparison result and the preset calculation parameters, to calculate the predicted loss value between the actual replenishment data and the predicted replenishment data.
[0015] According to an embodiment of the present disclosure, the determining the actual replenishment data and the predicted replenishment data based on the comparison result and the preset calculation parameter to calculate the predicted loss value includes: obtaining an absolute value of a difference between the actual replenishment data and the predicted replenishment data; in response to the comparison result being that the actual replenishment data is less than the predicted replenishment data, subtracting the preset calculation parameter from one and multiplying the result by the absolute value of the difference to obtain a first sub-loss value; or, in response to the comparison result being that the actual replenishment data is greater than or equal to the predicted replenishment data, multiplying the preset calculation parameter by the absolute value of the difference to obtain a second sub-loss value; and adding all of the first sub-loss values and all of the second sub-loss values to obtain the predicted loss value.
[0016] According to one embodiment of the present disclosure, the predicted replenishment data includes calculated sales volume, safety stock and target stock, and the determining of the actual replenishment data and the predicted replenishment data to calculate the predicted loss value includes: respectively determining a first loss value, a second loss value and a third loss value of the calculated sales volume, the safety stock and the target stock.
[0017] According to one embodiment of the present disclosure, determining the loss value of the initial replenishment forecasting model based on the predicted loss value and the simulated loss value includes: calculating and obtaining the loss value of the initial replenishment forecasting model based on the first loss value, the second loss value, the third loss value and the simulated loss value.
[0018] According to an embodiment of the present disclosure, the simulated replenishment data includes data at multiple moments, the real replenishment data includes data corresponding to the simulated replenishment data at multiple moments in one-to-one relationship, and the calculating the simulated loss value based on the real replenishment data and the simulated replenishment data includes: subtracting the real replenishment data from the simulated replenishment data to obtain an initial simulated loss value; determining a self-learning parameter corresponding to each initial loss value; and calculating the simulated loss value based on the self-learning parameter and the initial simulated loss value.
[0019] According to one embodiment of the present disclosure, the calculation of the simulation loss value based on the self-learning parameter and the initial simulation loss value includes: for any initial loss value, calculating a first parameter based on the initial loss value and the corresponding self-learning parameter, and taking the logarithm of the self-learning parameter as the second parameter; taking the sum of the first parameter and the second parameter as a sub-simulation loss value of the initial loss value; and summing the sub-simulation loss values of all initial loss values to obtain the simulation loss value.
[0020] According to an embodiment of the present disclosure, simulating the predicted replenishment data through the simulation unit to obtain simulated replenishment data includes: obtaining simulation parameters; based on the simulation parameters and the predicted replenishment data, simulating the order placement link, the arrival link and the sales link in sequence through the simulation unit, and determining the simulated replenishment data based on the simulation results.
[0021] According to one embodiment of the present disclosure, simulating the order placement link includes: obtaining the order placement cycle and obtaining the target inventory in the forecast replenishment data; and simulating the order placement link based on the order placement cycle and the target inventory.
[0022] According to one embodiment of the present disclosure, the simulating the ordering link based on the ordering cycle and the target inventory includes: obtaining the current inventory for any ordering cycle; determining the replenishment quantity based on the difference between the target inventory and the current inventory, and simulating the ordering link based on the replenishment quantity.
[0023] According to an embodiment of the present disclosure, the method further comprises: obtaining an order cycle mark of the current simulation moment; and determining whether the current simulation moment is an order cycle based on the order cycle mark. 13. The method according to claim 12, characterized in that the method further comprises: in response to the current simulation moment not being an order cycle, determining that the replenishment quantity is 0.
[0024] According to one embodiment of the present disclosure, simulating the arrival link includes: obtaining the supplier response time in the simulation parameters; and simulating the arrival link based on the supplier response time.
[0025] According to one embodiment of the present disclosure, the simulation of the arrival link based on the supplier response time includes: subtracting the current simulation time from the time of the previous order cycle to obtain the order time difference; in response to the order time difference being equal to the supplier response time, determining the purchase arrival quantity based on the replenishment quantity, and determining the updated inventory based on the purchase arrival quantity and the current inventory to realize the simulation of the arrival link.
[0026] According to one embodiment of the present disclosure, the method further includes: in response to the order time difference not being equal to the supplier response time, determining that the purchased arrival quantity is 0.
[0027] According to one embodiment of the present disclosure, simulating the sales link includes: obtaining the simulated sales volume in the simulation parameters; and determining the cumulative inventory based on the simulated sales volume and the updated inventory to simulate the sales link.
[0028] According to one embodiment of the present disclosure, the method further includes: obtaining real sales volume; and determining the accumulated sales volume loss based on subtracting the real sales volume from the simulated sales volume.
[0029] According to one embodiment of the present disclosure, obtaining the simulated sales volume in the simulation parameters includes: obtaining historical sales volume and the valid historical sales days corresponding to the historical sales volume; dividing the historical sales volume and the valid historical sales days to obtain the simulated sales volume.
[0030] According to one embodiment of the present disclosure, adjusting the replenishment forecasting model based on the loss value includes: comparing the loss value with a loss threshold; and updating parameters of the forecasting unit in response to the loss value being greater than the loss threshold.
[0031] To achieve the above-mentioned purpose, the second aspect of the present disclosure proposes a replenishment method, comprising: processing the target replenishment prediction model trained by the replenishment prediction model training method described in the first aspect with the data to be predicted to obtain a predicted replenishment opportunity and a predicted replenishment quantity; and replenishing based on the predicted replenishment opportunity and the predicted replenishment quantity.
[0032] To achieve the above-mentioned purpose, a third aspect of the present disclosure proposes a replenishment prediction model training device, including: an acquisition module, used to acquire training samples and an initial replenishment prediction model, the initial replenishment prediction model including a prediction unit and a simulation unit, the prediction module, used to input training data into the replenishment prediction model, and predict predicted replenishment data through the prediction unit; a simulation module, used to simulate the predicted replenishment data through the simulation unit to obtain simulated replenishment data, and input the simulated replenishment data into the prediction unit for iterative prediction; a training module, used to repeat the above-mentioned prediction and simulation steps until the training is completed, determine the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjust the initial replenishment prediction model based on the loss value, and output a target replenishment prediction model.
[0033] To achieve the above-mentioned purpose, the fourth aspect of the present disclosure proposes a replenishment device, including: a processing module, used to process the target replenishment prediction model trained by the replenishment prediction model training method described in the first aspect to obtain a predicted replenishment opportunity and a predicted replenishment quantity; a replenishment module, used to replenish based on the predicted replenishment opportunity and the predicted replenishment quantity.
[0034] To achieve the above-mentioned purpose, the fifth aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the replenishment prediction model training method as described in the first aspect embodiment of the present disclosure.
[0035] To achieve the above-mentioned purpose, the sixth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the replenishment prediction model training method as described in the first aspect embodiment of the present disclosure.
[0036] To achieve the above-mentioned purpose, the seventh aspect of the present disclosure proposes a computer program product, including a computer program, which, when executed by a processor, is used to implement the replenishment prediction model training method as described in the first aspect of the present disclosure.
[0037] By training and generating a target replenishment prediction model that includes both prediction units and simulation units, prediction and simulation can be achieved through the same model, reducing intermediate processes, reducing decision errors, and ultimately directly generating the theoretically optimal replenishment decision, while reducing the cost of generating replenishment decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a schematic diagram of a replenishment prediction model training method according to an embodiment of the present disclosure;
[0039] Figure 2 is a schematic diagram of a causal convolution of a replenishment prediction model according to an embodiment of the present disclosure;
[0040] Figure 3 is a schematic diagram of another replenishment prediction model training method according to an embodiment of the present disclosure;
[0041] Figure 4 is a schematic diagram of another replenishment prediction model training method according to an embodiment of the present disclosure;
[0042] Figure 5 is a schematic diagram of another replenishment prediction model training method according to an embodiment of the present disclosure;
[0043] Figure 6 is a schematic diagram of a replenishment method according to one embodiment of the present disclosure;
[0044] Figure 7 is a schematic diagram of a replenishment prediction model training device according to one embodiment of the present disclosure;
[0045] Figure 8 is a schematic diagram of a replenishment device according to one embodiment of the present disclosure;
[0046] Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0047] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0048] Figure 1 A schematic diagram of an exemplary implementation of a replenishment prediction model training method proposed in the present disclosure is shown as follows: Figure 1 As shown, the replenishment prediction model training method includes the following steps:
[0049] S101, obtaining training samples and an initial replenishment prediction model, where the initial replenishment prediction model includes a prediction unit and a simulation unit.
[0050] The replenishment prediction model training method of the embodiment of the present application can be applied to the sales forecasting scenario. The executor of the replenishment prediction model training of the embodiment of the present application can be the replenishment prediction model training device of the embodiment of the present application, and the replenishment prediction model training device can be set on an electronic device.
[0051] It should be noted that the replenishment prediction model training method disclosed in the present invention can be implemented through the MQCNN framework. It should be noted that the MQCNN framework is a time series prediction method based on the seq2seq model (encoder decoder model) and combined with the attention mechanism. Through the MQCNN algorithm, the connection between the prediction unit and the simulation unit can be guaranteed, and the evaluation and optimization of the overall model can be realized.
[0052] It should be noted that the training data is prepared in advance, and the training data can be of various types, without any limitation herein. For example, the training data can be obtained by processing historical sales data, or can be manually established.
[0053] The training data may include a variety of contents, without any limitation here. For example, it may include sales volume, sales time, order cycle, order quantity, etc.
[0054] S102, inputting the training data into the replenishment prediction model, and predicting the replenishment data through the prediction unit.
[0055] In the embodiment of the present disclosure, there may be multiple prediction units, which are not limited here.
[0056] In one possible implementation, the prediction unit can output sales forecasts and target inventory forecasts at multiple time points. The core of the prediction unit is two parts: causal convolution and forking. Figure 2 As shown, causal convolution ensures that when outputting multiple predictions, past predictions do not use future information.
[0057] The implementation logic of Forking is to calculate the number of concurrent calls currently required, select the called implementation list through the load balancing algorithm, call the implementation list concurrently, and put the successful processing results into the blocking queue, get the first result in the processing result queue, and determine whether it is an exception. If it is an exception, it will be thrown, otherwise it will feedback the result.
[0058] It should be noted that the forecast replenishment data may include a variety of data, which is not limited here. For example, it may include the forecasted target inventory, future sales volume, required replenishment quantity and replenishment time, etc.
[0059] S103, simulating the predicted replenishment data through a simulation unit to obtain simulated replenishment data, and inputting the simulated replenishment data into the prediction unit for iterative prediction.
[0060] In the embodiments of the present disclosure, there may be multiple types of simulation units, and no limitation is made herein.
[0061] In a possible implementation, the simulation unit may be simulation software, and the simulation is performed by inputting the forecast replenishment data into the simulation software to obtain the simulated replenishment data.
[0062] It should be noted that the simulated replenishment data may include a variety of information, which is not limited here. For example, it may include simulated daily sales, simulated inventory turnover, etc.
[0063] S104, repeat the above prediction and simulation steps until the training is completed, determine the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjust the initial replenishment prediction model based on the loss value, and output the target replenishment prediction model.
[0064] It should be noted that there may be multiple criteria for determining whether training is complete, which are not limited here and may be limited according to actual design requirements.
[0065] Optionally, all training data may be processed to completion.
[0066] Optionally, it may also be that a preset number of cycles or a preset training time has been reached.
[0067] It is understandable that model training is an iterative process, which is carried out by continuously adjusting the network parameters of the model until the overall loss function value of the model is less than the preset value, or the overall loss function value of the model no longer changes or changes slowly, the model converges, and a trained model is obtained.
[0068] In the disclosed embodiment, firstly, a training sample and an initial replenishment prediction model are obtained, and the initial replenishment prediction model includes a prediction unit and a simulation unit, then the training data is input into the replenishment prediction model, and the predicted replenishment data is predicted by the prediction unit, and then the predicted replenishment data is simulated by the simulation unit to obtain the simulated replenishment data, and the simulated replenishment data is input into the prediction unit for iterative prediction, and finally the above prediction and simulation steps are repeated until the training is completed, and the loss value of the initial replenishment prediction model is determined based on the predicted replenishment data and the simulated replenishment data, and the initial replenishment prediction model is adjusted based on the loss value, and the target replenishment prediction model is output. Thus, by generating a target replenishment prediction model including both a prediction unit and a simulation unit through training, it is possible to realize prediction and simulation through the same model, reduce the intermediate process, reduce the decision error, and finally directly generate the theoretically optimal replenishment decision, and at the same time reduce the generation cost of the replenishment decision.
[0069] In the above embodiment, the loss value of the initial replenishment prediction model is determined based on the predicted replenishment data and the simulated replenishment data, and the loss value of the initial replenishment prediction model can also be determined by Figure 3 Explaining further, the method includes:
[0070] S301, calculating a predicted loss value based on the actual replenishment data and the predicted replenishment data, and calculating a simulated loss value based on the actual replenishment data and the simulated replenishment data.
[0071] In the embodiment of the present disclosure, the predicted replenishment data includes data at multiple moments, and the actual replenishment data includes data corresponding one-to-one to the predicted replenishment data at multiple moments.
[0072] It should be noted that the multiple moments may be sampling moments, which are set in advance and may be changed according to actual design requirements, and no limitation is made here.
[0073] In the implementation of the present disclosure, the predicted loss value is calculated based on the actual replenishment data and the predicted replenishment data. First, the preset calculation parameters are obtained, and then for the predicted replenishment data at any moment, the predicted replenishment data is compared with the corresponding actual replenishment data. Finally, based on the comparison result and the preset calculation parameters, the actual replenishment data and the predicted replenishment data are determined to calculate the predicted loss value.
[0074] S302: Determine the loss value of the initial replenishment forecasting model based on the predicted loss value and the simulated loss value.
[0075] It should be noted that there are many methods for determining the loss value based on the predicted loss value and the simulated loss value, which are not limited here and can be specifically limited according to actual design needs.
[0076] Optionally, the loss value of the replenishment prediction model can be obtained by inputting the predicted loss value and the simulated loss value into the loss value determination model. The loss value determination model is trained in advance and can be stored in the storage space of the electronic device for easy retrieval and use when needed.
[0077] Optionally, the predicted loss value and the simulated loss value may be calculated using a preset algorithm to obtain the loss value of the replenishment prediction model.
[0078] In the disclosed embodiment, the predicted loss value is first calculated based on the real replenishment data and the predicted replenishment data, and the simulated loss value is calculated based on the real replenishment data and the simulated replenishment data, and then the loss value of the replenishment prediction model is determined based on the predicted loss value and the simulated loss value. By obtaining the loss value of the prediction unit and the replenishment unit respectively, and then determining the overall loss of the model, it is possible to analyze the overall loss through the loss of a single unit, providing a more accurate data basis for subsequent training.
[0079] In the above embodiment, based on the comparison result and the preset calculation parameter, the actual replenishment data and the predicted replenishment data are determined to calculate the predicted loss value. The absolute value of the difference between the actual replenishment data and the predicted replenishment data may be first obtained. In response to the comparison result that the actual replenishment data is less than the predicted replenishment data, the preset calculation parameter is subtracted from one and multiplied by the absolute value of the difference to obtain a first sub-loss value. Alternatively, in response to the comparison result that the actual replenishment data is greater than or equal to the predicted replenishment data, the preset calculation parameter is multiplied by the absolute value of the difference to obtain a second sub-loss value. All first sub-loss values and all second sub-loss values are added to obtain the predicted loss value.
[0080] In the embodiment of the present disclosure, the predicted loss value can be calculated by the following formula:
[0081]
[0082] Among them, L r (y,y p ) is the predicted loss value, r is the preset calculation parameter, y i To predict replenishment data, It is the real replenishment data. It should be noted that the preset calculation parameters are set in advance and can be changed according to the actual design needs, and no limitation is made here.
[0083] It should be noted that the forecast replenishment data includes the calculation of sales volume, safety stock and target stock, and the first loss value, second loss value and third loss value of sales volume, safety stock and target stock can be calculated respectively by the above formula.
[0084] Furthermore, the loss value of the replenishment prediction model may be calculated based on the first loss value, the second loss value, the third loss value and the simulated loss value.
[0085] In the above embodiment, the simulated replenishment data includes data at multiple times, the real replenishment data includes data corresponding to the simulated replenishment data at multiple times, and the simulated loss value is calculated based on the real replenishment data and the simulated replenishment data. Figure 4 Explaining further, the method includes:
[0086] S401, subtracting the real replenishment data from the simulated replenishment data to obtain an initial simulation loss value.
[0087] S402, determining the self-learning parameters corresponding to each initial loss value.
[0088] In the embodiment of the present disclosure, the self-learning parameters corresponding to different initial loss values may be different, and no limitation is made here.
[0089] It should be noted that in the embodiments of the present disclosure, the change relationship between the historical data and the simulation data can be determined based on the historical data of previous replenishment logistics, and the prior probability value of the Bayesian network can be determined. According to the prior probability value, the conditional probability value of the Bayesian network is self-learned to achieve parameter self-learning, and the subsequent loss value calculation is performed based on the self-learning parameters.
[0090] S403, calculating a simulation loss value based on the self-learning parameters and the initial simulation loss value.
[0091] In the disclosed embodiment, first, for any initial loss value, a first parameter is calculated based on the initial loss value and the corresponding self-learning parameter, the logarithm of the self-learning parameter is used as the second parameter, and then the sum of the first parameter and the second parameter is used as the sub-simulation loss value of the initial loss value. Finally, the sub-simulation loss values of all initial loss values are summed to obtain the simulation loss value.
[0092] In the embodiment of the present disclosure, the simulation loss value can be calculated by the following formula:
[0093]
[0094] Among them, multi_loss is the simulation loss value, σ i is the self-learning parameter corresponding to the i-th initial simulation loss value, loss i is the i-th initial simulation loss value.
[0095] In the disclosed embodiment, the real replenishment data and the simulated replenishment data are first subtracted to obtain the initial simulation loss value, and then the self-learning parameters corresponding to each initial loss value are determined, and finally the simulation loss value is calculated based on the self-learning parameters and the initial simulation loss value. Thus, by setting the self-learning parameters, the loss value of the simulation result can be determined in an a priori manner, which is more accurate and in line with the actual operation.
[0096] In the embodiment of the present disclosure, the predicted replenishment data is simulated by the simulation unit to obtain the simulated replenishment data, and the simulated replenishment data is input into the prediction unit for iterative prediction. Figure 5 Explaining further, the method includes:
[0097] S501, obtaining simulation parameters.
[0098] It should be noted that the simulation parameters are pre-set, which are simulation data input in advance before the simulation. The simulation parameters may include multiple types, which are not limited here. For example, the simulation parameters may include a preset simulation time, an order cycle, etc.
[0099] S502, based on the simulation parameters and the predicted replenishment data, the order placement link, the arrival link and the sales link are simulated in sequence by the simulation unit, and the simulated replenishment data is determined based on the simulation results.
[0100] In the disclosed embodiment, the order placement process is simulated to obtain the order placement cycle and the target inventory in the forecast replenishment data, and then the order placement process is simulated based on the order placement cycle and the target inventory.
[0101] Optionally, the current inventory can be obtained for any order placement cycle, and the replenishment quantity can be determined based on the difference between the target inventory and the current inventory to realize the simulated order placement process.
[0102] In the embodiment of the present disclosure, the order placement process can be simulated by the following formula:
[0103]
[0104] Among them, p t Mark the order cycle, ti t is the target inventory, inυ t-1 is the current inventory, ord t For replenishment quantity.
[0105] It should be noted that p t When it is 0, it means that it is not in the order cycle, the replenishment quantity is 0, p tWhen it is 1, it means that in the order cycle, the replenishment quantity needs to be determined by the difference between the target inventory and the current inventory. From the formula, it can be seen that when the difference between the target inventory and the current inventory is less than 0, it means that replenishment is not needed and the replenishment quantity is 0. When the difference between the target inventory and the current inventory is greater than 0, it means that replenishment is needed and the replenishment quantity is the difference between the target inventory and the current inventory.
[0106] In the embodiment of the present disclosure, to simulate the arrival phase, the supplier response time in the simulation parameters may be obtained, and then the arrival phase may be simulated based on the supplier response time.
[0107] It should be noted that the current simulation time can be subtracted from the time of the previous order cycle to obtain the order time difference. In response to the order time difference being equal to the supplier response time, the purchase arrival quantity is determined based on the replenishment quantity, and the updated inventory is determined based on the purchase arrival quantity and the current inventory to realize the simulation arrival link.
[0108] In the embodiment of the present disclosure, the arrival link can be simulated by the following formula:
[0109]
[0110] Among them, aog t is the simulated arrival quantity on day t, ord i is the replenishment quantity on the i-th day, and υlt is the supplier response time.
[0111] It should be noted that the supplier response time is set in advance, which is the time from the goods supplier's supply to the goods transportation to the warehouse. The supplier response time can be changed according to the actual design needs and is not limited here. When the difference between the number of days t corresponding to the simulation time and the number of days i corresponding to the replenishment is the supplier response time, it means that the goods have arrived, otherwise the simulated arrival quantity is 0.
[0112] In the embodiment of the present disclosure, the simulated sales link can be realized by obtaining the simulated sales volume in the simulation parameters, and then determining the cumulative inventory based on the simulated sales volume and the updated inventory.
[0113] In the disclosed embodiment, the accumulated sales loss may also be determined by obtaining the actual sales volume and then subtracting the actual sales volume from the simulated sales volume.
[0114] In the implementation, because products have off-seasons and peak seasons, or there are days with high sales and days with low sales in a week or a month, when determining the simulated sales volume, the historical sales volume and the valid historical sales days corresponding to the historical sales volume can be obtained, and then the historical sales volume and the valid historical sales days can be divided to obtain the simulated sales volume.
[0115] It should be noted that the effective historical sales days are the days when the sales volume exceeds the set sales volume.
[0116] In the disclosed embodiment, since the simulation model generally does not require parameter changes, when adjusting the replenishment forecasting model based on the loss value, only the parameters of the forecasting unit may be updated.
[0117] Figure 6 A schematic diagram of an exemplary implementation of a replenishment method proposed in the present disclosure is shown as follows: Figure 1 As shown, the replenishment method includes the following steps:
[0118] S601, processing the target replenishment prediction model trained by the replenishment prediction model training method to obtain the predicted replenishment timing and the predicted replenishment quantity.
[0119] It should be noted that the specific training process can be found in the content of the above embodiment and will not be repeated here.
[0120] The data to be predicted may include a variety of information, which is not limited here. For example, it may include historical sales volume, order cycle, etc.
[0121] S602: Replenishment is performed based on the predicted replenishment timing and the predicted replenishment quantity.
[0122] In the disclosed embodiment, the target replenishment prediction model trained by the replenishment prediction model training method first processes the data to be predicted to obtain the predicted replenishment timing and the predicted replenishment quantity, and then replenishment is performed based on the predicted replenishment timing and the predicted replenishment quantity. In this way, the efficiency and accuracy of predicting the predicted replenishment timing and the predicted replenishment quantity can be improved by predicting the data to be predicted by the trained target replenishment prediction model.
[0123] Corresponding to the replenishment prediction model training methods provided in the above-mentioned embodiments, an embodiment of the present disclosure further provides a replenishment prediction model training device. Since the replenishment prediction model training device provided in the embodiment of the present disclosure corresponds to the replenishment prediction model training methods provided in the above-mentioned embodiments, the implementation methods of the above-mentioned replenishment prediction model training methods are also applicable to the replenishment prediction model training device provided in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.
[0124] Figure 7 A schematic diagram of a replenishment prediction model training device proposed in the present disclosure is shown in FIG. Figure 7 As shown, the replenishment prediction model training device 700 includes: an acquisition module 710, a prediction module 720, a simulation module 730 and a training module 740.
[0125] The acquisition module 710 is used to acquire training samples and an initial replenishment prediction model, and the initial replenishment prediction model includes a prediction unit and a simulation unit.
[0126] The prediction module 720 is used to input the training data into the replenishment prediction model and predict the replenishment data through the prediction unit.
[0127] The simulation module 730 is used to simulate the predicted replenishment data through the simulation unit to obtain simulated replenishment data, and input the simulated replenishment data into the prediction unit for iterative prediction.
[0128] The training module 740 is used to repeat the above prediction and simulation steps until the training is completed, determine the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjust the initial replenishment prediction model based on the loss value, and output the target replenishment prediction model.
[0129] In one possible implementation of the present disclosure, the training module 740 is further used to: calculate the predicted loss value based on the real replenishment data and the predicted replenishment data, and calculate the simulated loss value based on the real replenishment data and the simulated replenishment data; determine the loss value of the replenishment prediction model based on the predicted loss value and the simulated loss value. By obtaining the loss value of the prediction unit and the replenishment unit respectively, and then determining the overall loss of the model, it is possible to analyze the overall loss through the loss of a single unit, providing a more accurate data basis for subsequent training.
[0130] In the embodiment of the present disclosure, the predicted loss value can be calculated by the following formula:
[0131]
[0132] Among them, L r (y,y p ) is the predicted loss value, r is the preset calculation parameter, y i To predict replenishment data, It is the real replenishment data. It should be noted that the preset calculation parameters are set in advance and can be changed according to the actual design needs, and no limitation is made here.
[0133] In a possible implementation of the present disclosure, the training module 740 is further used to: obtain preset calculation parameters; compare the predicted replenishment data with the corresponding actual replenishment data for the predicted replenishment data at any moment; and determine the actual replenishment data and the predicted replenishment data based on the comparison result and the preset calculation parameters to calculate the predicted loss value.
[0134] In a possible implementation of the present disclosure, the training module 740 is further used to: obtain an absolute value of a difference between actual replenishment data and predicted replenishment data; in response to a comparison result that the actual replenishment data is less than the predicted replenishment data, subtract a preset calculation parameter from one and multiply the result by the absolute value of the difference to obtain a first sub-loss value; or, in response to a comparison result that the actual replenishment data is greater than or equal to the predicted replenishment data, multiply the preset calculation parameter by the absolute value of the difference to obtain a second sub-loss value; and add all first sub-loss values and all second sub-loss values to obtain a predicted loss value.
[0135] In one possible implementation of the present disclosure, forecasting replenishment data includes calculating sales volume, safety stock and target stock, and the training module 740 is further used to respectively determine the first loss value, the second loss value and the third loss value of the calculated sales volume, safety stock and target stock.
[0136] In a possible implementation of the present disclosure, the training module 740 is further used to calculate the loss value of the replenishment prediction model based on the first loss value, the second loss value, the third loss value and the simulation loss value.
[0137] In a possible implementation of the present disclosure, the simulated replenishment data includes data at multiple moments, the real replenishment data includes data corresponding one-to-one to the simulated replenishment data at multiple moments, and the training module 740 is further used to: subtract the real replenishment data from the simulated replenishment data to obtain an initial simulation loss value; determine a self-learning parameter corresponding to each initial loss value; and calculate the simulation loss value based on the self-learning parameter and the initial simulation loss value.
[0138] In one possible implementation of the present disclosure, the training module 740 is also used to: for any initial loss value, calculate a first parameter based on the initial loss value and a corresponding self-learning parameter, and use the logarithm of the self-learning parameter as the second parameter; use the sum of the first parameter and the second parameter as a sub-simulation loss value of the initial loss value; and sum all the sub-simulation loss values of the initial loss value to obtain a simulation loss value.
[0139] In one possible implementation of the present disclosure, the training module 740 is further used to: obtain simulation parameters; based on the simulation parameters and the predicted replenishment data, sequentially simulate the ordering link, the arrival link and the sales link through the simulation unit, and determine the simulated replenishment data based on the simulation results.
[0140] In a possible implementation of the present disclosure, the training module 740 is further used to: obtain an order cycle and a target inventory in the forecast replenishment data; and simulate an order process based on the order cycle and the target inventory.
[0141] In a possible implementation of the present disclosure, the training module 740 is further used to determine the replenishment quantity based on the difference between the target inventory and the current inventory to realize the simulated order placement link.
[0142] In a possible implementation of the present disclosure, the training module 740 is further used to: obtain an order cycle mark of the current simulation moment; and determine whether the current simulation moment is an order cycle based on the order cycle mark.
[0143] In a possible implementation of the present disclosure, the training module 740 is further used to: in response to the current simulation moment not being an order cycle, determine that the replenishment quantity is 0.
[0144] In a possible implementation of the present disclosure, the training module 740 is further used to: obtain the supplier response time in the simulation parameters; and simulate the arrival link based on the supplier response time.
[0145] In one possible implementation of the present disclosure, the training module 740 is also used to: subtract the current simulation time from the time of the previous order cycle to obtain the order time difference; in response to the order time difference being equal to the supplier response time, determine the purchase arrival quantity based on the replenishment quantity, and determine the updated inventory based on the purchase arrival quantity and the current inventory to realize the simulation arrival link.
[0146] In a possible implementation of the present disclosure, the training module 740 is further used to: in response to the order time difference not being equal to the supplier response time, determine that the purchase arrival quantity is 0.
[0147] In a possible implementation of the present disclosure, the simulation module 730 is further used to: obtain the simulated sales volume in the simulation parameters; and determine the cumulative inventory based on the simulated sales volume and the updated inventory to implement the simulated sales link.
[0148] In one possible implementation of the present disclosure, the simulation module 730 is further used to: obtain real sales volume; and determine the accumulated sales volume loss by subtracting the real sales volume from the simulated sales volume.
[0149] In a possible implementation of the present disclosure, the simulation module 730 is further used to: obtain historical sales volume and valid historical sales days corresponding to the historical sales volume; and divide the historical sales volume and the valid historical sales days to obtain simulated sales volume.
[0150] In a possible implementation of the present disclosure, the training module 740 is further used to: compare the loss value with the loss threshold; and update the parameters of the prediction unit in response to the loss value being greater than the loss threshold.
[0151] By training and generating a target replenishment prediction model that includes both prediction units and simulation units, prediction and simulation can be achieved through the same model, reducing intermediate processes, reducing decision errors, and ultimately directly generating the theoretically optimal replenishment decision, while reducing the cost of generating replenishment decisions.
[0152] Figure 8 A schematic diagram of a replenishment device proposed in the present disclosure, such as Figure 8 As shown, the replenishment device 800 includes: a processing module 810 and a replenishment module 820.
[0153] The processing module 810 is used to process the target replenishment prediction model trained by the replenishment prediction model training method to the prediction data to obtain the predicted replenishment opportunity and the predicted replenishment quantity.
[0154] The replenishment module 820 is used to replenish based on the predicted replenishment timing and the predicted replenishment quantity.
[0155] By predicting the data to be predicted through the trained target replenishment prediction model, the efficiency and accuracy of predicting the replenishment timing and replenishment quantity can be improved.
[0156] In order to implement the above embodiment, the present disclosure also provides an electronic device 900, such as Fig. 9 As shown, the electronic device 900 includes: a processor 901 and a memory 902 communicatively connected to the processor, the memory 902 stores instructions executable by at least one processor, and the instructions are executed by at least one processor 901 to implement the replenishment prediction model training method as described in the first aspect of the present disclosure.
[0157] In order to implement the above embodiments, the embodiments of the present disclosure further propose a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to implement the replenishment prediction model training method as described in the first aspect of the embodiments of the present disclosure.
[0158] In order to implement the above embodiments, the embodiments of the present disclosure further propose a computer program product, including a computer program, which, when executed by a processor, implements the replenishment prediction model training method as described in the first aspect of the embodiments of the present disclosure.
[0159] In the description of the present disclosure, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0160] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0161] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0162] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A replenishment prediction model training method, characterized in that: The method comprises: Acquire training samples and an initial replenishment prediction model, wherein the initial replenishment prediction model includes a prediction unit and a simulation unit; Inputting training data into the replenishment prediction model, and predicting replenishment data through the prediction unit; The predicted replenishment data is simulated by the simulation unit to obtain simulated replenishment data, and the simulated replenishment data is input into the prediction unit for iterative prediction; Repeat the above prediction and simulation steps until the training is completed, determine the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjust the initial replenishment prediction model based on the loss value, and output a target replenishment prediction model.
2. The method according to claim 1, characterized in that The determining the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data includes: Calculating a predicted loss value based on the real replenishment data and the predicted replenishment data, and calculating a simulated loss value based on the real replenishment data and the simulated replenishment data; Based on the predicted loss value and the simulated loss value, a loss value of the initial replenishment forecasting model is determined.
3. The method according to claim 2, characterized in that The predicted replenishment data includes data at multiple moments, the actual replenishment data includes data corresponding to the predicted replenishment data at multiple moments, and the calculating of the predicted loss value based on the actual replenishment data and the predicted replenishment data includes: Get preset calculation parameters; For the predicted replenishment data at any moment, comparing the predicted replenishment data with the corresponding actual replenishment data; Based on the comparison result and the preset calculation parameters, the actual replenishment data and the predicted replenishment data are determined to calculate a predicted loss value.
4. The method according to claim 3, characterized in that The step of determining the actual replenishment data and the predicted replenishment data based on the comparison result and the preset calculation parameters to calculate the predicted loss value includes: Obtaining an absolute value of a difference between the actual replenishment data and the predicted replenishment data; In response to the comparison result that the actual replenishment data is less than the predicted replenishment data, subtracting the preset calculation parameter from one and multiplying the result by the absolute value of the difference to obtain a first sub-loss value; or, In response to the comparison result being that the actual replenishment data is greater than or equal to the predicted replenishment data, multiplying the preset calculation parameter by the absolute value of the difference to obtain a second sub-loss value; All of the first sub-loss values and all of the second sub-loss values are added together to obtain the predicted loss value.
5. The method according to claim 4, characterized in that The predicted replenishment data includes calculating sales volume, safety stock and target stock, and the determining the actual replenishment data and the predicted replenishment data to calculate the predicted loss value includes: A first loss value, a second loss value, and a third loss value of the calculated sales volume, the safety stock, and the target stock are determined respectively.
6. The method according to claim 5, characterized in that The determining the loss value of the initial replenishment forecasting model based on the predicted loss value and the simulated loss value includes: Based on the first loss value, the second loss value, the third loss value and the simulated loss value, a loss value of the initial replenishment forecasting model is calculated and obtained.
7. The method according to claim 2, characterized in that The simulated replenishment data includes data at multiple moments, the real replenishment data includes data corresponding to the simulated replenishment data at multiple moments in a one-to-one manner, and the calculating of the simulated loss value based on the real replenishment data and the simulated replenishment data includes: Subtracting the real replenishment data from the simulated replenishment data to obtain an initial simulation loss value; Determine the self-learning parameters corresponding to each initial loss value; The simulation loss value is calculated based on the self-learning parameter and the initial simulation loss value.
8. The method according to claim 7, characterized in that The calculating the simulation loss value based on the self-learning parameter and the initial simulation loss value comprises: For any initial loss value, a first parameter is calculated based on the initial loss value and a corresponding self-learning parameter, and the logarithm of the self-learning parameter is used as a second parameter; Taking the sum of the first parameter and the second parameter as the sub-simulation loss value of the initial loss value; The sub-simulation loss values of all initial loss values are summed to obtain the simulation loss value.
9. The method according to claim 1, characterized in that: The simulating the predicted replenishment data through the simulation unit to obtain simulated replenishment data includes: Get simulation parameters; Based on the simulation parameters and the predicted replenishment data, the order placement link, the arrival link and the sales link are simulated in sequence by the simulation unit, and the simulated replenishment data is determined based on the simulation results.
10. The method according to claim 9, characterized in that The order placement process is simulated, including: Obtaining an order cycle and a target inventory in the forecast replenishment data; The order placement process is simulated based on the order placement cycle and the target inventory.
11. The method according to claim 10, characterized in that The step of simulating the order placement process based on the order placement cycle and the target inventory includes: Get the current inventory for any order cycle; Based on the difference between the target inventory and the current inventory, a replenishment quantity is determined, and the order placement process is simulated based on the replenishment quantity.
12. The method according to claim 11, characterized in that The method further comprises: Get the order cycle mark at the current simulation moment; Based on the order cycle mark, it is determined whether the current simulation moment is an order cycle.
13. The method according to claim 12, characterized in that The method further comprises: In response to the current simulation moment not being an order cycle, the replenishment quantity is determined to be 0.
14. The method according to claim 11, characterized in that The simulation of the arrival process includes: Obtaining the supplier response time in the simulation parameters; The arrival process is simulated based on the supplier response time.
15. The method according to claim 14, characterized in that The simulating the arrival link based on the supplier response time includes: Subtract the current simulation time from the time of the previous order cycle to obtain the order time difference; In response to the order time difference being equal to the supplier response time, the purchase arrival quantity is determined based on the replenishment quantity, and the updated inventory is determined based on the purchase arrival quantity and the current inventory to simulate the arrival link.
16. The method according to claim 15, characterized in that The method further comprises: In response to the order time difference not being equal to the supplier response time, the purchased arrival quantity is determined to be 0.
17. The method according to claim 15, characterized in that Simulate the sales process, including: Obtain the simulated sales volume in the simulation parameters; Based on the simulated sales volume and the updated inventory, the cumulative inventory is determined to simulate the sales process.
18. The method according to claim 17, characterized in that The method further comprises: Get real sales volume; The actual sales volume is subtracted from the simulated sales volume to determine the accumulated sales volume loss.
19. The method according to claim 17, characterized in that The obtaining of the simulated sales volume in the simulation parameters includes: Obtain the historical sales volume of the previous order cycle and the valid historical sales days corresponding to the historical sales volume; The historical sales volume is divided by the effective historical sales days to obtain the simulated sales volume.
20. The method according to claim 1, characterized in that The adjusting the initial replenishment forecasting model based on the loss value includes: Based on comparing the loss value with a loss threshold; In response to the loss value being greater than the loss threshold, updating parameters of the prediction unit.
21. A replenishment method, characterized in that: include: Processing the target replenishment prediction model trained by the replenishment prediction model training method according to any one of claims 1 to 20 to obtain a predicted replenishment timing and a predicted replenishment quantity; Replenishment is performed based on the predicted replenishment timing and the predicted replenishment quantity.
22. A replenishment prediction model training device, characterized in that: include: An acquisition module, used to acquire training samples and an initial replenishment prediction model, wherein the initial replenishment prediction model includes a prediction unit and a simulation unit; A prediction module, used for inputting training data into the replenishment prediction model, and predicting replenishment data through the prediction unit; A simulation module, configured to simulate the predicted replenishment data through the simulation unit to obtain simulated replenishment data, and input the simulated replenishment data into the prediction unit for iterative prediction; A training module is used to repeat the above prediction and simulation steps until the training is completed, determine the loss value of the initial replenishment prediction model based on the predicted replenishment data and the simulated replenishment data, adjust the initial replenishment prediction model based on the loss value, and output a target replenishment prediction model.
23. A replenishment device, characterized in that: include: A processing module, configured to process the target replenishment prediction model trained by the replenishment prediction model training method according to any one of claims 1 to 20 to obtain a predicted replenishment opportunity and a predicted replenishment quantity; A replenishment module is used to replenish based on the predicted replenishment opportunity and the predicted replenishment quantity.
24. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 20 or the method according to claim 21.
25. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 20 or the method according to claim 21 when executed by a processor.