Training method of sales volume prediction model, and article sales volume prediction method and device

By combining historical data and inventory time for sales and inventory prediction, the replenishment problem caused by inaccurate sales forecasts in the prior art is solved, and the prediction accuracy and reliability of replenishment decisions are improved.

CN120106895APending Publication Date: 2025-06-06BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311666600.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-06
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

When replenishing items, inaccurate sales forecasts lead to unavailable replenishment volumes, resulting in problems such as out of stock or stock backlog.

Method used

By obtaining the historical data of items and historical inventory time, using the Gemini network model to predict sales volume and inventory, and building a loss function with real labels, adjusting the model parameters to improve prediction accuracy.

Benefits of technology

It improves the prediction accuracy of the sales forecast model, avoids the problems of out-of-stock or inventory backlog, and enhances the reliability of replenishment decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106895A_ABST
    Figure CN120106895A_ABST
Patent Text Reader

Abstract

The invention provides a sales volume prediction model training method and device, an article sales volume prediction method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of computers. The sales volume prediction model training method comprises the steps of obtaining historical article data and historical inventory time of articles; inputting the historical article data into a first sub-network of a sales volume prediction model for sales volume prediction, and obtaining a daily sales volume prediction result in a prediction period; based on the sales prediction result and the historical inventory time, using a second sub-network of the sales prediction model to perform inventory prediction to obtain an inventory prediction result; and constructing a first loss function according to the sales prediction result and the real sales label, and constructing a second loss function according to the inventory prediction result and the real inventory label, so as to adjust parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model. The sales volume prediction accuracy of the sales volume prediction model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] When replenishing items, the sales forecast of the items in the future plays a key role in the replenishment quantity. Inaccurate theoretical forecasts of item sales will cause the predicted replenishment quantity to be affected and unavailable, resulting in out-of-stock or inventory backlogs.

[0003] Therefore, how to improve the prediction accuracy of the item sales prediction model is very necessary to improve the replenishment effect. Summary of the invention

[0004] The purpose of the present disclosure is to provide a sales prediction model training method, an item sales prediction method, a sales prediction model training device, an item sales prediction device, an electronic device and a computer-readable storage medium, thereby improving the prediction accuracy of the sales prediction model at least to a certain extent.

[0005] According to a first aspect of the present disclosure, a training method for a sales prediction model is provided, comprising: obtaining historical item data and historical inventory time of an item; inputting the historical item data into a first subnetwork of the sales prediction model to perform sales prediction, and obtain daily sales prediction results within a prediction period; based on the sales prediction results and the historical inventory time, using a second subnetwork of the sales prediction model to perform inventory quantity prediction, and obtain inventory prediction results; constructing a first loss function according to the sales prediction results and true sales labels, and constructing a second loss function according to the inventory prediction results and true inventory labels, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

[0006] In an exemplary embodiment of the present disclosure, the historical item data is input into the first sub-network of the sales forecasting model to perform sales forecasting and obtain sales forecasting results, including: forming historical time series information of the item based on the historical item data; using the first sub-network to perform sales forecasting on the historical time series information to form a sales forecast sequence based on the daily sales forecast results within the forecast period.

[0007] In an exemplary embodiment of the present disclosure, the historical inventory time is the historical inventory days; based on the sales forecast result and the historical inventory time, the second sub-network of the sales forecast model is used to perform inventory quantity forecasting to obtain the inventory forecast result, including: based on the time series, obtaining the target sales results of each day in the historical inventory days from the sales forecast result through the second sub-network; and determining the inventory forecast result according to the sum of the target sales results.

[0008] In an exemplary embodiment of the present disclosure, constructing a first loss function based on the sales prediction results and the actual sales labels includes: constructing a first sub-loss function based on each of the sales prediction results and the corresponding actual sales labels within the prediction period; obtaining a non-zero sales prediction result with a real sales label of zero within the prediction period, and constructing a second sub-loss function based on the non-zero sales prediction result; determining the first loss function based on the first sub-loss function and the second sub-loss function.

[0009] In an exemplary embodiment of the present disclosure, constructing the second sub-loss function according to the non-zero sales prediction result includes: counting the number of days of the non-zero sales prediction result; and constructing the second sub-loss function according to the non-zero sales prediction result and the number of days.

[0010] In an exemplary embodiment of the present disclosure, constructing a second loss function based on the inventory prediction result and the actual inventory label includes: constructing a third sub-loss function based on the inventory prediction result and the corresponding actual inventory label; when the inventory prediction result is zero and the corresponding actual inventory label is greater than zero, obtaining a fourth sub-loss function according to a preset strategy; and determining the second loss function based on the third sub-loss function and the fourth sub-loss function.

[0011] In an exemplary embodiment of the present disclosure, the item is a long-tail item.

[0012] According to a second aspect of the present disclosure, a method for predicting item sales is provided, comprising: obtaining target historical item data and target historical inventory time of an item to be predicted; inputting the target historical item data and target historical inventory time into a target model to obtain a daily sales forecast result of the item to be predicted within a prediction period; wherein the target model is obtained by training a sales forecast model according to the training method for a sales forecast model according to any one of the above exemplary embodiments.

[0013] In an exemplary embodiment of the present disclosure, after obtaining the daily sales forecast results of the item to be predicted within the forecast period, the method further includes: obtaining a target inventory time determined based on the sales forecast results; and using the target inventory time to update the historical inventory time for use in the next iterative training of the target model.

[0014] In an exemplary embodiment of the present disclosure, the method further includes: determining a target inventory level based on daily sales forecast results within the forecast period; and determining a target replenishment level based on the target inventory level and the current inventory level of the item to be forecasted.

[0015] According to a third aspect of the present disclosure, a training device for a sales prediction model is provided, comprising: a data acquisition module for acquiring historical item data and historical inventory time of items; a first processing module for inputting the historical item data into a first sub-network of a sales prediction model for sales prediction, and obtaining daily sales prediction results within a prediction period; a second processing module for performing inventory quantity prediction using a second sub-network of the sales prediction model based on the sales prediction results and the historical inventory time, and obtaining inventory prediction results; a parameter adjustment module for constructing a first loss function based on the sales prediction results and true sales labels, and constructing a second loss function based on the inventory prediction results and true inventory labels, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

[0016] According to a fourth aspect of the present disclosure, there is provided an apparatus for predicting item sales, comprising: a data acquisition module for acquiring target historical item data and target historical inventory time of an item to be predicted; a sales prediction module for inputting the target historical item data and target historical inventory time into a target model to obtain a daily sales prediction result of the item to be predicted within a prediction period; wherein the target model is obtained by training a sales prediction model according to the training method for a sales prediction model described in any one of the above exemplary embodiments.

[0017] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to implement the above method.

[0018] According to a sixth aspect of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and the computer program implements the above method when executed by a processor.

[0019] The technical solution involved in the embodiment of the present disclosure, on the one hand, obtains the historical item data and historical inventory time of the item, inputs the historical item data into the first sub-network of the sales prediction model for sales prediction, obtains the sales prediction results of each day in the prediction period, and based on the sales prediction results and the historical inventory time, uses the second sub-network of the sales prediction model to predict the inventory quantity, and obtains the inventory prediction results. In this process, the replenishment parameter (historical inventory time) is introduced to predict the inventory quantity in the model training stage, and then the second loss function can be constructed according to the inventory prediction results and the real inventory label to guide the training of the model. That is, it avoids the separation of the item sales prediction stage and the replenishment side stage, uses the historical inventory time of the replenishment side to guide the sales prediction, increases the performance of the sales prediction model in the replenishment dimension, and improves the prediction accuracy of the sales prediction model. On the other hand, the first loss function is constructed according to the sales prediction results and the real sales labels, and the parameters in the sales prediction model are adjusted in combination with the first loss function and the second loss function, which is to combine the loss corresponding to the sales prediction with the loss corresponding to the inventory quantity to guide the model training, so that the sales prediction model can simultaneously mine the characteristics of sales and inventory, and further help to improve the prediction accuracy of the sales prediction model.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A schematic diagram showing the stages involved in the item sales forecasting solution of the embodiment of the present disclosure is shown;

[0023] Figure 2 A flowchart schematically illustrating a method for training a sales forecasting model according to an exemplary embodiment of the present disclosure;

[0024] Figure 3 A schematic diagram schematically illustrates a structure of a sales forecasting model of an exemplary embodiment of the present disclosure;

[0025] Figure 4 A schematic diagram schematically illustrates a data processing process of a sales volume prediction model in an exemplary embodiment of the present disclosure;

[0026] Figure 5A flowchart schematically illustrates an implementation method of obtaining sales forecast results in an exemplary embodiment of the present disclosure;

[0027] Figure 6 A flowchart schematically illustrates an implementation method of constructing a first loss function in an exemplary embodiment of the present disclosure;

[0028] Figure 7 A flowchart schematically illustrates an implementation method of constructing a second loss function according to an exemplary embodiment of the present disclosure;

[0029] Figure 8 A flowchart schematically illustrates a method for training a sales forecasting model in an exemplary embodiment of the present disclosure;

[0030] Fig. 9 A flowchart schematically illustrates a method for predicting item sales in an exemplary embodiment of the present disclosure;

[0031] Fig.10 A schematic diagram schematically illustrates the composition of a training device for a sales prediction model in an exemplary embodiment of the present disclosure;

[0032] Fig.11 A schematic diagram schematically shows the composition of an item sales prediction device in an exemplary embodiment of the present disclosure;

[0033] Fig.12 A schematic diagram of an electronic device to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION

[0034] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0035] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0036] Figure 1 A schematic diagram of the stages involved in the item sales forecasting solution of the embodiment of the present disclosure is shown, such as Figure 1 As shown, the technical solution of the embodiment of the present disclosure includes a model training stage and a model application stage.

[0037] In an embodiment of the present disclosure, the training method of the sales prediction model provided can be executed by a terminal device. During the training stage of the sales prediction model, the terminal device can obtain the historical item data and historical inventory time of the item, input the historical item data into the first sub-network of the sales prediction model to perform sales prediction, and obtain the sales prediction results for each day within the prediction period; then, based on the sales prediction results and the historical inventory time, the second sub-network of the sales prediction model is used to perform inventory quantity prediction to obtain the inventory prediction results, and finally, a first loss function is constructed according to the sales prediction results and the true sales labels, and a second loss function is constructed according to the inventory prediction results and the true inventory labels, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain the target model, and then use the target model to perform sales prediction for the item. In this way, when all steps in the training method of the sales prediction model and the item sales prediction method provided in the embodiment of the present disclosure can be executed by the terminal device, all steps can be executed by the processor of the terminal device.

[0038] The terminal device can be an intelligent device with data processing capabilities, such as monitoring equipment, smart phones, computers, tablet computers, vehicle-mounted devices, wearable devices and other intelligent devices. The terminal device can also be called a mobile terminal, terminal, mobile device, etc. The present disclosure does not limit the type of terminal device.

[0039] Furthermore, the technical solution provided in the embodiment of the present disclosure may also be executed by a server. Correspondingly, in this mode of execution by a server, the server may start executing the steps in the technical solution of the embodiment of the present disclosure in response to a trigger command, wherein the trigger command may be sent by a terminal device used by a user, or may be triggered locally by the server in response to some automation events. The server may be a background system that provides relevant services in the embodiment of the present disclosure, and may include one electronic device with computing functions such as a portable computer, a desktop computer, a smart phone, or a cluster formed by multiple electronic devices.

[0040] In addition, the technical solution of the embodiment of the present disclosure can also be executed by the terminal device and the server in collaboration. In this way of collaborative execution by the terminal device and the server, some steps in the technical solution provided by the embodiment of the present disclosure are executed by the terminal device, while other steps are executed by the server. For example, the technical solution provided by the embodiment of the present disclosure can be executed by the server in the training phase of the sales forecasting model, and the trained target model is sent to the terminal device, and the terminal device executes the model application phase.

[0041] It should be noted that in this method of collaborative execution by the terminal device and the server, the steps respectively executed by the terminal device and the server can be dynamically adjusted according to actual conditions, and the embodiments of the present disclosure do not impose any special restrictions on this.

[0042] At present, the mode of automatic replenishment is usually determined according to the sales forecast results of items. In the field of item sales forecasting, time series forecasting methods are used, such as ARIMA (Autoregressive Integrated Moving Average Model), LSTM (Long Short Term Memory), DEEPAR (Probabilistic Forecasting with Autoregressive Recurrent, an autoregressive model that combines deep learning and probability models), TFT (Temporal Fusion Transformers), prophet, etc.

[0043] However, for some items with sparse sales, strong intermittency and relatively low sales, such as long-tail items, if such items are predicted using traditional time series methods, the weighted results are basically very small values ​​due to the large indirectness of item sales. If machine learning models are used for prediction, the model will tend to output very small predictions due to the large intermittency and low differentiation between items, resulting in very small replenishment quantities or even unavailable replenishment quantities. As a result, the replenishment quantities of such items are inaccurate, causing inventory shortages or backlogs.

[0044] In the process of implementing the item sales forecasting solution of the embodiment of the present disclosure, it is found that the replenishment quantity is usually determined by using the total sales forecast value using the interval dimension. For example, if the sales volume of each day in the next 91 days is predicted, if the preset inventory days are 25 days, the replenishment quantity will use the sum of the sales forecast results of the first 25 days of the 91 days as the replenishment quantity, that is, the required inventory of items. However, if the two stages of sales forecast and replenishment are completely separated, due to the strong intermittent characteristics of some items, it will be difficult to predict which day there will be sales. At this time, the model will predict a lower sales volume for each day. This will result in poor effectiveness due to the low sales forecast, and it cannot be put into practical application, affecting the effectiveness of replenishment.

[0045] Based on this, the disclosed embodiment first provides a training method for a sales prediction model, by introducing a replenishment parameter (historical inventory time) to predict the inventory in the model training stage, and then constructing a second loss function based on the inventory prediction results and the real inventory label to guide the model training. That is, it avoids separating the sales prediction stage and the replenishment stage of the item, uses the historical inventory time of the replenishment side to guide the sales prediction, increases the performance of the sales prediction model in the replenishment dimension, improves the prediction accuracy of the sales prediction model, and combines the loss corresponding to the sales prediction with the loss corresponding to the inventory to guide the model training, so that the sales prediction model can simultaneously explore the characteristics of sales and inventory, which is further conducive to improving the prediction accuracy of the sales prediction model.

[0046] refer to Figure 2 As shown, the training method of the sales prediction model of the embodiment of the present disclosure may include the following steps S210 to S240:

[0047] In step S210, historical item data and historical inventory time of the item are obtained.

[0048] In an exemplary embodiment of the present disclosure, the historical item data of an item includes various types of item data such as historical sales volume, saleable status, activity information (such as whether it is on promotion), etc. For example, the historical item data of an item in the past 24 days is {item data on the first day, item data on the second day, ..., item data on the 24th day}, wherein the item data of each day at least includes the sales volume of the item on that day, and the item data of each day may also include multiple types of item data, for example, the historical item data of the past 24 days is {(item sales volume, saleable status, whether it is on promotion), (item sales volume, saleable status, whether it is on promotion), ..., (item sales volume, saleable status, whether it is on promotion)}. If the sales volume prediction model is used to predict the sales volume of long-tail items, the item samples in the model training stage may use long-tail items.

[0049] Among them, the historical inventory time is obtained from the historical replenishment information and belongs to the replenishment parameter. The inventory time refers to the time that the item needs to be kept in stock, for example, the inventory time is 25 days. Therefore, usually in the replenishment stage, replenishment is also arranged according to the inventory time of the item.

[0050] In some optional embodiments, the inventory time will also be updated according to the sales forecast results to guide subsequent replenishment. The historical inventory time described in the embodiment of the present disclosure is output by the replenishment side. Here, the historical inventory time can be considered as a known quantity, and the method of obtaining it is not specifically limited here.

[0051] In step S220, the historical item data is input into the first sub-network of the sales forecasting model to perform sales forecasting, and obtain the sales forecast results for each day within the forecasting period.

[0052] In an exemplary embodiment of the present disclosure, the prediction period refers to a preset time period, such as 91 days, and the first sub-network will output the sales forecast results for each day in the 91 days. Optionally, the prediction period is greater than the historical inventory time to facilitate subsequent inventory forecasting.

[0053] The sales prediction model is a model used to predict the sales of items, including a first sub-network and a second sub-network. Figure 3 As shown, the output of the first sub-network of the embodiment of the present disclosure is used as the input of the second sub-network, the first sub-network is used to perform sales forecasting, and the second sub-network is used to predict the inventory quantity according to the sales forecasting result. The inventory quantity refers to the total inventory quantity required for the item.

[0054] The first sub-network may be a time series network, such as MQCNN, MQRNN, etc., which is not specifically limited in the embodiments of the present disclosure. After the historical item data of the item is input into the first sub-network of the sales forecasting model, the sales forecast results for each day in the forecast period will be obtained. For example, if the forecast period is n, the sales forecast results are

[0055] In step S230, based on the sales forecast result and the historical inventory time, the second sub-network of the sales forecast model is used to perform inventory forecasting to obtain an inventory forecast result.

[0056] In an exemplary embodiment of the present disclosure, the inventory forecast result is the inventory quantity required within the historical inventory time predicted by the second sub-network, and the inventory forecast result is the total sales volume forecast using the interval dimension.

[0057] Among them, Figure 4 As shown, the second sub-network can be used to obtain the sum of sales forecast results corresponding to the historical inventory time, and the inventory forecast result can be calculated by the following formula (1):

[0058]

[0059] in, is the inventory forecast result, tidays is the historical inventory time, Forecast results for daily sales.

[0060] For example, if the sales forecast result includes the sales forecast result for each day in the next 91 days [1, 2, 3, ..., 91], and the historical inventory time is 25 days, the inventory forecast result calculated by the second sub-network is: 1+2+3+...+25=325.

[0061] In step S240, a first loss function is constructed based on the sales prediction results and the actual sales labels, and a second loss function is constructed based on the inventory prediction results and the actual inventory labels, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

[0062] In an exemplary embodiment of the present disclosure, the real sales volume tag refers to the actual sales volume of each day in the forecast period, and the real inventory tag refers to the actual inventory volume in the forecast period.

[0063] Among them, the first loss function constructed according to the sales prediction results and the real sales labels is the loss on the sales side, and the second loss function constructed according to the inventory prediction results and the real inventory labels is the loss on the inventory side, that is, the loss on the replenishment side. The disclosed embodiment adjusts the parameters in the sales prediction model in combination with the first loss function and the second loss function, which combines the loss corresponding to the sales prediction with the loss corresponding to the inventory to guide the model training, and enables the sales prediction model to simultaneously explore the characteristics of sales and inventory, which is further conducive to improving the prediction accuracy of the sales prediction model.

[0064] In an exemplary embodiment, a method for obtaining sales forecast results is provided. Figure 5 As shown, inputting historical item data into the first sub-network of the sales prediction model to perform sales prediction, and obtaining the sales prediction result may include steps S510 and S520:

[0065] Step S510: Generate historical time series information of the item based on historical item data.

[0066] The historical item data of the item is sorted in chronological order to form the historical time series information of the item, such as {item data on the first day, item data on the second day, ..., item data on the xth day}.

[0067] Step 520: Use the first sub-network to perform sales forecasting on the historical time series information to form a sales forecast sequence according to the daily sales forecast results within the forecast period.

[0068] The historical time series information of the items is used as the input of the first sub-network to perform sales forecasting, output the daily sales forecast results within the forecast period, and form a sales forecast sequence according to the time series.

[0069] In an exemplary embodiment, the historical inventory time is the historical inventory days. Based on the aforementioned exemplary embodiment, a method for obtaining inventory forecast results is also provided. Based on the sales forecast results and the historical inventory time, the second sub-network of the sales forecast model is used to perform inventory forecasting, and obtaining the inventory forecast results may include:

[0070] Based on the time series, the second sub-network is used to obtain the target sales results of each day in the historical inventory days from the sales forecast results, and then the inventory forecast results are determined based on the sum of the target sales results. For details, please refer to formula (1), which will not be described here.

[0071] The disclosed embodiment uses the historical inventory days of the replenishment side as the input of the sales forecasting model, thereby introducing the historical inventory days of the replenishment side to predict the inventory during sales forecasting, avoiding the separation of the item sales forecasting stage and the replenishment stage, and using the historical inventory time of the replenishment side to guide the sales forecast, thereby increasing the performance of the sales forecasting model in the replenishment dimension.

[0072] In an exemplary embodiment, a method for constructing a first loss function is provided. Figure 6 As shown, constructing a first loss function according to the sales prediction result and the actual sales label may include steps S610 to S630:

[0073] Step S 610: construct a first sub-loss function according to each sales prediction result within the prediction period and the corresponding actual sales label.

[0074] The first sub-loss function is a conventional sales loss function, which can be calculated by the following formula (2):

[0075]

[0076] Among them, loss sale_mae is the first sub-loss function, n is the prediction period, such as 91 days; y i is the actual sales label of the future i-th day in the prediction cycle, is the sales forecast result corresponding to the future i-th day.

[0077] Step S620: Obtain non-zero sales prediction results whose actual sales labels are zero within the prediction period, and construct a second sub-loss function based on the non-zero sales prediction results.

[0078] In the disclosed embodiment, considering that the sales forecast of an item is based on a day dimension, it is necessary to control the forecast quantity in the day dimension, that is, if the actual sales volume is zero and the sales forecast result is non-zero, the forecast sales volume of the item is increased by adding additional penalties, thereby improving the effectiveness of the replenishment quantity calculated based on the forecast sales volume.

[0079] Based on this, during the prediction period, we can obtain non-zero sales prediction results when the actual sales label is zero, that is, add a loss for the results when the sales volume on a single day is zero but the sales prediction result is non-zero.

[0080] In some optional embodiments, constructing the second sub-loss function according to the non-zero sales volume prediction result may include:

[0081] First, the number of days with non-zero sales forecast results is counted, and then the second sub-loss function is constructed based on the non-zero sales forecast results and the number of days. Specifically, the loss is in the form of counting, and the second sub-loss function is constructed by counting the results of zero sales on a single day and non-zero sales forecast results and the number of days.

[0082] In some optional embodiments, the second sub-loss function may be constructed by the following formula (3):

[0083]

[0084] Among them, loss sale_zeros is the second sub-loss function, is an indicative function, a function that takes 1 or 0 depending on whether an event occurs or not. When yi=0, is 1, otherwise is 0; for the activation function Act hour, when hour, when A result approximately equal to 1 needs to be achieved.

[0085] Optionally, the activation function Act needs to be a function that can calculate the gradient back propagation, so Act(x)=tanh(relu(x)) can be selected. Based on this, formula (3) can be expressed as formula (4):

[0086]

[0087] The disclosed embodiment constructs a second sub-loss function as the loss corresponding to the non-zero sales prediction result, and adds the loss to the result in the prediction period where the actual sales volume on a single day is zero and the corresponding single-day sales prediction result is non-zero, so as to guide the sales prediction model to output the sales volume for the items that need to be sold, so as to effectively improve the sales prediction results output by the sales prediction model.

[0088] Step S630: Determine a first loss function according to the first sub-loss function and the second sub-loss function.

[0089] After obtaining the first sub-loss function and the second sub-loss function, the sum of the first sub-loss function and the second sub-loss function can be obtained to obtain the first loss function. It can be calculated by the following formula (5):

[0090] loss sale =loss sale_mae + loss sale_zeros (5)

[0091] Among them, loss saleis the first loss function.

[0092] It should be noted that the first sub-loss function and the second sub-loss function may be weighted and summed according to preset weights to obtain the first loss function.

[0093] The disclosed embodiment determines the first loss function by combining the first sub-loss function and the second sub-loss function, and adds the loss of targeted non-zero sales prediction to the loss function on the corresponding sales side, which can be used to improve the predicted sales of the item, thereby improving the availability of the replenishment quantity calculated based on the predicted sales.

[0094] In an exemplary embodiment, a method for constructing a second loss function is also provided. Figure 7 As shown, constructing a second loss function according to the inventory prediction result and the real inventory label may include steps S710 to S730:

[0095] Step S710: construct a third sub-loss function according to the inventory prediction results and the corresponding real inventory labels.

[0096] The third sub-loss function is the conventional inventory loss, which can be obtained by the following formula (6):

[0097]

[0098] Among them, loss ti_mae is the third sub-loss function, is the inventory forecast result, ti is The corresponding actual inventory quantity.

[0099] Step S720: When the inventory prediction result is zero and the corresponding real inventory label is greater than zero, the fourth sub-loss function is obtained according to the preset strategy.

[0100] In the disclosed embodiment, considering that there is sales but the inventory prediction result (equivalent to the replenishment quantity prediction) is 0, it is necessary to guide the sales prediction model to output the replenishment quantity for such items that need to be replenished, so the fourth sub-loss function is added.

[0101] Among them, the fourth sub-loss function can be in counting form and can be back-propagated so that the parameters can be updated using gradient descent.

[0102] Specifically, the fourth sub-loss function can be constructed by the following formula (7):

[0103]

[0104] Among them, loss ti_nozero is the fourth sub-loss function, I ti>0is an indicative function, which takes 1 or 0 depending on whether the event occurs or not. When ti>0, I ti>0 is 1, otherwise I ti>0 is 0; for the activation function Act hour, when hour, when A result approximately equal to 1 needs to be achieved.

[0105] Step S730: Determine a second loss function according to the third sub-loss function and the fourth sub-loss function.

[0106] After obtaining the third sub-loss function and the fourth sub-loss function, the sum of the third sub-loss function and the fourth sub-loss function can be obtained to obtain the second loss function. It can be calculated by the following formula (6):

[0107] loss ti = loss ti_mae + loss ti_nozero (6)

[0108] Among them, loss ti is the second loss function.

[0109] It should be noted that the third sub-loss function and the fourth sub-loss function may be weighted and summed according to preset weights to obtain the second loss function.

[0110] The disclosed embodiment determines the second loss function by combining the third sub-loss function and the fourth sub-loss function, and adds a targeted zero replenishment loss to the loss function on the corresponding inventory side, which can be used to improve the predicted sales volume of items. Even if the sales volume of long-tail items is highly intermittent, replenishment is still required in most cases in the replenishment dimension. By introducing the fourth sub-loss function, the availability of the replenishment quantity calculated based on the predicted sales volume is improved.

[0111] In an exemplary embodiment, after obtaining the first loss function and the second loss function, the sum of the first loss function and the second loss function is calculated to adjust the parameters of the sales prediction model according to the obtained target loss function to obtain a target model.

[0112] The first loss function and the second loss function may also be weighted and summed according to preset weights to obtain a target loss function, and there is no special limitation on this.

[0113] It should be noted that, considering that the fourth sub-loss function will guide the sales forecasting model to output a higher forecast result, because if the predicted inventory result is greater than zero, the fourth sub-loss function is zero, by combining the fourth sub-loss function with the second sub-loss function in the target loss function, the sales forecasting model can be guided to output a reasonable forecast result, which can be used to effectively increase the predicted amount of items.

[0114] In an exemplary embodiment, during the model training phase of the disclosed embodiment, long-tail items are marked and used for model training, so that the trained target model can be used to predict the sales volume of long-tail items to guide the determination of replenishment quantity.

[0115] Figure 8 This is a flowchart of a training method for a sales forecasting model according to an embodiment of the present disclosure. Figure 8 , taking historical item data including historical sales volume and saleable status as an example, the training method of the sales volume prediction model of the embodiment of the present disclosure is explained.

[0116] Step S810, obtaining historical item data and historical inventory time of the item.

[0117] Among them, the historical time series information is formed according to the historical sales volume and saleable status of the item, such as the historical time series information formed based on the time series is {(item sales volume 1, saleable status 1), (item sales volume 2, saleable status 2), ..., (item sales volume N, saleable status N)}.

[0118] Step S820: Use the first sub-network to perform sales forecasting on the historical time series information to form a sales forecast sequence according to the daily sales forecast results within the forecast period.

[0119] For example, the sales forecast sequence with a forecast period of n is obtained as follows:

[0120] Step S830: Based on the sales forecast result and the historical inventory time, the second sub-network of the sales forecast model is used to perform inventory forecasting to obtain an inventory forecast result.

[0121] Among them, based on the time series, the target sales results of each day in the historical inventory days (such as 25 days) can be obtained from the sales forecast results through the second sub-network, and the sum of the target sales results is used as the inventory forecast result.

[0122] Step S840: constructing a first loss function according to the sales prediction result and the actual sales label, and constructing a second loss function according to the inventory prediction result and the actual inventory label.

[0123] Among them, according to each sales prediction result and the corresponding real sales label within the prediction period (n), the first sub-loss function is constructed, and the non-zero sales prediction result with the real sales label of zero is obtained within the prediction period, and the second sub-loss function is constructed according to the non-zero sales prediction result. For details, please refer to formulas (2)-(5).

[0124] Among them, according to the inventory prediction result and the corresponding real inventory label, the third sub-loss function is constructed, and when the inventory prediction result is zero and the corresponding real inventory label is greater than zero, the fourth sub-loss function is obtained according to the preset strategy, so as to determine the second loss function according to the third sub-loss function and the fourth sub-loss function. For details, please refer to formulas (6) and (7).

[0125] Step S850: Adjust the parameters in the sales prediction model by combining the first loss function and the second loss function to obtain a target model.

[0126] The training method of the sales prediction model of the embodiment of the present disclosure, on the one hand, obtains the historical item data and historical inventory time of the item, inputs the historical item data into the first sub-network of the sales prediction model for sales prediction, obtains the sales prediction results of each day in the prediction period, and based on the sales prediction results and the historical inventory time, uses the second sub-network of the sales prediction model to predict the inventory quantity, and obtains the inventory prediction results. In this process, the replenishment parameter (historical inventory time) is introduced to predict the inventory quantity in the model training stage, and then the second loss function can be constructed according to the inventory prediction results and the real inventory label to guide the training of the model. That is, it avoids the separation of the item sales prediction stage and the replenishment side stage, uses the historical inventory time of the replenishment side to guide the sales prediction, increases the performance of the sales prediction model in the replenishment dimension, and improves the prediction accuracy of the sales prediction model. On the other hand, the first loss function is constructed according to the sales prediction results and the real sales labels, and the parameters in the sales prediction model are adjusted in combination with the first loss function and the second loss function, which is to combine the loss corresponding to the sales prediction with the loss corresponding to the inventory quantity to guide the model training, so that the sales prediction model can simultaneously mine the characteristics of sales and inventory, and further help to improve the prediction accuracy of the sales prediction model. Furthermore, it is possible to avoid the problem that the sales forecast result is too low, resulting in the sales forecast result being unavailable, and then causing the determined replenishment quantity to be unavailable.

[0127] For further reference, Fig. 9 As shown, in an exemplary embodiment of the present disclosure, a method for predicting item sales is provided, comprising step S910 and step S920:

[0128] Step S910: Obtain target historical item data and target historical inventory time of the item to be predicted;

[0129] Step S920: inputting the target historical item data and the target historical inventory time into the target model to obtain the daily sales forecast result of the item to be forecasted within the forecast period;

[0130] The target model is obtained by training the sales forecast model according to the training method of the sales forecast model in any one of the above exemplary embodiments.

[0131] Among them, the model training process involved in step S920 has been recorded in detail in the above exemplary embodiments and will not be repeated here.

[0132] In an exemplary embodiment, a method for implementing model iterative training is also provided. After obtaining the daily sales forecast results of the item to be forecasted within the forecast period, the method may also include:

[0133] Obtain the target inventory time determined based on sales forecast results;

[0134] The target inventory time is used to update the historical inventory time for use in the next iterative training of the target model.

[0135] Among them, on the replenishment side, the target inventory time can be determined based on the sales forecast results. For example, the target inventory time can be calculated by combining turnover, stocking cycle and sales forecast results. The embodiments of the present disclosure do not make specific limitations on this, and all existing methods of calculating the target inventory time are applicable.

[0136] After the target inventory time is obtained, the target inventory time may be used to update the historical inventory time, so that the updated historical inventory time may be used in the next model iteration.

[0137] Furthermore, the sales forecasting model after the next iteration can be used to continue the next sales forecasting process, and in the next sales forecasting process, the above-mentioned updated historical inventory time can be used as the target historical inventory time. This cycle can be repeated to achieve mutual complementation between model training and model prediction, and the prediction accuracy of the model can be continuously improved during the model application process.

[0138] In an exemplary embodiment, the target inventory level can also be determined based on the daily sales forecast results within the forecast period, and the target replenishment level can be determined based on the target inventory level and the current inventory level of the items to be forecasted to guide specific replenishment operations and improve the effectiveness of replenishment.

[0139] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0140] For further reference, Fig.10 As shown, in an exemplary embodiment of the present disclosure, a training device 1000 for a sales forecasting model is provided, comprising a data acquisition module 1010, a first processing module 1020, a second processing module 1030 and a parameter adjustment module 1040. Among them:

[0141] The data acquisition module 1010 is used to acquire historical item data and historical inventory time of items;

[0142] The first processing module 1020 is used to input the historical item data into the first sub-network of the sales forecasting model to perform sales forecasting and obtain the sales forecast results for each day within the forecasting period;

[0143] The second processing module 1030 performs inventory quantity forecasting using the second sub-network of the sales forecasting model based on the sales forecasting result and the historical inventory time to obtain an inventory forecasting result;

[0144] The parameter adjustment module 1040 is used to construct a first loss function based on the sales prediction results and the actual sales labels, and to construct a second loss function based on the inventory prediction results and the actual inventory labels, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

[0145] In an exemplary embodiment, the first processing module 1020 is configured to perform: forming historical time series information of the item based on the historical item data; using the first sub-network to perform sales forecasting on the historical time series information to form a sales forecast sequence based on the daily sales forecast results within the forecast period.

[0146] In an exemplary embodiment, the historical inventory time is the historical inventory days; the second processing module 1030 is configured to execute: based on the time sequence, obtaining the target sales results of each day in the historical inventory days from the sales forecast results through the second sub-network; and determining the inventory forecast result according to the sum of the target sales results.

[0147] In an exemplary embodiment, the parameter adjustment module 1040 is configured to perform: constructing a first sub-loss function based on each of the sales prediction results within the prediction period and the corresponding true sales labels; obtaining a non-zero sales prediction result with a true sales label of zero within the prediction period, and constructing a second sub-loss function based on the non-zero sales prediction result; determining the first loss function based on the first sub-loss function and the second sub-loss function.

[0148] In an exemplary embodiment, the parameter adjustment module 1040 is configured to execute: counting the number of days of the non-zero sales prediction result; and constructing the second sub-loss function according to the non-zero sales prediction result and the number of days.

[0149] In an exemplary embodiment, the parameter adjustment module 1040 is configured to execute: constructing a third sub-loss function based on the inventory prediction result and the corresponding real inventory label; when the inventory prediction result is zero and the corresponding real inventory label is greater than zero, obtaining a fourth sub-loss function according to a preset strategy; and determining the second loss function based on the third sub-loss function and the fourth sub-loss function.

[0150] In an exemplary embodiment, the item is a long-tail item.

[0151] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0152] In addition, if Fig.11 As shown, the embodiment of the present disclosure also provides an article sales forecasting device 1100, see Fig.11 The article sales forecasting device 1100 includes a data acquisition module 1110 and a sales forecasting module 1120. Specifically:

[0153] The data acquisition module 1110 is used to obtain the target historical item data and target historical inventory time of the item to be predicted; the sales prediction module 1120 is used to input the target historical item data and target historical inventory time into the target model to obtain the daily sales prediction results of the item to be predicted within the prediction period; wherein the target model is obtained by training the sales prediction model according to the training method of the sales prediction model of any one of the above exemplary embodiments.

[0154] In an exemplary embodiment, the data acquisition module 1110 is further configured to execute: acquiring a target inventory time determined based on the sales forecast result; and updating the historical inventory time using the target inventory time for use in the next iterative training of the target model.

[0155] In an exemplary embodiment, the data acquisition module 1110 is further configured to execute: determining a target inventory level based on the daily sales forecast results within the forecast period; and determining a target replenishment level based on the target inventory level and the current inventory level of the item to be forecasted.

[0156] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0157] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0158] The exemplary embodiments of the present disclosure also provide an electronic device for the above method, which may be the above imaging device or server. Generally, the electronic device includes at least a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above method by executing the executable instructions.

[0159] Below Fig.12 Taking the mobile terminal 1200 in the example, the structure of the electronic device in the embodiment of the present disclosure is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Fig.12 The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 1200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation of the mobile terminal 1200. In other embodiments, the mobile terminal may also adopt the same Fig.12 Different interface connection methods, or a combination of multiple interface connection methods.

[0160] like Fig.12 As shown, the mobile terminal 1200 may specifically include: a processor 1201, a memory 1202, a bus 1203, a mobile communication module 1204, an antenna 1, a wireless communication module 1205, an antenna 2, a display screen 1206, a camera module 1207, an audio module 1208, a power module 1209, and a sensor module 1210.

[0161] Processor 1201 may include one or more processing units, for example: processor 1201 may include AP (Application Processor), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, encoder, decoder, DSP (Digital Signal Processor), baseband processor and / or NPU (Neural-Network Processing Unit), etc.

[0162] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of the image or video to restore the image or video data. The mobile terminal 1200 can support one or more encoders and decoders, for example: image formats such as JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap), and video formats such as MPEG (Moving Picture Experts Group) 1, MPEG10, H.1063, H.1064, and HEVC (High Efficiency Video Coding).

[0163] The processor 1201 may be connected to the memory 1202 or other components via a bus 1203 .

[0164] The memory 1202 may be used to store computer executable program codes, which may include instructions. The processor 1201 executes various functional applications and data processing of the mobile terminal 1200 by running the instructions stored in the memory 1202. The memory 1202 may also store application data, such as images, videos, and other files.

[0165] The communication function of the mobile terminal 1200 can be implemented by the mobile communication module 1204, antenna 1, wireless communication module 1205, antenna 2, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 1204 can provide 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 1200. The wireless communication module 1205 can provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. applied to the mobile terminal 1200.

[0166] The display screen 1206 is used to implement display functions, such as displaying user interfaces, images, videos, etc., and displaying abnormal prompt information. The camera module 1207 is used to implement shooting functions, such as shooting images, videos, etc., to collect scene images. The audio module 1208 is used to implement audio functions, such as playing audio, collecting voice, etc. The power module 1209 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc. The sensor module 1210 may include one or more sensors to implement corresponding induction detection functions.

[0167] In addition, the exemplary embodiments of the present disclosure further provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification.

[0168] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0169] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0170] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0171] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. A training method for a sales forecasting model. It is characterized in that The training method comprises: Get the historical item data and historical inventory time of the item; Inputting the historical item data into the first sub-network of the sales forecasting model to perform sales forecasting, and obtaining sales forecast results for each day within the forecasting period; Based on the sales forecast result and the historical inventory time, using the second sub-network of the sales forecast model to perform inventory forecasting to obtain an inventory forecast result; A first loss function is constructed according to the sales prediction result and the actual sales label, and a second loss function is constructed according to the inventory prediction result and the actual inventory label, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

2. The method according to claim 1, It is characterized in that The step of inputting the historical item data into the first sub-network of the sales prediction model to perform sales prediction to obtain sales prediction results includes: forming historical time series information of the item according to the historical item data; The first sub-network is used to perform sales forecasting on the historical time series information, so as to form a sales forecast sequence according to the daily sales forecast results within the forecast period.

3. The method according to claim 1, It is characterized in that The historical inventory time is the historical inventory days; the method of performing inventory quantity forecasting based on the sales forecast result and the historical inventory time using the second sub-network of the sales forecast model to obtain the inventory forecast result includes: Based on the time series, obtaining the target sales result of each day in the historical inventory days from the sales forecast result through the second sub-network; The inventory forecast result is determined based on the sum of the target sales results.

4. The method according to claim 1, It is characterized in that The constructing a first loss function according to the sales prediction result and the actual sales label includes: Constructing a first sub-loss function according to each of the sales forecast results within the forecast period and the corresponding real sales labels; Obtaining a non-zero sales prediction result whose true sales label is zero within the prediction period, and constructing a second sub-loss function according to the non-zero sales prediction result; The first loss function is determined according to the first sub-loss function and the second sub-loss function.

5. The method according to claim 4, It is characterized in that The constructing a second sub-loss function according to the non-zero sales volume prediction result includes: Count the number of days with non-zero sales forecast results; The second sub-loss function is constructed according to the non-zero sales volume prediction result and the number of days.

6. The method according to claim 1, It is characterized in that The constructing a second loss function according to the inventory prediction result and the actual inventory label includes: Constructing a third sub-loss function according to the inventory prediction result and the corresponding real inventory label; When the inventory prediction result is zero and the corresponding real inventory label is greater than zero, obtaining a fourth sub-loss function according to a preset strategy; The second loss function is determined according to the third sub-loss function and the fourth sub-loss function.

7. A method for predicting item sales volume, It is characterized in that The method comprises: Obtain target historical item data and target historical inventory time of the item to be predicted; Input the target historical item data and the target historical inventory time into the target model to obtain the daily sales forecast result of the item to be forecasted within the forecast period; Wherein, the target model is obtained by training the sales forecasting model according to the training method of the sales forecasting model according to any one of claims 1 to 6.

8. The method according to claim 7, It is characterized in that After obtaining the daily sales forecast result of the item to be forecasted within the forecast period, the method further includes: Obtaining a target inventory time determined based on the sales forecast result; The historical inventory time is updated using the target inventory time for use in the next iterative training of the target model.

9. The method according to claim 8, It is characterized in that The method further comprises: Determine the target inventory level based on the daily sales forecast results within the forecast period; A target replenishment quantity is determined according to the target inventory quantity and the current inventory quantity of the item to be predicted.

10. A training device for a sales forecasting model, It is characterized in that include: A data acquisition module, used to acquire historical item data and historical inventory time of items; A first processing module, used for inputting the historical item data into a first sub-network of a sales forecasting model to perform sales forecasting, and obtain sales forecasting results for each day within a forecasting period; A second processing module, based on the sales forecast result and the historical inventory time, uses the second sub-network of the sales forecast model to perform inventory forecasting to obtain an inventory forecast result; A parameter adjustment module is used to construct a first loss function based on the sales prediction result and the actual sales label, and to construct a second loss function based on the inventory prediction result and the actual inventory label, so as to adjust the parameters in the sales prediction model in combination with the first loss function and the second loss function to obtain a target model.

11. An item sales forecasting device, It is characterized in that include: A data acquisition module, used to acquire target historical item data and target historical inventory time of the item to be predicted; The sales forecasting module is used to input the target historical item data and the target historical inventory time into the target model to obtain the sales forecast results of the item to be forecasted every day within the forecast period; Wherein, the target model is obtained by training the sales forecasting model according to the training method of the sales forecasting model according to any one of claims 1 to 6.

12. An electronic device, It is characterized in that include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.

13. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.