CN112907267A - Method and device for predicting cargo quantity, computer equipment and storage medium - Google Patents

Method and device for predicting cargo quantity, computer equipment and storage medium Download PDF

Info

Publication number
CN112907267A
CN112907267A CN201911220464.2A CN201911220464A CN112907267A CN 112907267 A CN112907267 A CN 112907267A CN 201911220464 A CN201911220464 A CN 201911220464A CN 112907267 A CN112907267 A CN 112907267A
Authority
CN
China
Prior art keywords
time
predicted
data set
historical
prediction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911220464.2A
Other languages
Chinese (zh)
Inventor
丁宇
魏昊卿
曾文烨
闵炎华
王飞
刘子恒
汤芬斯蒂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SF Technology Co Ltd
SF Tech Co Ltd
Original Assignee
SF Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SF Technology Co Ltd filed Critical SF Technology Co Ltd
Priority to CN201911220464.2A priority Critical patent/CN112907267A/en
Publication of CN112907267A publication Critical patent/CN112907267A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/08Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
    • G06Q10/083Shipping

Abstract

The application relates to a cargo quantity prediction method, a cargo quantity prediction device, a computer device and a storage medium. The method comprises the following steps: acquiring a target prediction time and a historical characteristic data set of the cargo quantity in the historical record, acquiring a cargo quantity added characteristic corresponding to a node of the next prediction time according to the historical characteristic data set, updating the cargo quantity added characteristic to the historical characteristic data set to obtain an updated historical characteristic data set, re-using the updated historical characteristic data set as the historical characteristic data set, returning to the step of acquiring a cargo quantity added characteristic corresponding to the node of the next prediction time according to the historical characteristic data set until the node of the next prediction time is the target prediction time, and predicting the cargo quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time. The reliable prediction characteristic data are used as the historical characteristic data of the target prediction time, and the accuracy of the predicted component data of the target prediction time is improved.

Description

Method and device for predicting cargo quantity, computer equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and an apparatus for predicting a quantity of goods, a computer device, and a storage medium.
Background
With the development of logistics technology, the analysis of express delivery quantity is used as an important process in the field of logistics, the forecast of cargo quantity is a fundamental and important problem in the field of logistics, and the reasonable estimation of quantity has important reference function for personnel, vehicle configuration and planning of logistics companies in the next year.
The traditional component prediction is realized based on a supervised learning method, the medium-term and long-term component prediction is generally supplemented by a data filling mode, the supervised machine learning method is highly dependent on input features, and the filling method causes inaccuracy of medium-term and long-term component prediction results due to the fact that component features are extremely easy to repeat for the medium-term and long-term component prediction.
Disclosure of Invention
Based on this, it is necessary to provide a method, an apparatus, a computer device and a storage medium for predicting medium-and long-term quality, which can improve the accuracy of the medium-and long-term quality prediction result, aiming at the technical problem that the medium-and long-term quality prediction result is inaccurate.
A method of component prediction, the method comprising:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a new cargo quantity characteristic corresponding to the next predicted time node according to the historical characteristic data set;
updating the newly added characteristics of the cargo quantity to a historical characteristic data set to obtain an updated historical characteristic data set;
the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set is returned until the next prediction time node is the target prediction time;
and predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
In one embodiment, obtaining a historical data set of characteristics of the quantity of the items in the history comprises:
acquiring time characteristics and preset lag time of each time node in a historical record;
determining a lag time node corresponding to each time node according to the time characteristics and the lag time;
acquiring component data of each time node and hysteresis component data corresponding to the hysteresis time nodes;
calculating the mean value and the variance of the components according to the hysteresis component data to obtain the window characteristics of each time node;
and obtaining a historical characteristic data set according to the time characteristics, the component data, the hysteresis component data and the window characteristics of each time node.
In one embodiment, obtaining the new cargo quantity added feature corresponding to the next predicted time node according to the historical feature data set comprises:
acquiring a feature data weight parameter corresponding to a feature category of historical feature data;
according to the historical characteristic data and the characteristic data weight parameters, obtaining predicted component data corresponding to the next predicted time node;
obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data;
and determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted delay quantity data and the predicted window characteristic corresponding to the next predicted time node.
In one embodiment, the step of obtaining the new added feature of the cargo quantity corresponding to the next predicted time node according to the historical feature data set by using the updated historical feature data set as the historical feature data set again until the next predicted time node is the target predicted time further includes:
determining a time period to be predicted according to the target prediction time;
the step of taking the updated historical characteristic data set as the historical characteristic data set again and returning to the step of obtaining the cargo quantity newly-increased characteristic corresponding to the next prediction time node according to the historical characteristic data set until the next prediction time node is the target prediction time comprises the following steps:
and when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the cargo quantity newly-increased characteristic corresponding to the next predicted time node is returned according to the historical characteristic data set until the next predicted time node is the target predicted time.
In one embodiment, 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 longer than the preset time length, acquiring 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 of time node with time characteristics including non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve;
and when the time node to be predicted is a second type time node with time characteristics including holidays, acquiring a characteristic data set of the lead time of the second type time node, re-using the characteristic data set of the lead time as a historical characteristic data set, returning to the step of acquiring the cargo quantity newly-added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the first type time node or the target predicted time.
In one embodiment, obtaining the feature data set of the lead time of the time node of the second type includes:
acquiring the predicted characteristic data of a second type of time node in the lead time, and the predicted component data and the predicted delay component data corresponding to a first type of time node in the lead time;
determining the characteristics of a prediction window according to the prediction hysteresis quantity data to obtain prediction characteristic data of a first class of time nodes in the lead time;
and collecting the predicted characteristic data of the first type of time nodes and the predicted characteristic data of the second type of time nodes in the lead time to obtain a characteristic data set of the lead time of the second type of time nodes to be predicted.
In one embodiment, the time-series variation trend curve comprises a total time-series variation trend curve, a periodic variation trend curve, a holiday variation curve and an error curve; obtaining predicted component quantity data of the first type of time nodes according to corresponding values of the first type of time nodes in the time sequence variation trend curve comprises the following steps:
according to the corresponding trend term of the first class of time nodes in the total time sequence change trend curve, the period term in the periodic change trend curve, the holiday term in the holiday change curve and the error term in the error curve;
and accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time nodes.
A cargo quantity prediction apparatus, the apparatus comprising:
the historical characteristic data set acquisition module is used for acquiring a target prediction time and a historical characteristic data set of the goods quantity in the historical record;
the newly-added feature acquisition module is used for acquiring the newly-added feature of the cargo quantity corresponding to the next predicted time node according to the historical feature data set;
the updating module is used for updating the newly added characteristics of the goods quantity to the historical characteristic data set to obtain an updated historical characteristic data set;
the circulation module is used for taking the updated historical characteristic data set as the historical characteristic data set again and returning to the step of obtaining the new cargo quantity added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the target predicted time;
and the predicted component data obtaining module is used for predicting the cargo component according to the latest updated historical characteristic data set to obtain predicted component data of the target predicted time.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a new cargo quantity characteristic corresponding to the next predicted time node according to the historical characteristic data set;
updating the newly added characteristics of the cargo quantity to a historical characteristic data set to obtain an updated historical characteristic data set;
the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set is returned until the next prediction time node is the target prediction time;
and predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a new cargo quantity characteristic corresponding to the next predicted time node according to the historical characteristic data set;
updating the newly added characteristics of the cargo quantity to a historical characteristic data set to obtain an updated historical characteristic data set;
the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set is returned until the next prediction time node is the target prediction time;
and predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
The goods quantity predicting method, the device, the computer equipment and the storage medium have the advantages that through the target predicting time and the historical characteristic data set of the goods quantity in the historical record, predicting the quantity of goods according to the characteristic data in the historical characteristic data set to obtain the new quantity of goods characteristic corresponding to the next prediction time node, then updating the newly added characteristics of the cargo quantity to the historical characteristic data set to obtain an updated historical characteristic data set, further taking the updated historical characteristic data set as the historical characteristic data set again to carry out rolling cycle updating prediction, the reliability of the characteristic data of the predicted quantity data for predicting the target predicted time is improved, the problem of data repeatability caused by simple data filling in the traditional mode is solved, and the accuracy of the predicted quantity data of the target predicted time is improved by using the reliable predicted characteristic data as the historical characteristic data of the target predicted time.
Drawings
FIG. 1 is a diagram illustrating an exemplary scenario for a cargo quantity prediction method;
FIG. 2 is a schematic flow chart of a cargo quantity prediction method according to an embodiment;
FIG. 3 is a flow diagram illustrating the historical characteristic data set steps of a cargo quantity prediction method in one embodiment;
FIG. 4 is a schematic flow chart of a cargo quantity prediction method according to another embodiment;
FIG. 5 is a block diagram showing the construction of a component predicting apparatus according to an embodiment;
FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for predicting the quantity of the cargo items can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The server 104 receives target prediction time to be subjected to piece amount prediction uploaded by the terminal, obtains the target prediction time and a historical characteristic data set of the goods amount in the historical record, obtains a goods amount newly-added characteristic corresponding to a next prediction time node according to the historical characteristic data set, wherein the historical characteristic data set is composed of characteristic data of a plurality of historical time nodes, the historical time nodes are arranged according to the time sequence, and a time node immediately after the last historical time node is the next prediction time node. The next predicted time node may be a target time node corresponding to the target predicted time directly, or may be an intermediate time node between the last past time node and the target time node, for example, when the target time node is a time node immediately after the last past time node, the next predicted time node is a time node corresponding to the target predicted time, and for example, when there are other time nodes between the target time node and the last past time node, the next predicted time node is the intermediate time node. The time variation amplitude between the adjacent time nodes can be one day or other time lengths set according to requirements, and the variation amplitude between every two adjacent time nodes is the same. For example, if the piece data to be predicted is a daily piece, the amplitude between the respective time nodes, i.e., the cycle period, may be set to 1 day. Updating the cargo quantity newly-increased feature to a historical feature data set to obtain an updated historical feature data set, re-using the updated historical feature data set as the historical feature data set and returning, obtaining the cargo quantity newly-increased feature corresponding to the next predicted time node according to the historical feature data set until the next predicted time node is the target predicted time, predicting the cargo quantity according to the latest updated historical feature data set to obtain the predicted quantity data of the target predicted time and feeding the predicted quantity data back to the terminal 102.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
It is to be understood that the application scenario described above can also be implemented by a terminal carrying a processor. The method comprises the steps that a processor of a terminal obtains target prediction time and a historical characteristic data set of the quantity of goods in a historical record, obtains a new quantity characteristic of the goods corresponding to a node of the next prediction time according to the historical characteristic data set, updates the new quantity characteristic of the goods to the historical characteristic data set to obtain an updated historical characteristic data set, takes the updated historical characteristic data set as the historical characteristic data set again, returns to the step of obtaining the new quantity characteristic of the goods corresponding to the node of the next prediction time according to the historical characteristic data set until the node of the next prediction time is the target prediction time, predicts the quantity of the goods according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time, and displays the predicted quantity data.
In one embodiment, as shown in fig. 2, a method for predicting the amount of cargo is provided, which is illustrated by applying the method to the server in fig. 1, and includes the following steps S210 to S240.
S210, acquiring a target prediction time and a historical characteristic data set of the cargo quantity in the historical record.
The goods quantity prediction refers to a process of performing prediction analysis on the quantity of the time node to be predicted according to various historical characteristic data before the time node to be predicted, and the goods can be express, and the goods quantity prediction can be the express receiving quantity prediction and the express delivery quantity prediction. The component prediction analysis can be obtained by Xgboost (eXtreme Gradient Boosting) and LSTM (Long Short-Term Memory network) machine learning models. The target prediction time refers to a time at which the component prediction is required, and specifically, the target prediction time may be a short-term time, a medium-term time, or a long-term time. The short-term time, the medium-term time, or the long-term time are relative concepts with respect to the historical time range, for example, the current time is 11/15/2019, the historical time range is 10/1/11/14/taking the prediction period as an example, the target prediction time is a short-term time if the target prediction time is separated from the current time by several days, such as 11/18/month, the target prediction time is a medium-term time if the target prediction time is separated from the current time by several weeks, such as 11/29/month, and the target prediction time is a long-term time if the target prediction time is separated from the current time by several months, even several years, such as 2020/5/1/month. The time range of the history record refers to a range formed by historical time of existing data related to the quantity of the historical goods, for example, the history record is data starting from 3/1/2019, and if the current time is 11/15/2019, the history record is data from 3/1/2019 to 11/15/2019. It is understood that the dates are only used for illustration, and in practical application, the dates can be adjusted according to practical situations.
In one embodiment, the forecast of the quantity of cargo items may be a daily quantity forecast, with one day being an analysis period. In another embodiment, the analysis period of the cargo quantity prediction may also be adjusted according to the actual demand, for example, a period of one week, and the like, which is not limited herein.
And S220, acquiring the new cargo quantity added characteristic corresponding to the next predicted time node according to the historical characteristic data set.
The features in the historical feature data set include time features, component data, hysteresis data, and window features for each time node in the time range for which the history corresponds. The new cargo quantity adding features comprise time features, quantity data, hysteresis quantity data and window features of the next predicted time node.
Taking daily measurement prediction as an example, for a historical time node T, the time characteristics include the day of the week T, the day of the month T, whether T is a holiday, etc. The holidays comprise legal holidays and shopping festivals of large shopping platforms and the like. The component data comprises components corresponding to T, the hysteresis component data comprises component data of historical time nodes corresponding to hysteresis time, the hysteresis time is 7 days for example, and the hysteresis component data comprises components corresponding to historical time nodes T-1 to T-7 and the like. The lag time includes, but is not limited to, one week, and can be adjusted as needed. The window characteristic includes a mean and variance of a plurality of historical data associated with the presence of the particular location data, the historical data having a time range that is the same as the lag time range, e.g., for time node T, the lag time is T-1 to T-7, and the window characteristic for time node T includes the mean, variance, etc. of the T-1 to T-7 components. . In one embodiment, for any historical time node T in the history, the time characteristic, the element quantity data, the hysteresis quantity data and the window characteristic thereof may form a multidimensional vector.
The component prediction analysis can be obtained by 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. The machine learning model for performing the component prediction analysis may be obtained by performing model training and model parameter adjustment through historical feature data. The model training may be obtained based on an existing model training mode, and is not limited herein. Through a trained machine learning model, various historical characteristic data in a historical time range can be used as input data, prediction analysis of the machine learning model is utilized to obtain predicted quantity data of a first prediction time node corresponding to an existing historical record, namely an initial prediction time node, time characteristics of the initial prediction time node and a corresponding lag time range can be determined in the same manner based on the predicted quantity data of the initial prediction time node, and then prediction lag quantity data and prediction window characteristics of the initial prediction time node are determined according to the lag time range, so that the cargo quantity increasing characteristic of the initial prediction time node is obtained. The initial prediction time node is a time adjacent to the maximum value of the historical time range and having no temporary data, and for example, if the historical records are from 10 months 1 day to 11 months 14 days, the initial prediction time node is 11 months 15 days.
And S230, updating the newly added characteristics of the goods quantity to the historical characteristic data set to obtain an updated historical characteristic data set.
According to the predicted quantity data of the next predicted time node, the predicted hysteresis quantity data and the predicted window characteristic corresponding to the next predicted time node can be obtained, and the cargo quantity increasing characteristic of the time node can be obtained by combining the time characteristic of the time node. In a specific embodiment, since the duration of the lag time is fixed, for example, the specified time node is pushed back by one week, 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 is also updated correspondingly. And determining each item of component quantity data in the updated lag time range by updating the lag time range, so as to obtain the predicted lag component quantity data and the predicted window characteristic corresponding to the next predicted time node. For example, if the lag time range of the initial prediction time node is 11/8 to 11/14, the update lag time range corresponding to the next prediction time node after update is 11/9 to 11/15, that is, the lag time range is pushed back by one day. And updating the cargo quantity newly-added characteristics such as time characteristics, predicted quantity data, predicted delay quantity data and predicted window characteristics to a historical characteristic data set to obtain an updated historical characteristic data set.
And S240, taking the updated historical characteristic data set as the historical characteristic data set again, judging whether the next predicted time node is the target predicted time, returning to the step S220 when the judgment result is yes, and jumping to the step S250 when the judgment result is no.
In one embodiment, when the target predicted time is short-term time or medium-term time, predicted component quantity data of a next predicted time node corresponding to a historical time range can be predicted according to various feature data in a historical feature data set corresponding to a historical record, a cargo component quantity newly-added feature corresponding to the next predicted time node is updated to the historical feature data set, the updated historical feature data set is used as the historical feature data set again and returned, a cargo component quantity newly-added feature corresponding to the next predicted time node is obtained according to the historical feature data set, the steps are sequentially rolled and updated, the newly-obtained predicted component quantity data and other predicted component quantity features are updated to the historical feature data set, and the next predicted time node is the target predicted time. It can be understood that, according to the data accuracy requirement, the rolling update prediction can be performed on all time periods corresponding to the long-term time.
In another embodiment, when the target prediction time is the long-term prediction time, for a time period to be predicted corresponding to the target prediction time, obtaining predicted component data of the time period to be predicted by distinguishing holidays and non-holidays in a time range to be predicted, adopting a rolling updating prediction mode for the holidays, adopting a time sequence prediction mode for the non-holidays, then obtaining predicted characteristic data based on the predicted component data of the time period to be predicted, and updating the newly-added predicted characteristic data of the time period to be predicted to a historical characteristic data set to obtain the predicted component data of the target prediction time.
And S250, predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
And predicting the goods quantity by the latest updated historical characteristic data set, and obtaining predicted quantity data of the target predicted time by adopting the same prediction mode as the method.
The method for predicting the quantity of the goods comprises the steps of predicting time of the target and historical characteristic data sets of the quantity of the goods in the historical records, predicting the quantity of goods according to the characteristic data in the historical characteristic data set to obtain the new quantity of goods characteristic corresponding to the next prediction time node, then updating the newly added characteristics of the cargo quantity to the historical characteristic data set to obtain an updated historical characteristic data set, further taking the updated historical characteristic data set as the historical characteristic data set again to carry out rolling cycle updating prediction, the reliability of the characteristic data of the predicted quantity data for predicting the target predicted time is improved, the problem of data repeatability caused by simple data filling in the traditional mode is solved, and the accuracy of the predicted quantity data of the target predicted time is improved by using the reliable predicted characteristic data as the historical characteristic data of the target predicted time.
In one embodiment, as shown in FIG. 3, obtaining the historical characteristic data set of the quantity of the cargo item in the history record includes steps S310 to S350.
S310, acquiring time characteristics and preset lag time of each time node in the history record.
And S320, determining a lag time node corresponding to each time node according to the time characteristics and the lag time.
S330, acquiring the component data of each time node and the hysteresis component data corresponding to the hysteresis time node.
And S340, calculating the mean value and the variance of the elements according to the hysteresis element data to obtain the window characteristics of each time node.
And S350, obtaining a historical characteristic data set according to the time characteristics, the component data, the lagging component data and the window characteristics of each time node.
The historical records are formed by characteristic data of time nodes of each piece of existing piece data, wherein if the piece data of the current time can be directly obtained, the maximum time node corresponding to the historical records can be the current time, the initial predicted time node corresponding to the historical records is the next day of the current time, and if the piece data of the current time cannot be directly obtained, the maximum time node corresponding to the historical records can be the previous day of the current time, and the initial predicted time node corresponding to the historical records is the current time. The current time refers to the current date of the system.
The history record comprises a plurality of history time nodes, and one natural day is taken as one time node. In the embodiment, for any historical time node in the historical record, the feature data of the historical time node is required to be acquired, and the feature data comprises a time feature, a piece quantity data, a hysteresis quantity data and a window feature. The specific treatment process comprises the following steps: and acquiring the time characteristics of the historical time node and a preset lag time, wherein the preset lag time can be a week or other set time, and the lag time is a set fixed value, so that the number of the lag time nodes included in the lag time range is also a fixed value, but the lag time nodes included in the lag time range are updated according to the update of the next predicted time node. Determining a lag time node (such as 11 month and 8 days to 11 month and 14 days) corresponding to the historical time node according to the date (such as 11 month and 14 days) in the time characteristics of the historical time node and a preset lag time (such as 1 week), then obtaining lag component data of the lag time node, and respectively calculating a component average value and a component variance according to the lag component data to obtain the window characteristics of the historical time node. By taking the characteristic data as the basis of the component prediction, the influence of the characteristic data on the component prediction can be considered, and the accuracy of the predicted data is improved.
In one embodiment, in one of the embodiments, obtaining the new cargo quantity characteristic corresponding to the next predicted time node from the historical characteristic data set comprises: and acquiring a feature data weight parameter corresponding to the feature category of the historical feature data. And obtaining predicted component data corresponding to the next predicted time node according to the historical characteristic data and the characteristic data weight parameters. And obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data. And determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted delay quantity data and the predicted window characteristic corresponding to the next predicted time node.
In one embodiment, the component prediction analysis may be derived from machine learning models such as Xgboost and LSTM. The machine learning model comprises a plurality of parameter values, the parameter values can be obtained by adjusting through model training, and training data of the model can be historical characteristic data carrying designated output data as labels. The parameter combination can be realized in a grid search mode, and the specific evaluation criterion is a predictive evaluation index SMAPE (symmetric average absolute percentage error) of the historical component. The method comprises the steps of obtaining feature data weight parameters corresponding to feature types of historical feature data by adjusting and optimizing model parameters through a group of parameters with minimum SMAPE obtained through grid search and cross validation, inputting the historical record quantity feature data into a pre-trained machine learning model for quantity prediction in the application process of quantity prediction to obtain the quantity prediction data of a next prediction time node corresponding to the historical record, updating a lag time node according to the quantity prediction data of the next prediction time node, and determining prediction lag quantity data and prediction window features corresponding to the next prediction time node. The machine learning model after model training and parameter adjustment is used for carrying out component quantity prediction analysis, the strong calculation analysis capability of machine learning can be utilized, the processing efficiency is improved, meanwhile, through parameter adjustment, overfitting of data is avoided, and the reliability of predicted component quantity data is improved.
In one embodiment, as shown in fig. 4, the method further includes a step S410 when the updated historical characteristic data set is reused as the historical characteristic data set and the step of obtaining the cargo quantity added characteristic corresponding to the next predicted time node according to the historical characteristic data set is returned until the next predicted time node is the target predicted time.
And step S410, determining a time period to be predicted according to the target prediction time.
And taking the updated historical characteristic data set as the historical characteristic data set again, and returning to the step of obtaining the cargo quantity newly-increased characteristic corresponding to the next prediction time node according to the historical characteristic data set until the next prediction time node is the target prediction time, wherein the step S420 is specifically included.
Step S420, when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical characteristic data set is used as the historical characteristic data set again, whether the next predicted time node is the target predicted time or not is judged, if yes, the step S220 is returned, and if not, the step S250 is skipped.
The time period to be predicted is a time range which takes an initial prediction time node as a starting point and a target prediction time or the previous day of the target prediction time as an end point, the preset time is a time node for judging whether the target prediction time is long-term time, when the corresponding time period of the time period to be predicted is not more than the preset time period, namely the target prediction time is short-term time or middle-term time, and when the corresponding time period of the time period to be predicted is more than the preset time period, namely the target prediction time is long-term time. For short-term time or middle-term time, each time node to be predicted in the time period to be predicted can be obtained by performing rolling updating prediction in sequence, so that the accuracy of the piece prediction data of each time period to be predicted is improved.
In a specific embodiment, taking a cycle period of 1 day as an example, the corresponding duration of the time period to be predicted is not greater than the preset duration, namely, when the target prediction time is short-term time or middle-term time, firstly, the prediction characteristic data of the initial prediction time is taken as newly added historical characteristic data to obtain an updated historical characteristic data set, namely, the original historical characteristic data and the newly added historical characteristic data are taken as input data together to carry out prediction analysis to obtain the prediction component data of the next prediction time node which is the next day after the initial prediction time node, then, the updated historical characteristic data set corresponding to the next prediction time node is used for carrying out the quantity prediction processing, the rolling update prediction is carried out in sequence until the next prediction time node is the target prediction time, and carrying out prediction analysis by taking the target prediction time as an object to obtain predicted component data of the target prediction time.
In one embodiment, 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 longer than the preset time length, acquiring 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 of time node with time characteristics including non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve; and when the time node to be predicted is a second type time node with time characteristics including holidays, acquiring a characteristic data set of the lead time of the second type time node, re-using the characteristic data set of the lead time as a historical characteristic data set, returning to the step of acquiring the cargo quantity newly-added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the first type time node or the target predicted time.
The lead time refers to a time range formed by each time node before the time node to be predicted, namely, all time nodes before the time node to be predicted are included. And for the long-term time, acquiring the time characteristics of each time node to be predicted, wherein the time characteristics comprise whether the time node is a holiday or not. For long-term piece quantity prediction, the piece quantity prediction can be carried out through rolling of the auxiliary piece quantity of the time sequence model, for the prediction of daily piece quantity, the time sequence model only has time and piece quantity, the time sequence model has obvious periodicity, the time sequence model is stable in ordinary times of non-special holidays, and the fitting capability is weak for sudden holidays (such as national celebration, mid-autumn and double-ten days). The supervised machine learning based on the characteristics has stronger capability of fitting prediction due to the introduction of various external and component characteristics, and can effectively solve the problem of weak fitting of a time sequence model. And (3) adopting a rolling updating prediction mode for the time from T +1 to T + M before the prediction sequence, replacing rolling updating with a time sequence prediction result obtained by performing time sequence prediction based on a time sequence model for the predicted component data of each time node from the T + M day to obtain predicted component data for the non-holiday, then obtaining predicted characteristic data according to the predicted component data, and inputting the predicted characteristic data into a machine learning model for prediction by using the rolling updating prediction mode if the holiday is met, so as to circulate. For non-holidays in a time period to be predicted, a time sequence prediction mode is adopted, predicted piece quantity data can be obtained quickly, and the efficiency of long-term daily piece quantity prediction is improved. The time sequence prediction capturing periodicity capability and the strong enough expansion capability and fitting capability of the supervision machine learning model are adopted, the machine learning model with time sequence prediction and rolling updating is adopted for tasks with high calculation time consumption requirements, the calculated amount of rolling recalculation component characteristics is reduced, and the prediction accuracy and the prediction efficiency can be considered.
In one embodiment, when the corresponding duration of 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 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 according to the preset duration M, so that the condition prediction is carried out in a rolling updating mode in the first time period to be predicted within the preset duration with the initial prediction time as a starting point, for the second time period to be predicted (T + M, T + N), a processing mode of distinguishing a first type of time nodes with time characteristics including non-holidays from a second type of time nodes with time characteristics including holidays is adopted for processing, a fixed time period before the time period to be predicted is set to be adopted in a rolling updating mode, so that the data accuracy of the early prediction of the time period to be predicted can be further improved, providing a reliable data basis for subsequent prediction processing.
In another embodiment, a second preset duration P may be set, the time period (T +1, T + N) to be predicted is divided into (T +1, T + N-P ] and (T + N-P, T + N) such that within a specified duration P from the target predicted time, i.e., a time node in (T + N-P, T + N), component prediction is performed by means of rolling update, thereby improving the accuracy of the predicted feature data including the predicted component data And the data accuracy of the later prediction of the time period to be predicted is further improved, so that a more accurate prediction result is obtained.
In another embodiment, the time period (T +1, T + N) to be predicted may be divided into (T +1, T + M ], (T + M, T + N-P ]) and (T + N-P, T + N) according to the first preset time length M and the second preset time length P, and the time nodes in (T +1, T + M ] and (T + N-P, T + N) are subjected to prediction processing in a rolling update manner, and for (T + M, T + N-P), the first type of time nodes with time characteristics including non-holidays and the second type of time nodes with time characteristics including holidays are subjected to processing in a processing manner of distinguishing the time nodes, so as to ensure the accuracy of early prediction and late prediction of the time period to be predicted.
In one embodiment, obtaining the feature data set of the lead time of the second type of time node comprises: acquiring the predicted characteristic data of a second type of time node in the lead time, and the predicted component data and the predicted delay component data corresponding to a first type of time node in the lead time; determining the characteristics of a prediction window according to the prediction hysteresis quantity data to obtain prediction characteristic data of a first class of time nodes in the lead time; and collecting the predicted characteristic data of the first type of time nodes and the predicted characteristic data of the second type of time nodes in the lead time to obtain a characteristic data set of the lead time of the second type of time nodes to be predicted.
The predicted component quantity data of the second type of time node needs the feature data of each time node before the time node, before rolling updating prediction is carried out, the predicted delay component quantity data, namely the predicted delay component quantity data, needs to be determined according to the predicted component quantity data, then the predicted window features are obtained through processing of calculating the mean value, the variance and the like, then the predicted feature data of the first type of time node and the predicted feature data of the second type of time node in the lead time are collected, and each item of predicted feature data of the lead time of the second type of time node to be predicted is obtained, so that the accuracy of the predicted component quantity of the time node to be predicted including the time feature of the holiday is improved.
In one embodiment, the time-series trend curve includes a total time-series trend curve, a periodic trend curve, a holiday trend curve, and an error curve. Obtaining predicted component quantity data of the first type of time nodes according to corresponding values of the first type of time nodes in the time sequence variation trend curve comprises the following steps: and according to the corresponding trend term in the total time sequence change trend curve of the first class of time nodes, the period term in the periodic change trend curve, the holiday term in the holiday change curve and the error term in the error curve. And accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time nodes.
When time sequence prediction is carried out, time sequence change trend curves including a total time sequence change trend curve, a periodic change trend curve, a holiday change curve and an error curve are obtained through analysis based on a large amount of historical data,
the time sequence prediction can be realized based on a Prophet algorithm, and the principle of the Prophet algorithm is to use a component ytt+t+ht+∈tResolution in which gtA trend item which represents the variation trend of the time series on the non-periodic surface; stRepresents a period term, otherwise known as a seasonal term, typically in units of weeks or years; h istA term representing holidays, which represents whether holidays exist on the current day; e is the same astRepresenting an error term or a residue term. The Prophet algorithm obtains the predicted value of the time series by fitting the terms and then finally accumulating the terms. The specific prediction input and output is to input a time t column and a component y column as inputs, namely to input a time stamp and a corresponding component value of a known time sequence and the length of the time sequence to be predicted; and outputting the time series trend needing to be predicted. The output result can provide necessary statistical indexes including a fitting curve, an upper bound, a lower bound and the like, and the processing efficiency of the part quantity prediction can be improved by carrying out time sequence prediction on the non-holidays.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided a cargo quantity prediction apparatus including: a historical feature data set obtaining module 510, a newly added feature obtaining module 520, an updating module 530, a looping module 540, and a predicted component data obtaining module 550, wherein:
a historical characteristic data set obtaining module 510, configured to obtain a historical characteristic data set of the target predicted time and the amount of the cargo in the history.
And a new feature obtaining module 520, configured to obtain, according to the historical feature data set, a new cargo quantity feature corresponding to the next predicted time node.
And the updating module 530 is configured to update the cargo quantity newly-added feature to the historical feature data set to obtain an updated historical feature data set.
And the circulation module 540 is configured to reuse the updated historical feature data set as a historical feature data set, and return to the step of obtaining the new cargo quantity added feature corresponding to the next predicted time node according to the historical feature data set until the next predicted time node is the target predicted time.
And a predicted component data obtaining module 550, configured to perform the cargo component prediction according to the latest updated historical feature data set, so as to obtain predicted component data of the target prediction time.
In one embodiment, the historical characteristic data set obtaining module is further configured to obtain a time characteristic and a preset delay duration of each time node in the historical record; determining a lag time node corresponding to each time node according to the time characteristics and the lag time; acquiring component data of each time node and hysteresis component data corresponding to the hysteresis time nodes; calculating the mean value and the variance of the components according to the hysteresis component data to obtain the window characteristics of each time node; and obtaining a historical characteristic data set according to the time characteristics, the component data, the hysteresis component data and the window characteristics of each time node.
In one embodiment, the loop module is further configured to obtain a feature data weight parameter corresponding to a feature category of the historical feature data; according to the historical characteristic data and the characteristic data weight parameters, obtaining predicted component data corresponding to the next predicted time node; obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data; and determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted delay quantity data and the predicted window characteristic corresponding to the next predicted time node.
In one embodiment, the cargo quantity prediction apparatus further includes a time period determination module for determining a time period to be predicted according to the target prediction time. And the circulation module is also used for taking the updated historical characteristic data set as the historical characteristic data set again when the corresponding duration of the time period to be predicted is not greater than the preset duration, and returning to the step of obtaining the newly-increased feature of the cargo quantity corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the target predicted time.
In one embodiment, the cycle module is further configured to obtain a time characteristic corresponding to each time node to be predicted in the time period to be predicted when the time period to be predicted is longer than a preset time; when the time node to be predicted is a first type of time node with time characteristics including non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve; and when the time node to be predicted is a second type time node with time characteristics including holidays, acquiring a characteristic data set of the lead time of the second type time node, re-using the characteristic data set of the lead time as a historical characteristic data set, returning to the step of acquiring the cargo quantity newly-added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the first type time node or the target predicted time.
In one embodiment, the loop module is further configured to obtain predicted feature data of the second type of time node in the lead time, and predicted component data and predicted lag component data corresponding to the first type of time node in the lead time; determining the characteristics of a prediction window according to the prediction hysteresis quantity data to obtain prediction characteristic data of a first class of time nodes in the lead time; and collecting the predicted characteristic data of the first type of time nodes and the predicted characteristic data of the second type of time nodes in the lead time to obtain a characteristic data set of the lead time of the second type of time nodes to be predicted.
In one embodiment, the time series variation trend curve includes a total time series variation trend curve, a periodic variation trend curve, a holiday variation curve and an error curve; the circulation module is also used for changing a corresponding trend item in a trend curve, a period item in a periodic change trend curve, a holiday item in a holiday change curve and an error item in an error curve according to the first type of time nodes; and accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time nodes.
The device for predicting the quantity of the cargo items predicts the time and the historical characteristic data set of the quantity of the cargo items in the historical record according to the target, predicting the quantity of goods according to the characteristic data in the historical characteristic data set to obtain the new quantity of goods characteristic corresponding to the next prediction time node, then updating the newly added characteristics of the cargo quantity to the historical characteristic data set to obtain an updated historical characteristic data set, further taking the updated historical characteristic data set as the historical characteristic data set again to carry out rolling cycle updating prediction, the reliability of the characteristic data of the predicted quantity data for predicting the target predicted time is improved, the problem of data repeatability caused by simple data filling in the traditional mode is solved, and the accuracy of the predicted quantity data of the target predicted time is improved by using the reliable predicted characteristic data as the historical characteristic data of the target predicted time.
For the specific limitations of the device for predicting the amount of cargo, reference may be made to the above limitations of the method for predicting the amount of cargo, which are not described herein again. The modules in the device for predicting the amount of cargo may be implemented in whole or in part by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store the component quantity forecast data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a cargo quantity prediction method.
Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a new cargo quantity characteristic corresponding to the next predicted time node according to the historical characteristic data set;
updating the newly added characteristics of the cargo quantity to a historical characteristic data set to obtain an updated historical characteristic data set;
the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set is returned until the next prediction time node is the target prediction time;
and predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring time characteristics and preset lag time of each time node in a historical record;
determining a lag time node corresponding to each time node according to the time characteristics and the lag time;
acquiring component data of each time node and hysteresis component data corresponding to the hysteresis time nodes;
calculating the mean value and the variance of the components according to the hysteresis component data to obtain the window characteristics of each time node;
and obtaining a historical characteristic data set according to the time characteristics, the component data, the hysteresis component data and the window characteristics of each time node.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring a feature data weight parameter corresponding to a feature category of historical feature data;
according to the historical characteristic data and the characteristic data weight parameters, obtaining predicted component data corresponding to the next predicted time node;
obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data;
and determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted delay quantity data and the predicted window characteristic corresponding to the next predicted time node.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
determining a time period to be predicted according to the target prediction time;
and when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the cargo quantity newly-increased characteristic corresponding to the next predicted time node is returned according to the historical characteristic data set until the next predicted time node is the target predicted time.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the time period to be predicted is longer than the preset time length, acquiring 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 of time node with time characteristics including non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve;
and when the time node to be predicted is a second type time node with time characteristics including holidays, acquiring a characteristic data set of the lead time of the second type time node, re-using the characteristic data set of the lead time as a historical characteristic data set, returning to the step of acquiring the cargo quantity newly-added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the first type time node or the target predicted time.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
acquiring the predicted characteristic data of a second type of time node in the lead time, and the predicted component data and the predicted delay component data corresponding to a first type of time node in the lead time;
determining the characteristics of a prediction window according to the prediction hysteresis quantity data to obtain prediction characteristic data of a first class of time nodes in the lead time;
and collecting the predicted characteristic data of the first type of time nodes and the predicted characteristic data of the second type of time nodes in the lead time to obtain a characteristic data set of the lead time of the second type of time nodes to be predicted.
In one embodiment, the time series variation trend curve includes a total time series variation trend curve, a periodic variation trend curve, a holiday variation curve and an error curve; the processor, when executing the computer program, further performs the steps of:
according to the corresponding trend term of the first class of time nodes in the total time sequence change trend curve, the period term in the periodic change trend curve, the holiday term in the holiday change curve and the error term in the error curve;
and accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time nodes.
The computer device for implementing the method for predicting the quantity of the cargo items can predict the quantity of the cargo items according to the target prediction time and the historical characteristic data set of the quantity of the cargo items in the historical record, predicting the quantity of goods according to the characteristic data in the historical characteristic data set to obtain the new quantity of goods characteristic corresponding to the next prediction time node, then updating the newly added characteristics of the cargo quantity to the historical characteristic data set to obtain an updated historical characteristic data set, further taking the updated historical characteristic data set as the historical characteristic data set again to carry out rolling cycle updating prediction, the reliability of the characteristic data of the predicted quantity data for predicting the target predicted time is improved, the problem of data repeatability caused by simple data filling in the traditional mode is solved, and the accuracy of the predicted quantity data of the target predicted time is improved by using the reliable predicted characteristic data as the historical characteristic data of the target predicted time.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a new cargo quantity characteristic corresponding to the next predicted time node according to the historical characteristic data set;
updating the newly added characteristics of the cargo quantity to a historical characteristic data set to obtain an updated historical characteristic data set;
the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set is returned until the next prediction time node is the target prediction time;
and predicting the goods quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring time characteristics and preset lag time of each time node in a historical record;
determining a lag time node corresponding to each time node according to the time characteristics and the lag time;
acquiring component data of each time node and hysteresis component data corresponding to the hysteresis time nodes;
calculating the mean value and the variance of the components according to the hysteresis component data to obtain the window characteristics of each time node;
and obtaining a historical characteristic data set according to the time characteristics, the component data, the hysteresis component data and the window characteristics of each time node.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring a feature data weight parameter corresponding to a feature category of historical feature data;
according to the historical characteristic data and the characteristic data weight parameters, obtaining predicted component data corresponding to the next predicted time node;
obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data;
and determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted delay quantity data and the predicted window characteristic corresponding to the next predicted time node.
In one embodiment, the computer program when executed by the processor further performs the steps of:
determining a time period to be predicted according to the target prediction time;
and when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical characteristic data set is used as the historical characteristic data set again, and the step of obtaining the cargo quantity newly-increased characteristic corresponding to the next predicted time node is returned according to the historical characteristic data set until the next predicted time node is the target predicted time.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the time period to be predicted is longer than the preset time length, acquiring 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 of time node with time characteristics including non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve;
and when the time node to be predicted is a second type time node with time characteristics including holidays, acquiring a characteristic data set of the lead time of the second type time node, re-using the characteristic data set of the lead time as a historical characteristic data set, returning to the step of acquiring the cargo quantity newly-added characteristic corresponding to the next predicted time node according to the historical characteristic data set until the next predicted time node is the first type time node or the target predicted time.
In one embodiment, the computer program when executed by the processor further performs the steps of:
acquiring the predicted characteristic data of a second type of time node in the lead time, and the predicted component data and the predicted delay component data corresponding to a first type of time node in the lead time;
determining the characteristics of a prediction window according to the prediction hysteresis quantity data to obtain prediction characteristic data of a first class of time nodes in the lead time;
and collecting the predicted characteristic data of the first type of time nodes and the predicted characteristic data of the second type of time nodes in the lead time to obtain a characteristic data set of the lead time of the second type of time nodes to be predicted.
In one embodiment, the time series variation trend curve includes a total time series variation trend curve, a periodic variation trend curve, a holiday variation curve and an error curve; the computer program when executed by the processor further realizes the steps of:
according to the corresponding trend term of the first class of time nodes in the total time sequence change trend curve, the period term in the periodic change trend curve, the holiday term in the holiday change curve and the error term in the error curve;
and accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time nodes.
The computer-readable storage medium for implementing the method for predicting the quantity of the cargo items as described above, by predicting the time of the target and the historical feature data set of the quantity of the cargo items in the history, predicting the quantity of goods according to the characteristic data in the historical characteristic data set to obtain the new quantity of goods characteristic corresponding to the next prediction time node, then updating the newly added characteristics of the cargo quantity to the historical characteristic data set to obtain an updated historical characteristic data set, further taking the updated historical characteristic data set as the historical characteristic data set again to carry out rolling cycle updating prediction, the reliability of the characteristic data of the predicted quantity data for predicting the target predicted time is improved, the problem of data repeatability caused by simple data filling in the traditional mode is solved, and the accuracy of the predicted quantity data of the target predicted time is improved by using the reliable predicted characteristic data as the historical characteristic data of the target predicted time.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. 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. By way of illustration and not limitation, RAM is available in a variety of forms such as static RAM (MRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A cargo quantity prediction method, the method comprising:
acquiring target prediction time and a historical characteristic data set of the goods quantity in a historical record;
acquiring a cargo quantity newly-increased feature corresponding to the next predicted time node according to the historical feature data set;
updating the newly added feature of the cargo quantity to the historical feature data set to obtain the updated historical feature data set;
taking the updated historical characteristic data set as the historical characteristic data set again, and returning to the step of obtaining the new cargo quantity added characteristic corresponding to the next prediction time node according to the historical characteristic data set until the next prediction time node is the target prediction time;
and predicting the cargo quantity according to the latest updated historical characteristic data set to obtain predicted quantity data of the target prediction time.
2. The method of claim 1, wherein said obtaining a historical data set characterizing the quantity of the items in the history comprises:
acquiring time characteristics and preset lag time of each time node in the historical record;
determining a lag time node corresponding to each time node according to the time characteristics and the lag time;
acquiring component data of each time node and hysteresis component data corresponding to the hysteresis time nodes;
calculating the mean value and the variance of the hysteresis component quantity according to the hysteresis component quantity data to obtain the window characteristics of each time node;
and obtaining the historical characteristic data set according to the time characteristics, the component quantity data, the hysteresis component quantity data and the window characteristics of each time node.
3. The method of claim 1, wherein said deriving a cargo quantity innovation feature corresponding to a next predicted time node from the historical feature dataset comprises:
acquiring a feature data weight parameter corresponding to the feature category of the historical feature data;
obtaining predicted component data corresponding to a next predicted time node according to each historical feature data and the feature data weight parameter;
obtaining prediction hysteresis quantity data and prediction window characteristics in the prediction characteristic data according to the prediction quantity data;
and determining the cargo quantity newly-increased characteristic corresponding to the next predicted time node according to the time characteristic, the predicted quantity data, the predicted lagging quantity data and the predicted window characteristic corresponding to the next predicted time node.
4. The method according to claim 1, wherein the step of obtaining a new cargo quantity added feature corresponding to a next predicted time node from the updated historical feature data set as the historical feature data set and returning the new cargo quantity added feature to the next predicted time node according to the historical feature data set until the next predicted time node is the target predicted time further comprises:
determining a time period to be predicted according to the target prediction time;
the step of obtaining the new added feature of the cargo quantity corresponding to the next predicted time node by taking the updated historical feature data set as the historical feature data set again and returning the updated historical feature data set to the target predicted time until the next predicted time node is the target predicted time includes:
and when the corresponding duration of the time period to be predicted is not greater than the preset duration, the updated historical characteristic data set is used as the historical characteristic data set again, the step of obtaining the new cargo quantity increasing characteristic corresponding to the next predicted time node is returned according to the historical characteristic data set until the next predicted time node is the target predicted time.
5. The method of claim 4, wherein after determining the time period to be predicted according to the target prediction time, further comprising:
when the time period to be predicted is longer than a preset time length, acquiring 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 of time node of which the time characteristics comprise non-holidays, acquiring a time sequence change trend curve of the time period to be predicted, and obtaining predicted component data of the first type of time node according to a corresponding value of the first type of time node in the time sequence change trend curve;
when the time node to be predicted is the second type time node of which the time characteristics comprise holidays, acquiring a characteristic data set of the lead time of the second type time node, using the characteristic data set of the lead time as the historical characteristic data set again, returning the historical characteristic data set, and acquiring the new added characteristics of the cargo quantity corresponding to the next predicted time node until the next predicted time node is the first type time node or the target predicted time.
6. The method of claim 5, wherein the obtaining the feature data set of the lead time of the second type of time node comprises:
acquiring the predicted characteristic data of the second type of time node in the lead time, and the predicted component data and the predicted delay component data corresponding to the first type of time node in the lead time;
determining a prediction window characteristic according to the prediction hysteresis component data to obtain prediction characteristic data of a first class time node in the lead time;
and collecting the predicted characteristic data of the first class of time nodes and the predicted characteristic data of the second class of time nodes in the preposed time to obtain a characteristic data set of the preposed time of the second class of time nodes to be predicted.
7. The method of claim 5, wherein the time-series trend curve comprises a total time-series trend curve, a periodic trend curve, a holiday trend curve, and an error curve; the obtaining the predicted component quantity data of the first type of time node according to the corresponding value of the first type of time node in the time sequence variation trend curve comprises:
according to the corresponding trend term of the first type of time nodes in the total time sequence change trend curve, the period term in the period change trend curve, the holiday term in the holiday change curve and the error term in the error curve;
and accumulating the trend term, the period term, the holiday term and the error term to obtain the predicted component data of the first type of time node.
8. A cargo quantity prediction apparatus, characterized in that the apparatus comprises:
the historical characteristic data set acquisition module is used for acquiring a target prediction time and a historical characteristic data set of the goods quantity in the historical record;
the newly added feature acquisition module is used for acquiring the newly added feature of the cargo quantity corresponding to the next predicted time node according to the historical feature data set;
the updating module is used for updating the cargo quantity newly-added feature to the historical feature data set to obtain the updated historical feature data set;
a cycle module, configured to re-use the updated historical feature data set as the historical feature data set, and return to the step of obtaining a cargo quantity added feature corresponding to a next predicted time node according to the historical feature data set until the next predicted time node is the target predicted time;
and the predicted component data obtaining module is used for predicting the cargo component according to the latest updated historical characteristic data set to obtain predicted component data of the target prediction time.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201911220464.2A 2019-12-03 2019-12-03 Method and device for predicting cargo quantity, computer equipment and storage medium Pending CN112907267A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911220464.2A CN112907267A (en) 2019-12-03 2019-12-03 Method and device for predicting cargo quantity, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911220464.2A CN112907267A (en) 2019-12-03 2019-12-03 Method and device for predicting cargo quantity, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112907267A true CN112907267A (en) 2021-06-04

Family

ID=76103955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911220464.2A Pending CN112907267A (en) 2019-12-03 2019-12-03 Method and device for predicting cargo quantity, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112907267A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012149705A1 (en) * 2011-08-11 2012-11-08 华为技术有限公司 Long-term prediction method and apparatus of network traffic
CN105184391A (en) * 2015-08-19 2015-12-23 国网山东省电力公司电力科学研究院 Method for predicting wind speed and power of wind farm based on wavelet decomposition and support vector machine
CN107527113A (en) * 2017-08-01 2017-12-29 北京理工大学 A kind of operating mode Forecasting Methodology of hybrid car travel operating mode
CN107527124A (en) * 2017-10-13 2017-12-29 众安信息技术服务有限公司 The method and apparatus for generating industry basic side combination forecasting
CN107818416A (en) * 2017-11-01 2018-03-20 众安信息技术服务有限公司 The method and apparatus for generating Corporate Finance index forecast model
CN108615087A (en) * 2016-12-13 2018-10-02 中国电力科学研究院 A kind of photovoltaic module temperature short term prediction method and its forecasting system
CN108648445A (en) * 2018-04-19 2018-10-12 浙江浙大中控信息技术有限公司 Dynamic traffic Tendency Prediction method based on traffic big data
WO2019019255A1 (en) * 2017-07-25 2019-01-31 平安科技(深圳)有限公司 Apparatus and method for establishing prediction model, program for establishing prediction model, and computer-readable storage medium
CN109767024A (en) * 2017-11-09 2019-05-17 顺丰科技有限公司 Part amount prediction technique and device, equipment and storage medium
CN109978208A (en) * 2017-12-28 2019-07-05 顺丰科技有限公司 A kind of time series data prediction technique, device and computer storage medium
CN110019401A (en) * 2017-12-25 2019-07-16 顺丰科技有限公司 Part amount prediction technique, device, equipment and its storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012149705A1 (en) * 2011-08-11 2012-11-08 华为技术有限公司 Long-term prediction method and apparatus of network traffic
CN105184391A (en) * 2015-08-19 2015-12-23 国网山东省电力公司电力科学研究院 Method for predicting wind speed and power of wind farm based on wavelet decomposition and support vector machine
CN108615087A (en) * 2016-12-13 2018-10-02 中国电力科学研究院 A kind of photovoltaic module temperature short term prediction method and its forecasting system
WO2019019255A1 (en) * 2017-07-25 2019-01-31 平安科技(深圳)有限公司 Apparatus and method for establishing prediction model, program for establishing prediction model, and computer-readable storage medium
CN107527113A (en) * 2017-08-01 2017-12-29 北京理工大学 A kind of operating mode Forecasting Methodology of hybrid car travel operating mode
CN107527124A (en) * 2017-10-13 2017-12-29 众安信息技术服务有限公司 The method and apparatus for generating industry basic side combination forecasting
CN107818416A (en) * 2017-11-01 2018-03-20 众安信息技术服务有限公司 The method and apparatus for generating Corporate Finance index forecast model
CN109767024A (en) * 2017-11-09 2019-05-17 顺丰科技有限公司 Part amount prediction technique and device, equipment and storage medium
CN110019401A (en) * 2017-12-25 2019-07-16 顺丰科技有限公司 Part amount prediction technique, device, equipment and its storage medium
CN109978208A (en) * 2017-12-28 2019-07-05 顺丰科技有限公司 A kind of time series data prediction technique, device and computer storage medium
CN108648445A (en) * 2018-04-19 2018-10-12 浙江浙大中控信息技术有限公司 Dynamic traffic Tendency Prediction method based on traffic big data

Similar Documents

Publication Publication Date Title
CN108647914B (en) Production scheduling method and device, computer equipment and storage medium
US20150254554A1 (en) Information processing device and learning method
CN110390425A (en) Prediction technique and device
CN112465011B (en) Project risk prediction method and system based on project research and development process
KR102453582B1 (en) Method and system for ai demand forcasting
CN110415036B (en) User grade determining method, device, computer equipment and storage medium
CN111091196A (en) Passenger flow data determination method and device, computer equipment and storage medium
CN110610382A (en) Vehicle sales prediction method, apparatus, computer device, and storage medium
CN112395331A (en) User portrayal method, apparatus, device and medium for credit card client
CN113537850A (en) Storage optimization method and device, computer equipment and storage medium
CN112950262A (en) Sales prediction method, sales prediction apparatus, computer device, and storage medium
CN114971748A (en) Prediction data generation method, model training method, computer device, and storage medium
CN116757378A (en) Demand response evaluation model training method, application evaluation method and related equipment
CN111382974A (en) Method and device for determining shelf position, warehousing system and computer equipment
CN108764553B (en) User scale prediction method and device and computer equipment
CN111274531A (en) Commodity sales amount prediction method, commodity sales amount prediction device, computer equipment and storage medium
CN114066510A (en) Method and device for predicting commodity sales, computer equipment and storage medium
CN112907267A (en) Method and device for predicting cargo quantity, computer equipment and storage medium
CN112862137A (en) Method and device for predicting quantity, computer equipment and computer readable storage medium
CN112749821B (en) Express delivery quantity prediction method, device, computer equipment and storage medium
CN108897818B (en) Method and device for determining aging state of data processing process and readable storage medium
CN113837782A (en) Method and device for optimizing periodic item parameters of time series model and computer equipment
CN115545248A (en) Target object prediction method, device, equipment and medium
CN114548463A (en) Line information prediction method, line information prediction device, computer equipment and storage medium
CN114676868A (en) Logistics cargo quantity prediction method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination