Logistics cargo volume prediction method, device, computer equipment and storage medium
By generating historical cargo volume time series, determining the test dataset, and selecting the optimal time series model for prediction, the problem of large fluctuations in logistics cargo volume prediction is solved, the prediction accuracy and robustness are improved, and the scientific allocation of logistics resources is supported.
Patent Information
- Application Number
- CN202011547651.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-24
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2040-12-24
AI Technical Summary
Existing methods for predicting logistics cargo volume are greatly affected by fluctuations in cargo volume at different times, resulting in low accuracy of prediction results.
By acquiring historical cargo volume information of the sorting site to be predicted, a historical cargo volume time series is formed. The time identifier of the time window to be predicted is determined. The test dataset is determined from the historical cargo volume time series based on the time identifier. The test dataset is then input into the sub-models of multiple time series models to calculate the deviation. The optimal target time series model is selected for prediction.
It improves the accuracy and robustness of cargo volume forecasting, enabling it to better adapt to forecasting needs in different scenarios and support the scientific allocation of logistics resources.
Smart Images

Figure CN114676868B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of logistics technology, and in particular to a logistics cargo volume prediction method, device, computer equipment and storage medium. Background Art
[0002] In recent years, with the development of the logistics industry, the logistics business volume has maintained a high growth rate. The reliability of logistics cargo volume forecasts is an important basis for the deployment of logistics infrastructure, and is of great significance to the rational allocation of regional and sorting site resources.
[0003] At present, the methods for predicting the volume of goods in logistics are generally regression prediction, machine learning prediction algorithms, deep learning algorithms based on LSTM (Long Short-Term Memory), etc. Although these methods are already better prediction methods, due to the particularity of the logistics industry, these prediction methods still have the following shortcomings: For example, it is difficult to obtain internal and external data in the logistics industry that can be used as prediction features for modeling, and many algorithms based on big data or deep learning cannot give results with good robustness. For another example, due to the impact of holidays or shopping festivals, the volume of goods fluctuates greatly, which interferes with the prediction model, causing different models to have uneven prediction results, affecting the accuracy of the model prediction results.
[0004] Therefore, the current cargo volume forecasting method is greatly affected by the fluctuations in futures volumes at different times, and the prediction results have low accuracy. Summary of the invention
[0005] Based on this, it is necessary to provide a logistics cargo volume prediction method, device, computer equipment and storage medium to address the technical problems that the above-mentioned cargo volume prediction method is greatly affected by the fluctuations in futures volumes at different times and the prediction results are less accurate.
[0006] A method for predicting logistics cargo volume, the method comprising:
[0007] Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0008] Determine a time mark of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time mark;
[0009] Inputting each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtaining the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model;
[0010] According to the deviation, determining a target time series model from each of the sub-models;
[0011] The target time series model is used to predict the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window.
[0012] In one embodiment, the historical cargo quantity information includes the sorting time and cargo quantity of each historical waybill; the step of obtaining the historical cargo quantity information of the sorting site to be predicted to form a historical cargo quantity time series includes:
[0013] According to the sorting time and the cargo quantity of the waybill, counting the cargo quantities corresponding to the preset multiple time periods;
[0014] The cargo volumes corresponding to each of the time periods are sorted in chronological order to obtain the historical cargo volume time series.
[0015] In one embodiment, it includes:
[0016] Performing data cleaning and preprocessing on the historical cargo volume time series according to the time identifier to obtain a processed cargo volume time series;
[0017] A test data set is determined from the processed cargo volume time series according to the time identifier.
[0018] In one embodiment, the time mark includes a stable period and holidays, and the data cleaning and preprocessing of the historical cargo volume time series according to the time mark to obtain the processed cargo volume time series includes:
[0019] If the time mark is a stable period, the cargo volume in each time period during the holiday in the historical cargo volume time series is compared with the cargo volume at the corresponding historical time to obtain a cargo volume deviation value;
[0020] If the cargo volume deviation value is greater than the deviation value threshold, the time period corresponding to the holiday in the historical cargo volume sequence is determined to be an abnormal period, and the cargo volume of the abnormal period is replaced by the cargo volume of the corresponding historical time.
[0021] In one embodiment, the process of obtaining the sub-model corresponding to the time series model includes:
[0022] Selecting a plurality of training data sequences from the historical cargo volume time series;
[0023] Within a preset model parameter range, the time series model is trained according to the training data sequence to obtain multiple groups of model parameters corresponding to the time series model, and the time series model and the corresponding groups of model parameters are respectively used as a sub-model.
[0024] In one embodiment, the selecting a plurality of training data sequences from the historical cargo volume time series includes:
[0025] The preset sliding window width is used to move in the historical cargo volume time series, and the training data generated by the sliding step corresponding to each sliding window is used as a training data sequence.
[0026] In one embodiment, determining the target time series model from each of the sub-models according to the deviation includes:
[0027] Obtain the deviation ratio corresponding to each sub-model, and take the sub-model with the largest deviation ratio as the target time series model; the deviation ratio represents the ratio of the number of deviations within a preset accuracy range to the total number of deviations of all prediction results corresponding to the sub-model;
[0028] If there are multiple sub-models with the largest deviation ratio, the average deviation of each prediction result of each sub-model is obtained, and the model with the smallest average deviation is used as the target time series model;
[0029] If there are multiple models with the smallest average deviation, the deviation standard deviation of each sub-model is obtained according to the deviation of each prediction result of each sub-model and the average deviation, and the model with the smallest deviation standard deviation is used as the target time series model.
[0030] A logistics cargo volume prediction device, the device comprising:
[0031] A time series forming module is used to obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0032] A test data acquisition module, used to determine the time identifier of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time identifier;
[0033] The deviation acquisition module is used to input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model;
[0034] A model determination module, used to determine a target time series model from each of the sub-models according to the deviation;
[0035] The cargo volume prediction module is used to predict the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window through the target time series model.
[0036] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0037] Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0038] Determine a time mark of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time mark;
[0039] Inputting each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtaining the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model;
[0040] According to the deviation, a target time series model is determined from each of the sub-models, and the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window is predicted by using the target time series model.
[0041] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0042] Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0043] Determine a time mark of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time mark;
[0044] Inputting each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtaining the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model;
[0045] According to the deviation, a target time series model is determined from each of the sub-models, and the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window is predicted by using the target time series model.
[0046] The above-mentioned logistics cargo volume prediction method, device, computer equipment and storage medium obtain the historical cargo volume information of the sorting site to be predicted to form a historical cargo volume time series; after determining the time mark of the time window to be predicted, a test data set is determined from the historical cargo volume time series according to the time mark; each test data in the test data set is input into the sub-model corresponding to the preset multiple time series models in turn, and the deviation of the prediction result of each sub-model for each test data is obtained, and further according to the deviation, a target time series model is determined from each sub-model, and the cargo volume of the sorting site to be predicted in the time window to be predicted is predicted by the target time series model. This method takes the time mark of the time window to be predicted into account in the cargo volume forecast, selects the corresponding target time series model according to the time mark, so that the target time series model can accurately predict the cargo volume forecast of the time window to be predicted, thereby improving the accuracy of the prediction result. By determining the test data set through the time mark and testing each sub-model, the selected target time series model can be more consistent with the cargo volume situation of the time window to be predicted, further improving the accuracy of the prediction result of the target time series model. By presetting multiple sub-models, testing each sub-model, and finally selecting the optimal sub-model as the target time series model, the prediction advantages of different sub-models in specific scenarios can be fully utilized, and the prediction performance of the target time series model can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a flow chart of a method for predicting logistics cargo volume in one embodiment;
[0048] Figure 2 A schematic diagram of a flow chart of a method for predicting logistics cargo volume in another embodiment;
[0049] Figure 3 A schematic diagram of a flow chart of a logistics cargo volume prediction step in one embodiment;
[0050] Figure 4 is a structural block diagram of a logistics cargo volume prediction device in one embodiment;
[0051] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] In one embodiment, Figure 1As shown, a method for predicting the volume of logistics cargo is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0054] Step S102, obtaining historical cargo volume information of the sorting site to be predicted, and forming a historical cargo volume time series.
[0055] Among them, the historical cargo volume information includes the sorting site identification, the sorting time of the sorting operation at the sorting site and the cargo volume of the waybill.
[0056] The sorting site identifier is a mark indicating the uniqueness of the sorting site. For example, the sorting site identifier may be a sorting site code.
[0057] In the specific implementation, if there are multiple sorting sites to be predicted, the historical waybills corresponding to each sorting site to be predicted can be collected according to the sorting site identifier, and then the cargo volume of each sorting site is classified and counted in the daily dimension according to the sorting time and sorting volume of each historical waybill at the sorting site, so as to obtain the daily sorting volume of each sorting site, and form the daily cargo volume into a historical cargo volume time series.
[0058] Furthermore, in one embodiment, the above step S102 specifically includes: counting the cargo quantities corresponding to multiple preset time periods according to the sorting time and the cargo quantity of the waybill; and sorting the cargo quantities corresponding to each time period in chronological order to obtain a historical cargo quantity time series.
[0059] Specifically, each time period may be every day, and the daily cargo volumes of the sorting sites to be predicted are sorted in chronological order to obtain a historical cargo volume time series.
[0060] Step S104, determining the time identifier of the time window to be predicted, and determining a test data set from the historical cargo volume time series according to the time identifier.
[0061] Among them, time marks include stable periods and holidays.
[0062] In the specific implementation, the time series can be divided into stable periods and holidays based on industry experience, industry status, promotional activities and other industry information. According to the time mark corresponding to the time window to be predicted, it is determined whether the time window to be predicted belongs to a holiday or a stable period, and then the historical cargo time series is targeted for data cleaning and preprocessing based on the determination result to obtain the processed cargo time series. Then, according to the time mark of the time window to be predicted, a test data set is determined from the processed cargo time series. More specifically, when the time window to be predicted is a stable period, the test data set should be selected in the stable period close to the time window to be predicted; when the time window to be predicted is a holiday, the test data set should be selected in the holiday close to the time window to be predicted.
[0063] Step S106, input each test data in the test data set into the sub-model corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a set of model parameters corresponding to the time series model.
[0064] The deviation represents the deviation between the model's predicted results and the actual results.
[0065] In the specific implementation, SARIMA (Seasonal Autoregressive Integrated Moving Average), Holt-Winters (a time series analysis and forecasting method), and PROPHET (a decomposable time series model) can be selected as the preset time series models. Among them, the Holt-Winters model uses a third-order exponential smoothing model, and the specific form of the PROPHET model is as follows: y(t) = g(t) + s(t) + h(t) + e(t), where g(t), s(t) and h(t) represent growth, seasonality, and holidays effect, respectively, and e(t) represents the noise term. Each time series model and a corresponding set of model parameters are used as a sub-model. Each test data in the selected test data set is input into each sub-model to obtain the prediction result of each sub-model. The prediction result is subtracted from the actual result to obtain the deviation of the prediction result of each test data under each sub-model. Thus, a model prediction result library composed of the prediction results of each sub-model can be obtained. By adopting time series trend extrapolation models such as SARIMA, Holt-Winters, and PROPHET, it has great advantages for logistics forecasting problems with obvious periodicity and time sensitivity. Adding these three time series models to the candidate models can give full play to the prediction advantages of each model in specific scenarios and improve the prediction performance of the model.
[0066] Step S108, determining the target time series model from each sub-model according to the deviation.
[0067] In the specific implementation, since each test data in the test data set corresponds to a prediction result and a deviation under the sub-model, all deviations corresponding to each sub-model can constitute a deviation set, and the target time series model can be further determined from each sub-model according to the deviation set and the preset model selection conditions. More specifically, the sub-model with the largest proportion can be used as the target time series model by calculating the proportion of each deviation in the deviation set corresponding to each sub-model within the deviation threshold range, or the sub-model with the smallest mean value can be used as the target time series model by calculating the mean of the deviation set corresponding to each sub-model, or the sub-model with the smallest standard deviation can be used as the target time series model by calculating the deviation standard deviation of the deviation set corresponding to each sub-model.
[0068] Step S110, predicting the cargo volume of the sorting site to be predicted within the time window to be predicted by using the target time series model.
[0069] In a specific implementation, after determining the target time series model and model parameters, the target time series model can be used to predict the cargo volume of the sorting site to be predicted within the time window to be predicted.
[0070] Furthermore, after the target time series model is used to predict the cargo volume of the sorting site to be predicted within the time window to be predicted and the prediction result is obtained, a visualization graph of the prediction result of the cargo volume of the sorting site to be predicted within the time window to be predicted can be generated and sent to the user. For example, the predicted value of the cargo volume for each day in the future can be generated into a line graph according to the time change, so as to realize the visualization presentation of the model prediction result, and the prediction result can be automatically sent to the user's mailbox via email.
[0071] In the above-mentioned logistics cargo volume prediction method, by obtaining the historical cargo volume information of the sorting site to be predicted, a historical cargo volume time series is formed; after determining the time mark of the time window to be predicted, a test data set is determined from the historical cargo volume time series according to the time mark; each test data in the test data set is sequentially input into the sub-model corresponding to the preset multiple time series models, and the deviation of the prediction result of each sub-model for each test data is obtained, and further according to the deviation, the target time series model is determined from each sub-model, and the cargo volume of the sorting site to be predicted in the time window to be predicted is predicted by the target time series model. This method takes the time mark of the time window to be predicted into the cargo volume prediction, selects the corresponding target time series model according to the time mark, so that the target time series model can accurately predict the cargo volume prediction of the time window to be predicted, and improves the accuracy of the prediction result. By proposing different prediction settings for the prediction of the stable period and holidays, the limitations caused by the lack of external data and the low prediction accuracy are overcome, and it has the advantages of high accuracy and strong robustness, and supports the scientific allocation of logistics resources. By determining the test data set through time tags and testing each sub-model, the selected target time series model can be more consistent with the cargo volume in the time window to be predicted, further improving the accuracy of the prediction results of the target time series model. By presetting multiple sub-models, testing each sub-model, and finally selecting the optimal sub-model as the target time series model, the prediction advantages of different sub-models in specific scenarios can be fully utilized, further improving the prediction performance of the target time series model.
[0072] In one embodiment, the above step S104 specifically includes: performing data cleaning and preprocessing on the historical cargo volume time series according to the time identifier to obtain a processed cargo volume time series; and determining a test data set from the processed cargo volume time series according to the time identifier.
[0073] Furthermore, in one embodiment, the above-mentioned step of performing data cleaning and preprocessing on the historical cargo volume time series according to the time identifier to obtain the processed cargo volume time series includes: if the time identifier is a stable period, then comparing the cargo volume of each time period during the holidays in the historical cargo volume time series with the cargo volume of the corresponding historical time to obtain a cargo volume deviation value; if the cargo volume deviation value is greater than the deviation value threshold, then determining that the time period corresponding to the holiday in the historical cargo volume sequence is an abnormal period, and replacing the cargo volume of the abnormal period with the cargo volume of the corresponding historical time.
[0074] In the specific implementation, since the test data set affects the selection of the target time series model, after forming the historical cargo volume time series, it is also necessary to identify and clean the abnormal period data in the historical cargo volume time series. More specifically, the historical cargo volume time series can be cleaned and preprocessed according to the time mark of the time window to be predicted. For the historical cargo volume time series whose time window to be predicted is a stable period, the identification of abnormal period data can adopt the method of secondary comparison detection. The specific process includes: according to the pre-divided holidays and stable periods, the cargo volume of each day of the holiday is extracted from the historical cargo volume time series, and compared with the cargo volume of the previous week and the same period of the week before last, to obtain the cargo volume deviation value. The cargo volume deviation value is compared with the preset deviation value threshold. When the cargo volume deviation value is greater than the deviation value threshold, the holiday is determined to be an abnormal period, and the time window affected by the abnormal period is determined, that is, the affected time period. The daily cargo volume in the time window is replaced with the cargo volume of the same period last week. If the same period last week is a holiday, it can be replaced with the cargo volume of the same period last week. By analogy, the processed cargo volume time series corresponding to the stable period is obtained. For the historical cargo volume time series whose time window to be predicted is a holiday, it is necessary to retain the historical holiday cargo volume as a prediction reference, so no targeted data cleaning is performed here.
[0075] In this embodiment, the historical cargo volume time series is targeted for data cleaning and preprocessing through the time mark of the time window to be predicted, so that the processed time series is more consistent with the cargo volume of the time window to be predicted, so that the target time series model selected based on the test data set determined by the processed time series can make a more accurate prediction of the cargo volume of the time window to be predicted. For example, the time window of abnormal data is screened out through a preset abnormal deviation value threshold, and the selected abnormal period data is replaced by the same period volume of the previous week, and the data is stabilized. This preprocessing mode can effectively improve the prediction of the time series model for the stable period data.
[0076] In one embodiment, the process of obtaining the sub-model corresponding to the time series model includes: selecting multiple training data sequences from the historical cargo volume time series; training the time series model according to the training data sequences within a preset model parameter range to obtain multiple groups of model parameters corresponding to the time series model, and using the time series model and the corresponding groups of model parameters as a sub-model respectively.
[0077] Furthermore, in one embodiment, the step of selecting multiple training data sequences from the historical cargo volume time series includes: moving in the historical cargo volume time series through a preset sliding window width, and taking the training data generated by the sliding step corresponding to each sliding window as a training data sequence.
[0078] In the specific implementation, the sliding window width can be set first and the starting position can be selected to obtain a training data sequence. By analogy, according to the sliding step size corresponding to each sliding window, it moves in the historical cargo volume time series. When it moves to the set end position, the last training data sequence is generated, thereby obtaining multiple training data sequences. For the above-mentioned SARIMA, Holt-Winters, and PROPHET three time series models, the initial model parameter range is set respectively. Within the model parameter range, each time series model is trained. Each time series model will correspond to multiple sets of model parameters. Each time series model and its corresponding set of model parameters are used as a sub-model, thereby obtaining multiple sub-models corresponding to each time series model.
[0079] In this embodiment, the initially selected multiple time series models are trained through training data sequences to obtain multiple sub-models corresponding to each time series model, so as to further test each sub-model according to different prediction time windows and select the optimal sub-model for cargo volume prediction, which can improve the accuracy of the model prediction results and avoid the problem that the prediction accuracy of the prediction based on only a single model is not high due to the strong model assumptions of a single model, and the actual data is difficult to meet the assumptions, especially the problem of uneven prediction effects when the cargo volume fluctuates significantly.
[0080] In one embodiment, the above step S108 specifically includes: obtaining the deviation ratio corresponding to each sub-model, and taking the sub-model with the largest deviation ratio as the target time series model; the deviation ratio represents the ratio of the number of deviations within a preset accuracy range to the total number of deviations of all prediction results corresponding to the sub-model; if there are multiple sub-models with the largest deviation ratio, then obtaining the average deviation of each prediction result of each sub-model, and taking the model with the smallest average deviation as the target time series model; if there are multiple models with the smallest average deviation, then obtaining the deviation standard deviation of each sub-model according to the deviation of each prediction result of each sub-model and the average deviation, and taking the model with the smallest deviation standard deviation as the target time series model.
[0081] In the specific implementation, after obtaining the deviation of the prediction results of each sub-model for each test data, each deviation is compared with the preset accuracy range, and the number of target deviations within the preset accuracy range is screened, and the ratio of the number of target deviations to the total number of deviations of all prediction results corresponding to the sub-model is obtained to obtain the deviation ratio of each sub-model, and the sub-model with the largest deviation ratio is used as the target time series model. If there are multiple sub-models with the largest deviation ratio, the average deviation of each prediction result of each sub-model is calculated as the average deviation of each sub-model, and the model with the smallest average deviation is used as the target time series model. If there are multiple models with the smallest average deviation, the deviation standard deviation of each sub-model is calculated according to the standard deviation formula, and the model with the smallest deviation standard deviation is used as the target time series model.
[0082] It is understandable that the selection of the target time series model is not limited to the selection method provided in this embodiment, and the target time series model can also be determined by only one selection method among the deviation ratio, the average deviation and the deviation standard deviation.
[0083] In this embodiment, after obtaining the deviation of the test results of each sub-model for each test data in the test set, the set model selection conditions are used to adaptively select the optimal sub-model as the target time series model to predict the cargo volume at the predicted time venue within the predicted time window, thereby improving the accuracy of the prediction results.
[0084] In another embodiment, Figure 2 As shown, a method for predicting logistics cargo volume is provided, and the method comprises the following steps:
[0085] Step S202, obtaining historical cargo quantity information of the sorting site to be predicted, the historical cargo quantity information including the sorting time and cargo quantity of each historical waybill;
[0086] Step S204, according to the sorting time and the cargo quantity of the waybill, the cargo quantities corresponding to the preset multiple time periods are counted, and the cargo quantities corresponding to the respective time periods are sorted in chronological order to obtain a historical cargo quantity time series;
[0087] Step S206, determining the time mark of the time window to be predicted, and performing data cleaning and preprocessing on the historical cargo volume time series according to the time mark to obtain a processed cargo volume time series;
[0088] Step S208, determining a test data set from the historical cargo volume time series according to the time identifier;
[0089] Step S210, input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in sequence, and obtain the deviation of the prediction result of each sub-model for each test data;
[0090] Step S212, obtaining the deviation ratio corresponding to each sub-model, and taking the sub-model with the largest deviation ratio as the target time series model; the deviation ratio represents the ratio of the number of deviations within a preset accuracy range to the total number of deviations of all prediction results corresponding to the sub-model;
[0091] Step S214: if there are multiple sub-models with the largest deviation ratio, the average deviation of each prediction result of each sub-model is obtained, and the model with the smallest average deviation is used as the target time series model;
[0092] Step S216: If there are multiple models with the smallest average deviation, the deviation standard deviation of each sub-model is obtained according to the deviation of each prediction result of each sub-model and the average deviation, and the model with the smallest deviation standard deviation is used as the target time series model;
[0093] Step S218, predicting the cargo volume of the sorting site to be predicted within the time window to be predicted by using the target time series model.
[0094] In this embodiment, by taking the time mark of the time window to be predicted into account in the cargo volume forecast, the corresponding target time series model is selected according to the time mark, so that the target time series model can accurately predict the cargo volume forecast of the time window to be predicted, thereby improving the accuracy of the prediction results. By proposing different prediction settings for the prediction of stable periods and holidays, the limitations caused by the lack of external data and low prediction accuracy are overcome, and the advantages of high accuracy and strong robustness are achieved, which supports the scientific allocation of logistics resources. By determining the test data set through the time mark and testing each sub-model, the selected target time series model can be more consistent with the cargo volume of the time window to be predicted, further improving the accuracy of the prediction results of the target time series model. By presetting multiple sub-models, testing each sub-model, and finally selecting the optimal sub-model as the target time series model, the prediction advantages of different sub-models in specific scenarios can be fully utilized, further improving the prediction performance of the target time series model.
[0095] In one embodiment, Figure 3 As shown, a flow chart of logistics cargo volume forecasting steps is provided, including the following steps:
[0096] (1) Collect the historical cargo volume information of the site to be predicted in the recent period to form a historical cargo volume time series, and then divide the time into a stable period and holidays. Thus, the historical cargo volume time series can be divided into a stable period series and a holiday series.
[0097] (2) Determine whether the time window to be predicted is a stable period. If so, perform data cleaning and preprocessing on the historical cargo volume time series to obtain a processed cargo volume time series, and determine the test data set from the processed cargo volume time series. If not, determine the test data set from the historical cargo volume time series.
[0098] (3) The sub-models corresponding to the preset multiple time series models are tested through the test data set to obtain the deviation of the prediction results of each sub-model and form a model prediction result library.
[0099] (4) Cross-validate each sub-model, select the current optimal model, and predict the cargo volume in the prediction time window. After obtaining the prediction results, visualize the prediction results.
[0100] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0101] In one embodiment, Figure 4 As shown, a logistics cargo volume prediction device is provided, including: a time series forming module 402, a test data acquisition module 404, a deviation acquisition module 406 and a cargo volume prediction module 408, wherein:
[0102] The time series forming module 402 is used to obtain the historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0103] A test data acquisition module 404 is used to determine the time identifier of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time identifier;
[0104] The deviation acquisition module 406 is used to input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model;
[0105] A model determination module 408 is used to determine a target time series model from each sub-model according to the deviation;
[0106] The cargo volume prediction module 410 is used to predict the cargo volume of the sorting site to be predicted within the time window to be predicted by using the target time series model.
[0107] In one embodiment, the historical cargo volume information includes the sorting time and cargo volume of each historical waybill; the above logistics cargo volume forecast is specifically used for
[0108] In one embodiment, the time series forming module 402 is specifically used to count the cargo quantities corresponding to multiple preset time periods according to the sorting time and the cargo quantity of the waybill; and sort the cargo quantities corresponding to each time period in chronological order to obtain a historical cargo quantity time series.
[0109] In one embodiment, the test data acquisition module 404 is further used to clean and preprocess the historical cargo volume time series according to the time identifier to obtain a processed cargo volume time series; and determine a test data set from the processed cargo volume time series according to the time identifier.
[0110] In one embodiment, the test data acquisition module 404 further includes:
[0111] The deviation value acquisition module is used to compare the cargo volume in each time period during the holidays in the historical cargo volume time series with the cargo volume at the corresponding time in history to obtain the cargo volume deviation value if the time mark is a stable period;
[0112] The cargo volume replacement module is used to determine that the time period corresponding to the holiday in the historical cargo volume sequence is an abnormal period if the cargo volume deviation value is greater than the deviation value threshold, and replace the cargo volume in the abnormal period with the cargo volume of the corresponding historical time.
[0113] In one embodiment, the above-mentioned device also includes a sub-model acquisition module, which is used to select multiple training data sequences from the historical cargo volume time series; within the preset model parameter range, the time series model is trained according to the training data sequence to obtain multiple groups of model parameters corresponding to the time series model, and the time series model and the corresponding groups of model parameters are respectively used as a sub-model.
[0114] In one embodiment, the above-mentioned device also includes a training data acquisition module, which is used to move in the historical cargo volume time series through a preset sliding window width, and use the training data generated by the sliding step corresponding to each sliding window as a training data sequence.
[0115] In one embodiment, the above-mentioned model determination module 408 is specifically used to obtain the deviation ratio corresponding to each sub-model, and take the sub-model with the largest deviation ratio as the target time series model; the deviation ratio represents the ratio of the number of deviations within a preset accuracy range to the total number of deviations of all prediction results corresponding to the sub-model; if there are multiple sub-models with the largest deviation ratio, the average deviation of each prediction result of each sub-model is obtained, and the model with the smallest average deviation is taken as the target time series model; if there are multiple models with the smallest average deviation, the deviation standard deviation of each sub-model is obtained according to the deviation of each prediction result of each sub-model and the average deviation, and the model with the smallest deviation standard deviation is taken as the target time series model.
[0116] It should be noted that the logistics cargo volume prediction device of the present application corresponds one-to-one to the logistics cargo volume prediction method of the present application. The technical features and beneficial effects described in the embodiment of the above-mentioned logistics cargo volume prediction method are all applicable to the embodiment of the logistics cargo volume prediction device. For specific contents, please refer to the description in the embodiment of the method of the present application. It will not be repeated here. This is hereby declared.
[0117] In addition, each module in the above-mentioned logistics cargo volume prediction device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.
[0118] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for predicting the volume of logistics cargo is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0119] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0121] Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0122] Determine the time mark of the time window to be predicted, and determine the test data set from the historical cargo volume time series according to the time mark;
[0123] Input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a set of model parameters corresponding to the time series model;
[0124] According to the degree of deviation, the target time series model is determined from each sub-model, and the cargo volume of the sorting site to be predicted within the time window to be predicted is predicted through the target time series model.
[0125] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0126] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0127] Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series;
[0128] Determine the time mark of the time window to be predicted, and determine the test data set from the historical cargo volume time series according to the time mark;
[0129] Input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a set of model parameters corresponding to the time series model;
[0130] According to the degree of deviation, the target time series model is determined from each sub-model, and the cargo volume of the sorting site to be predicted within the time window to be predicted is predicted through the target time series model.
[0131] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0132] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0133] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0134] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for predicting logistics cargo volume, characterized in that: The method comprises: Obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series; Determine a time mark of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time mark; the time mark is a stable period or a holiday; Inputting each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtaining the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model; According to the deviation, determining a target time series model from each of the sub-models; Predicting the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window by using the target time series model; The step of determining a test data set from the historical cargo volume time series according to the time identifier includes: If the time mark is the stable period, data cleaning and preprocessing are performed on the historical cargo volume time series to obtain a processed cargo volume time series, and the test data set is selected from the stable period of the processed cargo volume time series close to the time window to be predicted; If the time mark is the holiday, the test data set is selected from the holiday close to the time window to be predicted in the historical cargo volume time series.
2. The method according to claim 1, characterized in that The historical cargo quantity information includes the sorting time and cargo quantity of each historical waybill; the acquisition of the historical cargo quantity information of the sorting site to be predicted to form a historical cargo quantity time series includes: According to the sorting time and the cargo quantity of the waybill, counting the cargo quantities corresponding to the preset multiple time periods; The cargo volumes corresponding to each of the time periods are sorted in chronological order to obtain the historical cargo volume time series.
3. The method according to claim 1, characterized in that If the time mark is the stable period, data cleaning and preprocessing are performed on the historical cargo volume time series to obtain a processed cargo volume time series, including: If the time mark is a stable period, the cargo volume in each time period during the holiday in the historical cargo volume time series is compared with the cargo volume at the corresponding historical time to obtain a cargo volume deviation value; If the cargo volume deviation value is greater than the deviation value threshold, the time period corresponding to the holiday in the historical cargo volume time series is determined to be an abnormal period, and the cargo volume of the abnormal period is replaced by the cargo volume of the corresponding historical time.
4. The method according to claim 1, characterized in that The process of obtaining the sub-model corresponding to the time series model includes: Selecting a plurality of training data sequences from the historical cargo volume time series; Within a preset model parameter range, the time series model is trained according to the training data sequence to obtain multiple groups of model parameters corresponding to the time series model, and the time series model and the corresponding groups of model parameters are respectively used as a sub-model.
5. The method according to claim 4, characterized in that The selecting a plurality of training data sequences from the historical cargo volume time series comprises: The preset sliding window width is used to move in the historical cargo volume time series, and the training data generated by the sliding step corresponding to each sliding window is used as a training data sequence.
6. The method according to claim 1, characterized in that Determining a target time series model from each of the sub-models according to the deviation includes: Obtain the deviation ratio corresponding to each sub-model, and take the sub-model with the largest deviation ratio as the target time series model; the deviation ratio represents the ratio of the number of deviations within a preset accuracy range to the total number of deviations of all prediction results corresponding to the sub-model; If there are multiple sub-models with the largest deviation ratio, the average deviation of each prediction result of each sub-model is obtained, and the model with the smallest average deviation is used as the target time series model; If there are multiple models with the smallest average deviation, the deviation standard deviation of each sub-model is obtained according to the deviation of each prediction result of each sub-model and the average deviation, and the model with the smallest deviation standard deviation is used as the target time series model.
7. A logistics cargo volume prediction device, characterized in that: The device comprises: A time series forming module is used to obtain historical cargo volume information of the sorting site to be predicted and form a historical cargo volume time series; A test data acquisition module is used to determine the time mark of the time window to be predicted, and determine a test data set from the historical cargo volume time series according to the time mark; the time mark is a stable period or a holiday; The deviation acquisition module is used to input each test data in the test data set into the sub-models corresponding to the preset multiple time series models in turn, and obtain the deviation of the prediction result of each sub-model for each test data; each sub-model is composed of a time series model and a group of model parameters corresponding to the time series model; A model determination module, used to determine a target time series model from each of the sub-models according to the deviation; A cargo volume prediction module, used to predict the cargo volume of the to-be-predicted sorting site within the to-be-predicted time window by using the target time series model; The test data acquisition module is also used to, if the time identifier is the stable period, perform data cleaning and preprocessing on the historical cargo volume time series to obtain a processed cargo volume time series, and select the test data set from the stable period of the processed cargo volume time series close to the time window to be predicted; if the time identifier is the holiday, select the test data set from the holiday of the historical cargo volume time series close to the time window to be predicted.
8. The device according to claim 7, characterized in that The historical cargo quantity information includes the sorting time and cargo quantity of each historical waybill; the time series forming module is also used to count the cargo quantities corresponding to multiple preset time periods according to the sorting time and the waybill cargo quantity; and sort the cargo quantities corresponding to each of the time periods in chronological order to obtain the historical cargo quantity time series.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
