Cargo quantity prediction method, device, computer equipment and storage medium

By obtaining and updating historical characteristic data of cargo volume and performing rolling cycle predictions, the problem of inaccurate predictions caused by repeated shipment characteristics in traditional methods is solved, and the accuracy of mid- and long-term cargo volume forecasting is improved.

CN112907267BActive Publication Date: 2024-08-23SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911220464.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-03
Publication Date
2024-08-23
Estimated Expiration
2039-12-03

AI Technical Summary

Technical Problem

Traditional medium- and long-term cargo volume forecasting methods rely on supervised learning and are highly dependent on input features, resulting in repeated package volume features and inaccurate prediction results.

Method used

By obtaining the historical feature data set, obtain the new features of the cargo volume at the next prediction time node, and update it to the historical feature data set, perform a rolling cycle update forecast, use reliable forecast feature data to improve forecast accuracy, and avoid data Repetitive issues.

Benefits of technology

The accuracy of medium- and long-term cargo volume forecasting results is improved. Through the rolling update forecasting mechanism, more reliable feature data is provided, which enhances the reliability and accuracy of forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112907267B
    Figure CN112907267B
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for predicting the quantity of goods. The method includes: obtaining a historical feature data set of the target prediction time and the quantity of goods in the historical records, obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set, updating the newly added features of the quantity of goods to the historical feature data set, obtaining an updated historical feature data set, using the updated historical feature data set as the historical feature data set again, and returning to the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time, predicting the quantity of goods according to the latest updated historical feature data set, and obtaining the predicted quantity data of the target prediction time. Using reliable prediction feature data as the historical feature data of the target prediction time improves the accuracy of the predicted quantity data of the target prediction time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, computer equipment and storage medium for predicting the quantity of goods. Background Art

[0002] With the development of logistics technology, express volume analysis has become an important process in the logistics field. Cargo volume forecasting is a basic and important issue in the logistics field. Through reasonable estimation of the volume, it has an extremely important reference role in the logistics company's personnel, vehicle configuration, and planning for the coming year.

[0003] Traditional shipment volume forecasting is based on supervised learning methods. For mid- to long-term shipment volume forecasting, it is generally supplemented by data filling. The supervised machine learning method is highly dependent on the input features. For mid- to long-term shipment volume forecasting, the filling method is not suitable because the shipment volume features are easily repeated, resulting in inaccurate mid- to long-term shipment volume forecasting results. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for quantity prediction that can improve the accuracy of medium- and long-term quantity prediction results in order to address the technical problem of inaccurate medium- and long-term quantity prediction results.

[0005] A method for predicting piece quantity, the method comprising:

[0006] Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records;

[0007] Based on the historical feature data set, obtain the new features of the cargo quantity corresponding to the next prediction time node;

[0008] The newly added features of the cargo quantity are updated to the historical feature data set to obtain an updated historical feature data set;

[0009] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time;

[0010] Cargo quantity is predicted based on the latest updated historical feature data set to obtain the predicted quantity data for the target prediction time.

[0011] In one embodiment, obtaining a historical feature data set of the quantity of goods in the historical records includes:

[0012] Obtain the time characteristics and preset lag time of each time node in the historical records;

[0013] According to the time characteristics and the lag time, determine the lag time node corresponding to each time node;

[0014] Obtain the piece quantity data at each time node and the lagged piece quantity data corresponding to the lagged time node;

[0015] According to the lagged quantity data, the mean value and variance of the quantity are calculated to obtain the window characteristics of each time node;

[0016] According to the time characteristics, piece quantity data, lagged piece quantity data and window characteristics of each time node, a historical feature data set is obtained.

[0017] In one embodiment, obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set includes:

[0018] Obtaining feature data weight parameters corresponding to feature categories of historical feature data;

[0019] According to each historical feature data and feature data weight parameter, the predicted quantity data corresponding to the next prediction time node is obtained;

[0020] According to the predicted piece quantity data, the predicted lagged piece quantity data and the predicted window characteristics in the predicted characteristic data are obtained;

[0021] According to the time characteristics corresponding to the next prediction time node, the predicted piece quantity data, the predicted lagged piece quantity data and the prediction window characteristics, the newly added characteristics of the cargo piece quantity corresponding to the next prediction time node are determined.

[0022] In one embodiment, after the updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set is returned, until the next prediction time node is before the target prediction time, it also includes:

[0023] Determine the time period to be predicted based on the target prediction time;

[0024] The steps of reusing the updated historical feature data set as the historical feature data set and returning to obtain the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set until the next prediction time node is the target prediction time include:

[0025] When the duration corresponding to the time period to be predicted is not greater than the preset duration, the updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time.

[0026] In one embodiment, after determining the time period to be predicted according to the target prediction time, the method further includes:

[0027] When the time period to be predicted is greater than the preset time length, the time characteristics corresponding to each time node to be predicted in the time period to be predicted are obtained;

[0028] When the time node to be predicted is a first-type time node whose time characteristics include non-holidays, a time series change trend curve of the time period to be predicted is obtained, and the predicted piece quantity data of the first-type time node is obtained according to the corresponding value of the first-type time node in the time series change trend curve;

[0029] When the time node to be predicted is a second-type time node whose time characteristics include holidays, a feature data set of the lead time of the second-type time node is obtained, the feature data set of the lead time is re-used as a historical feature data set, and the step of obtaining new features of the cargo quantity corresponding to the next predicted time node based on the historical feature data set is returned until the next predicted time node is a first-type time node or a target prediction time.

[0030] In one embodiment, obtaining a feature data set of the lead time of the second type of time node includes:

[0031] Obtaining the predicted feature data of the second type of time nodes within the lead time, and the predicted piece quantity data and the predicted lagged piece quantity data corresponding to the first type of time nodes within the lead time;

[0032] According to the data of the predicted delayed quantity, the prediction window characteristics are determined to obtain the prediction characteristic data of the first type of time node within the lead time;

[0033] The prediction feature data of the first type of time nodes within the lead time and the prediction feature data of the second type of time nodes are collected to obtain a feature data set of the lead time of the second type of time nodes to be predicted.

[0034] In one embodiment, the time series change trend curve includes a total time series change trend curve, a periodic change trend curve, a holiday change curve, and an error curve; and according to the corresponding value of the first type of time node in the time series change trend curve, the predicted piece quantity data of the first type of time node is obtained, including:

[0035] According to the trend item corresponding to the first type of time node in the total time series change trend curve, the period item in the period change trend curve, the holiday item in the holiday change curve, and the error item in the error curve;

[0036] Accumulate trend items, cycle items, holiday items and error items to obtain the predicted quantity data for the first type of time node.

[0037] A cargo quantity prediction device, comprising:

[0038] A historical feature data set acquisition module is used to acquire a historical feature data set of target prediction time and cargo quantity in historical records;

[0039] A new feature acquisition module is added to obtain the new features of the cargo quantity corresponding to the next prediction time node based on the historical feature data set;

[0040] An updating module, used to update the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set;

[0041] A loop module, used to use the updated historical feature data set as the historical feature data set again, and return to the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time;

[0042] The predicted piece quantity data acquisition module is used to predict the cargo quantity based on the latest updated historical feature data set to obtain the predicted piece quantity data for the target prediction time.

[0043] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0044] Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records;

[0045] Based on the historical feature data set, obtain the new features of the cargo quantity corresponding to the next prediction time node;

[0046] The newly added features of the cargo quantity are updated to the historical feature data set to obtain an updated historical feature data set;

[0047] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time;

[0048] Cargo quantity is predicted based on the latest updated historical feature data set to obtain the predicted quantity data for the target prediction time.

[0049] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0050] Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records;

[0051] Based on the historical feature data set, obtain the new features of the cargo quantity corresponding to the next prediction time node;

[0052] The newly added features of the cargo quantity are updated to the historical feature data set to obtain an updated historical feature data set;

[0053] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time;

[0054] Cargo quantity is predicted based on the latest updated historical feature data set to obtain the predicted quantity data for the target prediction time.

[0055] The above-mentioned cargo quantity prediction method, device, computer equipment and storage medium use the target prediction time and the historical feature data set of the cargo quantity in the historical records to predict the quantity according to the feature data in the historical feature data set, obtain the newly added features of the cargo quantity corresponding to the next prediction time node, and then update the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set, and then use the updated historical feature data set again as the historical feature data set for rolling cycle update prediction, so as to improve the reliability of the feature data used to predict the predicted quantity data for the target prediction time, avoid the data duplication problem caused by simple data filling in the traditional method, and use reliable prediction feature data as the historical feature data of the target prediction time to improve the accuracy of the predicted quantity data for the target prediction time. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is an application scenario diagram of a cargo quantity prediction method in an embodiment;

[0057] Figure 2 A schematic diagram of a flow chart of a method for predicting the quantity of goods in one embodiment;

[0058] Figure 3 A schematic flow chart of a historical feature data set step in a method for predicting the quantity of goods in one embodiment;

[0059] Figure 4 A schematic diagram of a flow chart of a method for predicting the quantity of goods in another embodiment;

[0060] Figure 5 is a structural block diagram of a device for predicting the quantity of parts in an embodiment;

[0061] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0063] The cargo quantity prediction method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The server 104 receives the target prediction time to be predicted for the quantity uploaded by the terminal, obtains the target prediction time and the historical feature data set of the quantity of goods in the historical record, and obtains the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set. The historical feature data set is composed of feature data of multiple historical time nodes, and the historical time nodes are arranged in chronological order. The time node immediately after the last historical time node is the next prediction time node. Among them, the next prediction time node can be directly the target time node corresponding to the target prediction time, or it can be the intermediate time node between the last historical time node and the target time node. For example, when the target time node is a time node immediately after the last historical time node, the next prediction time node is the time node corresponding to the target prediction time. For another example, when there are other time nodes between the target time node and the last historical time node, the next prediction time node is the intermediate time node. The time change range between adjacent time nodes can be one day or other time lengths set according to demand, and the change range between every two adjacent time nodes is the same. For example, if the quantity data to be predicted is the daily quantity, the amplitude between each time node, i.e., the cycle period, can be set to 1 day. The newly added features of the quantity of goods are updated to the historical feature data set to obtain an updated historical feature data set, and the updated historical feature data set is used as the historical feature data set again and returned. According to the historical feature data set, the newly added features of the quantity of goods corresponding to the next prediction time node are obtained, until the next prediction time node is the target prediction time, and the quantity of goods is predicted according to the latest updated historical feature data set, and the predicted quantity data of the target prediction time is obtained and fed back to the terminal 102.

[0064] The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0065] It can be understood that the above application scenario can also be implemented by a terminal carrying a processor. The processor of the terminal obtains the target prediction time and the historical feature data set of the quantity of goods in the historical records, obtains the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set, updates the newly added features of the quantity of goods to the historical feature data set, obtains the updated historical feature data set, uses the updated historical feature data set again as the historical feature data set, and returns to the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time, performs the prediction of the quantity of goods according to the latest updated historical feature data set, obtains the predicted quantity data of the target prediction time and displays it.

[0066] In one embodiment, Figure 2 As shown, a method for predicting the quantity of goods is provided, and the method is applied to Figure 1 Taking the server in as an example, the method includes the following steps S210 to S240.

[0067] S210, obtaining a historical feature data set of a target prediction time and a quantity of goods in historical records.

[0068] Cargo quantity forecasting refers to the process of forecasting and analyzing the quantity at the predicted time node based on the historical feature data before the predicted time node. The cargo can be express delivery, and the cargo quantity forecast can be the prediction of the received quantity of express delivery or the prediction of the delivered quantity of express delivery. The quantity forecasting analysis can be obtained through machine learning models such as Xgboost (eXtreme GradientBoosting) and LSTM (Long Short-Term Memory). The target forecast time refers to the time when the quantity forecast is required. Specifically, the target forecast time can be short-term, medium-term or long-term. Among them, short-term time, medium-term time or long-term time are relative concepts in terms of historical time range. For example, the current time is November 15, 2019, and the time range of historical records is from October 1 to November 14. Taking the forecast period of 1 day as an example, if the target forecast time is a few days away from the current time, such as November 18, it is a short-term time. If the target forecast time is a few weeks away from the current time, such as November 29, it is a medium-term time. If the target forecast time is a few months or even years away from the current time, such as May 1, 2020, it is a long-term time. The time range of historical records refers to the range of historical time consisting of historical cargo volume related data. For example, the historical records start from March 1, 2019, and the current time is November 15, 2019, then the historical records are data from March 1, 2019 to November 15, 2019. It can be understood that the above dates are only used for illustration and can be adjusted according to actual conditions in actual applications.

[0069] In one embodiment, the cargo quantity forecast may be a daily quantity forecast, with one day as an analysis period. In another embodiment, the analysis period of the cargo quantity forecast may also be adjusted according to actual needs, such as with one week as a period, etc., which is not limited here.

[0070] S220, obtaining new features of the cargo quantity corresponding to the next prediction time node based on the historical feature data set.

[0071] The features in the historical feature data set include the time features, quantity data, lagged quantity data, and window features of each time node in the time range corresponding to the historical records. The newly added features of the cargo quantity include the time features, quantity data, lagged quantity data, and window features of the next predicted time node.

[0072] Taking the daily volume prediction as an example, for a historical time node T, the time features include T is the day of the week, T is the day of the month, whether T is a holiday, etc. Among them, holidays include various statutory holidays and shopping festivals of major shopping platforms, etc. The volume data includes the volume corresponding to T, and the lagged volume data includes the volume data of the historical time node corresponding to the lag time. Taking the lag time of 7 days as an example, the lagged volume data includes the volume corresponding to the historical time nodes T-1 to T-7, etc. Among them, the lag time includes but is not limited to one week, which can be adjusted as needed. The window feature includes the average value and variance of multiple historical data associated with the specific location data. The time range of the historical data is the same as the lag time range. For example, for time node T, the lag time is T-1 to T-7, then the window feature of time node T includes the average value and variance of the volume from T-1 to T-7. . In one embodiment, for any historical time node T in the historical record, its time feature, volume data, lagged volume data and window feature can constitute a multidimensional vector.

[0073] The prediction analysis of the quantity of goods can be obtained through a machine learning model, wherein the machine learning model can be any one of an Xgboost model, an LSTM model or other machine learning models. Among them, the machine learning model used for the prediction analysis of the quantity of goods can be obtained by training the model and adjusting the model parameters through historical feature data. Among them, the model training can be obtained based on the existing model training method, which is not limited here. Through the trained machine learning model, the various historical feature data in the historical time range can be used as input data, and the prediction analysis of the machine learning model can be used to obtain the predicted quantity of goods data of the first prediction time node corresponding to the existing historical record, that is, the initial prediction time node. Based on the predicted predicted quantity of goods data of the initial prediction time node, the time characteristics of the initial prediction time node and the corresponding lag time range can be determined in the same way as above, and then the predicted lag quantity of goods data and prediction window characteristics of the initial prediction time node are determined according to the lag time range, so as to obtain the newly added characteristics of the quantity of goods at the initial prediction time node. Among them, the initial prediction time node refers to the time adjacent to the maximum value of the historical time range and there is no quantity data for the time being. For example, if the historical record is from October 1 to November 14, the initial prediction time node is November 15.

[0074] S230, updating the newly added feature of the cargo quantity to the historical feature data set to obtain an updated historical feature data set.

[0075] According to the predicted piece quantity data of the next predicted time node, the predicted lagged piece quantity data and prediction window characteristics corresponding to the next predicted time node can be obtained. Combined with the time characteristics of the time node, the newly added characteristics of the cargo piece quantity at the time node can be obtained. In a specific embodiment, since the duration of the lag time is fixed, such as a week after the specified time node, when the next predicted time node is updated, that is, the time node is pushed back by one day, the historical time range corresponding to the updated next predicted time node will also be updated accordingly. The updated lag time range is relative to the updated next predicted time node. The piece quantity data within the lag time range are all historical data that have been predicted or directly obtained. By updating the lag time range and determining the various piece quantity data within the updated lag time range, the predicted lagged piece quantity data and prediction window characteristics corresponding to the next predicted time node can be obtained. For example, if the lag time range of the initial prediction time node is from November 8 to November 14, the updated lag time range corresponding to the updated next prediction time node is from November 9 to November 15, that is, the lag time range is pushed back by one day. The newly added features of the cargo quantity, such as time features, predicted quantity data, predicted lagged quantity data and prediction window features, are updated to the historical feature dataset to obtain an updated historical feature dataset.

[0076] S240, the updated historical feature data set is used again as the historical feature data set, and it is determined whether the next prediction time node is the target prediction time. When the determination result is yes, it returns to step S220, and when the determination result is no, it jumps to step S250.

[0077] In one embodiment, when the target prediction time is a short-term time or a medium-term time, the predicted quantity data of the next prediction time node corresponding to the historical time range can be predicted based on the various feature data in the historical feature data set corresponding to the historical records, and the newly added features of the quantity of goods corresponding to the next prediction time node are updated to the historical feature data set as the newly added data, and the updated historical feature data set is used again as the historical feature data set, and returned, and the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node is performed based on the historical feature data set, and the newly obtained predicted quantity data and other predicted quantity features are updated to the historical feature data set in turn, until the next prediction time node is the target prediction time. It can be understood that according to the data accuracy requirements, rolling update predictions can also be performed for all time periods corresponding to long-term time.

[0078] In another embodiment, when the target prediction time is a long-term prediction time, for the time period to be predicted corresponding to the target prediction time, by distinguishing holidays and non-holidays in the time range to be predicted, a rolling update prediction method is adopted for holidays, and a time series prediction method is adopted for non-holidays, to obtain predicted piece quantity data for the time period to be predicted, and then prediction feature data is obtained based on the predicted piece quantity data for the time period to be predicted, and the newly added prediction feature data for the time period to be predicted is updated to the historical feature data set to obtain the predicted piece quantity data for the target prediction time.

[0079] S250, predicting the cargo quantity based on the latest updated historical feature data set to obtain predicted quantity data at the target prediction time.

[0080] The cargo quantity is predicted using the latest updated historical feature data set, and the same prediction method as the above method is used to obtain the predicted quantity data for the target prediction time.

[0081] The above-mentioned cargo quantity prediction method uses the target prediction time and the historical feature data set of the cargo quantity in the historical records to predict the quantity according to the feature data in the historical feature data set, obtains the newly added features of the cargo quantity corresponding to the next prediction time node, and then updates the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set, and then uses the updated historical feature data set again as the historical feature data set for rolling cycle update prediction, so as to improve the reliability of the feature data used to predict the predicted quantity data of the target prediction time, avoid the data duplication problem caused by simple data filling in the traditional method, and use reliable prediction feature data as the historical feature data of the target prediction time to improve the accuracy of the predicted quantity data of the target prediction time.

[0082] In one embodiment, Figure 3 As shown, obtaining a historical feature data set of the quantity of goods in the historical records includes steps S310 to S350.

[0083] S310, obtaining the time characteristics of each time node in the historical record and the preset lag time.

[0084] S320: Determine the lag time node corresponding to each time node according to the time feature and the lag time.

[0085] S330, obtaining the piece quantity data of each time node and the delayed piece quantity data corresponding to the delayed time node.

[0086] S340, calculating the average and variance of the quantity according to the lagged quantity data, and obtaining the window characteristics of each time node.

[0087] S350, obtaining a historical feature data set according to the time characteristics, piece quantity data, lagged piece quantity data and window characteristics of each time node.

[0088] The historical records are composed of the characteristic data of the time nodes of each existing piece quantity data. If the piece quantity data of the current time can be directly obtained, the maximum time node corresponding to the historical records can be the current time, and the initial prediction time node corresponding to the historical records is the day after the current time. If the piece quantity data of the current time cannot be directly obtained, the maximum time node corresponding to the historical records can be the day before the current time, and the initial prediction time node corresponding to the historical records is the current time. The current time refers to the current date of the system.

[0089] The historical records include multiple historical time nodes, with one natural day as one time node. In an embodiment, for any historical time node in the historical records, it is necessary to obtain the characteristic data of the historical time node, including time characteristics, piece quantity data, lagged piece quantity data and window characteristics. The specific processing process includes: obtaining the time characteristics and the preset lag time of the historical time node, the preset lag time can be one week or other set time. Since the lag time is a set fixed value, the number of lag time nodes included in the lag time range is also a fixed value, but the lag time nodes specifically included in the lag time range will be updated according to the update of the next predicted time node. According to the date (such as November 14) and the preset lag time (such as 1 week) in the time characteristics of the historical time node, the lag time node corresponding to the historical time node (such as November 8 to November 14) is determined, and then the lagged piece quantity data of the lag time node is obtained. According to the lagged piece quantity data, the piece quantity average and variance are calculated respectively, and the window characteristics of the historical time node can be obtained. By using the above-mentioned characteristic data as the basis for piece quantity prediction, the impact of various data on piece quantity prediction can be considered to improve the accuracy of the prediction data.

[0090] In one embodiment, in one of the embodiments, obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set includes: obtaining the feature data weight parameter corresponding to the feature category of the historical feature data. According to each historical feature data and the feature data weight parameter, the predicted quantity data corresponding to the next prediction time node is obtained. According to the predicted quantity data, the predicted lagged quantity data and the prediction window features in the predicted feature data are obtained. According to the time features, predicted quantity data, predicted lagged quantity data and prediction window features corresponding to the next prediction time node, the newly added features of the cargo quantity corresponding to the next prediction time node are determined.

[0091] In one embodiment, the prediction analysis of the quantity of pieces can be obtained by machine learning models such as Xgboost and LSTM. The machine learning model includes multiple parameter values, and the parameter values ​​can be adjusted by model training. The training data of the model can be historical feature data with specified output data as labels. Among them, the parameter combination can be realized by grid search, and the specific evaluation criterion is the prediction evaluation index SMAPE (symmetric mean absolute percentage error) of the historical quantity. That is, through grid search, the minimum set of parameters of SMAPE obtained by cross-validation is realized to achieve the adjustment and optimization of the model parameters, and the feature data weight parameters corresponding to the feature category of the historical feature data can be obtained. In the application process of the quantity prediction, the quantity feature data of the historical record is input into the pre-trained machine learning model for quantity prediction, so as to obtain the quantity prediction data of the next prediction time node corresponding to the historical record, and then according to the quantity prediction data of the next prediction time node, the lag time node is updated to determine the prediction lag quantity data and prediction window characteristics corresponding to the next prediction time node. By performing piece quantity forecasting analysis using a machine learning model that has undergone model training and parameter adjustment, we can leverage the powerful computing and analysis capabilities of machine learning to improve processing efficiency. At the same time, through parameter adjustment, we can avoid overfitting of data and improve the reliability of predicted piece quantity data.

[0092] In one embodiment, Figure 4 As shown, the updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node based on the historical feature data set is returned, until the next prediction time node is the target prediction time, and step S410 is also included.

[0093] Step S410, determining the time period to be predicted according to the target prediction time.

[0094] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time, specifically including step S420.

[0095] Step S420, when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical feature data set is used again as the historical feature data set, and it is determined whether the next prediction time node is the target prediction time. When the judgment result is yes, return to step S220, when the judgment result is no, jump to step S250.

[0096] The time period to be predicted refers to the time range starting from the initial prediction time node and ending at the target prediction time or the day before the target prediction time. The preset duration is the time node for judging whether the target prediction time is a long-term time. When the duration corresponding to the time period to be predicted is not greater than the preset duration, the target prediction time is a short-term time or a medium-term time. When the duration corresponding to the time period to be predicted is greater than the preset duration, the target prediction time is a long-term time. For short-term or medium-term time, each time node to be predicted within the time period to be predicted can be sequentially updated and predicted to improve the accuracy of the quantity forecast data for each time period to be predicted.

[0097] In a specific embodiment, taking a cycle of 1 day as an example, when the corresponding duration of the time period to be predicted is not greater than the preset duration, that is, when the target prediction time is a short-term time or a medium-term time, the prediction feature data of the initial prediction time is first used as the newly added historical feature data to obtain an updated historical feature data set, that is, the original historical feature data and the newly added historical feature data are used together as input data for prediction and analysis to obtain the predicted piece quantity data of the next prediction time node one day after the initial prediction time node, and then the updated historical feature data set corresponding to the next prediction time node is used to perform piece quantity prediction processing, and rolling update predictions are performed in sequence until the next prediction time node is the target prediction time, and then prediction analysis is performed with the target prediction time as the object to obtain the predicted piece quantity data of the target prediction time.

[0098] In one embodiment, after determining the time period to be predicted according to the target prediction time, it also includes: when the time period to be predicted is greater than a preset time length, obtaining the time characteristics corresponding to each time node to be predicted in the time period to be predicted; when the time node to be predicted is a first-type time node whose time characteristics include non-holidays, obtaining the time series change trend curve of the time period to be predicted, and obtaining the predicted quantity data of the first-type time node according to the corresponding value of the first-type time node in the time series change trend curve; when the time node to be predicted is a second-type time node whose time characteristics include holidays, obtaining the feature data set of the lead time of the second-type time node, re-using the feature data set of the lead time as a historical feature data set, and returning to the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the first-type time node or the target prediction time.

[0099] Lead time refers to the time range composed of various time nodes before the time node to be predicted, that is, it includes all time nodes before the time node to be predicted. For long-term time, the time characteristics of each time node to be predicted are obtained, and the time characteristics include whether it is a holiday. For long-term quantity forecasting, the time series model can be used to assist in rolling quantity forecasting. For daily quantity forecasting, the input of the time series model is only time and quantity. The time series model is relatively stable in normal times when the periodicity is obvious and non-special holidays, but the fitting ability is weak for sudden holidays (such as National Day, Mid-Autumn Festival, Double Eleven, etc.). Feature-based supervised machine learning has a stronger ability to fit and predict because it can introduce a variety of external and quantity features, which can effectively solve the problem of poor fitting of the time series model. The prediction method of rolling update prediction is used from T+1 to T+M before the prediction sequence. For the predicted quantity data of each time node from T+M, for non-holidays, the time series prediction results obtained by time series prediction based on the time series model are used instead of rolling updates to obtain the predicted quantity data, and then the predicted feature data is obtained based on the predicted quantity data. If it is a holiday, the prediction method of rolling update prediction is used, and the predicted feature data is input into the machine learning model for prediction, and this cycle is repeated. For non-holidays within the time period to be predicted, the time series prediction method can be used to quickly obtain the predicted quantity data, thereby improving the efficiency of long-term daily quantity prediction. The time series prediction has the ability to capture periodicity and the supervised machine learning model has strong enough expansion and fitting capabilities. For tasks with high computational time requirements, the time series prediction and rolling update machine learning model are used to reduce the computational complexity of rolling recalculation of quantity features, which can take into account both the accuracy and efficiency of the prediction.

[0100] In one of the embodiments, when the duration corresponding to the time period to be predicted is greater than the preset duration M, the time period to be predicted (T+1, T+N) is obtained, and according to the preset duration M, the first time period to be predicted (T+1, T+M] and the second time period to be predicted (T+M, T+N) are determined, so as to realize the prediction of the quantity of pieces by rolling update in the first time period to be predicted within the preset duration starting from the initial prediction time. For the second time period to be predicted (T+M, T+N), a processing method for distinguishing the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays is adopted. Setting the previous fixed time period of the time period to be predicted to adopt the rolling update method can further improve the data accuracy of the early prediction of the time period to be predicted, and provide a reliable data basis for subsequent prediction processing.

[0101] In another embodiment, a second preset time length P can be set to divide the time period to be predicted (T+1, T+N) into (T+1, T+NP] and (T+NP, T+N), so that within the specified time length P from the target prediction time, that is, the time node in (T+NP, T+N), the quantity prediction is performed by rolling update, thereby improving the accuracy of the prediction feature data including the predicted quantity data. For the time period to be predicted (T+1, T+NP], a processing method for distinguishing the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays is adopted for processing. For (T+1, T+NP], a processing method for distinguishing the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays is adopted for processing. The data accuracy of the later prediction of the time period to be predicted can be further improved, thereby obtaining a more accurate prediction result.

[0102] In another embodiment, the time period to be predicted (T+1, T+N) can be divided into (T+1, T+M], (T+M, T+NP] and (T+NP, T+N) according to a first preset time length M and a second preset time length P. For the time nodes in (T+1, T+M] and (T+NP, T+N), a rolling update method is used for prediction processing. For (T+M, T+NP], a processing method is used to distinguish between the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays, so as to ensure the accuracy of the early prediction and the later prediction of the time period to be predicted.

[0103] In one embodiment, obtaining a feature data set of the lead time of a second type of time node includes: obtaining predicted feature data of the second type of time node within the lead time, and predicted quantity data and predicted lagging quantity data corresponding to the first type of time node within the lead time; determining prediction window features based on the predicted lagging quantity data to obtain predicted feature data of the first type of time node within the lead time; aggregating the predicted feature data of the first type of time node and the predicted feature data of the second type of time node within the lead time to obtain a feature data set of the lead time of the second type of time node to be predicted.

[0104] Since the predicted quantity data of the second type of time node requires the characteristic data of each time node before this time node, before performing rolling update prediction, it is necessary to determine the predicted lagged quantity data based on the predicted quantity data, and then obtain the prediction window characteristics by calculating the mean value and variance, and then aggregate the predicted characteristic data of the first type of time node in the lead time and the predicted characteristic data of the second type of time node to be predicted to obtain the various predicted characteristic data of the lead time of the second type of time node to be predicted, so as to improve the accuracy of the predicted quantity of the time node to be predicted including the time feature of holidays.

[0105] In one embodiment, the time series change trend curve includes a total time series change trend curve, a period change trend curve, a holiday change curve, and an error curve. According to the corresponding value of the first type of time node in the time series change trend curve, the predicted quantity data of the first type of time node is obtained, including: according to the trend item corresponding to the first type of time node in the total time series change trend curve, the period item in the period change trend curve, the holiday item in the holiday change curve, and the error item in the error curve. Accumulate the trend item, period item, holiday item, and error item to obtain the predicted quantity data of the first type of time node.

[0106] When performing time series forecasting, it is necessary to analyze a large amount of historical data to obtain time series change trend curves, including the total time series change trend curve, the cycle change trend curve, the holiday change curve, and the error curve.

[0107] Time series prediction can be achieved based on the Prophet algorithm. The principle of the Prophet algorithm is to convert the quantity y t = t + t +h t +∈ t Split, where g t Represents the trend term, which represents the trend of change of the time series in the non-periodic state; s t It represents the periodic term, or seasonal term, which is generally measured in weeks or years; h t Represents a holiday item, indicating whether there is a holiday on that day; ∈ t Represents the error term or the residual term. The Prophet algorithm fits these terms and then adds them up to get the predicted value of the time series. The specific prediction input and output are the input time t column and the quantity y column, that is, the input known time series timestamp and corresponding quantity value, as well as the length of the time series to be predicted; output the trend of the time series to be predicted. Among them, the output results can provide necessary statistical indicators, including fitting curves, upper and lower bounds, etc. By performing time series prediction on non-holidays, the processing efficiency of quantity prediction can be improved.

[0108] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0109] In one embodiment, Figure 5 As shown, a cargo quantity prediction device is provided, comprising: a historical feature data set acquisition module 510, a new feature acquisition module 520, an update module 530, a circulation module 540 and a predicted quantity data acquisition module 550, wherein:

[0110] The historical feature data set acquisition module 510 is used to acquire the historical feature data set of the target prediction time and the quantity of goods in the historical records.

[0111] The newly added feature acquisition module 520 is used to acquire the newly added features of the cargo quantity corresponding to the next prediction time node based on the historical feature data set.

[0112] The updating module 530 is used to update the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set.

[0113] The loop module 540 is used to use the updated historical feature data set as the historical feature data set again, and return to the step of obtaining the new features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time.

[0114] The predicted piece quantity data acquisition module 550 is used to predict the cargo piece quantity according to the latest updated historical feature data set to obtain the predicted piece quantity data at the target prediction time.

[0115] In one embodiment, the historical feature data set acquisition module is also used to obtain the time characteristics and preset lag time of each time node in the historical records; determine the lag time node corresponding to each time node based on the time characteristics and the lag time; obtain the piece quantity data of each time node and the lagged piece quantity data corresponding to the lag time node; calculate the piece quantity average and variance based on the lagged piece quantity data to obtain the window characteristics of each time node; obtain the historical feature data set based on the time characteristics, piece quantity data, lagged piece quantity data and window characteristics of each time node.

[0116] In one embodiment, the loop module is also used to obtain feature data weight parameters corresponding to feature categories of historical feature data; obtain predicted piece quantity data corresponding to the next prediction time node based on each historical feature data and the feature data weight parameters; obtain predicted lagged piece quantity data and prediction window characteristics in the predicted feature data based on the predicted piece quantity data; determine the newly added features of the cargo piece quantity corresponding to the next prediction time node based on the time characteristics, predicted piece quantity data, predicted lagged piece quantity data and prediction window characteristics corresponding to the next prediction time node.

[0117] In one embodiment, the cargo quantity prediction device further includes a time period determination module, which is used to determine the time period to be predicted according to the target prediction time. The loop module is also used to, when the time period to be predicted is not longer than the preset time period, use the updated historical feature data set as the historical feature data set again, and return to the step of obtaining the cargo quantity additional feature corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time.

[0118] In one embodiment, the loop module is also used to obtain the time characteristics corresponding to each time node to be predicted in the time period to be predicted when the time period to be predicted is greater than a preset time length; when the time node to be predicted is a first-type time node whose time characteristics include non-holidays, obtain the time series change trend curve of the time period to be predicted, and obtain the predicted quantity data of the first-type time node according to the corresponding value of the first-type time node in the time series change trend curve; when the time node to be predicted is a second-type time node whose time characteristics include holidays, obtain the feature data set of the lead time of the second-type time node, re-use the feature data set of the lead time as a historical feature data set, and return to the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the first-type time node or the target prediction time.

[0119] In one embodiment, the loop module is also used to obtain the predicted feature data of the second type of time node within the lead time, as well as the predicted quantity data and predicted lagging quantity data corresponding to the first type of time node within the lead time; determine the prediction window characteristics based on the predicted lagging quantity data to obtain the predicted feature data of the first type of time node within the lead time; aggregate the predicted feature data of the first type of time node within the lead time and the predicted feature data of the second type of time node to be predicted to obtain the feature data set of the lead time of the second type of time node to be predicted.

[0120] In one embodiment, the time series change trend curve includes a total time series change trend curve, a periodic change trend curve, a holiday change curve and an error curve; the loop module is also used to accumulate trend items, periodic items, holiday items and error items according to the corresponding trend items of the first type of time nodes in the total time series change trend curve, the periodic items in the periodic change trend curve, the holiday items in the holiday change curve, and the error items in the error curve to obtain the predicted quantity data of the first type of time nodes.

[0121] The above-mentioned cargo quantity prediction device uses the target prediction time and the historical feature data set of the cargo quantity in the historical records to perform quantity prediction based on the feature data in the historical feature data set, obtains the newly added features of the cargo quantity corresponding to the next prediction time node, and then updates the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set, and then uses the updated historical feature data set again as the historical feature data set for rolling cycle update prediction, so as to improve the reliability of the feature data used to predict the predicted quantity data for the target prediction time, avoid the data duplication problem caused by simple data filling in the traditional method, and use reliable prediction feature data as the historical feature data of the target prediction time to improve the accuracy of the predicted quantity data for the target prediction time.

[0122] For the specific definition of the cargo quantity prediction device, please refer to the definition of the cargo quantity prediction method above, which will not be repeated here. Each module in the above cargo quantity prediction device can be implemented in whole or in part by software, hardware and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0123] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store piece quantity prediction data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting the quantity of goods is implemented.

[0124] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0126] Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records;

[0127] Based on the historical feature data set, obtain the new features of the cargo quantity corresponding to the next prediction time node;

[0128] The newly added features of the cargo quantity are updated to the historical feature data set to obtain an updated historical feature data set;

[0129] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time;

[0130] Cargo quantity is predicted based on the latest updated historical feature data set to obtain the predicted quantity data for the target prediction time.

[0131] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0132] Obtain the time characteristics and preset lag time of each time node in the historical records;

[0133] According to the time characteristics and the lag time, determine the lag time node corresponding to each time node;

[0134] Obtain the piece quantity data at each time node and the lagged piece quantity data corresponding to the lagged time node;

[0135] According to the lagged quantity data, the mean value and variance of the quantity are calculated to obtain the window characteristics of each time node;

[0136] According to the time characteristics, piece quantity data, lagged piece quantity data and window characteristics of each time node, a historical feature data set is obtained.

[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0138] Obtaining feature data weight parameters corresponding to feature categories of historical feature data;

[0139] According to each historical feature data and feature data weight parameter, the predicted quantity data corresponding to the next prediction time node is obtained;

[0140] According to the predicted piece quantity data, the predicted lagged piece quantity data and the predicted window characteristics in the predicted characteristic data are obtained;

[0141] According to the time characteristics corresponding to the next prediction time node, the predicted piece quantity data, the predicted lagged piece quantity data and the prediction window characteristics, the newly added characteristics of the cargo piece quantity corresponding to the next prediction time node are determined.

[0142] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0143] Determine the time period to be predicted based on the target prediction time;

[0144] When the duration corresponding to the time period to be predicted is not greater than the preset duration, the updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time.

[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0146] When the time period to be predicted is greater than the preset time length, the time characteristics corresponding to each time node to be predicted in the time period to be predicted are obtained;

[0147] When the time node to be predicted is a first-type time node whose time characteristics include non-holidays, a time series change trend curve of the time period to be predicted is obtained, and the predicted piece quantity data of the first-type time node is obtained according to the corresponding value of the first-type time node in the time series change trend curve;

[0148] When the time node to be predicted is a second-type time node whose time characteristics include holidays, a feature data set of the lead time of the second-type time node is obtained, the feature data set of the lead time is re-used as a historical feature data set, and the step of obtaining new features of the cargo quantity corresponding to the next predicted time node based on the historical feature data set is returned until the next predicted time node is a first-type time node or a target prediction time.

[0149] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0150] Obtaining the predicted feature data of the second type of time nodes within the lead time, and the predicted piece quantity data and the predicted lagged piece quantity data corresponding to the first type of time nodes within the lead time;

[0151] According to the data of the predicted delayed quantity, the prediction window characteristics are determined to obtain the prediction characteristic data of the first type of time node within the lead time;

[0152] The prediction feature data of the first type of time nodes within the lead time and the prediction feature data of the second type of time nodes are collected to obtain a feature data set of the lead time of the second type of time nodes to be predicted.

[0153] In one embodiment, the time series change trend curve includes a total time series change trend curve, a periodic change trend curve, a holiday change curve and an error curve; when the processor executes the computer program, the following steps are also implemented:

[0154] According to the trend item corresponding to the first type of time node in the total time series change trend curve, the period item in the period change trend curve, the holiday item in the holiday change curve, and the error item in the error curve;

[0155] Accumulate trend items, cycle items, holiday items and error items to obtain the predicted quantity data for the first type of time node.

[0156] The above-mentioned computer device for implementing the cargo quantity prediction method uses the target prediction time and the historical feature data set of the cargo quantity in the historical records to predict the quantity according to the feature data in the historical feature data set, obtains the newly added features of the cargo quantity corresponding to the next prediction time node, and then updates the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set, and then uses the updated historical feature data set again as the historical feature data set for rolling cycle update prediction, so as to improve the reliability of the feature data used to predict the predicted quantity data for the target prediction time, avoid the data duplication problem caused by simple data filling in the traditional method, and use reliable prediction feature data as the historical feature data for the target prediction time to improve the accuracy of the predicted quantity data for the target prediction time.

[0157] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0158] Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records;

[0159] Based on the historical feature data set, obtain the new features of the cargo quantity corresponding to the next prediction time node;

[0160] The newly added features of the cargo quantity are updated to the historical feature data set to obtain an updated historical feature data set;

[0161] The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the additional features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time;

[0162] Cargo quantity is predicted based on the latest updated historical feature data set to obtain the predicted quantity data for the target prediction time.

[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0164] Obtain the time characteristics and preset lag time of each time node in the historical records;

[0165] According to the time characteristics and the lag time, determine the lag time node corresponding to each time node;

[0166] Obtain the quantity data of each time node and the lagged quantity data corresponding to the lagged time node;

[0167] According to the lagged quantity data, the mean value and variance of the quantity are calculated to obtain the window characteristics of each time node;

[0168] According to the time characteristics, piece quantity data, lagged piece quantity data and window characteristics of each time node, a historical characteristic data set is obtained.

[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0170] Obtaining feature data weight parameters corresponding to feature categories of historical feature data;

[0171] According to each historical feature data and feature data weight parameter, the predicted quantity data corresponding to the next prediction time node is obtained;

[0172] According to the predicted piece quantity data, the predicted lagged piece quantity data and the predicted window characteristics in the predicted characteristic data are obtained;

[0173] According to the time characteristics corresponding to the next prediction time node, the predicted piece quantity data, the predicted lagged piece quantity data and the prediction window characteristics, the newly added characteristics of the cargo piece quantity corresponding to the next prediction time node are determined.

[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0175] Determine the time period to be predicted based on the target prediction time;

[0176] When the duration corresponding to the time period to be predicted is not greater than the preset duration, the updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time.

[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0178] When the time period to be predicted is greater than the preset time length, the time characteristics corresponding to each time node to be predicted in the time period to be predicted are obtained;

[0179] When the time node to be predicted is a first-type time node whose time characteristics include non-holidays, a time series change trend curve of the time period to be predicted is obtained, and the predicted piece quantity data of the first-type time node is obtained according to the corresponding value of the first-type time node in the time series change trend curve;

[0180] When the time node to be predicted is a second-type time node whose time characteristics include holidays, a feature data set of the lead time of the second-type time node is obtained, the feature data set of the lead time is re-used as a historical feature data set, and the step of obtaining new features of the cargo quantity corresponding to the next predicted time node based on the historical feature data set is returned until the next predicted time node is a first-type time node or a target prediction time.

[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0182] Obtaining the predicted feature data of the second type of time nodes within the lead time, and the predicted piece quantity data and the predicted lagged piece quantity data corresponding to the first type of time nodes within the lead time;

[0183] According to the data of the predicted delayed quantity, the prediction window characteristics are determined to obtain the prediction characteristic data of the first type of time node within the lead time;

[0184] The prediction feature data of the first type of time nodes within the lead time and the prediction feature data of the second type of time nodes are collected to obtain a feature data set of the lead time of the second type of time nodes to be predicted.

[0185] In one embodiment, the time series change trend curve includes a total time series change trend curve, a periodic change trend curve, a holiday change curve and an error curve; when the computer program is executed by the processor, the following steps are also implemented:

[0186] According to the trend item corresponding to the first type of time node in the total time series change trend curve, the period item in the period change trend curve, the holiday item in the holiday change curve, and the error item in the error curve;

[0187] Accumulate trend items, cycle items, holiday items and error items to obtain the predicted quantity data for the first type of time node.

[0188] The computer-readable storage medium for implementing the cargo quantity prediction method uses the target prediction time and the historical feature data set of the cargo quantity in the historical records to predict the quantity according to the feature data in the historical feature data set, obtains the newly added features of the cargo quantity corresponding to the next prediction time node, and then updates the newly added features of the cargo quantity to the historical feature data set to obtain an updated historical feature data set, and then uses the updated historical feature data set again as the historical feature data set for rolling cycle update prediction, so as to improve the reliability of the feature data used to predict the predicted quantity data for the target prediction time, avoid the data duplication problem caused by simple data filling in the traditional method, and use reliable prediction feature data as the historical feature data for the target prediction time to improve the accuracy of the predicted quantity data for the target prediction time.

[0189] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (MRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0191] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for predicting the quantity of goods, characterized in that: The method comprises: Obtain the target prediction time and the historical feature data set of the cargo quantity in the historical records; Determine the time period to be predicted according to the target prediction time; when the duration corresponding to the time period to be predicted (T+1, T+N) is greater than the preset duration M, determine the first time period to be predicted (T+1, T+M] and the second time period to be predicted (T+M, T+N) according to the preset duration M; For the first time period to be predicted (T+1, T+M], obtaining the newly added features of the cargo quantity corresponding to the next prediction time node according to the historical feature data set; The newly added feature of the quantity of goods corresponding to the next prediction time node is updated to the historical feature data set to obtain the updated historical feature data set; The updated historical feature data set is used again as the historical feature data set, and the step of obtaining the newly added feature of the quantity of goods corresponding to the next prediction time node according to the historical feature data set is returned until the next prediction time node is the target prediction time; Cargo quantity prediction is performed based on the latest updated historical feature data set to obtain predicted quantity data for the first time period to be predicted; For the second time period to be predicted (T+M, T+N), the cargo quantity prediction processing is performed by using two processing methods to distinguish the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays, wherein the cargo quantity prediction processing method of the second type of time nodes is the same as that of the first time period to be predicted (T+1, T+M]; When the time node to be predicted is a first-type time node whose time characteristics include non-holidays, the time series change trend curve of the time period to be predicted is obtained, and the predicted quantity data of the first-type time node is obtained according to the corresponding value of the first-type time node in the time series change trend curve.

2. The method according to claim 1, characterized in that The acquisition of the historical feature data set of the quantity of goods in the historical records includes: Obtaining the time characteristics and preset lag time of each time node in the historical record; Determine the lag time node corresponding to each of the time nodes according to the time characteristics and the lag time; Obtaining the piece quantity data of each of the time nodes and the delayed piece quantity data corresponding to the delayed time nodes; According to the lagged piece quantity data, the piece quantity average value and variance are calculated to obtain the window characteristics of each time node; The historical feature data set is obtained according to the time characteristics, piece quantity data, lagged piece quantity data and the window characteristics of each time node.

3. The method according to claim 1, characterized in that The acquiring, according to the historical feature data set, a new feature of the quantity of goods corresponding to the next prediction time node comprises: Acquire a feature data weight parameter corresponding to a feature category of the historical feature data; Obtaining predicted piece quantity data corresponding to the next prediction time node according to each of the historical feature data and the feature data weight parameter; According to the predicted piece quantity data, the predicted delayed piece quantity data and the predicted window characteristics in the predicted characteristic data are obtained; According to the time characteristics corresponding to the next prediction time node, the predicted piece quantity data, the predicted lagged piece quantity data and the prediction window characteristics, the newly added characteristics of the cargo piece quantity corresponding to the next prediction time node are determined.

4. The method according to claim 1, characterized in that: The step of reusing the updated historical feature data set as the historical feature data set and returning to the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set until the next prediction time node is the target prediction time further includes: When the duration corresponding to the time period to be predicted is not greater than the preset duration, the updated historical feature data set is re-used as the historical feature data set, and the step of obtaining the newly added features of the cargo quantity corresponding to the next prediction time node based on the historical feature data set is returned until the next prediction time node is the target prediction time.

5. The method according to claim 4, characterized in that After determining the time period to be predicted according to the target prediction time, the method further includes: When the time period to be predicted is greater than a preset time length, obtaining time characteristics corresponding to each time node to be predicted in the time period to be predicted; When the time node to be predicted is a second-type time node whose time characteristics include holidays, a feature data set of the lead time of the second-type time node is obtained, the feature data set of the lead time is re-used as the historical feature data set, and the step of obtaining the newly added feature of the cargo quantity corresponding to the next predicted time node based on the historical feature data set is returned until the next predicted time node is the first-type time node or the target prediction time.

6. The method according to claim 5, characterized in that The step of obtaining the feature data set of the lead time of the second type of time node comprises: Acquire the predicted characteristic data of the second type of time nodes within the lead time, and the predicted piece quantity data and the predicted lagged piece quantity data corresponding to the first type of time nodes within the lead time; Determine the prediction window characteristics according to the predicted delayed quantity data, and obtain the prediction characteristic data of the first type of time node within the lead time; The prediction feature data of the first type of time nodes and the prediction feature data of the second type of time nodes within the lead time are aggregated to obtain a feature data set of the lead time of the second type of time nodes to be predicted.

7. The method according to claim 5, characterized in that The time series change trend curve includes a total time series change trend curve, a periodic change trend curve, a holiday change curve and an error curve; the predicted quantity data of the first type of time node obtained according to the corresponding value of the first type of time node in the time series change trend curve includes: According to the trend item corresponding to the first type of time node in the total time series change trend curve, the period item in the period change trend curve, the holiday item in the holiday change curve, and the error item in the error curve; The trend item, the cycle item, the holiday item and the error item are accumulated to obtain the predicted quantity data of the first type of time node.

8. A cargo quantity prediction device, characterized in that: The device comprises: A historical feature data set acquisition module is used to acquire a historical feature data set of target prediction time and cargo quantity in historical records; A time period determination module is used to determine the time period to be predicted according to the target prediction time; when the duration corresponding to the time period to be predicted (T+1, T+N) is greater than the preset duration M, a first time period to be predicted (T+1, T+M] and a second time period to be predicted (T+M, T+N) are determined according to the preset duration M; a new feature acquisition module is added to obtain, for the first time period to be predicted (T+1, T+M], a new feature of the cargo quantity corresponding to the next prediction time node according to the historical feature data set; An updating module, configured to update the newly added features of the quantity of goods corresponding to the next prediction time node to the historical feature data set, to obtain an updated historical feature data set; a loop module, configured to use the updated historical feature data set again as the historical feature data set, and return to the step of obtaining the newly added features of the quantity of goods corresponding to the next prediction time node according to the historical feature data set, until the next prediction time node is the target prediction time; The module for obtaining the predicted quantity data is used to predict the quantity of goods according to the latest updated historical feature data set, and obtain the predicted quantity data for the first time period to be predicted; for the second time period to be predicted (T+M, T+N), the prediction processing of the quantity of goods is performed by using two processing methods to distinguish the first type of time nodes whose time characteristics include non-holidays and the second type of time nodes whose time characteristics include holidays, wherein the processing method for predicting the quantity of goods at the second type of time nodes is the same as that for the first time period to be predicted (T+1, T+M]. When the time node to be predicted is the first type of time node whose time characteristics include non-holidays, the time series change trend curve of the time period to be predicted is obtained, and the predicted quantity data of the first type of time nodes are obtained according to the corresponding values ​​of the first type of time nodes in the time series change trend curve.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.