Inventory prediction method and apparatus

WO2026166138A1PCT designated stage Publication Date: 2026-08-13BEIJING WODONG TIANJUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-08-13

Smart Images

  • Figure CN2025134923_13082026_PF_FP_ABST
    Figure CN2025134923_13082026_PF_FP_ABST
Patent Text Reader

Abstract

An inventory prediction method and apparatus, relating to the technical field of computers. A specific embodiment of the method comprises: determining historical information of a target item in a historical time period and a predicted time period; inputting the historical information and the predicted time period into a foundation model, and, on the basis of an output of the foundation model, determining reference information of the target item in the predicted time period; determining a first internal factor and a first external factor of the target item in the predicted time period; inputting the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuned model; on the basis of an output of the fine-tuned model, determining predicted sales volume information of the target item in the predicted time period; and on the basis of the predicted sales volume information, determining predicted inventory information of the target item corresponding to a preset time period. In the embodiment, the inventory of the item in the predicted time period can be accurately predicted.
Need to check novelty before this filing date? Find Prior Art

Description

Inventory forecasting methods and apparatus

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202510138364.4, filed on February 7, 2025, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This disclosure relates to the field of computer technology, and more particularly to an inventory forecasting method and apparatus. Background Technology

[0004] Inventory forecasting is used to predict the inventory level of an item over a future period. Once the inventory level is determined, processes such as inventory turnover and replenishment can be executed based on the forecast. The inventory level needs to meet the sales demand for the item. However, during the sales process, many additional factors can affect sales volume, making it difficult to accurately determine the inventory level. Summary of the Invention

[0005] In view of this, embodiments of the present disclosure provide an inventory forecasting method and apparatus that can accurately predict the inventory of goods during the forecast period.

[0006] In a first aspect, embodiments of this disclosure provide an inventory forecasting method, including:

[0007] Determine the historical information and prediction period for the target item within a historical time period;

[0008] Historical information and the prediction period are input into the basic model, and the reference information of the target item during the prediction period is determined based on the output of the basic model.

[0009] Identify the primary internal and primary external factors for the target item during the forecast period;

[0010] Input historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model;

[0011] Based on the output of the fine-tuned model, determine the predicted sales information of the target item during the prediction period;

[0012] Based on the predicted sales information, determine the predicted inventory information for the target item for the corresponding preset time period.

[0013] Optionally, historical information, reference information, the first internal factor, and the first external factor are input into the fine-tuning model, including:

[0014] Identify the second internal and second external factors of the target item within a historical time period;

[0015] Historical information, reference information, first internal factor, second internal factor, first external factor, and second external factor are input into the fine-tuning model.

[0016] Optionally, before determining the historical information of the target item in the historical period and the prediction period, the method further includes:

[0017] Based on the existing information of the target item, multiple first samples of the target item are generated; wherein, the first sample includes: the first historical information of the target item and the first prediction information corresponding to the first historical information;

[0018] The base model is trained using multiple first samples.

[0019] Optionally, before determining the historical information of the target item in the historical period and the prediction period, the method further includes:

[0020] Based on the existing information of the target item, multiple second samples of the target item are generated; wherein, the second samples include: second historical information of the target item and second prediction information corresponding to the second historical information;

[0021] The initial model is trained using multiple second samples;

[0022] Multiple third samples of the target item are generated; wherein, the third sample includes: third historical information of the target item, third reference information corresponding to the third historical information, internal factors corresponding to the third historical information, external factors corresponding to the third prediction information, and third prediction information corresponding to the third prediction information; the third reference information is obtained using the base model;

[0023] By using multiple third samples, the initial trained model is trained to obtain a fine-tuned model.

[0024] Optionally, after determining the predicted sales information of the target item during the prediction period based on the output of the fine-tuning model, the process also includes:

[0025] Determine the replenishment constraints for the target item;

[0026] Based on replenishment constraints and projected sales, generate the replenishment quantity for the target item.

[0027] Optionally, it also includes:

[0028] Determine whether there are primary internal and primary external factors affecting the target item during the forecast period;

[0029] In response to the absence of a first internal factor and a first external factor, the reference information is determined as the predicted sales volume information of the target item during the forecast period.

[0030] Secondly, embodiments of this disclosure provide an inventory forecasting apparatus, comprising:

[0031] The information determination module is used to determine the historical information and predicted time period of the target item in a historical period;

[0032] The first input module is used to input historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model.

[0033] The factor determination module is used to determine the first internal factor and the first external factor of the target item during the prediction period;

[0034] The second input module is used to input historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model;

[0035] The sales volume determination module is used to determine the predicted sales volume information of the target item during the prediction period based on the output of the fine-tuning model.

[0036] The inventory determination module is used to determine the predicted inventory information for a target item for a preset time period based on the predicted sales information.

[0037] Thirdly, embodiments of this disclosure provide an electronic device, including:

[0038] One or more processors;

[0039] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the methods of any of the above embodiments.

[0040] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the methods of any of the above embodiments.

[0041] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method of any of the above embodiments.

[0042] One embodiment disclosed above has the following advantages or beneficial effects: First, based on the historical information of the target item, the reference information of the target item during the prediction period is determined. Then, the historical information of the target item, the reference information, the first internal factor, and the first external factor are input into the fine-tuning model to obtain the predicted sales information of the target item during the prediction period.

[0043] The first internal factor refers to the attributes related to the transportation or loading of the target item. This first internal factor may include: stockout rate, damage rate, average delivery time, and the number of transport units. The first external factor refers to information unrelated to the target item itself but capable of influencing its sales volume during the forecast period, such as weather conditions, sales strategies, supplier factors, and social factors. Reference information provides a foundation for fine-tuning the model. By comprehensively considering the target item's historical information, reference information, the first internal factor, and the first external factor, forecasted sales volume information that meets sales needs can be obtained. Finally, based on the forecasted sales volume information of the target item, the inventory of the item during the forecast period can be accurately predicted.

[0044] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0045] The accompanying drawings are provided to better understand this disclosure and do not constitute an undue limitation thereof. Wherein:

[0046] Figure 1 is a schematic diagram of the flow of an inventory forecasting method provided in an embodiment of this disclosure;

[0047] Figure 2 is a schematic diagram of the flow of an inventory forecasting method provided in another embodiment of this disclosure;

[0048] Figure 3 is a schematic diagram of the flow of an inventory forecasting method provided in another embodiment of this disclosure;

[0049] Figure 4 is a schematic flowchart of a method for determining replenishment quantity according to an embodiment of this disclosure;

[0050] Figure 5 is a schematic diagram of an inventory forecasting device provided in an embodiment of this disclosure;

[0051] Figure 6 is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present disclosure. Detailed Implementation

[0052] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0053] It should be noted that the acquisition, storage, use, and processing of data in the technical solutions of this disclosure comply with the relevant provisions of national laws and regulations.

[0054] Figure 1 is a schematic flowchart of an inventory forecasting method provided in an embodiment of this disclosure. As shown in Figure 1, the method includes:

[0055] Step 101: Determine the historical information and predicted time period of the target item in the historical period.

[0056] Historical time periods correspond to forecast time periods. For example, the forecast time period is the next 7 days, while the historical time period is the current day plus or minus 6 or 14 days. The forecast time period is from January 16, 2024 to January 22, 2024, while the historical time period could be from January 1, 2024 to January 15, 2024.

[0057] The scheme of this disclosure is used to predict the sales volume of an item in each unit of time within a prediction period. The unit of time can be a day, week, month, or even 1 hour, 3 hours, half a day, etc. Historical information and predicted sales information should be statistically analyzed in units of time. For ease of explanation, the unit of time in this disclosure embodiment is a day.

[0058] Step 102: Input the historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model.

[0059] The basic model is used to predict the sales volume of a target item during the forecast period in the absence of factors affecting sales volume.

[0060] In one embodiment of this disclosure, the base model includes an encoder and a decoder. The encoder may employ a transformer structure, a Wavenet structure, a TCN structure, etc. The decoder may employ a multi-layer MLP structure, a CNN structure, an LSTM structure, etc. The base model employing the encoder and decoder can accurately predict the sales information of the target item during the prediction period in the absence of factors affecting sales.

[0061] For example, the forecast period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. Historical information includes: 2024-01-01: 500; 2024-01-02: 450; 2024-01-03: 480; 2024-01-04: 520; 2024-01-05: 510; 2024-01-07: 530; 2024-01-07: 550; 2024-01-09: 560; 2024-01-10: 580; 2024-01-11: 600; 2024-01-12: 620; 2024-01-13: 630; 2024-01-14: 650; 2024-01-15: 640.

[0062] Input the above historical information and forecast period into the base model. The output of the base model can be in the following format: 2024-01-16: XXX; 2024-01-17: XXX; 2024-01-18: XXX; 2024-01-19: XXX; 2024-01-20: XXX; 2024-01-21: XXX; 2024-01-22: XXX.

[0063] Step 103: Determine the first internal factor and the first external factor for the target item during the forecast period.

[0064] The first internal factor is the attribute information related to the transportation or loading of the target item during the forecast period. This first internal factor may include: stockout rate, damage rate, average delivery time, and number of transport units. For the stockout rate, if the stockout rate is high within the statistical period, the forecasted sales volume information can be appropriately increased to better reflect sales needs. For the damage rate, if the damage rate is high within the statistical period, the forecasted sales volume information can be appropriately reduced to decrease operating costs. For the delivery time, if the delivery time is long, the forecasted sales volume information should be appropriately increased. The number of transport units refers to the number of items placed in a box or carton. The forecasted sales volume information must be an integer multiple of the number of transport units.

[0065] The first internal factor can be analyzed by the fine-tuned model. It can obtain information on multiple internal factors that can influence the sales volume of the target item during the prediction period. Each internal factor is encoded, and then the codes corresponding to each internal factor are combined in a preset order to obtain the first internal factor.

[0066] The first type of external factor refers to information unrelated to the target item itself but capable of influencing its sales volume during the forecast period. This includes factors such as weather, sales strategies, supplier information, and social factors. For example, increased rainfall in summer can affect the sales of air conditioners and fans. Similarly, strong promotional activities can lead to sales exceeding expectations.

[0067] The first external factor can be analyzed by the fine-tuned model. It can obtain information on multiple external factors that can influence the sales volume of the target item during the prediction period. Each external factor is encoded, and then the codes corresponding to each external factor are combined in a preset order to obtain the first external factor.

[0068] The primary internal factor and the primary external factor are the factors that influence product sales from different perspectives. By comprehensively considering both the primary internal and primary external factors, a more comprehensive and accurate data reference can be provided for fine-tuning the model, thereby obtaining a more accurate sales forecast.

[0069] Step 104: Input historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model.

[0070] Fine-tuning models can be constructed using large language models such as LLAMA, GPT2, and qwen. When using a large language model for fine-tuning, the information on various item attribute factors that can affect the sales volume of the target item during the prediction period can be described in language as the first internal factor. For example, the first internal factor could be: the expected stockout rate from day XX to day XX is 5%, the expected delivery time from day XX to day XX is 5 days, and the quantity in the box is 5, etc.

[0071] When fine-tuning the model using a large language model, the external factors that can influence the sales of the target item during the forecast period can be described in language as the first external factor. For example, the first external factor could be: a promotional event for the target item will be launched from XX to XX, or there will be high temperatures from XX to XX.

[0072] In one embodiment of this disclosure, the first internal factor includes first internal information corresponding to at least one internal influencing factor. Internal influencing factors may include: stockout rate, damage rate, average delivery time, number of transport units, etc.

[0073] The first internal information can include: expected time point, influencing factors, and trend information. For example, the first internal information could be: the expected delivery time for February 20, 2024 is 7 days, and a delivery time exceeding 5 days will cause inventory shortages. Here, February 20, 2024 is the expected time point, the 7-day delivery time is the internal influencing factor, and the 5-day delivery time causing inventory shortages is the trend information. Multiple pieces of the above-mentioned first internal information constitute the first internal factor. Fine-tuning the model can analyze this first internal factor to accurately obtain predicted sales information.

[0074] The first internal information can also include historical internal descriptive information. Historical internal descriptive information describes the relevant internal factors for historical periods. For example, the first internal information could be: the estimated delivery time for February 20, 2024 is 7 days; a delivery time exceeding 5 days will cause inventory shortages; and the historical delivery times for January 2, 2024, and January 5, 2023 were 6 days and 8 days, respectively. The historical delivery times of 6 days for January 2, 2024, and January 5, 2023, are the historical internal descriptive information. By analyzing historical internal descriptive information, the fine-tuning model can obtain richer information on influencing factors, thereby improving the accuracy of sales forecasts.

[0075] In one embodiment of this disclosure, the first external factor includes at least one piece of first external information corresponding to an external influencing factor. External influencing factors may include: weather information, sales strategy information, supplier information, social information, etc.

[0076] The first external information may include: the expected time point, influencing factors, and trend information. For example, the first external information could be: it is expected to rain on January 20, 2024, and sales of product A in category X will decrease on rainy days. Here, January 20, 2024 is the expected time point, rain is the external influencing factor, and the decrease in sales of product A in category X on rainy days is the trend information. Multiple pieces of the above-mentioned first external information constitute the first external factor. The fine-tuning model can analyze this first external factor to accurately obtain the predicted sales information.

[0077] The first external information can also include historical external descriptive information. Historical external descriptive information is a description of external factors during historical periods. For example, the first external information could be: it is predicted that it will rain on January 20, 2024; sales of product A in category X will decrease on rainy days; and there was also light rain on January 2, 2024, and January 5, 2023. The fact that there was light rain on January 2, 2024, and January 5, 2023 is historical external descriptive information. By analyzing historical external descriptive information, the fine-tuning model can obtain richer information on influencing factors, thereby improving the accuracy of sales prediction.

[0078] Step 105: Based on the output of the fine-tuning model, determine the predicted sales information of the target item during the prediction period.

[0079] Referring to the example above, the forecast period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. Historical information includes: 2024-01-01: 500; 2024-01-02: 450; 2024-01-03: 480; 2024-01-04: 520; 2024-01-05: 510; 2024-01-07: 530; 2024-01-07: 550; 2024-01-09: 560; 2024-01-10: 580; 2024-01-11: 600; 2024-01-12: 620; 2024-01-13: 630; 2024-01-14: 650; 2024-01-15: 640.

[0080] The reference information output by the basic model includes: 2024-01-16: 670; 2024-01-17: 680; 2024-01-18: 690; 2024-01-19: 700; 2024-01-20: 710; 2024-01-21: 720; 2024-01-22: 730.

[0081] The first internal factor could be: the estimated delivery time for January 20, 2024 is 6 days, and a delivery time of more than 5 days will cause inventory shortages.

[0082] The first external factor could be: it is expected to rain on January 20, 2024, and sales of product category X, to which item A belongs, will decrease on rainy days.

[0083] The aforementioned historical information, reference information, first internal factor, and first external factor are input into the fine-tuning model. The output of the fine-tuning model can be in the following format: 2024-01-16: XXX; 2024-01-17: XXX; 2024-01-18: XXX; 2024-01-19: XXX; 2024-01-20: XXX; 2024-01-21: XXX; 2024-01-22: XXX.

[0084] Step 106: Based on the predicted sales information, determine the predicted inventory information for the target item for the corresponding preset time period.

[0085] Determine the safety stock of the target item for a preset time period. Then, based on the safety stock and projected sales information, determine the projected inventory information for the target item for the corresponding preset time period. Specifically, the sum of the safety stock and projected sales information can be used as the projected inventory information.

[0086] The expected delivery time of the target item within the forecast period can be input into the inventory forecasting model to obtain the safety stock of the target item within the preset period. Generally, the longer the expected delivery time of the target item, the larger the safety stock. The shorter the expected delivery time of the target item, the smaller the safety stock.

[0087] The model can also input the first internal and first external factors of the target item during the forecast period into the inventory forecasting model to obtain the safety stock of the target item during the preset period. By comprehensively considering the first internal and first external factors of the target item, the safety stock can be predicted more accurately.

[0088] In the scheme of this embodiment, reference information for the target item during the forecast period is first determined based on historical information of the target item. Then, the historical information, reference information, first internal factors, and first external factors of the target item are input into a fine-tuning model to obtain the predicted sales volume information of the target item during the forecast period. The reference information provides a basic reference for the fine-tuning model. By comprehensively considering the historical information, reference information, first internal factors, and first external factors of the target item, predicted sales volume information that meets sales needs can be obtained. Finally, based on the predicted sales volume information of the target item, the inventory of the item during the forecast period can be accurately predicted.

[0089] Figure 2 is a schematic flowchart of an inventory forecasting method provided in another embodiment of this disclosure. As shown in Figure 2, the method includes:

[0090] Step 201: Determine the historical information and predicted time period of the target item in the historical period.

[0091] Step 202: Input the historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model.

[0092] Step 203: Determine the first internal factor and the first external factor of the target item during the prediction period, and determine the second internal factor and the second external factor of the target item during the historical period.

[0093] The second internal factor is the attribute information related to the transportation or loading of the target item during a historical period. This second internal factor may include: stockout rate, damage rate, average delivery time, and number of transport units. For the stockout rate, if the stockout rate is high within the statistical period, the predicted sales volume information can be appropriately increased to better adapt to sales needs. For the damage rate, if the damage rate is high within the statistical period, the predicted sales volume information can be appropriately reduced to reduce operating costs. For the delivery time, if the delivery time is long, the predicted sales volume information should be appropriately increased. The number of transport units refers to the number of items placed in a whole box or carton. The predicted sales volume information must be an integer multiple of the number of transport units.

[0094] The second internal factor can be analyzed by a fine-tuned model. It can obtain information on multiple internal factors that influence the sales volume of a target item over a historical period. Each internal factor is encoded, and then the codes corresponding to each internal factor are combined in a preset order to obtain the second internal factor.

[0095] When fine-tuning the model using a large language model, the internal factors that influence the sales volume of the target item over a historical period can be described in language as secondary internal factors. For example, secondary internal factors could be: a stockout rate of 3% from day XX to day XX, or a damage rate of 1% from day XX to day XX, etc.

[0096] The second external factor is information related to factors that can influence the sales volume of the target item over a historical period, such as weather information, sales strategy information, supplier information, and social factors. For example, increased rainfall in summer can affect the sales of air conditioners and fans. Regarding sales strategy information, large-scale promotional activities can lead to sales exceeding expectations.

[0097] The second external factor can be analyzed by a fine-tuned model. It can obtain information on multiple external factors that can influence the sales volume of a target item over a historical period. Each external factor is encoded, and then the codes corresponding to each factor are combined in a preset order to obtain the second external factor.

[0098] When fine-tuning the model using a large language model, information about external factors that can influence the sales of a target item over a historical period can be described in language, serving as secondary external factors. For example, secondary external factors could include: a promotional event for the target item will be launched from XX to XX, or high temperatures will occur from XX to XX.

[0099] In one embodiment of this disclosure, the second internal factor includes second internal information corresponding to at least one internal influencing factor. Internal influencing factors may include: stockout rate, damage rate, average delivery time, and number of transport units, etc.

[0100] Secondary internal information may include historical time points and influencing factors. For example, the factor information for a secondary internal influencing factor could be: a stockout rate of 3% on January 20, 2023. Here, January 20, 2023 is the historical time point, and the stockout rate of 3% is the influencing factor. Multiple pieces of secondary internal information in this form constitute a secondary internal factor. Fine-tuning the model can analyze this secondary internal factor to accurately obtain predicted sales information.

[0101] In one embodiment of this disclosure, the second external factor includes at least one second external information corresponding to an external influencing factor. External influencing factors may include: weather information, sales strategy information, supplier information, social information, etc.

[0102] Secondary external information may include historical time points and influencing factors. For example, the factor information for a secondary external influencing factor could be: there was a promotional activity on January 20, 2023. Here, January 20, 2023 is the historical time point, and the promotional activity is the influencing factor. Multiple pieces of secondary external information in this form constitute a secondary external factor. Fine-tuning the model can analyze this secondary external factor to accurately obtain predicted sales information.

[0103] Step 204: Input historical information, reference information, first internal factor, second internal factor, first external factor, and second external factor into the fine-tuning model.

[0104] Step 205: Based on the output of the fine-tuning model, determine the predicted sales information of the target item during the prediction period.

[0105] Referring to the example above, the forecast period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. Historical information includes: 2024-01-01: 500; 2024-01-02: 450; 2024-01-03: 480; 2024-01-04: 520; 2024-01-05: 510; 2024-01-07: 530; 2024-01-07: 550; 2024-01-09: 560; 2024-01-10: 580; 2024-01-11: 600; 2024-01-12: 620; 2024-01-13: 630; 2024-01-14: 650; 2024-01-15: 640.

[0106] The reference information output by the basic model includes: 2024-01-16: 670; 2024-01-17: 680; 2024-01-18: 690; 2024-01-19: 700; 2024-01-20: 710; 2024-01-21: 720; 2024-01-22: 730.

[0107] The first internal factor could be: the projected stockout rate of 3% from January 16, 2024 to January 22, 2024, and the projected delivery time of 5 days from January 16, 2024 to January 20, 2024.

[0108] The first external factor could be: it is expected to rain on January 20, 2024, and sales of product category X, to which item A belongs, will decrease if it rains continuously.

[0109] The second internal factor could be: a stockout rate of 3% from January 1, 2024 to January 15, 2024, and a damage rate of 1% from January 1, 2024 to January 15, 2024, etc.

[0110] The second external factor can be: light rain also occurred on January 2, 2024, and January 5, 2023. Input the above historical information, reference information, the first internal factor, the second internal factor, the first external factor, and the second external factor into the fine-tuning model. The output of the fine-tuning model can be in the following format: January 16, 2024: XXX; January 17, 2024: XXX; January 18, 2024: XXX; January 19, 2024: XXX; January 20, 2024: XXX; January 21, 2024: XXX; January 22, 2024: XXX.

[0111] Step 206: Based on the predicted sales information, determine the predicted inventory information for the target item for the corresponding preset time period.

[0112] In the scheme of this embodiment, a first external factor for the target item during the prediction period and a second external factor during the historical period are determined. Based on the historical information, reference information, first external factor, and second external factor of the target item, the predicted sales information of the target item during the prediction period is determined. By combining the first external factor for the target item during the prediction period and the second external factor during the historical period, more data can be referenced for fine-tuning the model, resulting in more accurate predicted sales information.

[0113] In one embodiment of this disclosure, before determining the historical information and prediction period of the target item in a historical time period, the method further includes: generating multiple first samples of the target item based on the existing information of the target item; wherein, the first sample includes: first historical information of the target item and first prediction information corresponding to the first historical information; and using the multiple first samples to train the basic model.

[0114] The system stores existing information about the target item. Both the first historical information and the first predicted information are obtained from this existing information. The first historical information corresponds to the first historical time period, and the first predicted information corresponds to the first predicted time period; the first historical time period and the first predicted time period are mutually exclusive. Using multiple first samples to train the basic model can improve the prediction accuracy of the basic model.

[0115] For example, the system stores existing information about a target item from January 1, 2023 to December 31, 2023. It needs to predict the target item's sales volume for the next 3 days based on 7 days of historical information. The existing information from January 1, 2023 to January 7, 2023 can be used as historical information; and the existing information from January 8, 2023 to January 10, 2023 can be used as prediction information to generate the first sample. Similarly, the existing sales volume information from January 3, 2023 to January 9, 2023 can be used as historical information; and the existing sales volume information from January 10, 2023 to January 12, 2023 can be used as prediction information to generate another first sample.

[0116] In one embodiment of this disclosure, before determining the historical information and prediction period of the target item, the method further includes: generating multiple second samples of the target item based on existing information of the target item; wherein the second samples include: second historical information of the target item and second prediction information corresponding to the second historical information; training an initial model using the multiple second samples; generating multiple third samples of the target item; wherein the third samples include: third historical information of the target item, third prediction information corresponding to the third historical information and internal factors corresponding to the third prediction information, external factors corresponding to the third prediction information and third prediction information corresponding to the third historical information; the third reference sales information is obtained using the basic model; and training the trained initial model using the multiple third samples to obtain a fine-tuned model.

[0117] The training of the fine-tuned model is divided into two stages. In the first stage, the initial model is trained directly using the second sample. The second sample does not consider relevant factors affecting sales. In the second stage, the initial model trained in the first stage is trained using the third sample. The third sample considers information about relevant factors affecting sales. This two-stage model training not only improves the efficiency of model training but also results in higher prediction accuracy for the final fine-tuned model.

[0118] In the first phase, both the second historical information and the second projected sales information are obtained from existing information. The second historical information corresponds to the second historical time period, and the second projected sales information corresponds to the second projected time period; the second historical time period and the second projected time period are mutually exclusive.

[0119] For example, the system contains existing information about a target item from January 1, 2023 to December 31, 2023. Based on this 7-day historical information, we need to predict the target item's sales volume for the next 3 days. We can use the existing information from January 1, 2023 to January 7, 2023 as historical information; and the existing information from January 8, 2023 to January 10, 2023 as predicted sales volume information to generate a second sample. Similarly, we can use the existing information from January 3, 2023 to January 9, 2023 as historical information; and the existing information from January 10, 2023 to January 12, 2023 as predicted sales volume information to generate another second sample.

[0120] In the second stage, during the generation of the third sample, the third historical information and the third predicted sales information corresponding to the third sample are first obtained from the existing information. The method for determining the third historical information and the third predicted sales information is the same as that for the second sample. The third historical information is input into the base model, and based on the output of the base model, the third reference sales information corresponding to the third sample is obtained. The internal and external factors corresponding to the predicted sales information of the third sample are determined. Finally, the third historical information, the third reference sales information, the internal factors, the external factors, and the third predicted sales information corresponding to the third sample are combined to generate the third sample.

[0121] In one embodiment of this disclosure, the method further includes: determining whether there are first internal factors and first external factors for the target item during the forecast period; and in response to the absence of the first internal factors and first external factors, determining the reference information as the forecast sales information of the target item during the forecast period.

[0122] Before invoking the fine-tuning model, first determine whether there are first internal and first external factors for the target item during the forecast period. If there are no first internal and first external factors, directly determine the reference information as the predicted sales information of the target item during the forecast period. If there are first internal and first external factors, invoke the fine-tuning model to determine the predicted sales information of the target item during the forecast period.

[0123] Figure 3 is a schematic flowchart of an inventory forecasting method provided in another embodiment of this disclosure. As shown in Figure 3, the method includes:

[0124] Step 301: Determine the historical information and prediction period of the target item in the historical time period.

[0125] Step 302: Input the historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model.

[0126] Step 303: Determine the first internal factor and the first external factor for the target item during the forecast period.

[0127] Step 304: Input historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model.

[0128] Step 305: Based on the output of the fine-tuning model, determine the predicted sales information of the target item during the prediction period.

[0129] Step 306: Determine the replenishment constraint information for the target item.

[0130] Step 307: Generate the replenishment quantity for the target item based on the replenishment constraint information and the predicted sales information.

[0131] Replenishment constraints can include: replenishment quantity limit, safety stock, and existing inventory. Based on business needs, multiple replenishment constraints can be set. For example, the replenishment quantity cannot exceed the replenishment quantity limit, and the inventory after replenishment cannot fall below the safety stock.

[0132] Based on replenishment constraints and projected sales data, the replenishment quantity for the target item is generated. Specifically, the projected replenishment quantity is obtained by adding the safety stock to the projected sales data and subtracting the existing inventory. If the projected replenishment quantity exceeds the replenishment quantity limit, the excess quantity is determined as the replenishment quantity.

[0133] In the scheme of this disclosure embodiment, after determining the predicted sales information of the target item during the forecast period, the replenishment quantity of the target item is generated based on the replenishment constraint information and the predicted sales information. This enables the final replenishment quantity to better meet the actual sales needs and reduce the cost of item turnover and warehouse management.

[0134] Figure 4 is a schematic flowchart of a replenishment quantity determination method provided in an embodiment of this disclosure. As shown in Figure 4, the original data can be existing information about the target item stored in the system. The basic model includes a temporal encoder and a temporal decoder. The fine-tuning model adopts LLM (Large Language Model). The process of calling the fine-tuning model is a process of calling the pre-trained large model for simple fine-tuning. In this process, the new input text may include: basic information about the item, historical information, etc. The fine-tuning model is obtained by fine-tuning the trained initial model. Fine-tuning the trained initial model is used to make the fine-tuned initial model adaptable to the application scenario of sales forecasting.

[0135] The raw data undergoes initial preprocessing to generate historical information for the target item, which is structured in time series. This time series structure includes the historical time and the corresponding sales figures.

[0136] Historical information is input into the base model to obtain reference information for the target item. This reference information uses a time-series structure, which includes the prediction time and the corresponding sales volume.

[0137] The raw data undergoes a second preprocessing step to generate text for the target item. This text includes historical information about the target item. The first internal factor for the target item during the forecast period is determined, such as stockout rate and damage rate. The first external factor for the target item during the forecast period is also determined, such as marketing promotions and weather conditions. The historical information, reference information, the first internal information, and the first external factor in the original text are combined to generate new text. This new text is then input into a fine-tuning model to obtain the predicted sales volume information for the target item during the forecast period. Finally, based on the predicted sales volume information and the replenishment algorithm, the replenishment quantity for the target item is determined.

[0138] Figure 5 is a schematic diagram of a sales forecasting device according to an embodiment of this disclosure. As shown in Figure 5, the device includes:

[0139] The information determination module 501 is used to determine the historical information and predicted time period of the target item in a historical period.

[0140] The first input module 502 is used to input historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model.

[0141] The factor determination module 503 is used to determine the first internal factor and the first external factor of the target item during the prediction period;

[0142] The second input module 504 is used to input historical information, reference information, the first internal factor and the first external factor into the fine-tuning model;

[0143] The sales determination module 505 is used to determine the predicted sales information of the target item during the prediction period based on the output of the fine-tuning model.

[0144] The inventory determination module 506 is used to determine the predicted inventory information of the target item for a preset time period based on the predicted sales information.

[0145] Optionally, the second input module 504 is specifically used for:

[0146] Identify the second internal and second external factors of the target item within a historical time period;

[0147] Historical information, reference information, the first external factor, the second internal factor, and the second external factor are input into the fine-tuning model.

[0148] Optionally, it also includes:

[0149] The training module is used to generate multiple first samples of the target item based on the existing information of the target item; wherein, the first sample includes: the first historical information of the target item and the first prediction information corresponding to the first historical information;

[0150] The base model is trained using multiple first samples.

[0151] Optionally, it also includes:

[0152] The training module is used to generate multiple second samples of the target item based on the existing information of the target item; wherein, the second sample includes: the second historical information of the target item and the second prediction information corresponding to the second historical information;

[0153] The initial model is trained using multiple second samples;

[0154] Multiple third samples of the target item are generated; among them, the target item's third historical information, the third reference information corresponding to the third historical information, the internal factors corresponding to the third historical information, the external factors corresponding to the third prediction information, and the third prediction information corresponding to the third prediction information; the third reference information is obtained using the base model;

[0155] By using multiple third samples, the initial trained model is trained to obtain a fine-tuned model.

[0156] Optionally, it also includes:

[0157] The replenishment quantity determination module is used to determine the replenishment constraint information for the target item;

[0158] Based on replenishment constraints and projected sales, generate the replenishment quantity for the target item.

[0159] Optionally, the sales determination module 505 is also used for:

[0160] Determine whether there are primary internal and primary external factors affecting the target item during the forecast period;

[0161] In response to the absence of a first internal factor and a first external factor, the reference information is determined as the predicted sales volume information of the target item during the forecast period.

[0162] This disclosure provides an electronic device, including:

[0163] One or more processors;

[0164] A storage device for storing one or more programs that, when executed by one or more processors, cause the one or more processors to implement the methods of any of the above embodiments.

[0165] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the method of any of the above embodiments.

[0166] Referring now to FIG6, a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device of the present disclosure is shown. The terminal device shown in FIG6 is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present disclosure.

[0167] As shown in Figure 6, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0168] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0169] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this disclosure.

[0170] It should be noted that the computer-readable medium disclosed herein may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0171] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0172] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The described modules can also be located in a processor, and for example, can be described as: an information determination module, a first input module, a factor determination module, a second input module, a sales volume determination module, and an inventory determination module. The names of these modules do not necessarily limit the module itself; for example, the information determination module can also be described as "a module for determining historical information and prediction time periods for a target item in a historical period."

[0173] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include:

[0174] Determine the historical information and prediction period for the target item within a historical time period;

[0175] Historical information and the prediction period are input into the basic model, and the reference information of the target item during the prediction period is determined based on the output of the basic model.

[0176] Identify the primary internal and primary external factors for the target item during the forecast period;

[0177] Input historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model;

[0178] Based on the output of the fine-tuned model, determine the predicted sales information of the target item during the prediction period;

[0179] Based on the predicted sales information, determine the predicted inventory information for the target item for the corresponding preset time period.

[0180] According to the technical solution of this disclosure embodiment, reference information for the target item during the forecast period is first determined based on historical information of the target item. Then, the historical information, reference information, first internal factors, and first external factors of the target item are input into a fine-tuning model to obtain the predicted sales volume information of the target item during the forecast period. The first internal information refers to attribute information related to the transportation or loading of the target item. The first internal information may include: stockout rate, damage rate, average delivery time, and number of transport units. The first external factors are relevant factors unrelated to the target item itself but capable of affecting the sales volume of the target item during the forecast period, such as weather information, sales strategy information, supplier information, and social factors. The reference information provides a basic reference for the fine-tuning model. By comprehensively considering the historical information, reference information, first internal factors, and first external factors of the target item, predicted sales volume information that meets sales needs can be obtained. Finally, based on the predicted sales volume information of the target item, the inventory of the item during the forecast period can be accurately predicted.

[0181] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An inventory forecasting method, comprising: Determine the historical information and prediction period for the target item within a historical time period; The historical information and the predicted time period are input into the basic model, and the reference information of the target item in the predicted time period is determined based on the output of the basic model. Determine the first internal factor and the first external factor of the target item during the prediction period; The historical information, the reference information, the first internal factor, and the first external factor are input into the fine-tuning model; Based on the output of the fine-tuning model, the predicted sales information of the target item during the prediction period is determined; as well as Based on the predicted sales information, the predicted inventory information for the target item corresponding to the preset time period is determined.

2. The method according to claim 1, wherein, The step of inputting the historical information, the reference information, the first internal factor, and the first external factor into the fine-tuning model includes: Determine the second internal factor and the second external factor of the target item during the historical period; and The historical information, the reference information, the first internal factor, the second internal factor, the first external factor, and the second external factor are input into the fine-tuning model.

3. The method according to claim 1, wherein, Before determining the historical information and prediction period of the target item in the historical time period, the method further includes: Based on existing information about the target item, multiple first samples of the target item are generated; wherein, the first sample includes: first historical information of the target item and first prediction information corresponding to the first historical information; and The base model is trained using the multiple first samples.

4. The method according to claim 1, wherein, Before determining the historical information and prediction period of the target item in the historical time period, the method further includes: Based on the existing information of the target item, multiple second samples of the target item are generated; wherein, the second sample includes: second historical information of the target item and second prediction information corresponding to the second historical information; The initial model is trained using the multiple second samples; Generate multiple third samples of the target item; wherein, the third samples include: third historical information of the target item, third reference information corresponding to the third historical information, internal factors corresponding to the third historical information, external factors corresponding to the third prediction information, and third prediction information corresponding to the third prediction information; the third reference information is obtained using the base model; and Using the multiple third samples, the initial trained model is trained to obtain the fine-tuned model.

5. The method according to claim 1, wherein, After determining the predicted sales information of the target item for the predicted period based on the output of the fine-tuning model, the process further includes: Determine the replenishment constraint information for the target item; and Based on the replenishment constraint information and the predicted sales information, the replenishment quantity of the target item is generated.

6. The method according to claim 1, wherein, Also includes: Determine whether the target item has a first internal factor and a first external factor during the prediction period; as well as In response to the absence of the first internal factor and the first external factor, the reference information is determined as the predicted sales information of the target item during the prediction period.

7. An inventory forecasting device, comprising: The information determination module is used to determine the historical information and predicted time period of the target item in a historical period; The first input module is used to input the historical information and the prediction period into the basic model, and determine the reference information of the target item in the prediction period based on the output of the basic model. A factor determination module is used to determine the first internal factor and the first external factor of the target item during the prediction period. The second input module is used to input the historical information, the reference information, the first internal factor, and the first external factor into the fine-tuning model; The sales volume determination module is used to determine the predicted sales volume information of the target item during the prediction period based on the output of the fine-tuning model. as well as The inventory determination module is used to determine the predicted inventory information of the target item for the preset time period based on the predicted sales information.

8. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

9. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of claims 1-6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.