Sales forecast model training method, device, electronic device, and storage medium

By generating training sample sets and adjusting models, the problem of lack of historical sales data is solved, and the accurate sales forecast of single-category target products is achieved, ensuring the accuracy and accuracy of the prediction.

CN113723985BActive Publication Date: 2025-01-17JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110242143.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-04
Publication Date
2025-01-17
Estimated Expiration
2041-03-04

AI Technical Summary

Technical Problem

In some scenarios, sufficient historical sales data cannot be obtained, resulting in the sales forecasting model being unable to be effectively trained, which leads to a large deviation from the actual results of the product sales forecast.

Method used

A training method for sales prediction model is proposed. By collecting historical sales data of products from multiple categories, the training sample set is generated, the basic sales prediction model is trained, and the historical sales data adjustment model of the target product is adjusted to generate the target product target product target sales prediction model. . The method includes sliding window technology, time feature extraction, normalization of maximum and minimum historical sales, and data supplement of candidate products to ensure high accuracy of the model.

Benefits of technology

Accurate sales forecasts for single-category target products with small sample historical sales data characteristics are achieved, ensuring the accuracy and accuracy of sales forecasts, and providing an effective solution in the absence of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113723985B_ABST
    Figure CN113723985B_ABST
Patent Text Reader

Abstract

The present application proposes a method and device for training a sales forecasting model, the method comprising collecting first historical sales data of multiple categories of goods, and generating a first training sample set based on the first historical sales data; training a basic sales forecasting model based on the first training sample set to generate a target basic sales forecasting model; collecting second historical sales data of the target goods, and generating a second training sample set of the target goods based on the second historical sales data; adjusting the target basic sales forecasting model based on the second training sample set to generate a target sales forecasting model corresponding to the target goods. In the present application, the generated highly accurate target basic sales forecasting model is used as the basic forecasting model corresponding to a single category of goods, thereby realizing sales forecasting for a single category of target goods with small sample historical sales data characteristics, while effectively ensuring the accuracy and precision of the sales forecast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a training method, device, electronic device, and storage medium for a sales forecasting model. Background Art

[0002] Product sales forecasts affect the layout and control of the market to a certain extent.

[0003] In the related art, the sales forecasting method is to obtain a large amount of historical sales data according to different scenarios to realize the training of the sales forecasting model, such as the training of machine models and / or the training of deep learning models, etc. After the training of the sales forecasting model is completed, the actual product sales forecast is performed through the model.

[0004] In the implementation, many scenarios cannot obtain a large amount of historical sales data, and cannot generate training sample sets for model training. As a result, the sales forecasting models in some scenarios cannot be effectively trained, which leads to large deviations between the sales forecast results and the actual results in some scenarios.

[0005] For example, in some scenarios, it is difficult to obtain a large amount of time-granular historical sales data for a single product, and it is impossible to generate the training sample set required for the sales prediction model of a single product in this scenario, and thus it is impossible to effectively train the model, making it impossible to accurately predict the sales of the product in this scenario. Summary of the invention

[0006] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0007] To this end, the first aspect of the present application proposes a training method for a sales forecasting model.

[0008] The second aspect of the present application also proposes a training device for a sales forecasting model.

[0009] A third aspect of the present application provides an electronic device.

[0010] A fourth aspect of the present application provides a computer-readable storage medium.

[0011] A fifth aspect of the present application provides a computer program product.

[0012] In a first aspect, the present application proposes a method for training a sales forecasting model, comprising collecting first historical sales data of multiple categories of goods, and generating a first training sample set based on the first historical sales data; training a basic sales forecasting model based on the first training sample set to generate a target basic sales forecasting model; collecting second historical sales data of the target product, and generating a second training sample set for the target product based on the second historical sales data; and adjusting the target basic sales forecasting model based on the second training sample set to generate a target sales forecasting model corresponding to the target product.

[0013] In addition, the training method of the sales forecasting model proposed in the first aspect of the present application may also have the following additional technical features:

[0014] According to one embodiment of the present application, the target basic sales forecast model is adjusted based on the second training sample set, including backing up the target basic sales forecast model; based on the second training sample set, the backed up target basic sales forecast model is adjusted to generate a target sales forecast model corresponding to the target commodity.

[0015] According to one embodiment of the present application, the training method of the sales prediction model generates a training sample set in the following manner: based on a preset sliding window, the historical sales data corresponding to N time points are extracted from the collected historical sales data; the time features of the N+1th time point and the actual sales volume at the N+1th time point are extracted; the historical sales data of the N time points, the time features of the N+1th time point and the actual sales volume at the N+1th time point are used as a group of training samples in the training sample set, and the sliding window is continued to slide to a preset number of sliding times to generate the training sample set.

[0016] According to one embodiment of the present application, the training method of the sales prediction model also includes: obtaining time attribute information of the N+1 time points; encoding the N+1 time points based on the time attribute information to generate time features of the N+1 time points.

[0017] According to one embodiment of the present application, the training method of the sales prediction model also includes: extracting the maximum historical sales volume and the minimum historical sales volume from the training sample set; and normalizing the historical sales volume of each training sample in the training sample set based on the maximum historical sales volume and the minimum historical sales volume.

[0018] According to one embodiment of the present application, the training method of the sales prediction model generates historical sales data in the following manner: obtaining commodity orders, merging the commodity orders, and generating order data for any category; extracting key fields from the order data for any category, combining the data corresponding to the extracted key fields, and generating historical sales data for any category.

[0019] According to one embodiment of the present application, after generating the historical sales data of any one of the categories, it also includes: determining the sales volume of any one of the categories within a set time period based on the historical sales data of any one of the categories; in response to the sales volume within the set time period being less than a preset sales volume threshold, clearing the historical sales data of any one of the categories.

[0020] According to one embodiment of the present application, the merging of the commodity orders to generate order data for any category includes: obtaining the generation time and commodity category of the commodity order; determining a first candidate commodity order whose commodity category is consistent with any category; for any category, determining commodity orders belonging to the same time period based on the generation time of the first candidate commodity order; and merging the commodity orders belonging to the same time period to generate order data for any category.

[0021] According to one embodiment of the present application, the merging of the commodity orders to generate order data for any one of the categories includes: obtaining the commodity category and category level corresponding to the commodity order; determining a second candidate commodity order belonging to any one of the categories based on the commodity category; obtaining a target category level for any one of the categories, and filtering out second candidate commodity orders whose category level is higher than the target category level; and merging the remaining second candidate commodity orders to generate order data for any one of the categories.

[0022] According to one embodiment of the present application, the collecting of the second historical sales data of the target commodity includes: obtaining the quantity of the second historical sales data; in response to the quantity being lower than a preset quantity, obtaining candidate commodities similar to the target commodity; and selecting the historical sales data of the candidate commodities to supplement the second historical sales data.

[0023] According to one embodiment of the present application, after generating the target sales volume prediction model corresponding to the target commodity, it also includes: obtaining third historical sales data of the target commodity; obtaining time characteristics of the time point to be predicted; inputting the third historical sales data and the time characteristics of the time point to be predicted into the target sales volume prediction model, and outputting the predicted sales volume of the target commodity at the time point to be predicted.

[0024] In order to implement the sales prediction model training method proposed in the first aspect above, the second aspect of the present application also proposes a sales prediction model training device, including a first training sample set generation module, which is used to collect the first historical sales data of multiple categories of goods, and generate a first training sample set based on the first historical sales data; a model training module, which is used to train the basic sales prediction model based on the first training sample set to generate a target basic sales prediction model; a second training sample set generation module, which is used to collect the second historical sales data of the target product, and generate a second training sample set for the target product based on the second historical sales data; a model adjustment module, which is used to adjust the target basic sales prediction model based on the second training sample set to generate a target sales prediction model corresponding to the target product.

[0025] The training device for the sales forecasting model proposed in the second aspect of the present application may also have the following additional technical features:

[0026] According to one embodiment of the present application, the model adjustment module includes: a backup unit, used to back up the target basic sales prediction model; a model adjustment unit, used to adjust the backed up target basic sales prediction model based on the second training sample set to generate a target sales prediction model corresponding to the target product.

[0027] According to one embodiment of the present application, the training device of the sales prediction model also includes: a sales data acquisition module, which is used to extract the historical sales data corresponding to N time points from the collected historical sales data based on a preset sliding window; an extraction module, which is used to extract the time characteristics of the N+1th time point and the actual sales volume at the N+1 time point; a training sample set generation module, which is used to use the historical sales data of the N time points, the time characteristics of the N+1 time points and the actual sales volume at the N+1 time point as a group of training samples in the training sample set, and continue to slide the sliding window to a preset number of sliding times to generate the training sample set.

[0028] According to one embodiment of the present application, the training device of the sales prediction model also includes: a time attribute information acquisition module, used to obtain the time attribute information of the N+1 time points; an encoding module, used to encode the N+1 time points based on the time attribute information to generate the time features of the N+1 time points.

[0029] According to one embodiment of the present application, the training device of the sales prediction model also includes: an edge sales extraction module, used to extract the maximum historical sales and the minimum historical sales from the training sample set; a normalization processing module, used to normalize the historical sales of each training sample in the training sample set according to the maximum historical sales and the minimum historical sales.

[0030] According to one embodiment of the present application, the training device of the sales prediction model also includes: an order data generation module, which is used to obtain commodity orders, merge the commodity orders, and generate order data for any category; a historical sales data generation module, which is used to extract key fields from the order data of any category, combine the data corresponding to the extracted key fields, and generate historical sales data for any category.

[0031] According to one embodiment of the present application, the training device of the sales prediction model also includes: a sales acquisition module, used to determine the sales volume of any category within a set time period based on the historical sales data of any category; and a clearing module, used to clear the historical sales data of any category in response to the sales volume within the set time period being less than a preset sales threshold.

[0032] According to one embodiment of the present application, the order data generation module includes: an order information acquisition unit, used to acquire the generation time and product category of the product order; a candidate product order determination unit, used to determine a first candidate product order whose product category is consistent with any of the categories; an order determination unit, used to determine, for any of the categories, product orders belonging to the same time period based on the generation time of the first candidate product order; an order data generation unit, used to merge the product orders belonging to the same time period to generate order data for any of the categories.

[0033] According to one embodiment of the present application, the order data generation module includes: an order information acquisition unit, further used to obtain the commodity category and category level corresponding to the commodity order; a candidate commodity order determination unit, further used to determine a second candidate commodity order belonging to any of the categories based on the commodity category; an order determination unit, further used to obtain a target category level of any of the categories, and filter out second candidate commodity orders whose category level is higher than the target category level; an order data generation unit, further used to merge the remaining second candidate commodity orders to generate order data for any of the categories.

[0034] According to one embodiment of the present application, the second training sample set generation module includes: a quantity acquisition unit, used to obtain the quantity of the second historical sales data; a candidate product acquisition unit, used to obtain candidate products similar to the target product in response to the quantity being lower than a preset quantity; and a quantity supplement unit, used to select the historical sales data of the candidate products and supplement them as the second historical sales data.

[0035] According to one embodiment of the present application, the training device of the sales prediction model also includes: a third historical sales data acquisition module, used to obtain the third historical sales data of the target commodity; a time feature acquisition module, used to obtain the time feature of the time point to be predicted; and a testing module, used to input the third historical sales data and the time feature of the time point to be predicted into the target sales prediction model, and output the predicted sales of the target commodity at the time point to be predicted.

[0036] To achieve the above-mentioned purpose, the third aspect of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the training method of the sales prediction model proposed in the first aspect above.

[0037] The fourth aspect of the present application proposes a computer-readable storage medium, wherein the computer instructions are used to enable the computer to execute the training method of the sales forecasting model proposed in the first aspect.

[0038] The fifth aspect of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the training method of the sales prediction model proposed in the first aspect above.

[0039] The training method and device of the sales prediction model proposed in the present application obtain the first historical sales data according to the order record data, generate the first training sample set to train the basic sales prediction model, and generate the target basic sales prediction model. The second historical sales data of the target commodity is obtained according to the order record data, and the second training sample set is generated to train the target basic sales prediction model, and generate the target sales prediction model corresponding to the target commodity. In the present application, the generated high-precision target basic sales prediction model corresponding to all categories can be used as the basic prediction model of the target sales prediction model corresponding to each single category commodity. According to the difference of each single category commodity, the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is realized. At the same time, the target basic sales prediction model corresponding to all categories as the basis has a high-precision prediction function, so that the accuracy and precision of the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is effectively guaranteed.

[0040] It should be understood that the contents described in this application are not intended to identify the key or important features of the embodiments of this application, nor are they intended to limit the scope of this application. Other features of this application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0042] Figure 1 A flowchart of a sales forecasting model training method according to an embodiment of the present application;

[0043] Figure 2 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0044] Figure 3 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0045] Figure 4 A flowchart of a method for generating a sales forecast model training sample set according to another embodiment of the present application;

[0046] Figure 5 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0047] Figure 6 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0048] Figure 7 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0049] Figure 8 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0050] Fig. 9 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0051] Fig.10 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0052] Fig.11 A flowchart of a sales forecasting model training method according to another embodiment of the present application;

[0053] Fig.12 A flowchart of a sales forecasting model testing method according to another embodiment of the present application;

[0054] Fig.13 A schematic diagram of a method for generating training samples for a sales forecast model according to another embodiment of the present application;

[0055] Fig.14 A schematic diagram of a method for generating test samples for a sales prediction model according to another embodiment of the present application;

[0056] Fig.15 This is a schematic diagram of the structure of a sales forecast model training device according to an embodiment of the present application;

[0057] Fig.16 This is a structural schematic diagram of a sales forecast model training device according to another embodiment of the present application;

[0058] Fig.17 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0059] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0060] The following describes the training method, device, electronic device and storage medium of the sales forecasting model of the embodiment of the present application with reference to the accompanying drawings.

[0061] Figure 1 FIG. 1 is a flow chart of a sales forecasting model training method according to an embodiment of the present application. Figure 1 As shown, the training method of the sales prediction model includes:

[0062] S101, collecting first historical sales data of multiple categories of goods, and generating a first training sample set based on the first historical sales data.

[0063] E-commerce platforms can classify commodities into categories based on the existing market's general understanding of commodity types, and set relevant information about commodity categories as a dimension of commodity description information. Among them, the relevant information about commodity categories may include the name of each commodity category, the code of each commodity category, the details of commodity types that each commodity category can include, etc. When a commodity is put on the shelf, the commodity category to which the commodity belongs can be determined based on the relevant information about the set commodity category.

[0064] The e-commerce platform displays goods to the outside world, and when the purchase of goods is completed, a sales data of the goods can be generated. In an embodiment of the present application, before the training of the sales prediction model begins, the first historical sales data of multiple categories of goods can be extracted from the database. It should be noted that the multiple categories can be all categories, or categories with higher sales among all categories, to ensure that the training of the sales prediction model can obtain sufficient effective training sample data. For example, the first historical sales data of commodity categories with daily sales of less than 800 can be cleared.

[0065] The first historical sales data may include the user's order date, order time, product category, product order quantity, and order amount. Optionally, the first historical sales data of the product category may be obtained based on the category identifier of the product category, and the first historical sales data of multiple categories within a set time range may be obtained to ensure the accuracy of model training.

[0066] Further, after obtaining the first historical sales data, the first historical sales data may be preprocessed. Optionally, the first historical sales data may be cleaned, merged, converted, etc., wherein the preprocessing of the first historical sales data may include one or more of the above operations. Further, feature extraction is performed on the preprocessed first historical sales data to obtain a first training sample set.

[0067] S102: Training a basic sales prediction model based on a first training sample set to generate a target basic sales prediction model.

[0068] In an embodiment of the present application, a basic sales forecasting model is pre-constructed, and training parameters of the basic sales forecasting model are pre-configured, such as the number of training times, training step length, training error at the end, etc.

[0069] Optionally, the basic sales prediction model can be a ridge regression model (Ridge), a composite tree model (XGBoost, XGB), a neural network model (Neural Networks, NN), a meta-learning model (MetaLearning, MAML), etc.

[0070] In an embodiment of the present application, the first training sample set is input into the basic sales prediction model for training. During each training process, the loss function can be calculated based on the training error, and the model gradient can be obtained. Based on the obtained model gradient, the model parameters of the basic sales prediction model output by the current round of training are adjusted until the end conditions of the model training are met, thereby generating a target basic sales prediction model.

[0071] For example, the model training end condition can be set to use the number of training rounds as the judgment standard, and the preset number of training rounds can be set in advance. When the number of training rounds is the same as the preset number of training rounds, it can be determined that the entire model training process is completed, and the target basic sales forecast model can be generated.

[0072] For another example, the end condition of model training can be set to use the error degree of the model output result as the judgment standard, pre-set the upper limit of the error of the model output result after the training process is completed, and compare the error of the model output result of the current round of training with the preset upper limit of error. If the error of the model output result of the current round of training is less than the preset upper limit of error, it can be determined that the entire model training process is completed, and the target basic sales forecast model can be generated.

[0073] S103: Collect second historical sales data of the target commodity, and generate a second training sample set of the target commodity based on the second historical sales data.

[0074] In an embodiment of the present application, the second historical sales data of a single category of goods can be extracted from the database. It should be noted that the second historical sales data needs to be extracted for each category of goods in all categories to ensure that the sales prediction model can obtain training sample data for each category of goods in all categories, thereby achieving the effect that each single category of goods can have a corresponding sales prediction model.

[0075] The second historical sales data may include the user's order date, order time, product category, product order quantity, order amount, etc. Optionally, the second historical sales data of the product category may be obtained based on the category identifier of the product category, and the second historical sales data within a set time range in each product category may be obtained to ensure the accuracy of model training.

[0076] Further, after obtaining the second historical sales data, the second historical sales data may be preprocessed. Optionally, the obtained second historical sales data may be subjected to data cleaning, data merging, data conversion and other operations, wherein the preprocessing process for the second historical sales data may include one of the above operations or two or more of the above operations. Further, feature extraction is performed on the preprocessed second historical sales data to obtain a second training sample set of the target product.

[0077] S104: Based on the second training sample set, the target basic sales prediction model is adjusted to generate a target sales prediction model corresponding to the target product.

[0078] In the embodiment of the present application, the target basic sales forecast model is used as the basic model, and the corresponding training parameters are configured. Based on the training parameters of the target basic sales forecast model, the second training sample set is input into the target basic sales forecast model for adjustment until the end condition of the model adjustment is met, and the target sales forecast model corresponding to the target product is generated. The training process of the target sales forecast model corresponding to the target product, that is, the adjustment process of the target basic sales forecast model, is similar to the training process of generating the target basic sales forecast model, and will not be repeated here.

[0079] The training method of the sales prediction model proposed in the present application obtains the first historical sales data according to the order record data, generates a first training sample set to train the basic sales prediction model, and generates a target basic sales prediction model. The second historical sales data of the target commodity is obtained according to the order record data, and a second training sample set is generated. The target basic sales prediction model is adjusted to generate a target sales prediction model corresponding to the target commodity. In the present application, the generated high-precision target basic sales prediction model corresponding to all categories can be used as the basic prediction model of the target sales prediction model corresponding to each single category commodity. According to the difference of each single category commodity, the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is realized. At the same time, the target basic sales prediction model corresponding to all categories as the basis has a high-precision prediction function, so that the accuracy and precision of the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is effectively guaranteed.

[0080] Figure 2 FIG. 1 is a flow chart of a sales forecasting model training method according to another embodiment of the present application. Figure 2 As shown, the training method of the sales prediction model includes:

[0081] S201, collecting first historical sales data of multiple categories of goods, and generating a first training sample set based on the first historical sales data.

[0082] S202: Train a basic sales prediction model based on a first training sample set to generate a target basic sales prediction model.

[0083] S203: Collect second historical sales data of the target commodity, and generate a second training sample set of the target commodity based on the second historical sales data.

[0084] For steps S201 to S203, please refer to the above-mentioned related details, which will not be repeated here.

[0085] S204, backing up the target basic sales forecast model.

[0086] In the embodiment of the present application, the target basic sales forecast model is a model that can realize the sales forecast of all categories of goods, and is the basic model generated by the target basic sales forecast model corresponding to the single category target goods. In order to make the target basic sales forecast model usable multiple times and prevent it from being adjusted by a certain category of goods and thus being unusable by other categories of goods, the target basic sales forecast model needs to be backed up.

[0087] S205: Based on the second training sample set, the backup target basic sales prediction model is adjusted to generate a target sales prediction model corresponding to the target product.

[0088] For step S205, please refer to the relevant details of the above step S104, which will not be repeated here.

[0089] Obtain the second historical sales data of any target commodity, generate a second training sample set based on the second historical sales data, and adjust the backup target basic sales prediction model based on the second training sample set to generate an adjustment of the target sales prediction model for the target commodity.

[0090] To better understand the above embodiments, Figure 3 ,like Figure 3As shown, a target basic sales prediction model is trained through the first training sample set corresponding to multiple categories of goods. Furthermore, a backup can be performed for each target product, that is, once for each of product A, product B and product C, to obtain three backup target basic sales prediction models, and then the backup target basic sales prediction model is adjusted based on the second training sample set corresponding to product A, and then the target sales prediction model A for product A can be obtained. Similarly, the backup target basic sales prediction model can be adjusted based on the second training sample set corresponding to product B, and then the target sales prediction model B for product B can be obtained; similarly, the backup target basic sales prediction model can be adjusted based on the second training sample set corresponding to product C, and then the target sales prediction model C for product C can be obtained. The backup process is the process of migrating the target basic sales prediction model, and the parameters and performance of the model can be migrated to the target product for use.

[0091] The training method of the sales forecast model proposed in the present application first trains a target basic sales forecast model based on a first training sample set formed by multiple categories, and backs up the target basic sales forecast model, and then adjusts the backup target basic sales forecast model based on the second training sample set of the target commodity to generate a target sales forecast model corresponding to the target commodity. In the present application, the generated high-precision target basic sales forecast model corresponding to all categories can be used as the basic forecast model of the target sales forecast model corresponding to each single category of commodity. When it is necessary to predict the sales of a specific commodity, the backup target basic sales forecast model can be adjusted to ensure that the model parameters of the target basic sales forecast model remain unchanged, so that the target basic sales forecast model can be used multiple times. When the target basic sales forecast model is adjusted based on a certain commodity, the model parameters of the target basic sales forecast model will change, and the changed model is more suitable for the commodity. In order to ensure that the adjustments to the target basic sales forecast model between commodities do not affect each other, the model needs to be backed up. If no backup is performed, when the target basic sales forecast model is used to adjust the sales forecast model based on other products, the basic target sales forecast model used is a model adjusted based on a certain product. In this case, the forecast effect and accuracy of the adjusted sales forecast model are low.

[0092] To better understand the method for generating the first training sample set based on the first historical data and the second training sample set based on the second historical sales data proposed in the above embodiment, Figure 4 As shown, Figure 4 This is a flow chart of a method for generating a sales prediction model training sample set according to another embodiment of the present application. The method for generating a training sample set includes:

[0093] S401, based on a preset sliding window, extracting historical sales data corresponding to N time points from the collected historical sales data.

[0094] The sliding window can obtain the order record data corresponding to different time points from the order record data.

[0095] The size of the sliding window can determine the number of corresponding time points of the collected historical data.

[0096] In the implementation, the size of the sliding window is set according to the demand, and based on the sliding window of the preset size, it slides in the collected historical sales data to obtain the historical sales data corresponding to N time points.

[0097] For example, setting the sliding window size to 30 units, when using the sliding window to extract data from the collected historical sales data, you can obtain historical sales data corresponding to 30 time points, such as the historical sales data corresponding to 30 consecutive natural days from December 1, 2020 to December 30, 2020.

[0098] For another example, when the sliding window size is set to 7 units, when using the sliding window to extract data from the collected historical sales data, the historical sales data corresponding to 7 time points can be obtained, such as the historical sales data corresponding to 7 consecutive natural days from December 1, 2020 to December 7, 2020.

[0099] S402, extracting the time features at the N+1th time point and the actual sales volume at the N+1th time point.

[0100] In general, the time characteristics of a time point are often factors that affect the actual sales at that time point. For example, if the time point is a holiday or a specific promotion day, the actual sales are often higher than the daily sales. In the embodiment of the present application, time characteristics can be extracted, such as year, month, day, whether it is a promotion day, and other related information.

[0101] In an embodiment of the present application, after determining the N+1th time point, the historical sales data corresponding to the N+1th time point can be obtained, and then the actual sales volume corresponding to the N+1th time point can be extracted, and at the same time, the time features corresponding to the N+1th time point can be extracted.

[0102] Still taking the above example, set the N+1 time point to December 31, 2020. The sliding window obtains the historical sales data up to December 31, 2020 based on the time point. At the same time, the time features extracted to that time point are 2020, December, 31st, Thursday, New Year's Day promotion day, and other related information.

[0103] S403, taking the historical sales data at N time points, the time features at N+1 time points and the actual sales volume at N+1 time points as a set of training samples in a training sample set, and continuing to slide the sliding window to a preset number of sliding times to generate a training sample set.

[0104] In an embodiment of the present application, historical sales data at N time points, time features at N+1 time points, and actual sales at N+1 time points are used as a group of training samples in a training sample set.

[0105] According to the historical sales data at N time points, combined with the operation rules of the basic sales forecasting model and the time characteristics of the N+1 time point, the sales volume of the product at the N+1 time point is predicted, and the predicted sales volume of the product sales forecast is output. The predicted sales volume of the output sales forecasting model is compared with the actual sales volume corresponding to the N+1 time point obtained, and the model parameters of the basic sales forecasting model are adjusted according to the accuracy and deviation of the comparison results, so that the predicted sales volume of the basic sales forecasting model at the N+1 time point can be as close as possible to the actual sales volume at the N+1 time point, so as to complete the current round of training of the basic sales forecasting model.

[0106] In order to achieve better training results and make the predicted sales of the basic sales prediction model infinitely close to the actual sales, it is necessary to conduct model training and adjustment based on training samples multiple times. According to the basic sales prediction model's demand for the number of training sample sets, the preset number of sliding windows is set, and the preset number of sliding windows determines the number of training samples in the training sample set. Each time the sliding window is slid, a set of training samples combining historical sales data at N time points, time features at N+1 time points, and actual sales at N+1 time points can be obtained.

[0107] In order to obtain more training samples and generate sufficient sample data for training or adjusting the sales forecasting model, it is necessary to repeatedly slide the sliding window to a preset number of times, so as to obtain the training samples corresponding to the preset number of times, and combine the training samples corresponding to the preset number of times to obtain the corresponding training sample set.

[0108] For example, the sliding window size is set to 30 units, the sliding window preset sliding times is 100 times, and the sliding window is repeatedly slid to obtain historical sales data corresponding to 30 time points, a total of 100 groups. Each group of historical sales data constitutes a training sample, and all 100 groups of historical sales data constitute a training sample set.

[0109] The training method of the sales forecasting model proposed in this application obtains the historical sales data corresponding to N time points, the time features of the N+1 time point, and the actual sales data corresponding to the N+1 time point through a sliding window, and combines the three sets of data into a training sample. The number of sliding window slides is preset, and the number of training samples corresponding to the number of sliding times is obtained, and then a training sample set is generated. In this application, the acquisition of data corresponding to each time point and the extraction of time features are realized through a sliding window, which ensures the effective generation of training samples, and then generates a training sample set that can provide correct and effective training data, realizing efficient training of the basic sales forecasting model.

[0110] To better understand the method for generating a training sample set proposed in the above embodiment, Figure 5 , Figure 5 FIG. 1 is a flow chart of a sales forecasting model training method according to another embodiment of the present application. Figure 5 As shown, the method includes:

[0111] S501, obtaining time attribute information of N+1 time points.

[0112] In the embodiment of the present application, time attribute information of N+1 time points can be obtained through a sliding window, such as year, month, day, week, etc. The recording format of the time attribute information in the order record can be set, and the filtering condition can be determined according to the preset format, and the time attribute information corresponding to the time point can be obtained according to the filtering condition.

[0113] For example, if the record format of the time attribute information in the order record information is set to Thursday, January 28, 2021, you can set "year" as the keyword, and the filtering rule is that the number immediately before the "year" keyword is the year of the order, then the year time attribute information obtained at that time point is "2021". You can set "week" as the keyword, and the filtering rule is that the number immediately after the "week" keyword is the day of the week to which the order was generated, then the week time attribute information obtained at that time point is "Thursday".

[0114] S502, encoding N+1 time points based on the time attribute information to generate time features of the N+1 time points.

[0115] In order to ensure the effectiveness of the sales forecasting model in different time scenarios and make the historical sales data at different time points effectively applicable to the basic sales forecasting model, it is necessary to encode the time attribute information in the training sample set. The time attribute information of the N+1 time points obtained can be encoded in a unified manner to generate the time features corresponding to the N+1 time points.

[0116] For example, if the encoding method adopts the one-hot encoding rule, and the weekly time attribute information of one of the N+1 time points is "Monday", then "Monday" is encoded according to the one-hot encoding rule, and the time feature encoded as 1000000 is generated. For another example, if the weekly time attribute information of one of the N+1 time points is "Wednesday", then "Wednesday" is encoded according to the one-hot encoding rule, and the time feature encoded as 0010000 is generated.

[0117] Different encoding formats can be set according to different value ranges of different time attribute information, such as the value range of the month is 0 to 12, the value range of the day is 1 to 31, the value range of the week is 1 to 7, etc. Each value can be mapped into a vector, with the corresponding position being 1 and the remaining positions being 0. For example, when the month is March, "3" is mapped into a vector. Still taking one-hot encoding as an example, according to the rules of one-hot encoding, a monthly time feature of 001000000000 can be generated.

[0118] The training method of the sales forecast model proposed in this application obtains the time attribute information of N+1 time points, and uniformly encodes the time attribute information according to the set encoding rules to generate the time features corresponding to the N+1 time points. In this application, by setting a unified encoding rule for the time attribute information, the time features generated by the time attribute information corresponding to each time point are unified, thereby ensuring the effectiveness of the training of the sales forecast model.

[0119] Figure 6 FIG. 1 is a flow chart of a sales forecasting model training method according to another embodiment of the present application. Figure 5 As shown, the training method of the sales prediction model includes:

[0120] S601, extracting the maximum historical sales volume and the minimum historical sales volume from the training sample set.

[0121] Historical sales data is a continuous variable. There are large differences in the historical sales data of different commodity categories and in different time ranges.

[0122] In an embodiment of the present application, the sales data in the training sample set may be sorted by size, and then the maximum historical sales data and the minimum historical sales data may be extracted.

[0123] S602, normalizing the historical sales volume of each training sample in the training sample set according to the maximum historical sales volume and the minimum historical sales volume.

[0124] In the embodiment of the present application, in order to meet the requirements of the activation function of the neural network, it is necessary to normalize the historical sales data with large differences, so as to normalize the historical sales data to within a set range.

[0125] In the implementation, the neural network model is highly sensitive to different dimensions, and the value range of the activation function of the neural network is generally -1 to 1. Therefore, it is necessary to use the minimum and maximum normalization method (MinMaxScaler) for the characteristics of the historical sales data. The implementation method is as follows:

[0126]

[0127] Among them, x min ,x max They represent the maximum and minimum historical sales data of the corresponding dimensions respectively.

[0128] The sales forecast model training method proposed in the embodiment of the present application extracts the maximum historical sales data and the minimum historical sales data, and based on the requirements of the activation function of the neural network, normalizes the characteristics of the historical sales data to reduce the differences between the historical sales data and improve the effectiveness of the sales forecast model training.

[0129] To better understand the method for extracting and generating historical sales data proposed in the above embodiment, Figure 7 , Figure 7 FIG. 1 is a flow chart of a sales forecasting model training method according to another embodiment of the present application. Figure 7 As shown, the method includes:

[0130] S701, obtaining product orders, merging the product orders, and generating order data for any category.

[0131] In order to generate a sample set that can provide effective training for the sales forecasting model, it is necessary to extract historical sales data from the order record data as the data basis for generating training samples. Product orders are generated when users place orders on the platform. Product orders may include the user's order date, order time, product category, product order quantity, order amount, whether there is a discount, coupon type, discount amount, etc. After the product order is generated, it can be stored in the set location of the platform.

[0132] In the embodiment of the present application, according to the set screening conditions, the set location of the commodity order storage is screened to obtain the original commodity order, and the obtained original commodity orders are merged to generate order data of any category.

[0133] In the implementation, the time attribute information and the product category attribute information of the product order can be used as the set filtering conditions, and the time attribute information of the product order can be used as the keyword to filter out the original orders of all categories of products within the set time range at the set position, and then the product category information can be used as the keyword to filter again to obtain the original product orders of any category. The obtained original product orders of any category can be merged to generate order data of any category.

[0134] Among them, the original product orders obtained are order record data of the same format stored separately. It is necessary to merge the obtained separate original product orders to generate order data of any category. For example, taking the time attribute dimension as an example, the time granularity of the product order production time can be accurate to minutes or seconds. Therefore, the product orders obtained within the set time range can generate multiple separately stored product order records due to different generation times. The product order records are merged to generate order data.

[0135] As a possible way to achieve this, Figure 8 As shown, from the time dimension, the method for merging product orders and generating order data for any category is as follows:

[0136] S7011, obtain the generation time and product category of the product order.

[0137] In the embodiment of the present application, the time when the commodity order is generated and the commodity category can be obtained according to the attribute information contained in the commodity order. The time attribute information contained in the commodity order is the time when the commodity order is generated.

[0138] In the implementation, a fixed recording format of all information contained in the product order and the sorting position in the product order information can be set, so that the product orders of all products on the platform are recorded and stored in the same format, wherein the attribute information corresponding to the same field in all product orders is in the same position. The fixed recording format of time attribute information and product category information and the recording position of the two in the product order record can be obtained, and the key fields of the product order can be extracted to obtain the generation time and product category of the key field product order.

[0139] Among them, the key fields obtained, the information of product categories and the time when the product order was generated are for all categories.

[0140] S7013, determine the first candidate product order whose product category is consistent with any category.

[0141] In an embodiment of the present application, after obtaining the product category information in the product order, the product category information of any category is used as a keyword, and the keyword is extracted from the product category information in the obtained product orders of all categories to determine the product order corresponding to the product category consistent with the product category information of any category, and generate the first candidate product order.

[0142] For example, if the product category information of any category is set to "electronic product category", the obtained product category information of all categories includes the category information of all products on the platform. "Electronic product category" is used as a keyword, and a keyword extraction operation is performed in the obtained product category information of all categories, and the corresponding product orders that are consistent with the product category of "electronic product category" in the product category information of all categories are determined, and the first candidate product order of "electronic product category" is generated.

[0143] The first candidate product order of any category is all product orders of all products in any category since the start of sales.

[0144] S7015: For any category, determine the product orders that belong to the same time period according to the generation time of the first candidate product order.

[0145] In an embodiment of the present application, after the first candidate product order is generated, the time range required by the order data of any category is used as a keyword, and the product order generation time of the first candidate product order of any category obtained is filtered to obtain the product order generation time within the time range required by the order data of any category, and then the product orders within the same time range as the time range required by the order data of any category are obtained.

[0146] Still taking the first candidate product order of the "electronic product category" mentioned above as an example, after obtaining the first candidate product order of the "electronic product category" within the entire time range since the sale started, set the time range required for the order data of the "electronic product category" to 1 month, and set to obtain the product orders for each month within the three months from October to December 2020. The three time ranges of "October 2020", "November 2020" and "December 2020" can be used as keywords to filter the product order generation time in the first candidate product order, and obtain the product orders corresponding to the merchant order generation time for each month in the three-month time range from October to December 2020.

[0147] S7017, merge the product orders belonging to the same time period to generate order data for any category.

[0148] As a possible way to achieve this, Fig. 9As shown, from the commodity category dimension, the method for merging commodity orders and generating order data of any category is as follows:

[0149] S7012, obtain the product category and category level corresponding to the product order.

[0150] In the embodiment of the present application, the commodity category and category level corresponding to the commodity order can be obtained based on the attribute information contained in the commodity order.

[0151] Among them, regarding the commodity category level, in the same commodity category, the commodity category can be divided into different levels according to different classification refinement levels. After the commodity category level is set, the relevant information of each preset commodity category level and the relationship between the levels can be stored in the set location.

[0152] Taking the product categories of clothing as an example, the product categories of clothing are set to include women's clothing, men's clothing, children's clothing, etc. Among them, the product categories of women's clothing include skirts, tops, pants, suits, etc., among which skirts include one-piece dresses and half-skirts, and half-skirts can also include long skirts and short skirts, etc. According to the above example, it can be seen that there is a level relationship at the scope level between the product categories divided according to different degrees of refinement of clothing categories. The wider the range of product categories included, the higher the level of the product category. In the above example, the highest level product category is "clothing", the next level product category is "women's clothing, men's clothing, children's clothing", and the next level product category is "skirts, tops, pants, suits", and so on.

[0153] In the implementation, the fixed recording format of all information contained in the product order and the sorting position in the product order information can still be set, so that the product orders of all products on the platform are recorded and stored in the same format, wherein the attribute information corresponding to the same field in all product orders is in the same position. According to the fixed recording format in the product order and the position of each information, the product category information in the product order is obtained, and at the same time, the product category level of the product in the category is determined according to the obtained product category information.

[0154] Among them, the key fields obtained, the information of product categories and the levels of product categories include all categories.

[0155] S7014: Determine, according to the product category, a second candidate product order belonging to any category.

[0156] In the embodiment of the present application, after obtaining the product category information in the product order of all categories, the category information of any category is used as a keyword to filter the obtained product category information of all categories. Among them, the filtered result can be that the product category information is consistent with any category, or it can be that the level of the product category and any category belong to the next level or below in the same product category series. The product order corresponding to the product category information filtered by the above two results can be determined as the second candidate product order belonging to any category.

[0157] Taking the women's clothing category in the above-mentioned apparel products as an example, after obtaining the product category information of all product orders, use "women's clothing category" as the key field to filter out all the product category information, and use the product orders corresponding to the products with the product category information of "women's clothing category" as the second candidate product orders corresponding to "women's clothing category".

[0158] S7016, obtaining a target category level for any category, and filtering out second candidate product orders whose category levels are higher than the target category level.

[0159] In the embodiment of the present application, according to the relevant information of the classification of commodity categories in the same series of any category, the level relationship between the commodity categories in the series can be determined, which can be the same level or a high level and a low level.

[0160] A target category is determined among all levels of commodity categories included in any category, and the level of the target category is determined according to the refinement level of the target category and the range of commodities included. The level information of commodity categories of all orders in the second candidate commodity orders of any category is obtained, and compared with the level information of the target category, and commodity orders corresponding to commodity categories with a higher level than the target category are deleted to obtain the second candidate commodity orders of the target category level.

[0161] We can still take the above-mentioned apparel product category as an example. Any category is set as the apparel category. Therefore, all apparel product orders are obtained as the second candidate product orders. The level of the target product category is set to the second-level "dresses and suits". Therefore, among all apparel product orders, the product orders corresponding to the highest level "apparel category" and the product orders corresponding to the second-level "women's wear category, men's wear category, and children's wear category" need to be filtered out, and the product orders corresponding to the product categories with the same level as the "dresses and suits" product category or the second level and below are obtained as the second candidate product orders corresponding to the "dresses and suits" level.

[0162] S7018, merging the remaining second candidate product orders to generate order data for any category.

[0163] The method for generating order data of any category in the training method of the sales forecasting model proposed in this application is analyzed from two possible implementation methods, namely the time dimension and the product category dimension, and describes the possible generation methods of order data of any category.

[0164] It should be specially noted that the above-mentioned embodiments are applicable to the acquisition of the first historical sales data and the second historical sales data. Meanwhile, the above-mentioned embodiments are merely examples proposed in the present application and cannot be used as limitations to the present application.

[0165] S702, extract key fields from order data of any category, combine data corresponding to the extracted key fields, and generate historical sales data of any category.

[0166] In order to ensure that the training sample set generated by historical sales data can provide effective data for the training of the sales prediction model to the maximum extent, the order data can be extracted according to the needs of the training samples to generate the corresponding historical sales data.

[0167] In the implementation, the actual sales volume of goods will be affected by information such as holidays and promotional activities. During the time range of holidays and promotional activities, the actual sales volume of goods will be higher than that of normal days. In order to achieve high-precision sales prediction of the sales prediction model, the training samples required for model training need to carry sales data and time attribute information.

[0168] In the embodiment of the present application, sales data and time attribute information can be used as key fields, key fields can be extracted from the order data of any category, and the information fragments in the order data corresponding to the key fields can be combined to generate the historical sales data of any category of goods. Optionally, the keywords can also include whether there is a promotion, the category of goods, etc., which are only examples and are not specifically limited.

[0169] For example, set the extraction conditions of the key fields to sales data and time attribute information December 2020, take December 2020 and sales data as key fields, and extract the time attribute information fragments in all orders placed within the time range of December 2020 and the sales data information fragments carried by all orders placed within the time range of December 2020 from the order data of any category, combine the time attribute information fragment with the sales data information fragment, and generate the historical sales data of any category in December 2020.

[0170] The sales forecast model training method proposed in this application obtains commodity orders through set screening conditions, generates order data of any category, obtains corresponding order data through extraction of key fields, and then generates historical sales data of any category. In this application, the validity of historical sales data is guaranteed, so that the training sample set generated based on historical sales data can correctly and efficiently provide training data for sales forecast model training, thereby ensuring the training effect of sales forecast model training.

[0171] After generating the historical sales data for any category, you can Fig.10 As shown, Fig.10 This is a flow chart of a sales forecast model training method according to another embodiment of the present application. The sales forecast model training method includes:

[0172] S1001, determining the sales volume of any category within a set period of time based on the historical sales data of any category.

[0173] In the embodiment of the present application, the historical sales data of any category is obtained, the required time range is set according to the demand, and the set time range is used as the screening condition. The key field time attribute information of the historical sales data of any category is extracted, the extracted time attribute information is obtained, and the time attribute information within the set time range is screened, and the time attribute information within the set time range is obtained, and then the corresponding historical sales data of any category is obtained. At the same time, the number of extracted time attribute information can be counted, and then the sales volume of any category of goods within the set time length can be obtained.

[0174] S1002, in response to the sales volume within the set time period being less than the preset sales volume threshold, clearing the historical sales data of any category.

[0175] In order to better achieve the adjustment of the target basic sales forecast model, the sales threshold is set according to the requirements of the sample set required for model adjustment.

[0176] In an embodiment of the present application, the sales volume of any category of goods acquired within a set period of time is compared with a set sales threshold. If the sales volume of any category of goods within a set period of time is less than the set sales threshold, it can be understood that the historical sales data of any category cannot provide sufficient and effective data samples for the adjustment of the target basic sales prediction model, and therefore, it is cleared.

[0177] For example, if the lower limit of the number of sales data required by the sales prediction model is set to 800, when obtaining the first historical sales data, the historical sales data with daily sales of less than 800 can be cleared, or when obtaining the second historical sales data, the historical sales data with daily sales of less than 300 can be cleared.

[0178] The training method of the sales forecasting model proposed in this application obtains the sales volume of any category of goods within a set period of time and compares it with the preset sales volume threshold to determine whether the historical sales data of any category can provide sufficient and effective data samples for the adjustment of the target basic sales forecasting model, and clears the historical sales data of any category that cannot provide sufficient and effective data samples. In this application, by limiting the sales volume of the historical sales data of any category, the validity of the samples generated by the historical sales data of any category is guaranteed, thereby ensuring the adjustment effect of the target basic sales forecasting model.

[0179] Fig.11 FIG. 1 is a flow chart of a sales forecasting model training method according to another embodiment of the present application. Fig.11 As shown, the training method of the sales prediction model includes:

[0180] S1101, obtaining the quantity of the second historical sales data.

[0181] The second historical sales data is the order record data of a certain category of goods within a certain period of time, which can provide a data source for adjusting the training of the target basic sales prediction model.

[0182] In order to ensure that the target basic sales forecast model can be adjusted to the optimal state of the target basic sales forecast model based on the second historical sales data, so that the predicted sales of the target basic sales forecast model can be infinitely close to the actual sales, it is necessary to ensure the number of samples generated by the second historical sales data.

[0183] In an embodiment of the present application, a certain field in the second historical sales data can be extracted as a keyword, and the quantity of the second historical sales data can be obtained based on the quantity of the extracted key fields.

[0184] For example, the commodity order generation time in the second historical sales data may be extracted as a key field, and the quantity of the second historical sales data may be determined according to the quantity of the extracted commodity order generation time.

[0185] S1102 , in response to the quantity being lower than a preset quantity, obtaining candidate commodities similar to the target commodity.

[0186] In order to ensure the adjustment effect of the target sales forecast model, the preset number is set according to the minimum number of samples required for model adjustment.

[0187] In the embodiment of the present application, when the amount of the second historical sales data obtained is less than the preset amount, it can be understood that the current second historical sales data cannot provide sufficient and effective samples for adjusting the target sales prediction model. In view of this situation, an improved method that can be proposed is to compare the commodity category information to which the second historical sales data belongs with other commodity category information, and obtain commodity categories similar to the commodity category to which the second historical sales data belongs as candidate commodity categories.

[0188] For example, the second historical sales data is set to be limited edition sneakers of brand A, the preset number is 20, and the number of the second historical sales data is 15. At this time, the number of the second historical sales data is lower than the preset number. At this time, the product category information of brand A is compared with the information of other product categories, and it is obtained that the product categories of brand B and brand A are consistent, and the concepts of limited edition sneakers under the two brands are similar. Therefore, the limited edition sneakers of brand B can be used as a candidate product for the limited edition sneakers of brand A.

[0189] S1103, selecting historical sales data of candidate commodities and supplementing them as second historical sales data.

[0190] In an embodiment of the present application, after the candidate product is determined, the historical sales data of the candidate product is obtained based on the time range limitation of the second historical sales data and added to the second historical sales data so that the amount of the second historical sales data reaches a preset amount.

[0191] Still taking the limited edition sneakers of brand A and brand B as an example, the number of second historical sales data of brand A is 15. After determining that the limited edition sneakers of brand B are candidate products, the sales data of brand B's limited edition sneakers under the same restrictions are screened according to the screening conditions of the second historical sales data of brand A, totaling 10 groups. The 10 groups of historical sales data are added to the second historical sales data. At this time, the number of second historical sales data is 25, which is greater than the preset number of 20 groups. The second historical sales data at this time can provide sufficient and effective data sources for the adjustment of the target basic sales forecasting model.

[0192] The training method of the sales forecasting model proposed in the present application determines whether the amount of the second historical sales data is less than the preset amount. In response to the amount of the second historical sales data being less than the preset amount, the historical sales data of the candidate product can be selected for supplementation. In the present application, a solution that can be used when the number of samples of the second historical sales data is insufficient is proposed, which effectively guarantees the number of samples that can be provided by the second historical sales data, thereby ensuring the adjustment effect of the target basic sales forecasting model, so that the predicted sales of the target basic sales forecasting model can be infinitely close to the actual sales.

[0193] After generating the target basic sales forecast model corresponding to the target product, the sales forecast test of the product can be carried out according to the generated model, such as Fig.12 As shown, Fig.12 This is a flow chart of a sales forecast model testing method according to another embodiment of the present application. The sales forecast model training method includes:

[0194] S1201, obtaining third historical sales data of the target product.

[0195] In an embodiment of the present application, the target product for which sales forecasting is required can be determined based on the test requirements of the current target basic sales forecasting model, and the relevant information of the target product, such as the product name, can be used as a keyword to filter the set storage location of the order record data to obtain all order record data for the target product.

[0196] According to the sample time range required by the target basic sales forecasting model corresponding to the target product, set the screening time range for the required order record data, use the time range as the screening condition, and screen all the order record data corresponding to the acquired target product to obtain the order record data within the set time range corresponding to the target product, and generate the third historical sales data of the target product.

[0197] S1202, obtaining the time feature of the time point to be predicted.

[0198] In the implementation, according to the test requirements of the target basic sales forecasting model, the time point of the target product sales to be predicted is determined, and the corresponding time features can be extracted according to the set time point to be predicted. The specific extraction method can be found in the above related content, which will not be repeated here.

[0199] S1203, input the third historical sales data and the time characteristics of the time point to be predicted into the target sales volume prediction model, and output the predicted sales volume of the target product at the time point to be predicted.

[0200] In the embodiment of the present application, after obtaining the third historical sales data corresponding to the target product and the time characteristics of the time point to be predicted, the two are input into the target basic sales prediction model corresponding to the target product according to the format set by the target basic sales prediction model corresponding to the target product, and the algorithm y is executed. pred =f(x test ), output the predicted sales volume of the target product at the predicted time point, and complete the model testing.

[0201] To better understand the generation of the first training sample set proposed in the above embodiment, in the process of obtaining the first historical sales data, the historical sales data of each category of goods do not need to be divided, and are all used as the first historical sales data, such as Fig.13As shown, the first historical sales data extracted from product E, product F, product G, and product H are combined to generate a first training sample set for training a basic sales prediction model for multiple categories.

[0202] In order to ensure that the basic sales forecasting model can be fully and effectively trained, the training samples need to cover the historical sales data corresponding to various time periods of multiple categories of goods, so as to ensure that after the model training is completed, in the actual sales forecasting work, the sales forecast results can be infinitely close to the actual sales in extreme scenarios.

[0203] In order to adjust the target sales forecast model suitable for a certain product based on the basic sales forecast model, and after the target sales forecast model corresponding to a certain product is adjusted, the sales forecast of the certain product is carried out to test the accuracy of the adjusted target sales forecast model, the historical sales data of a category is divided into two parts, one of which is used as the second historical sales data, and the remaining part is used as the third historical sales data. Fig.14 As shown, two unequal amounts of historical sales data are extracted from each of product E, product F, product G, and product H, one of which is used as the second historical sales data corresponding to the target product to form a second training sample set, which is input into the target basic sales prediction model to train the target sales prediction model corresponding to the target product. The other part is used as the third historical sales data corresponding to the target product, and the third historical sales data is input into the target sales prediction model to predict the sales volume of the target product on the current day or on a future day.

[0204] Corresponding to the training methods of the sales forecast model proposed in the above-mentioned embodiments, an embodiment of the present application also proposes a training device for the sales forecast model. Since the training device for the sales forecast model proposed in the embodiment of the present application corresponds to the training methods for the sales forecast model proposed in the above-mentioned embodiments, the implementation method of the above-mentioned training method for the sales forecast model is also applicable to the training device for the sales forecast model proposed in the embodiment of the present application, and will not be described in detail in the following embodiments.

[0205] Fig.15 FIG. 1 is a structural diagram of a sales forecast model training device according to an embodiment of the present application. Fig.15 As shown, the training device 1500 for the sales prediction model includes a first training sample set generation module 151, a model training module 152, a second training sample set generation module 153, and a model adjustment module 154, wherein:

[0206] A first training sample set generating module 151, configured to collect first historical sales data of a plurality of categories of commodities, and generate a first training sample set based on the first historical sales data;

[0207] A model training module 152, configured to train a basic sales volume prediction model based on a first training sample set to generate a target basic sales volume prediction model;

[0208] A second training sample set generating module 153, configured to collect second historical sales data of the target commodity and generate a second training sample set of the target commodity based on the second historical sales data;

[0209] The model adjustment module 154 is used to adjust the target basic sales prediction model based on the second training sample set to generate a target sales prediction model corresponding to the target product.

[0210] The training device of the sales prediction model proposed in the present application obtains the first historical sales data according to the order record data, generates the first training sample set to train the basic sales prediction model, and generates the target basic sales prediction model. The second historical sales data of the target commodity is obtained according to the order record data, and the second training sample set is generated. The target basic sales prediction model is adjusted to generate the target sales prediction model corresponding to the target commodity. In the present application, the generated high-precision target basic sales prediction model corresponding to all categories can be used as the basic prediction model of the target sales prediction model corresponding to each single category commodity. According to the difference of each single category commodity, the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is realized. At the same time, the target basic sales prediction model corresponding to all categories as the basis has a high-precision prediction function, so that the accuracy and precision of the sales prediction of the single category target commodity with the characteristics of small sample historical sales data is effectively guaranteed.

[0211] Fig.16 FIG. 1 is a structural diagram of a sales forecast model training device according to another embodiment of the present application. Fig.16 As shown, the training device 1600 of the sales prediction model includes a first training sample set generation module 161, a model training module 162, a second training sample set generation module 163, a model adjustment module 164, a sales data acquisition module 165, an extraction module 166, a training sample set generation module 167, a time attribute information acquisition module 168, an encoding module 169, an edge sales extraction module 1610, a normalization processing module 1611, an order data generation module 1612, a historical sales data generation module 1613, a sales acquisition module 1614, a clearing module 1615, a third historical sales data acquisition module 1616, a time feature acquisition module 1617, and a testing module 1618, wherein:

[0212] It should be noted that the first training sample set generation module 151, the model training module 152, the second training sample set generation module 153, and the model adjustment module 154 have the same structure and function as the first training sample set generation module 161, the model training module 162, the second training sample set generation module 163, and the model adjustment module 164.

[0213] In the embodiment of the present application, the model adjustment module 164 includes:

[0214] A backup unit 1641 is used to back up the target basic sales volume prediction model;

[0215] The model adjustment unit 1642 is used to adjust the backup target basic sales prediction model based on the second training sample set to generate a target sales prediction model corresponding to the target product.

[0216] In the embodiment of the present application, the training device 1600 for the sales prediction model further includes a sales data acquisition module 165, an extraction module 166, and a training sample set generation module 167, wherein:

[0217] The sales data acquisition module 165 is used to extract historical sales data corresponding to N time points from the collected historical sales data based on a preset sliding window;

[0218] Extraction module 166, used to extract the time feature at the N+1th time point and the actual sales volume at the N+1th time point;

[0219] The training sample set generation module 167 is used to use the historical sales data at N time points, the time features at N+1 time points and the actual sales volume at N+1 time points as a set of training samples in the training sample set, and continue to slide the sliding window to a preset number of sliding times to generate a training sample set.

[0220] In the embodiment of the present application, the sales prediction model training device 1600 further includes a time attribute information acquisition module 168 and an encoding module 169, wherein:

[0221] The time attribute information acquisition module 168 is used to acquire the time attribute information of N+1 time points;

[0222] The encoding module 169 is used to encode N+1 time points based on the time attribute information to generate time features of the N+1 time points.

[0223] In the embodiment of the present application, the sales prediction model training device 1600 further includes a marginal sales extraction module 1610 and a normalization processing module 1611, wherein:

[0224] The marginal sales volume extraction module 1610 is used to extract the maximum historical sales volume and the minimum historical sales volume from the training sample set;

[0225] The normalization processing module 1611 is used to normalize the historical sales volume of each training sample in the training sample set according to the maximum historical sales volume and the minimum historical sales volume.

[0226] In the embodiment of the present application, the training device 1600 for the sales prediction model further includes an order data generation module 1612 and a historical sales data generation module 1613, wherein:

[0227] The order data generation module 1612 is used to obtain commodity orders, merge commodity orders, and generate order data for any category;

[0228] The historical sales data generating module 1613 is used to extract key fields from the order data of any category, combine the data corresponding to the extracted key fields, and generate the historical sales data of any category.

[0229] In the embodiment of the present application, the training device 1600 of the volume prediction model further includes a sales volume acquisition module 1614 and a clearing module 1615, wherein:

[0230] The sales volume acquisition module 1614 is used to determine the sales volume of any category within a set period of time based on the historical sales data of any category;

[0231] The clearing module 1615 is used to clear the historical sales data of any category in response to the sales volume within a set time period being less than a preset sales volume threshold.

[0232] In the embodiment of the present application, the order data generating module 1612 includes:

[0233] The order information acquisition unit 16121 is used to acquire the generation time and commodity category of the commodity order;

[0234] A candidate commodity order determining unit 16122, configured to determine a first candidate commodity order whose commodity category is consistent with any category;

[0235] The order determination unit 16123 is used to determine, for any category, product orders belonging to the same time period according to the generation time of the first candidate product order;

[0236] The order data generating unit 16124 is used to merge the commodity orders belonging to the same time period to generate order data of any category.

[0237] In the embodiment of the present application, the order data generating module 1612 further includes:

[0238] The order information acquisition unit 16121 is further used to acquire the commodity category and category level corresponding to the commodity order;

[0239] The candidate commodity order determining unit 16122 is further configured to determine, according to the commodity category, a second candidate commodity order belonging to any category;

[0240] The order determination unit 16123 is further configured to obtain a target category level for any category and filter out second candidate product orders whose category level is higher than the target category level;

[0241] The order data generating unit 16124 is further configured to merge the remaining second candidate product orders to generate order data of any category.

[0242] In the embodiment of the present application, the second training sample set generating module 163 includes:

[0243] The quantity acquisition unit 1631 is used to acquire the quantity of the second historical sales data;

[0244] A candidate commodity acquisition unit 1632, configured to acquire candidate commodities similar to the target commodity in response to the quantity being lower than a preset quantity;

[0245] The quantity supplement unit 1633 is used to select the historical sales data of the candidate commodities and supplement them as the second historical sales data.

[0246] In the embodiment of the present application, the training device 1600 for the sales prediction model further includes a third historical sales data acquisition module 1616, a time feature acquisition module 1617, and a testing module 1618, wherein:

[0247] The third historical sales data acquisition module 1616 is used to acquire the third historical sales data of the target commodity;

[0248] The time feature acquisition module 1617 is used to acquire the time feature of the time point to be predicted;

[0249] The test module 1618 is used to input the third historical sales data and the time characteristics of the time point to be predicted into the target sales volume prediction model, and output the predicted sales volume of the target product at the time point to be predicted.

[0250] The training device of the sales forecast model proposed in the present application obtains the first historical sales data, generates the first training sample set, trains the basic sales forecast model based on the first training sample set, and generates the target basic sales forecast model. The target basic sales forecast model is backed up to avoid mutual interference between the model adjustments corresponding to each target commodity. The second historical sales data of the target commodity is obtained, the second training sample set is generated, the target basic sales forecast model is adjusted based on the second training sample set, and the target sales forecast model corresponding to the target commodity is generated. After the target sales forecast model corresponding to the target commodity is generated, the third historical data is obtained to complete the test of the training results of the target sales forecast model corresponding to the target commodity. In the present application, the generated high-precision target basic sales forecast model corresponding to all categories can be used as the basic forecast model of the target sales forecast model corresponding to each single category commodity. According to the difference of each single category commodity, the sales forecast of the single category target commodity with the characteristics of small sample historical sales data is realized. At the same time, the target basic sales forecast model corresponding to all categories as the basis has a high-precision forecasting function, so that the accuracy and precision of the sales forecast of the single category target commodity with the characteristics of small sample historical sales data is effectively guaranteed.

[0251] To achieve the above embodiments, the present application also proposes an electronic device, a computer-readable storage medium and a computer program product.

[0252] Fig.17 A schematic block diagram of an example electronic device 1700 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0253] like Fig.17 As shown, the device 1700 includes a memory 171, a processor 172, and a computer program stored in the memory 171 and executable on the processor 172. When the processor 172 executes the program instructions, the training method of the sales prediction model proposed in the above embodiment is implemented.

[0254] The electronic device proposed in the embodiment of the present application executes a computer program stored in the memory 111 through the processor 172, obtains the first historical sales data, generates a first training sample set, trains the basic sales prediction model based on the first training sample set, and generates a target basic sales prediction model. The target basic sales prediction model is backed up to avoid mutual interference between the model adjustments corresponding to each target commodity. The second historical sales data of the target commodity is obtained, a second training sample set is generated, the target basic sales prediction model is adjusted based on the second training sample set, and a target sales prediction model corresponding to the target commodity is generated. After the target sales prediction model corresponding to the target commodity is generated, the third historical data is obtained to complete the test of the training results of the target sales prediction model corresponding to the target commodity. In the present application, the generated high-precision target basic sales forecasting model corresponding to all categories can be used as the basic forecasting model of the target sales forecasting model corresponding to each single category product. According to the difference of each single category product, the sales forecast of the single category target product with small sample historical sales data characteristics is realized. At the same time, the target basic sales forecasting model corresponding to all categories as the basis has a high-precision forecasting function, which effectively guarantees the accuracy and precision of the sales forecast of the single category target product with small sample historical sales data characteristics.

[0255] An embodiment of the present application proposes a computer-readable storage medium, on which a computer program is stored. When the program is executed by the processor 172, the training method of the sales prediction model proposed in the above embodiment is implemented.

[0256] The computer-readable storage medium of the embodiment of the present application stores a computer program and is executed by a processor. The processor 172 executes the computer program stored in the memory 171 to obtain the first historical sales data, generate a first training sample set, train the basic sales prediction model based on the first training sample set, and generate a target basic sales prediction model. The target basic sales prediction model is backed up to avoid mutual interference between the model adjustments corresponding to each target commodity. The second historical sales data of the target commodity is obtained, a second training sample set is generated, the target basic sales prediction model is adjusted based on the second training sample set, and a target sales prediction model corresponding to the target commodity is generated. After the target sales prediction model corresponding to the target commodity is generated, the third historical data is obtained to complete the test of the training results of the target sales prediction model corresponding to the target commodity. In the present application, the generated high-precision target basic sales forecasting model corresponding to all categories can be used as the basic forecasting model of the target sales forecasting model corresponding to each single category product. According to the difference of each single category product, the sales forecast of the single category target product with small sample historical sales data characteristics is realized. At the same time, the target basic sales forecasting model corresponding to all categories as the basis has a high-precision forecasting function, which effectively guarantees the accuracy and precision of the sales forecast of the single category target product with small sample historical sales data characteristics.

[0257] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0258] The program code for implementing the method itself can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0259] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0260] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0261] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0262] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server for a distributed system, or a server combined with a blockchain.

[0263] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0264] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0265] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0266] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0267] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0268] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0269] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0270] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

[0271] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0272] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A training method for a sales forecasting model, characterized in that: include: Collecting first historical sales data of multiple categories of commodities, and generating a first training sample set based on the first historical sales data; Training a basic sales forecasting model based on the first training sample set to generate a target basic sales forecasting model; Collecting second historical sales data of the target product, obtaining the quantity of the second historical sales data, and if the quantity is less than a preset quantity, obtaining candidate products similar to the target product, supplementing the historical sales data of the candidate products to the second historical sales data, and generating a second training sample set of the target product based on the supplemented second historical sales data; The target basic sales prediction model is backed up, and based on the second training sample set, the backed up target basic sales prediction model is adjusted to generate a target sales prediction model corresponding to the target product.

2. The training method of the sales forecasting model according to claim 1, characterized in that: The training sample set is generated as follows: Based on a preset sliding window, extract the historical sales data corresponding to N time points from the collected historical sales data; Extracting the time features of the N+1th time point and the actual sales volume at the N+1th time point; The historical sales data at the N time points, the time features at the N+1 time points and the actual sales volume at the N+1 time points are used as a group of training samples in the training sample set, and the sliding window is continued to slide to a preset number of sliding times to generate the training sample set.

3. The training method of the sales forecasting model according to claim 2, characterized in that: Also includes: Obtaining time attribute information of the N+1 time points; Based on the time attribute information, the N+1 time points are encoded to generate time features of the N+1 time points.

4. The training method of the sales forecasting model according to claim 2, characterized in that: Also includes: Extracting the maximum historical sales volume and the minimum historical sales volume from the training sample set; The historical sales volume of each training sample in the training sample set is normalized according to the maximum historical sales volume and the minimum historical sales volume.

5. The training method of the sales prediction model according to claim 1, characterized in that: Generate historical sales data in the following way: Obtaining product orders, merging the product orders, and generating order data for any category; Key fields are extracted from the order data of any one of the categories, and data corresponding to the extracted key fields are combined to generate historical sales data of any one of the categories.

6. The sales forecasting model training method according to claim 5, characterized in that: After generating the historical sales data of any category, the method further includes: Determine the sales volume of any of the categories within a set period of time based on the historical sales data of any of the categories; In response to the sales volume within the set time period being less than a preset sales volume threshold, the historical sales data of any of the categories is cleared.

7. The sales forecasting model training method according to claim 5, characterized in that: The merging of the commodity orders to generate order data of any category includes: Obtaining the generation time and product category of the product order; Determine a first candidate commodity order whose commodity category is consistent with any of the categories; For any of the categories, determining product orders belonging to the same time period according to the generation time of the first candidate product order; The commodity orders belonging to the same time period are merged to generate order data of any one of the categories.

8. The sales forecasting model training method according to claim 5, characterized in that: The merging of the commodity orders to generate order data of any category includes: Obtain the commodity category and category level corresponding to the commodity order; Determining, according to the commodity category, a second candidate commodity order belonging to any of the categories; Obtaining a target category level for any of the categories, and filtering out second candidate commodity orders whose category level is higher than the target category level; The remaining second candidate product orders are merged to generate order data of any one of the categories.

9. The sales forecasting model training method according to claim 1, characterized in that: After generating the target sales volume prediction model corresponding to the target commodity, the method further includes: Acquire third historical sales data of the target product; Obtain the time characteristics of the time point to be predicted; The third historical sales data and the time characteristics of the time point to be predicted are input into the target sales volume prediction model, and the predicted sales volume of the target product at the time point to be predicted is output.

10. A training device for a sales forecasting model, characterized in that: include: A first training sample set generating module, configured to collect first historical sales data of a plurality of categories of commodities, and generate a first training sample set based on the first historical sales data; A model training module, used to train a basic sales prediction model based on the first training sample set to generate a target basic sales prediction model; a second training sample set generating module, configured to collect second historical sales data of a target commodity, obtain the quantity of the second historical sales data, and if the quantity is less than a preset quantity, obtain candidate commodities similar to the target commodity, supplement the historical sales data of the candidate commodities to the second historical sales data, and generate a second training sample set of the target commodity based on the supplemented second historical sales data; A model adjustment module is used to back up the target basic sales prediction model and adjust the backed up target basic sales prediction model based on the second training sample set to generate a target sales prediction model corresponding to the target product.

11. The sales forecast model training device according to claim 10, characterized in that: Also includes: A sales data acquisition module, used to extract the historical sales data corresponding to N time points from the collected historical sales data based on a preset sliding window; An extraction module, used to extract the time feature of the N+1th time point and the actual sales volume at the N+1th time point; A training sample set generation module is used to use the historical sales data at the N time points, the time features at the N+1 time points and the actual sales volume at the N+1 time points as a group of training samples in the training sample set, and continue to slide the sliding window to a preset number of sliding times to generate the training sample set.

12. The sales forecast model training device according to claim 11, characterized in that: Also includes: A time attribute information acquisition module, used to acquire the time attribute information of the N+1 time points; The encoding module is used to encode the N+1 time points based on the time attribute information to generate time features of the N+1 time points.

13. The sales forecast model training device according to claim 11, characterized in that: Also includes: A marginal sales volume extraction module, used to extract the maximum historical sales volume and the minimum historical sales volume from the training sample set; The normalization processing module is used to normalize the historical sales volume of each training sample in the training sample set according to the maximum historical sales volume and the minimum historical sales volume.

14. The sales forecast model training device according to claim 10, characterized in that: Also includes: An order data generation module, used to obtain product orders, merge the product orders, and generate order data for any category; The historical sales data generation module is used to extract key fields from the order data of any category, combine the data corresponding to the extracted key fields, and generate the historical sales data of any category.

15. The training device for the sales prediction model according to claim 14, characterized in that: Also includes: A sales volume acquisition module, used to determine the sales volume of any category within a set period of time based on the historical sales data of any category; The clearing module is used to clear the historical sales data of any category in response to the sales volume within the set time period being less than a preset sales volume threshold.

16. The training device for the sales prediction model according to claim 14, characterized in that: The order data generating module comprises: An order information acquisition unit, used to acquire the generation time and commodity category of the commodity order; a candidate commodity order determining unit, configured to determine a first candidate commodity order whose commodity category is consistent with any one of the categories; an order determination unit, configured to determine, for any one of the categories, product orders belonging to the same time period according to the generation time of the first candidate product order; The order data generating unit is used to merge the commodity orders belonging to the same time period to generate the order data of any category.

17. The sales forecast model training device according to claim 14, characterized in that: The order data generating module comprises: An order information acquisition unit, further used to acquire the commodity category and category level corresponding to the commodity order; The candidate commodity order determination unit is further configured to determine, based on the commodity category, a second candidate commodity order belonging to any of the categories; The order determination unit is further used to obtain a target category level of any one of the categories, and filter out second candidate commodity orders whose category level is higher than the target category level; The order data generating unit is further used to merge the remaining orders of the second candidate products to generate order data of any one category.

18. The sales forecast model training device according to claim 10, characterized in that: Also includes: A third historical sales data acquisition module, used to acquire the third historical sales data of the target commodity; A time feature acquisition module is used to acquire the time feature of the time point to be predicted; The test module is used to input the third historical sales data and the time characteristics of the time point to be predicted into the target sales prediction model, and output the predicted sales of the target product at the time point to be predicted.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1-9.

21. 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 9.

Citation Information

Patent Citations

  • Product sales prediction method

    CN110599234A

  • Vehicle sales prediction method based on XGBoost recommendation algorithm

    CN111401941A