Inventory prediction method and device
By combining historical information, internal and external factors, and using basic and fine-tuning models to conduct inventory prediction, the problem of inaccurate inventory prediction in the existing technology is solved, and more accurate inventory prediction and better satisfaction of sales demands is achieved.
Patent Information
- Application Number
- CN202510138364.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-07
- Publication Date
- 2025-05-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art is difficult to accurately predict the inventory of items, and is affected by a variety of additional factors, resulting in inaccurate inventory prediction.
By determining the historical information and prediction period of the target item, input it to the basic model to obtain reference information, and then input it into the fine-tuning model based on internal and external factors to generate predicted sales information and finally determine the predicted inventory information.
Accurate prediction of the inventory of items during the forecast period can better meet sales needs and reduce inventory management costs.
Smart Images

Figure CN120046794A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to an inventory prediction method and apparatus. Background Art
[0002] Inventory prediction is used to predict the inventory quantity of an item within a future period of time. After determining the inventory of the item, processes such as turnover and replenishment of the item can be executed based on the predicted inventory. The inventory of the item needs to meet the sales requirements of the item. However, during the sales process of the item, there are many additional factors that affect the sales volume of the item, making it difficult to accurately determine the inventory of the item. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide an inventory prediction method and apparatus that can accurately predict the inventory of an item during a prediction period.
[0004] In a first aspect, embodiments of the present invention provide an inventory prediction method, including:
[0005] Determine the historical information of the target item during a historical period and the prediction period;
[0006] Input the historical information and the prediction period into a basic model, and determine the reference information of the target item during the prediction period according to the output of the basic model;
[0007] Determine the first internal factor and the first external factor of the target item during the prediction period;
[0008] Input the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuning model;
[0009] Determine the predicted sales volume information of the target item during the prediction period according to the output of the fine-tuning model;
[0010] Determine the predicted inventory information of the target item corresponding to the preset period according to the predicted sales volume information.
[0011] Optionally, the inputting the historical information, the reference information, the first internal factor, and the first external factor into the fine-tuning model includes:
[0012] Determine the second internal factor and the second external factor of the target item during the historical period;
[0013] Input the historical information, the reference information, the first internal factor, the second internal factor, the first external factor, and the second external factor into the fine-tuning model.
[0014] Optionally, before determining the historical information of the target item in the historical period and the prediction period, it further includes:
[0015] Generate a plurality of first samples of the target item according to 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;
[0016] Use the plurality of first samples to perform model training on the basic model.
[0017] Optionally, before determining the historical information of the target item in the historical period and the prediction period, it further includes:
[0018] Generate a plurality of second samples of the target item according to 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;
[0019] Use the plurality of second samples to perform model training on the initial model;
[0020] Generate a plurality of third samples of the target item; wherein, the third sample includes: the third historical information of the target item, 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 by using the basic model;
[0021] Use the plurality of third samples to perform model training on the trained initial model to obtain the fine-tuned model.
[0022] Optionally, after determining the predicted sales volume information of the target item in the prediction period according to the output of the fine-tuned model, it further includes:
[0023] Determine the replenishment constraint information of the target item;
[0024] Generate the replenishment quantity of the target item according to the replenishment constraint information and the predicted sales volume information.
[0025] Optionally, it further includes:
[0026] Determine whether there are the first internal factor and the first external factor of the target item in the prediction period;
[0027] In response to the non-existence of the first internal factor and the first external factor, determine the reference information as the predicted sales volume information of the target item in the prediction period.
[0028] Second aspect, an embodiment of the present invention provides an inventory prediction device, including:
[0029] An information determination module, configured to determine the historical information of the target item in the historical period and the prediction period;
[0030] A first input module, configured to input the historical information and the prediction period into a basic model, and determine the reference information of the target item in the prediction period according to the output of the basic model;
[0031] A factor determination module, configured to determine the first internal factor and the first external factor of the target item in the prediction period;
[0032] A second input module, configured to input the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuning model;
[0033] A sales volume determination module, configured to determine the predicted sales volume information of the target item in the prediction period according to the output of the fine-tuning model;
[0034] An inventory determination module, configured to determine the predicted inventory information of the target item corresponding to the preset period according to the predicted sales volume information.
[0035] Third aspect, an embodiment of the present invention provides an electronic device, including:
[0036] One or more processors;
[0037] A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the method of any of the above embodiments.
[0038] Fourth aspect, an embodiment of the present invention provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processor, the method of any of the above embodiments is implemented.
[0039] Fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, and when the computer program is executed by a processor, the method of any of the above embodiments is implemented.
[0040] One of the above embodiments of the present invention has the following advantages or beneficial effects: First, according to the historical information of the target item, the reference information of the target item in the prediction period is determined. Then, the historical information, the reference information, the first internal factor, and the first external factor of the target item are input into the fine-tuning model to obtain the predicted sales volume information of the target item in the prediction period.
[0041] Among them, the first internal information is attribute information related to the transportation or loading of the target item. The first internal information may include: out-of-stock rate, damaged goods rate, average arrival duration, number of transport units, etc. The first external factor is information on relevant factors that are not related to the target item itself and can affect the sales volume of the target item during the prediction period, such as weather factor information, sales strategy information, supplier factor information, social factor information, etc. The reference information is used to provide a basic reference for the fine-tuning model. By comprehensively considering the historical information, reference information, first internal factor, and first external factor of the target item, the predicted sales volume information that meets the sales demand can be obtained. Finally, based on the predicted sales volume information of the target item, the inventory of the item during the prediction period can be accurately predicted.
[0042] The further effects of the above-mentioned non-conventional optional methods will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention. Among them:
[0044] Figure 1 is a schematic diagram of the process of an inventory prediction method provided by an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of the process of an inventory prediction method provided by another embodiment of the present invention;
[0046] Figure 3 is a schematic diagram of the process of an inventory prediction method provided by still another embodiment of the present invention;
[0047] Figure 4 is a schematic diagram of the process of a replenishment quantity determination method provided by an embodiment of the present invention;
[0048] Figure 5 is a schematic diagram of the structure of an inventory prediction device provided by an embodiment of the present invention;
[0049] Figure 6 is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] The following describes exemplary embodiments of the present invention with reference to the accompanying drawings. Various details of the embodiments of the present invention are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted below.
[0051] It should be noted that in the technical solution of the embodiment of the present invention, the acquisition, storage, use, processing, etc. of data all comply with the relevant provisions of national laws and regulations.
[0052] Figure 1 It is a schematic diagram of the process of an inventory prediction method provided by an embodiment of the present invention. As Figure 1 shown, the method includes:
[0053] Step 101: Determine the historical information of the target item in the historical period and the prediction period.
[0054] The historical period corresponds to the prediction period. For example, if the prediction period is the next 7 days, the historical period can be the current day and the 6 days, 14 days, etc. counted backwards from the current day. If the prediction period is from January 16, 2024 to January 22, 2024, the historical period can be from January 1, 2024 to January 15, 2024.
[0055] The solution of the embodiment of the present invention is used to predict the sales volume of an item per unit time within the prediction period. The unit time can be days, weeks, months, etc., or it can be 1 hour, 3 hours, half a day, etc. The historical information and the predicted sales volume information should be statistically counted in units of time. For the convenience of description, the unit time in the embodiment of the present invention is all in days.
[0056] 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 according to the output of the basic model.
[0057] The basic model is used to predict the sales volume information of the target item in the prediction period in the absence of factors affecting the sales volume.
[0058] In an embodiment of the present invention, the basic model includes: an encoder and a decoder. The encoder can adopt structures such as the transformer structure, the wavenet structure, and the TCN structure. The decoder can adopt structures such as the multi-layer MLP structure, the CNN structure, and the LSTM structure. The basic model using the encoder and the decoder can more accurately predict the sales volume information of the target item in the prediction period in the absence of factors affecting the sales volume.
[0059] For example, the prediction period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. The historical information includes: January 1, 2024: 500; January 2, 2024: 450; January 3, 2024: 480; January 4, 2024: 520; January 5, 2024: 510; January 7, 2024: 530; January 7, 2024: 550; January 9, 2024: 560; January 10, 2024: 580; January 11, 2024: 600; January 12, 2024: 620; January 13, 2024: 630; January 14, 2024: 650; January 15, 2024: 640.
[0060] Input the above historical information and prediction period into the basic model. The output result of the basic model can be in the following form: 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.
[0061] Step 103: Determine the first internal factor and the first external factor of the target item during the prediction period.
[0062] The first internal factor is the attribute information related to transportation or loading corresponding to the target item during the prediction period. The first internal factor may include: out-of-stock rate, damaged goods rate, average arrival time, number of units per carrier, etc. For the out-of-stock rate, if the out-of-stock rate is relatively high during the statistical period, the predicted sales information can be appropriately increased to better meet the sales needs. For the damaged goods rate, if the damaged goods rate is relatively high during the statistical period, the predicted sales information can be appropriately reduced to reduce the operating cost. For the arrival time, when the arrival time is relatively long, the predicted sales information is appropriately increased. The number of units per carrier is the number of items placed in a whole box or a whole case. The predicted sales information needs to be an integer multiple of the number of units per carrier.
[0063] The first internal factor can be parsed by the fine-tuning model. Multiple internal factor information that can affect the sales volume of the target item during the prediction period can be obtained. Each internal factor information is encoded, and then the encoded information corresponding to each internal factor is combined in a preset order to obtain the first internal factor.
[0064] The first external factor is information on relevant factors that are unrelated to the target item itself and can affect the sales volume of the target item during the prediction period, such as weather factor information, sales strategy information, supplier factor information, social factor information, etc. For weather factor information, such as an increase in summer rainfall, it will affect the sales volume of air conditioners and fans. For sales strategy information, such as a large promotion intensity resulting in sales exceeding expectations.
[0065] The first external factor can be parsed by the fine-tuning model. Multiple external factor information that can affect the sales volume of the target item during the prediction period can be obtained. Each external factor information is encoded, and then the encodings corresponding to each external factor information are combined in a preset order to obtain the first external factor.
[0066] The first internal factor and the first external factor are influencing factors for the sales volume of the item from different perspectives. By comprehensively considering the first internal factor and the first external factor, more comprehensive and accurate data references can be provided for the fine-tuning model, thereby obtaining a more accurate predicted sales volume.
[0067] Step 104: Input the historical information, reference information, the first internal factor, and the first external factor into the fine-tuning model.
[0068] The fine-tuning model can be constructed using large language models such as LLAMA, GPT2, qwen, etc. When the fine-tuning model uses a large language model, the information on each item attribute factor 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 can be: the expected out-of-stock rate from XX day to XX day is 5%, the expected arrival duration from XX day to XX day is 5 days, the quantity in a whole box is 5, etc.
[0069] When the fine-tuning model uses a large language model, the information on each external factor that can affect the sales volume of the target item during the prediction period can be described in language as the first external factor. For example, the first external factor can be: there will be an XX promotion activity for the target item from XX day to XX day, and it will be high-temperature weather from XX day to XX day.
[0070] In an embodiment of the present invention, the first internal factor includes at least one piece of first internal information corresponding to an internal influencing factor. The internal influencing factors can include: out-of-stock rate, damaged goods rate, average arrival duration, quantity per transport unit, etc.
[0071] The first internal information may include: expected time points, influencing factors, and trend information. For example, the first internal information can be: the arrival time is expected to be 7 days on February 20, 2024, and an arrival time exceeding 5 days will cause inventory shortages. Among them, February 20, 2024 is the expected time point, the arrival time of 7 days is the internal influencing factor, and an arrival time exceeding 5 days will cause inventory shortages is the trend information. Multiple pieces of the first internal information in the above form constitute the first internal factor, and the fine-tuning model can analyze this first internal factor to accurately obtain the predicted sales information.
[0072] The first internal information may also include: historical internal description information. The historical internal description information is the relevant description of the internal factors in the historical period. For example, the first internal information can be: the arrival time is expected to be 7 days on February 20, 2024, and an arrival time exceeding 5 days will cause inventory shortages, and the arrival times on January 2, 2024 and January 5, 2023 were 6 days and 8 days respectively. Among them, the arrival times on January 2, 2024 and January 5, 2023 being 6 days and 8 days respectively are the historical internal description information. By analyzing the historical internal description information, the fine-tuning model can obtain more abundant influencing factor information, thereby improving the accuracy of predicted sales.
[0073] In an embodiment of the present invention, the first external factor includes at least one piece of first external information corresponding to an external influencing factor. The external influencing factors may include: weather factor information, sales strategy information, supplier factor information, social factor information, etc.
[0074] The first external information may include: expected time points, influencing factors, and trend information. For example, the first external information can be: it is expected to rain on January 20, 2024, and the sales volume of category X to which product A belongs will decrease on rainy days. Among them, January 20, 2024 is the expected time point, it will rain is the external influencing factor, and the sales volume of category X to which product A belongs will decrease on rainy days is the trend information. Multiple pieces of the first external information in the above form constitute the first external factor, and the fine-tuning model can analyze this first external factor to accurately obtain the predicted sales information.
[0075] The first external information may also include: historical external description information. The historical external description information is the relevant description of the external factors in the historical period. For example, the first external information can be: it is expected to rain on January 20, 2024, and the sales volume of category X to which product A belongs will decrease on rainy days, and there was also light rain on January 2, 2024 and January 5, 2023. Among them, there was also light rain on January 2, 2024 and January 5, 2023 is the historical external description information. By analyzing the historical external description information, the fine-tuning model can obtain more abundant influencing factor information, thereby improving the accuracy of predicted sales.
[0076] Step 105: Determine the predicted sales volume information of the target item during the prediction period according to the output of the fine-tuning model.
[0077] Referring to the above example, the prediction period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. The historical information includes: January 1, 2024: 500; January 2, 2024: 450; January 3, 2024: 480; January 4, 2024: 520; January 5, 2024: 510; January 7, 2024: 530; January 7, 2024: 550; January 9, 2024: 560; January 10, 2024: 580; January 11, 2024: 600; January 12, 2024: 620; January 13, 2024: 630; January 14, 2024: 650; January 15, 2024: 640.
[0078] The reference information output by the basic model includes: January 16, 2024: 670; January 17, 2024: 680; January 18, 2024: 690; January 19, 2024: 700; January 20, 2024: 710; January 21, 2024: 720; January 22, 2024: 730.
[0079] The first internal factor can be: The arrival time of goods is expected to be 6 days on January 20, 2024. An arrival time exceeding 5 days will cause inventory shortages.
[0080] The first external factor can be: It is expected to rain on January 20, 2024. When it rains, the sales volume of category X to which item A belongs will decrease.
[0081] Input the above historical information, reference information, the first internal factor and the first external factor into the fine-tuning model. The output result of the fine-tuning model can be in the following form: 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.
[0082] Step 106: Determine the predicted inventory information of the target item for the preset period according to the predicted sales volume information.
[0083] Determine the safety inventory of the target item for the preset period. Then, according to the safety inventory of the target item and the predicted sales volume information, determine the predicted inventory information of the target item for the preset period. Specifically, the sum of the safety inventory of the target item and the predicted sales volume information can be used as the predicted inventory information.
[0084] The expected arrival time of the target item corresponding to the prediction period can be input into the inventory prediction model to obtain the safety stock of the target item in the preset period. Generally, the longer the expected arrival time of the target item, the larger the safety stock of the target item. The shorter the expected arrival time of the target item, the smaller the safety stock of the target item.
[0085] The first internal factor and the first external factor of the target item in the prediction period can also be input into the inventory prediction model to obtain the safety stock of the target item in the preset period. By comprehensively considering the first internal factor and the first external factor of the target item, the safety stock can be predicted more accurately.
[0086] In the solution of the embodiment of the present invention, first, according to the historical information of the target item, the reference information of the target item in the prediction period is determined. Then, the historical information, reference information, first internal factor, and first external factor of the target item are input into the fine-tuning model to obtain the predicted sales volume information of the target item in the prediction period. The reference information is used to provide a basic reference for the fine-tuning model. By comprehensively considering the historical information, reference information, first internal factor, and first external factor of the target item, the predicted sales volume information that meets the sales demand can be obtained. Finally, based on the predicted sales volume information of the target item, the inventory of the item in the prediction period can be accurately predicted.
[0087] Figure 2 It is a schematic diagram of the process of an inventory prediction method provided by another embodiment of the present invention. As Figure 2 shown, the method includes:
[0088] Step 201: Determine the historical information of the target item in the historical period and the prediction period.
[0089] 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 according to the output of the basic model.
[0090] Step 203: Determine the first internal factor and the first external factor of the target item in the prediction period, and determine the second internal factor and the second external factor of the target item in the historical period.
[0091] The second internal factor is the attribute information related to transportation or loading corresponding to the target item in the historical period. The second internal information may include: out-of-stock rate, damaged goods rate, average arrival time, number of carrier units, etc. For the out-of-stock rate, if the out-of-stock rate is relatively high within the statistical period, the predicted sales volume information can be appropriately increased to better meet the sales needs. For the damaged goods rate, if the damaged goods rate is relatively high within the statistical period, the predicted sales volume information can be appropriately reduced to reduce operating costs. For the arrival time, if the arrival time is relatively long, the predicted sales volume information is appropriately increased. The number of carrier units is the number of items placed in a whole box or a whole case. The predicted sales volume information needs to be an integer multiple of the number of carrier units.
[0092] The second internal factor can be parsed by the fine-tuning model. Multiple internal factor information that can affect the sales volume of the target item in the historical period can be obtained. Each internal factor information is encoded, and then the encoded information corresponding to each internal factor is combined in a preset order to obtain the second internal factor.
[0093] When the fine-tuning model adopts a large language model, each internal factor information that can affect the sales volume of the target item in the historical period can be described in language as the second internal factor. For example, the second internal factor can be: the out-of-stock rate from XX day to XX day is 3%, the damaged goods rate from XX day to XX day is 1%, etc.
[0094] The second external factor is the relevant factor information that can affect the sales volume of the target item in the historical period, such as weather factor information, sales strategy information, supplier factor information, social factor information, etc. For the weather factor information, such as an increase in rainfall in summer, it will affect the sales volume of air conditioners and fans, etc. For the sales strategy information, such as a large promotion activity resulting in sales exceeding expectations, etc.
[0095] The second external factor can be parsed by the fine-tuning model. Multiple external factor information that can affect the sales volume of the target item in the historical period can be obtained. Each external factor information is encoded, and then the encoded information corresponding to each factor is combined in a preset order to obtain the second external factor.
[0096] When the fine-tuning model adopts a large language model, each external factor information that can affect the sales volume of the target item in the historical period can be described in language as the second external factor. For example, the second external factor can be: there will be an XX promotion activity for the target item from XX day to XX day, and the weather from XX day to XX day is high temperature, etc.
[0097] In an embodiment of the present invention, the second internal factor includes at least one piece of second internal information corresponding to an internal influencing factor. The internal influencing factors may include: out-of-stock rate, damaged goods rate, average arrival time, number of carrier units, etc.
[0098] The second internal information may include: historical time points, influencing factors. For example, the factor information of the second internal influencing factor can be: the out-of-stock rate on January 20, 2023 was 3%. Among them, January 20, 2023 is the historical time point, and the out-of-stock rate of 3% is the influencing factor. Multiple pieces of the second internal information in the above form constitute the second internal factor, and the fine-tuning model can parse this second internal factor to accurately obtain the predicted sales volume information.
[0099] In an embodiment of the present invention, the second external factor includes at least one piece of second external information corresponding to an external influencing factor. The external influencing factors may include: weather factor information, sales strategy information, supplier factor information, social factor information, etc.
[0100] The second external information may include: historical time points, influencing factors. For example, the factor information of the second external influencing factor can be: there was a promotion activity on January 20, 2023. Among them, January 20, 2023 is the historical time point, and having a promotion activity is the influencing factor. Multiple pieces of the second external information in the above form constitute the second external factor, and the fine-tuning model can parse this second external factor to accurately obtain the predicted sales volume information.
[0101] Step 204: Input the historical information, reference information, first internal factor, second internal factor, first external factor, and second external factor into the fine-tuning model.
[0102] Step 205: Determine the predicted sales volume information of the target item during the prediction period according to the output of the fine-tuning model.
[0103] Referring to the above example, the prediction period is from January 16, 2024 to January 22, 2024. The historical period is from January 1, 2024 to January 15, 2024. The historical information includes: January 1, 2024: 500; January 2, 2024: 450; January 3, 2024: 480; January 4, 2024: 520; January 5, 2024: 510; January 7, 2024: 530; January 7, 2024: 550; January 9, 2024: 560; January 10, 2024: 580; January 11, 2024: 600; January 12, 2024: 620; January 13, 2024: 630; January 14, 2024: 650; January 15, 2024: 640.
[0104] The reference information output by the basic model includes: January 16, 2024: 670; January 17, 2024: 680; January 18, 2024: 690; January 19, 2024: 700; January 20, 2024: 710; January 21, 2024: 720; January 22, 2024: 730.
[0105] The first internal factor can be: the expected out-of-stock rate from January 16 to January 22, 2024 is 3%, and the expected arrival time from January 16 to January 20, 2024 is 5 days, etc.
[0106] The first external factor can be: it is expected to rain on January 20, 2024, and the sales volume of category X to which item A belongs will decrease when it has been raining all the time.
[0107] The second internal factor can be: the out-of-stock rate from January 1 to January 15, 2024 is 3%, and the damaged goods rate from January 1 to January 15, 2024 is 1%, etc.
[0108] The second external factor can be: there was also light rain on January 2, 2024 and January 5, 2023 in history. 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 result of the fine-tuning model can be in the following form: 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.
[0109] Step 206: Determine the predicted inventory information of the target item for the preset time period according to the predicted sales volume information.
[0110] In the solution of the embodiment of the present invention, the first external factor of the target item in the prediction time period and the second external factor in the historical time period are determined respectively. According to the historical information, reference information, the first external factor and the second external factor of the target item, the predicted sales volume information of the target item in the prediction time period is determined. By combining the first external factor of the target item in the prediction time period and the second external factor in the historical time period, more data can be referred to by the fine-tuning model, and the finally obtained predicted sales volume information is more accurate.
[0111] In an embodiment of the present invention, before determining the historical information and the prediction period of the target item, it further includes: generating a plurality of first samples of the target item according to 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; using the plurality of first samples to train the basic model.
[0112] The existing information of the target item is stored in the system. Both the first historical information and the first prediction information are obtained from the existing information. The first historical information corresponds to the first historical period, the first prediction information corresponds to the first prediction period, and the first historical period corresponds to the first prediction period. Using the plurality of first samples to train the basic model can make the prediction accuracy of the basic model higher.
[0113] For example, the existing information of the target item from January 1, 2023 to December 31, 2023 is stored in the system. It is necessary to predict the sales information of the target item in the next 3 days based on the historical information of the target item in a 7-day historical period. The existing information from January 1, 2023 to January 7, 2023 can be used as the historical information; and then the existing information from January 8, 2023 to January 10, 2023 can be used as the prediction information to generate the first sample. Similarly, the existing sales information from January 3, 2023 to January 9, 2023 can be used as the historical information; and then the existing sales information from January 10, 2023 to January 12, 2023 can be used as the prediction information to generate another first sample.
[0114] In an embodiment of the present invention, before determining the historical information and the prediction period of the target item, it further includes: generating a plurality of second samples of the target item according to 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; using the plurality of second samples to train the initial model; generating a plurality of third samples of the target item; wherein, the third sample includes: the third historical information of the target item, the third prediction information corresponding to the third historical information, the internal factors corresponding to the third prediction information, the external factors corresponding to the third prediction information, and the third prediction information corresponding to the third historical information; the third reference sales information is obtained by using the basic model; using the plurality of third samples to train the trained initial model to obtain a fine-tuned model.
[0115] The training of the fine-tuning model is divided into two stages. In the first stage, the initial model is directly trained with the second sample. The second sample does not consider the relevant influencing factors affecting sales volume. In the second stage, the initial model trained in the first stage is trained using the third sample. The third sample takes into account the relevant factor information affecting sales volume. Through the model training in the two stages, not only can the training efficiency of the model be improved, but also the prediction accuracy of the final fine-tuning model can be made higher.
[0116] In the first stage, both the second historical information and the second predicted sales volume information are obtained from the existing information. The second historical information corresponds to the second historical period, the second predicted sales volume information corresponds to the second predicted period, and the second historical period corresponds to the second predicted period.
[0117] For example, there is existing information of the target item from January 1, 2023 to December 31, 2023 in the system. It is necessary to predict the sales volume information of the target item in the next 3 days based on the historical information of the target item in a 7-day historical period. The existing information from January 1, 2023 to January 7, 2023 can be used as the historical information; and then the existing information from January 8, 2023 to January 10, 2023 can be used as the predicted sales volume information to generate the second sample. Similarly, the existing information from January 3, 2023 to January 9, 2023 can be used as the historical information; and the existing information from January 10, 2023 to January 12, 2023 can be used as the predicted sales volume information to generate another second sample.
[0118] In the second stage, in the process of generating the third sample, first obtain the third historical information and the third predicted sales volume information corresponding to the third sample from the existing information. The determination methods of the third historical information and the third predicted sales volume information are the same as those of the second historical information and the second predicted sales volume information of the second sample. Input the third historical information into the basic model, and according to the output of the basic model, obtain the third reference sales volume information corresponding to the third sample. Determine the internal factors and external factors corresponding to the predicted sales volume information of the third sample. Finally, combine the third historical information, the third reference sales volume information, the internal factors, the external factors and the third predicted sales volume information corresponding to the third sample to generate the third sample.
[0119] In an embodiment of the present invention, it further includes: determining whether there are the first internal factor and the first external factor of the target item in the prediction period; in response to the non-existence of the first internal factor and the first external factor, determining the reference information as the predicted sales volume information of the target item in the prediction period.
[0120] Before calling the fine-tuned model, first determine whether there are the first internal factor and the first external factor of the target item during the prediction period. If the first internal factor and the first external factor do not exist, directly determine the reference information as the predicted sales volume information of the target item during the prediction period. If the first internal factor and the first external factor exist, call the fine-tuned model to determine the predicted sales volume information of the target item during the prediction period.
[0121] Figure 3 It is a schematic diagram of the process of an inventory prediction method provided by another embodiment of the present invention. As Figure 3 shown, the method includes:
[0122] Step 301: Determine the historical information of the target item during the historical period and the prediction period.
[0123] Step 302: Input the historical information and the prediction period into the basic model, and determine the reference information of the target item during the prediction period according to the output of the basic model.
[0124] Step 303: Determine the first internal factor and the first external factor of the target item during the prediction period.
[0125] Step 304: Input the historical information, the reference information, the first internal factor and the first external factor into the fine-tuned model.
[0126] Step 305: Determine the predicted sales volume information of the target item during the prediction period according to the output of the fine-tuned model.
[0127] Step 306: Determine the replenishment constraint information of the target item.
[0128] Step 307: Generate the replenishment quantity of the target item according to the replenishment constraint information and the predicted sales volume information.
[0129] The replenishment constraint information may include: replenishment quantity upper limit, safety stock, existing inventory, etc. According to business requirements, based on the replenishment constraint information, multiple replenishment constraint conditions are set. For example, the replenishment quantity cannot exceed the replenishment quantity upper limit, and the inventory after replenishment cannot be lower than the safety stock.
[0130] Generate the replenishment quantity of the target item according to the replenishment constraint information and the predicted sales volume information. Specifically, the predicted sales volume information can be added with the safety stock and subtracted by the existing inventory to obtain the predicted replenishment quantity. If the predicted replenishment quantity exceeds the replenishment quantity upper limit, the excess over the replenishment quantity upper limit is determined as the replenishment quantity.
[0131] In the solution of the embodiment of the present invention, after determining the predicted sales volume information of the target item during the prediction period, generating the replenishment quantity of the target item according to the replenishment constraint information and the predicted sales volume information can make the finally obtained replenishment quantity more in line with the actual sales needs and reduce the item turnover and warehouse management costs.
[0132] Figure 4 It is a schematic diagram of the process of a method for determining the replenishment quantity provided by an embodiment of the present invention. As Figure 4 shown, the original data can be the existing information of the target item stored in the system. The basic model includes: a time series encoder and a time series decoder. The fine-tuning model uses an LLM (Large Language Model). The process of calling the fine-tuning model is the process of performing simple fine-tuning on the pre-trained large model. In this process, the input new text can include: item basic information, historical information, etc. The fine-tuning model is obtained by fine-tuning the trained initial model, and the trained initial model is fine-tuned to make the fine-tuned initial model adaptable to the application scenario of sales volume prediction.
[0133] Perform a first preprocessing on the original data to generate the historical information of the target item, and the historical information adopts a time series structure. The time series structure includes: historical time and the sales volume information corresponding to this historical time.
[0134] Input the historical information into the basic model to obtain the reference information of the target item. The reference information adopts a time series structure. The time series structure includes: prediction time and the sales volume information corresponding to this prediction time.
[0135] Perform a second preprocessing on the original data to generate the text of the target item. The text includes the historical information of the target item, etc. Determine the first internal factors of the target item during the prediction period, such as out-of-stock rate, damaged goods rate and other factor information. Determine the first external factors of the target item during the prediction period, such as marketing promotion, weather and other factor information. Combine the historical information, reference information, first internal information and first external factors in the text to generate a new text. Input the new text into the fine-tuning model to obtain the predicted sales volume information of the target item during the prediction period. Finally, based on the predicted sales volume information and the replenishment algorithm, obtain the replenishment quantity of the target item.
[0136] Figure 5 It is a schematic structural diagram of a sales volume prediction device provided by an embodiment of the present invention. As Figure 5 shown, the device includes:
[0137] An information determination module 501, configured to determine the historical information and the prediction period of the target item in the historical period;
[0138] A first input module 502, configured 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 according to the output of the basic model;
[0139] A factor determination module 503, configured to determine the first internal factors and the first external factors of the target item in the prediction period;
[0140] A second input module 504 for inputting historical information, reference information, a first internal factor, and a first external factor into a fine-tuning model;
[0141] A sales volume determination module 505 for determining predicted sales volume information of a target item during a prediction period according to the output of the fine-tuning model;
[0142] An inventory determination module 506 for determining predicted inventory information of the target item corresponding to a preset period according to the predicted sales volume information.
[0143] Optionally, the second input module 504 is specifically configured to:
[0144] Determine a second internal factor and a second external factor of the target item during a historical period;
[0145] Input historical information, reference information, a first external factor, a second internal factor, and a second external factor into the fine-tuning model.
[0146] Optionally, it further includes:
[0147] A training module for generating multiple first samples of the target item according to the existing information of the target item; wherein, the first sample includes: the first historical information of the target item and the first predicted information corresponding to the first historical information;
[0148] Use the multiple first samples to perform model training on a basic model.
[0149] Optionally, it further includes:
[0150] A training module for generating multiple second samples of the target item according to the existing information of the target item; wherein, the second sample includes: the second historical information of the target item and the second predicted information corresponding to the second historical information;
[0151] Use the multiple second samples to perform model training on an initial model;
[0152] Generate multiple third samples of the target item; wherein, the third historical information of the target item, the third reference information corresponding to the third historical information, the internal factor corresponding to the third historical information, the external factor corresponding to the third predicted information, and the third predicted information corresponding to the third predicted information; the third reference information is obtained by using the basic model;
[0153] Use the multiple third samples to perform model training on the trained initial model to obtain a fine-tuning model.
[0154] Optionally, it further includes:
[0155] A replenishment quantity determination module for determining replenishment constraint information of the target item;
[0156] Generate the replenishment quantity of the target item according to the replenishment constraint information and the predicted sales volume information.
[0157] Optionally, the sales volume determination module 505 is further configured to:
[0158] Determine whether there are a first internal factor and a first external factor of the target item during the prediction period;
[0159] In response to the absence of the first internal factor and the first external factor, determine the reference information as the predicted sales volume information of the target item during the prediction period.
[0160] An embodiment of the present invention provides an electronic device, including:
[0161] One or more processors;
[0162] A storage device for storing one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the methods of any of the above embodiments.
[0163] An embodiment of the present invention provides a computer program product, including a computer program, which when executed by a processor, implements the methods of any of the above embodiments.
[0164] Next, refer to Figure 6 , which shows a schematic structural diagram of a computer system 600 of a terminal device suitable for implementing the embodiments of the present invention. Figure 6 The terminal device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0165] As Figure 6 shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage section 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0166] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, 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, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as required. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as required so that a computer program read out therefrom is installed into the storage section 608 as required.
[0167] Specifically, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, the above-described functions defined in the system of the present invention are executed.
[0168] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can 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. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can 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 can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0169] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks can occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0170] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, they 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. Among them, the names of these modules do not constitute a limitation to the modules themselves in some cases. For example, the information determination module can also be described as "a module for determining the historical information of the target item in the historical period and the prediction period".
[0171] As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium can be included in the device described in the above embodiments; it can also exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes:
[0172] Determine the historical information of the target item in the historical period and the prediction period;
[0173] Input the historical information and the prediction period into a basic model, and determine the reference information of the target item in the prediction period according to the output of the basic model;
[0174] Determine the first internal factor and the first external factor of the target item in the prediction period;
[0175] Input the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuning model;
[0176] Determine the predicted sales volume information of the target item in the prediction period according to the output of the fine-tuning model;
[0177] Determine the predicted inventory information of the target item corresponding to a preset period according to the predicted sales volume information.
[0178] According to the technical solution of the embodiment of the present invention, first, according to the historical information of the target item, the reference information of the target item in the prediction period is determined. Then, the historical information, reference information, first internal factor and first external factor of the target item are input into the fine-tuning model to obtain the predicted sales volume information of the target item in the prediction period. Among them, the first internal information is the attribute information related to the transportation or loading of the target item. The first internal information may include: out-of-stock rate, damaged goods rate, average arrival time, number of transport units, etc. The first external factor is the relevant factor information that has nothing to do with the target item itself and can affect the sales volume of the target item in the prediction period, such as weather factor information, sales strategy information, supplier factor information, social factor information, etc. The reference information is used to provide a basic reference for the fine-tuning model. By comprehensively considering the historical information, reference information, first internal factor and first external factor of the target item, the predicted sales volume information that meets the sales demand can be obtained. Finally, based on the predicted sales volume information of the target item, the inventory of the item in the prediction period can be accurately predicted.
[0179] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. 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 principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for inventory forecasting, characterized in that: include: Determine the historical information of the target item in the historical period and the forecast period; Inputting the historical information and the forecast period into a basic model, and determining reference information of the target item in the forecast period according to an output of the basic model; Determine a first internal factor and a first external factor of the target item in the forecast period; Inputting the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuning model; Determining predicted sales information of the target item in the predicted period according to the output of the fine-tuning model; The predicted inventory information of the target item corresponding to the preset time period is determined according to the predicted sales information.
2. The method according to claim 1, characterized in that 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 a second internal factor and a second external factor of the target object in the historical period; 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, characterized in that The step of determining the historical information of the target item in the historical period and before the forecast period also includes: Generate a plurality of first samples of the target item according to the existing information of the target item; wherein the first samples include: first historical information of the target item and first prediction information corresponding to the first historical information; The basic model is trained using the multiple first samples.
4. The method according to claim 1, characterized in that The step of determining the historical information of the target item in the historical period and before the forecast period also includes: Generate a plurality of second samples of the target object according to the existing information of the target object; wherein the second samples include: second historical information of the target object and second prediction information corresponding to the second historical information; Using the multiple second samples, performing model training on the initial model; Generate a plurality of 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 basic model; The trained initial model is trained using the multiple third samples to obtain the fine-tuning model.
5. The method according to claim 1, characterized in that After determining the predicted sales information of the target item in the predicted period according to the output of the fine-tuning model, the method further includes: Determining replenishment constraint information of the target item; The replenishment quantity of the target item is generated according to the replenishment constraint information and the predicted sales information.
6. The method according to claim 1, characterized in that Also includes: Determine whether the target item has a first internal factor and a first external factor in the forecast period; 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 in the predicted period.
7. An inventory forecasting device, characterized in that: include: An information determination module, used to determine the historical information of the target item in the historical period and the predicted period; A first input module, used to input the historical information and the forecast period into a basic model, and determine the reference information of the target item in the forecast period according to the output of the basic model; A factor determination module, used to determine a first internal factor and a first external factor of the target item in the prediction period; a second input module, configured to input the historical information, the reference information, the first internal factor, and the first external factor into a fine-tuning model; A sales volume determination module, configured to determine the predicted sales volume information of the target item in the predicted period according to the output of the fine-tuning model; The inventory determination module is used to determine the predicted inventory information of the target item corresponding to the preset time period according to the predicted sales information.
8. An electronic device, characterized in that: include: one or more processors; a 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 according to any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Inventory prediction method and device
CN106897795A
Big data sales forecasting method for household appliance industry
CN109214601A
Commodity sales volume prediction method and device based on Transformer + LSTM neural network model
CN111626764A
Training method and device of sales volume prediction model, electronic equipment and storage medium
CN113723985A
Product sales volume prediction method and device, equipment and medium
CN119006032A
Cited By
Inventory prediction method and apparatus
WO2026166138A1