Traffic prediction model training method, prediction method and device, and storage medium
By combining prophet and dilated convolution with bidirectional LSTM in a dual prediction model architecture, and utilizing the trend, periodicity and holiday characteristics of traffic data, this approach addresses the shortcomings of existing network traffic prediction methods in terms of accuracy and efficiency, achieving more efficient and stable traffic prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER
- Filing Date
- 2023-08-09
- Publication Date
- 2026-07-21
AI Technical Summary
Existing network traffic prediction methods have shortcomings in accuracy and efficiency. In particular, statistical models cannot extract nonlinear features, empirical pattern analysis models have increased uncertainty for components with large amplitude variations, and machine learning models have limitations in self-learning ability.
A dual prediction model architecture is adopted. First, the prophet model is used for preliminary prediction. Then, the residual value is corrected by dilated convolution and bidirectional long short-term memory LSTM model. Combined with the trend, periodicity and holiday characteristics of traffic data, the prediction accuracy is improved.
It improves the accuracy and efficiency of network traffic prediction, better handles traffic mutations, enhances the stability and reliability of the model, and reduces training and prediction time.
Smart Images

Figure CN119484309B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to a training method, prediction method, apparatus, and storage medium for a traffic prediction model. Background Technology
[0002] As operators' business scale continues to expand, network traffic is growing exponentially. Inappropriate allocation of traffic resources can lead to network-wide paralysis. Anticipating future traffic trends and planning network resources in advance can minimize network congestion.
[0003] The research methods for traffic scheduling in related technologies are mainly based on three categories: statistical models, empirical pattern analysis, and machine learning models. Statistical models use differencing methods to smooth traffic data before extracting network traffic features. The smoothed model is then fitted using statistical models, such as ARIMA (AutoRegressive, Integrated, Moving Average), but this requires stationary data and the model cannot extract nonlinear feature relationships. Empirical pattern analysis models decompose traffic data into numerous IMFs (Intrinsic Mode Functions) and residual components, and then predict them separately. However, this increases uncertainty for components with large amplitude variations. Machine learning-based traffic prediction models can learn independently and use their powerful learning capabilities to seek optimal solutions. These mainly include regression models, decision trees, and LSTM (Long Short-Term Memory) recurrent networks. Summary of the Invention
[0004] One objective of this disclosure is to improve the accuracy of network traffic prediction.
[0005] According to one aspect of some embodiments of this disclosure, a method for training a traffic prediction model is proposed, comprising: acquiring traffic training sample data; determining model parameters of a first prediction model, the model parameters including model structure type parameters, holiday feature parameters, and seasonality parameters; for each piece of data in the traffic training sample data, performing the following operations until training is completed: the first prediction model generates a first training prediction result based on the traffic training samples; obtaining training residual values based on the traffic training sample data and the corresponding first training prediction result; and a second training prediction model generates a second training prediction result based on the training residual values, wherein the first prediction model and the second prediction model are corrected based on the second training prediction result.
[0006] In some embodiments, the training method conforms to at least one of the following: the first prediction model includes a prophet model; or the second prediction model includes a dilated convolutional and bidirectional long short-term memory (LSTM) model.
[0007] In some embodiments, determining the model parameters of the first prediction model includes: determining that the first prediction model adopts a linear model type; determining holiday feature parameters based on the degree of holiday features of the traffic training sample data; and determining seasonality parameters based on whether the traffic training sample data has seasonal characteristics.
[0008] In some embodiments, obtaining the training residual value based on the traffic training sample data and the corresponding first training prediction result includes: obtaining the difference between the first training prediction result and the corresponding traffic training sample data as the training residual value.
[0009] In some embodiments, obtaining traffic training sample data includes: extracting traffic data from historical data; and performing data imputation and cleaning on the traffic data to obtain traffic training sample data.
[0010] In some embodiments, the training method further includes: after training is completed, acquiring traffic validation sample data; a first prediction model acquiring a first validation prediction result based on the traffic validation samples; acquiring a validation residual value based on the traffic validation sample data and the corresponding first validation prediction result; a second prediction model acquiring a second validation prediction result based on the validation residual value; determining a traffic validation prediction value based on the first validation prediction result and the second validation prediction result; and determining a model evaluation value based on the traffic validation prediction value and historical data.
[0011] In some embodiments, determining the traffic verification prediction value based on the first verification prediction result and the second verification prediction result includes: obtaining the sum of the first verification prediction result and the second verification prediction result as the traffic verification prediction value.
[0012] In some embodiments, determining the model evaluation value based on the traffic validation prediction value and historical data includes: obtaining at least one of the following as the model evaluation value: root mean square error, mean absolute error, mean absolute percentage error, and accuracy parameter based on the traffic validation prediction value and historical data.
[0013] According to one aspect of some embodiments of this disclosure, a traffic prediction method is proposed, comprising: acquiring current traffic data; processing the current traffic data through a first prediction model to acquire an initial prediction value; acquiring a prediction residual value based on the current traffic data and the initial prediction value; processing the prediction residual value through a second prediction model to acquire a prediction correction value; and acquiring a traffic prediction value based on the initial prediction value and the prediction correction value, wherein the first prediction model and the second prediction model are trained and generated according to any of the traffic prediction models described above.
[0014] According to one aspect of some embodiments of this disclosure, a model training apparatus is proposed, comprising: a sample data acquisition unit configured to acquire traffic training sample data; a parameter determination unit configured to determine model parameters of a first prediction model, the model parameters including model structure type parameters, holiday feature parameters, and seasonality parameters; and a training unit configured to perform the following operations for each piece of data in the traffic training sample data until training is completed: the first prediction model generates a first training prediction result based on the traffic training samples; obtains training residual values based on the traffic training sample data and the corresponding first training prediction result; and a second training prediction model generates a second training prediction result based on the training residual values, wherein the first prediction model and the second prediction model are corrected based on the second training prediction result.
[0015] In some embodiments, the apparatus further includes: a verification unit configured to acquire traffic verification sample data after training is completed; a first prediction model acquires a first verification prediction result based on the traffic verification samples; acquires a verification residual value based on the traffic verification sample data and the corresponding first verification prediction result; a second prediction model acquires a second verification prediction result based on the verification residual value; determines a traffic verification prediction value based on the first verification prediction result and the second verification prediction result; and determines a model evaluation value based on the traffic verification prediction value and historical data.
[0016] According to one aspect of some embodiments of this disclosure, a traffic prediction apparatus is proposed, comprising: a traffic acquisition unit configured to acquire current traffic data; and a prediction unit configured to: process the current traffic data through a first prediction model to acquire an initial prediction value; acquire a prediction residual value based on the current traffic data and the initial prediction value; process the prediction residual value through a second prediction model to acquire a prediction correction value; and acquire a traffic prediction value based on the initial prediction value and the prediction correction value, wherein the first prediction model and the second prediction model are generated by training a traffic prediction model according to any one of claims 1 to 8.
[0017] According to one aspect of some embodiments of the present disclosure, a data processing apparatus is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute any of the methods described above based on instructions stored in the memory.
[0018] According to one aspect of some embodiments of this disclosure, a non-transitory computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the steps of any of the methods described above. Attached Figure Description
[0019] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this disclosure, illustrate exemplary embodiments of the present disclosure and are used to explain the disclosure, but do not constitute an undue limitation of the disclosure. In the drawings:
[0020] Figure 1 Flowcharts showing some embodiments of the training method for the traffic prediction model disclosed herein.
[0021] Figure 2 Flowcharts showing some other embodiments of the training method for the traffic prediction model of this disclosure.
[0022] Figure 3 This is a flowchart illustrating some embodiments of the training method for the traffic prediction model disclosed herein.
[0023] Figure 4A -B is a schematic diagram of some embodiments of the second prediction model in the training method of the traffic prediction model of this disclosure.
[0024] Figure 5A -B is a schematic diagram illustrating the model performance of some further embodiments of the training method for the traffic prediction model disclosed herein.
[0025] Figure 6 This is a flowchart illustrating some embodiments of the traffic prediction method disclosed herein.
[0026] Figure 7 These are schematic diagrams of some embodiments of the model training apparatus disclosed herein.
[0027] Figure 8 This is a schematic diagram of some embodiments of the flow prediction device of this disclosure.
[0028] Figure 9 These are schematic diagrams illustrating some embodiments of the data processing apparatus of this disclosure.
[0029] Figure 10 These are schematic diagrams of other embodiments of the data processing apparatus of this disclosure. Detailed Implementation
[0030] The technical solutions of this disclosure will be further described in detail below with reference to the accompanying drawings and embodiments.
[0031] Flowcharts of some embodiments of the training method for the traffic prediction model disclosed herein are shown below. Figure 1 As shown.
[0032] In step 110, traffic training sample data is acquired. Traffic training sample data can be extracted from historical data, such as real traffic data that has already been generated and conforms to a predetermined format. In some embodiments, the traffic training sample data can be arranged chronologically according to the time of traffic generation. In some embodiments, the traffic training sample data can be data from a continuous time period.
[0033] In some embodiments, after extracting traffic data from historical data, the traffic data can be filled in and cleaned to serve as traffic training sample data, so that the traffic training sample data conforms to a predetermined format and increases the amount of information that the traffic training sample data can provide for model training.
[0034] In step 120, the model parameters of the first prediction model are determined. The model parameters include model structure type parameters, holiday feature parameters, and seasonality parameters.
[0035] In some embodiments, the first prediction model includes a prophet model.
[0036] In some embodiments, the model structure may include linear models and logistic regression growth models. In some embodiments, considering that the traffic data is time-series data and there is no prior knowledge to refer to, a linear model is used.
[0037] In some embodiments, the degree of holiday characteristics in the traffic training sample data is predetermined. Holiday characteristics refer to the difference in traffic data between holidays and weekdays exceeding a predetermined threshold. For example, areas with a high concentration of office buildings exhibit strong holiday characteristics in their traffic data, while areas that include both office buildings and residential areas show weaker holiday characteristics. The holiday characteristic parameter values are determined based on the predetermined relationship between the degree of holiday characteristics and the holiday characteristic parameter term in the first prediction model.
[0038] In some embodiments, it is predetermined whether the traffic training sample data possesses seasonal characteristics. Seasonal characteristics refer to the difference in traffic data across different seasons exceeding a predetermined threshold. The seasonal characteristic parameter values are determined based on a predetermined relationship between the presence of seasonal characteristics and the seasonal characteristic parameter terms in the first prediction model.
[0039] Step 120 completes the initial configuration of the first prediction model. Next, the model training operation is performed using the sample data obtained in step 110. The traffic training sample data is input into the first prediction model line by line, and step 131 is executed.
[0040] In step 131, the first prediction model generates a first training prediction result based on the traffic training samples.
[0041] In step 132, the training residual value is obtained based on the traffic training sample data and the corresponding first training prediction result.
[0042] In some embodiments, the difference between the first training prediction result and the corresponding traffic training sample data can be used as the training residual value.
[0043] In step 133, the training residual values are input into the second training prediction model. The second training prediction model generates a second training prediction result based on the training residual values. In some embodiments, the second prediction model includes a dilated convolutional and bidirectional long short-term memory (LSTM) model.
[0044] During training, the first and second prediction models will be corrected based on the second training prediction results.
[0045] In step 134, it is determined whether training is complete. In some embodiments, the number of traffic training sample data can be used to control the end of training; for example, training ends when all traffic training sample data is used up. In some embodiments, the convergence degree of the model can be determined by its loss function, and the model training ends when the convergence degree is greater than a predetermined convergence threshold.
[0046] If training is completed, a traffic prediction model is obtained. In some embodiments, the traffic prediction model may include a first prediction model and a second prediction model that have been trained, as well as a residual value calculation unit between the first and second prediction models.
[0047] If training is not completed, return to step 131 and input the next traffic training sample data into the first prediction model.
[0048] Based on the methods described in the above embodiments, the trend characteristics, periodic characteristics, and holiday characteristics of traffic data can be utilized to improve the targeting and accuracy of information utilization in sample data, thereby improving the accuracy and convergence efficiency of the model. The residual terms can be reused to improve the prediction accuracy of the model and correct the parts with poor prediction results, which is conducive to improving the prediction accuracy when using the model for prediction in subsequent uses.
[0049] In some embodiments, after training is completed, the model can be validated first. If the validation passes, it can be put into use; if the validation fails, training continues, thereby avoiding affecting the stability of production.
[0050] Flowcharts of other embodiments of the training method for the traffic prediction model disclosed herein are shown below. Figure 2 As shown above. Figure 1 In the illustrated embodiment, after training is completed, the following steps are performed: Figure 2 The operation in the illustrated embodiment.
[0051] In step 241, traffic verification sample data is obtained. Traffic verification sample data can be extracted from historical data, such as real traffic data that has already been generated and conforms to a predetermined format. In some embodiments, the traffic verification sample data can be arranged chronologically according to the time of traffic generation. In some embodiments, the traffic verification sample data can be data from a continuous time period.
[0052] In some embodiments, after extracting traffic data from historical data, the traffic data can be filled in and cleaned to serve as traffic validation sample data, so that the traffic validation sample data conforms to a predetermined format and increases the amount of information that the traffic validation sample data can provide for model training.
[0053] In some embodiments, a predetermined number of traffic sample data can be obtained and then divided into two parts: traffic training sample data and traffic verification sample data. The number of traffic training sample data is greater than that of traffic verification sample data, thereby reducing the steps of repeatedly obtaining sample data and improving the convenience of data acquisition.
[0054] In step 242, the traffic verification sample data is input into the first prediction model, and the first prediction model obtains the first verification prediction result based on the traffic verification sample.
[0055] In step 243, a verification residual value is obtained based on the traffic verification sample data and the corresponding first verification prediction result. In some embodiments, the difference between the first verification prediction result and the corresponding traffic verification sample data is used as the verification residual value.
[0056] In step 244, the verification residual value is input into the second prediction model, and the second prediction model obtains the second verification prediction result based on the verification residual value.
[0057] In step 245, a traffic verification prediction value is determined based on the first verification prediction result and the second verification prediction result. In some embodiments, the sum of the first verification prediction result and the second verification prediction result is calculated as the traffic verification prediction value.
[0058] In step 250, the model evaluation value is determined based on the flow verification prediction value and historical data.
[0059] In some embodiments, at least one of the following parameters—root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAS%), and accuracy parameter—is obtained as a model evaluation value based on traffic validation predictions and historical data. In some embodiments, thresholds can be set for the model evaluation values. If the threshold requirements are met, such as the RMSE being less than a predetermined RMSE threshold, the MAE being less than a predetermined validation residual value threshold, the MAS being less than a predetermined MAS percentage error threshold, or the accuracy parameter being greater than a predetermined accuracy parameter threshold, then the threshold requirements are met, and the current traffic prediction model can be put into production use. In some embodiments, if the threshold requirements are not met, including at least one model evaluation value failing to meet the corresponding threshold requirement, then the current traffic prediction model cannot yet be put into production use and needs further training.
[0060] Based on the method described in the above embodiments, the trained model can be validated, and the evaluation of the predicted values can determine whether the requirements are met, thereby improving the reliability of the model and improving the accuracy and reliability of subsequent traffic prediction using the model.
[0061] Flowcharts of some embodiments of the training method for the traffic prediction model disclosed herein are shown below. Figure 3 As shown.
[0062] The time-series traffic data of a branch of a telecom operator is used as the basis for the sample data. The completeness of the original traffic data is checked; if missing data is found, data imputation and cleaning are performed. Furthermore, a Prophet model is used for predictive analysis.
[0063] The Prophet algorithm decomposes time series data, which can not only handle time series data with anomalies but also impute and restore missing data. The Prophet model consists of four terms: trend term, periodic term, holiday term, and error term, as shown in formula (1):
[0064] p(t)=g(t)+s(t)+h(t)+ε t (1)
[0065] g(t) represents the trend of change in non-periodic data; s(t) is the seasonal term with periodic changes; h(t) represents the holiday term, which can be used to determine whether there is a holiday on that day; ε t This represents the error term.
[0066] In some embodiments, the model structure used to observe the trend term g(t) based on prior knowledge is determined. Considering that there is no prior knowledge to refer to when using time series data of traffic extracted from operators, a linear model is adopted, as detailed in formula (2):
[0067] g(t) = k + a(t) + m + a(t)T γ (2)
[0068] In this formula, k represents the growth rate, m is the offset parameter, a(t) represents the shifted step function, and γ is the adjustment factor.
[0069] The periodic term in s(t) can be simulated by Fourier series to represent the periodicity of the time series, as shown in formula (3):
[0070]
[0071] In this formula, a n and b n s(t) is the data fitting term, where P represents the time parameter, N is the period parameter, and n is an integer ranging from 1 to N. It determines whether the data exhibits seasonality; if so, an empirical coefficient can be set in s(t).
[0072] Based on the data characteristics, query whether the data contains holiday features, inputting h(t). The holiday model is shown below:
[0073]
[0074] Where k follows (0, v) 2 The larger the value of v, the greater the impact of holidays on the model.
[0075] The above steps complete the initial configuration of the prophet model.
[0076] Furthermore, the traffic training sample data is input into the prophet model to obtain the predicted value Y. predict Using the true value Y from the sample data true The residual term is obtained by comparing the predicted value: Residuals = Y predict -Y true .
[0077] The residual sequence Residuals are used for modeling involving dilated convolutions and bidirectional LSTMs. The prediction results of the dilated convolutions and bidirectional LSTMs are then used as the prediction results Y of the residual terms. Bi-LSTM .
[0078] In some embodiments, considering that pooling operations expand the receptive field of a neural network during feature extraction, and dilated convolutions can add many dilation points, the model can obtain more related information, such as... Figure 4A As shown in the image. Figure 4A (a) is a normal convolution with a kernel size of 3x3. (b) is a dilated convolution with a dilated kernel size of 1, and the receptive field of the kernel is 7x7. Figure 4A(c) With dilated convolution, the receptive field becomes 7x7, and the receptive field of the convolution kernel increases to 15x15. By dilating the convolution, the receptive field of the model is expanded, which helps to improve the prediction accuracy of the model.
[0079] In some embodiments, dilated convolutional structures are introduced into bidirectional LSTMs to effectively compensate for problems such as gradient vanishing that occur in one-dimensional scale convolutions. The Bi-LSTM network model is as follows: Figure 4B As shown: The Bi-LSTM module consists of three forward modules and three backward modules. (The last part, "from LSTM," appears to be a fragment and doesn't translate directly. It likely refers to a specific module or module.) front Obtain the forward hidden vector {h} f1 ,h f2 ,h f3}, by LSTM behind Obtain the backward hidden vector {h} b1 ,h b2 ,h b3}, concatenating and combining the forward and backward features yields: {[h f1 ,h b1 ],[h f2 ,h b2 ],[h f3 ,h b3 ]}, that is, η={h0,h1,h2}.
[0080] Furthermore, Y Bi-LSTM Feedback is fed into the prophet model and the model containing dilated convolutions and bidirectional LSTMs to achieve model tuning. Training is completed by repeatedly executing the training process using different sample data. After training, the prediction result is Y. realpredict =Y predict +Y Bi-LSTM .
[0081] The method described in the above embodiment can capture spatiotemporal features of data based on the improved prophet algorithm and by introducing a fusion of dilated convolution and bidirectional LSTM structure, thus solving the problem that residuals cannot be iterated again and improving prediction accuracy.
[0082] In some embodiments, the accuracy of the model trained in this disclosure can be demonstrated through experimental analysis. In some embodiments, at least one of RMSE (Root Mean Square Error), MAE (Mean Absolute Error), MAPE (Mean Absolute Percentage Error), and Accuracy can be used to evaluate the prediction performance of time-series traffic data, and their expressions are shown in Equations 5, 6, 7, and 8, respectively:
[0083]
[0084]
[0085]
[0086]
[0087] Where, x i For x′ i One term in the sequence is the predicted value, and the other is the corresponding true value. n is the number of data points in the sequence, and i is the data label, where i is an integer from 1 to n.
[0088] To verify the time efficiency of the proposed model, ARIMA, SVR (Support Vector Regression), GRU (Gated Recurrent Unit), and LSTM algorithms were compared and analyzed. The experimental results are detailed in Table 1.
[0089] Table 1 Comparison of running times for each model
[0090]
[0091] As shown in Table 1, when the number of network parameters is the same, the traffic prediction model in this disclosure has the shortest training and prediction times. The convergence times of the ARIMA, SVR, LSTM, and GRU algorithms are all relatively long, and their convergence speed is not as fast as that of the traffic prediction model in this disclosure. Therefore, it can be seen that the traffic prediction model in this disclosure greatly improves time efficiency and reduces time complexity.
[0092] To analyze the high prediction accuracy of the traffic prediction model in this disclosure, performance tests and evaluations were conducted on real datasets and compared with other algorithms. The experimental results are as follows: Figure 5A As shown, since ARIMA can only predict the linear portion of the data, it produces the worst prediction results and the largest errors. SVR, GRU, and LSTM models are deep learning-based feature extraction frameworks, and their prediction results are moderate. The traffic prediction model in this disclosure has the highest prediction accuracy, and its prediction curve is closest to the actual curve of the original traffic data. Therefore, this confirms that the traffic prediction model of this disclosure has high prediction accuracy. A comparison with the prediction curve of the baseline model shows that the prediction effect of the traffic prediction model of this disclosure is significantly improved at points of traffic abrupt change, and the algorithm of the traffic prediction model of this disclosure is more stable than the prediction results of the baseline model.
[0093] The average of the results from the three experiments at 20 min, 40 min, and 60 min was taken, and the resulting accuracy data are detailed in Table 2. For detailed experimental results, please refer to... Figure 5B .
[0094] Table 2 Comparison of Model Prediction Performance
[0095] ARIMA 0.73 0.67 0.61 SVR 0.74 0.73 0.72 GRU 0.78 0.70 0.71 LSTM 0.80 0.75 0.74 The model in this disclosure 0.83 0.82 0.79
[0096] From Table 2 and Figure 5B It was observed that, regardless of the training time (20 min, 40 min, or 60 min), the accuracy of the traffic prediction model and algorithm disclosed in this invention was higher than that of other models. Taking 60 min of data as an example, the model and algorithm proposed in this invention improved the accuracy by 29.5%, 9.4%, 11.2%, and 6.7% compared to ARIMA, SVR, GRU, and LSTM, respectively. This is because the hybrid model has a stronger learning ability for time series data, thus demonstrating that the traffic prediction model and algorithm disclosed in this invention have generally better accuracy.
[0097] In some embodiments, after training the model based on any of the traffic prediction model training methods mentioned above, a traffic prediction model is obtained. The traffic prediction model may include a trained first prediction model, a second prediction model, and a residual calculation unit between the first and second prediction models. Based on the traffic prediction model, flowcharts of some embodiments of the traffic prediction method disclosed herein are as follows: Figure 6 As shown.
[0098] In step 601, current traffic data is acquired. In some embodiments, real-time traffic data for the area to be predicted can be acquired. In some embodiments, the current traffic data can be preprocessed, including data imputation and cleaning, to improve the accuracy of subsequent predictions.
[0099] In step 602, the current traffic data is input into the first prediction model, and the current traffic data is processed by the first prediction model to obtain the initial prediction value. The first prediction model is a first prediction model generated after being trained by any of the training methods described above in this disclosure.
[0100] In step 603, the prediction residual value is obtained based on the current traffic data and the initial prediction value. In some embodiments, the difference between the initial prediction value and the current traffic data is calculated as the prediction residual value.
[0101] In step 604, the predicted residual value is input into the second prediction model, and the predicted residual value is processed by the second prediction model to obtain the predicted correction value. The second prediction model is a second prediction model generated after training by any of the training methods described above in this disclosure.
[0102] In step 604, a traffic forecast value is obtained based on the initial forecast value and the corrected forecast value. In some embodiments, the sum of the initial forecast value and the corrected forecast value can be calculated as the traffic forecast value.
[0103] The methods described in the above embodiments can utilize the trend characteristics, periodic characteristics, and holiday characteristics of traffic data, thereby improving the targeting and accuracy of information utilization in the data; the residual terms can be reused to improve the prediction accuracy of the model, correct parts with poor prediction results, and improve prediction accuracy.
[0104] Schematic diagrams of some embodiments of the model training apparatus disclosed herein are shown below. Figure 7 As shown.
[0105] The sample data acquisition unit 701 is capable of acquiring traffic training sample data. This traffic training sample data can be extracted from historical data, such as real traffic data that has already been generated and conforms to a predetermined format. In some embodiments, the traffic training sample data can be arranged chronologically according to the time of traffic generation. In some embodiments, the traffic training sample data can be data from a continuous time period. In some embodiments, after extracting traffic data from historical data, the sample data acquisition unit 701 can perform data imputation and cleaning on the traffic data to use it as traffic training sample data, making the traffic training sample data conform to a predetermined format and increasing the amount of information that the traffic training sample data can provide for model training.
[0106] The parameter determination unit 702 can determine the model parameters of the first prediction model, including model structure type parameters, holiday feature parameters, and seasonality parameters. In some embodiments, the first prediction model includes a prophet model. In some embodiments, the model structure type may include a linear model or a logistic regression growth model. In some embodiments, considering that the traffic data is time series data and there is no prior knowledge to refer to, a linear model is used. In some embodiments, the degree of holiday feature of the traffic training sample data is predetermined. Holiday feature refers to the difference between traffic data on holidays and weekdays exceeding a predetermined threshold. For example, the traffic data in areas with a high concentration of office buildings has a stronger holiday feature, while the traffic data in areas including both office buildings and residential areas has a weaker holiday feature. The holiday feature parameter value is determined according to the predetermined relationship between the degree of holiday feature and the holiday feature parameter item in the first prediction model. In some embodiments, it is predetermined whether the traffic training sample data has seasonality features. Seasonality features refer to the difference between traffic data in different seasons exceeding a predetermined threshold. The seasonality feature parameter value is determined according to the predetermined relationship between whether seasonality features are present and the seasonality feature parameter item in the first prediction model.
[0107] The training unit 703 can perform the following operations for each piece of data in the traffic training sample data until training is completed: the first prediction model generates a first training prediction result based on the traffic training sample; the training residual value is obtained based on the traffic training sample data and the corresponding first training prediction result; and the second training prediction model generates a second training prediction result based on the training residual value, wherein the first prediction model and the second prediction model are corrected based on the second training prediction result.
[0108] Such a model training device can utilize the trend characteristics, periodic characteristics, and holiday characteristics of traffic data, thereby improving the targeting and accuracy of information utilization in sample data, and improving the accuracy and convergence efficiency of the model. It can also reuse the residual terms to improve the prediction accuracy of the model, correct the parts with poor prediction results, and help improve the prediction accuracy when using the model for prediction in the future.
[0109] In some embodiments, such as Figure 7 As shown, the model training device also includes a verification unit 704, which can verify the accuracy of the trained model after training is completed. In some embodiments, the verification unit 704 can acquire traffic verification sample data, a first prediction model obtains a first verification prediction result based on the traffic verification samples, obtains a verification residual value based on the traffic verification sample data and the corresponding first verification prediction result, uses a second prediction model to obtain a second verification prediction result based on the verification residual value, and determines a traffic verification prediction value based on the first and second verification prediction results; furthermore, the verification unit determines a model evaluation value based on the traffic verification prediction value and historical data. In some embodiments, the verification unit 704 can be based on, for example... Figure 2 The method in any of the embodiments shown completes the model verification.
[0110] Such a model training device can validate the trained model and determine whether the predicted values meet the requirements by evaluating them, thereby improving the reliability of the model and improving the accuracy and reliability of subsequent traffic prediction using the model.
[0111] Schematic diagrams of some embodiments of the flow prediction device disclosed herein are shown below. Figure 8 As shown.
[0112] Traffic acquisition unit 801 can acquire current traffic data;
[0113] The prediction unit 802 can process the current traffic data through the first prediction model to obtain the initial prediction value; obtain the prediction residual value based on the current traffic data and the initial prediction value; process the prediction residual value through the second prediction model to obtain the prediction correction value; and obtain the traffic prediction value based on the initial prediction value and the prediction correction value. The first prediction model and the second prediction model are trained and generated according to any of the traffic prediction models mentioned above.
[0114] In some embodiments, the flow prediction device may be based on the above as follows: Figure 6 Traffic prediction can be performed using any of the methods shown in the embodiments.
[0115] Such traffic forecasting devices can utilize the trend characteristics, periodic characteristics, and holiday characteristics of traffic data, thereby improving the targeting and accuracy of information utilization in the data; they can also reuse residual terms to improve the prediction accuracy of the model, correct parts of the prediction that are not performing well, and improve the prediction accuracy.
[0116] A schematic diagram of the structure of an embodiment of the data processing device disclosed herein is shown below. Figure 9 As shown, the data processing device includes a memory 901 and a processor 902. The memory 901 can be a disk, flash memory, or any other non-volatile storage medium. The memory stores instructions from the training method of the traffic prediction model described above or from corresponding embodiments of the traffic prediction method. The processor 902 is coupled to the memory 901 and can be implemented as one or more integrated circuits, such as a microprocessor or microcontroller. The processor 902 executes the instructions stored in the memory, thereby improving the prediction accuracy of the model.
[0117] In one embodiment, it can also be as follows: Figure 10 As shown, the data processing device 1000 includes a memory 1001 and a processor 1002. The processor 1002 is coupled to the memory 1001 via a BUS bus 1003. The data processing device 1000 can also be connected to an external storage device 1005 via a storage interface 1004 to access external data, and can also be connected to a network or another computer system (not shown) via a network interface 1006. Further details are omitted here.
[0118] In this embodiment, storing data instructions in a memory and then processing those instructions with a processor can improve the accuracy of model predictions.
[0119] In another embodiment, a computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the steps of a method for training a traffic prediction model or a method corresponding to a traffic prediction method in the embodiments. Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, apparatus, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] This concludes the detailed description of the present disclosure. To avoid obscuring the concept of the disclosure, some details known in the art have not been described. Those skilled in the art will fully understand how to implement the technical solutions disclosed herein based on the above description.
[0124] The methods and apparatus of this disclosure may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of this disclosure are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, this disclosure may also be implemented as a program recorded on a recording medium, the program including machine-readable instructions for implementing the methods according to this disclosure. Thus, this disclosure also covers recording media storing programs for performing the methods according to this disclosure.
[0125] It should be noted that the terms "first," "second," etc., used in the specification, claims, and drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure and not to limit them; although this disclosure has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation of this disclosure or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of this disclosure, and all such modifications and substitutions should be covered within the scope of the technical solutions claimed in this disclosure.
Claims
1. A method for training a traffic prediction model, comprising: Obtain traffic training sample data; The model parameters of the first prediction model are determined, including model structure type parameters, holiday feature parameters, and seasonality parameters. The first prediction model includes the Prophet model. and For each data point in the traffic training sample data, perform the following operations until training is complete: The first prediction model generates a first training prediction result based on the traffic training samples; The training residual value is obtained based on the traffic training sample data and the corresponding first training prediction result; and The second prediction model generates a second training prediction result based on the training residual value. During the training process using each data point, the parameters of both the first and second prediction models are corrected based on the second training prediction result. The second prediction model includes a dilated convolution and a bidirectional long short-term memory (LSTM) model. This also includes: after completing the training, If the model evaluation value meets the threshold requirement, the first prediction model and the second prediction model are determined to have passed the verification. The model evaluation value is determined based on the traffic verification prediction value and historical data. The traffic verification prediction value is the sum of the prediction results of the first prediction model and the second prediction model when the trained traffic prediction model processes the traffic verification sample data.
2. The training method according to claim 1, wherein, The model parameters for determining the first prediction model include: The first prediction model is determined to be a linear model type; Based on the degree of holiday characteristics in the traffic training sample data, the holiday characteristic parameters are determined; and The seasonality parameter is determined based on whether the traffic training sample data has seasonal characteristics.
3. The training method according to claim 1, wherein, The step of obtaining the training residual value based on the traffic training sample data and the corresponding first training prediction result includes: The difference between the first training prediction result and the corresponding traffic training sample data is obtained as the training residual value.
4. The training method according to claim 1, wherein, The acquisition of traffic training sample data includes: Extract traffic data from historical data; The traffic data is filled in and cleaned to serve as the traffic training sample data.
5. The training method according to claim 1, further comprising: After completing the training, Obtain traffic verification sample data; The first prediction model obtains a first verification prediction result based on the traffic verification sample; The verification residual value is obtained based on the traffic verification sample data and the corresponding first verification prediction result; The second prediction model obtains a second verification prediction result based on the verification residual value; The traffic verification prediction value is determined based on the first verification prediction result and the second verification prediction result; and The model evaluation value is determined based on the traffic verification prediction value and historical data.
6. The training method according to claim 5, wherein, The step of determining the model evaluation value based on the traffic verification prediction value and historical data includes: Based on the traffic flow verification prediction value and historical data, at least one of the following parameters—root mean square error, mean absolute error, mean absolute percentage error, and accuracy—is used as the model evaluation value.
7. A traffic flow prediction method, comprising: Get current traffic data; The current traffic data is processed by the first prediction model to obtain the initial prediction value; The prediction residual value is obtained based on the current traffic data and the initial prediction value; The prediction residual value is processed by the second prediction model to obtain the prediction correction value; and Based on the initial prediction value and the correction prediction value, the traffic prediction value is obtained. Wherein, the first prediction model and the second prediction model are generated by training the traffic prediction model according to any one of claims 1 to 6.
8. A training device for a traffic prediction model, comprising: The sample data acquisition unit is configured to acquire traffic training sample data; The parameter determination unit is configured to determine the model parameters of the first prediction model, the model parameters including model structure type parameters, holiday feature parameters and seasonality parameters, the first prediction model including the Prophet model; and The training unit is configured to perform the following operations for each piece of data in the traffic training sample data, until training is complete: The first prediction model generates a first training prediction result based on the traffic training samples; The training residual value is obtained based on the traffic training sample data and the corresponding first training prediction result; and The second prediction model generates a second training prediction result based on the training residual value. During the training process using each data point, the parameters of both the first and second prediction models are corrected based on the second training prediction result. The second prediction model includes a dilated convolution and a bidirectional long short-term memory (LSTM) model. The validation unit is configured to be used after training is complete. If the model evaluation value meets the threshold requirement, the first prediction model and the second prediction model are determined to have passed the verification. The model evaluation value is determined based on the traffic verification prediction value and historical data. The traffic verification prediction value is the sum of the prediction results of the first prediction model and the second prediction model when the trained traffic prediction model processes the traffic verification sample data.
9. The training apparatus according to claim 8, wherein, The verification unit is configured to, after training is completed, Obtain traffic verification sample data; The first prediction model obtains a first verification prediction result based on the traffic verification sample; The verification residual value is obtained based on the traffic verification sample data and the corresponding first verification prediction result; The second prediction model obtains a second verification prediction result based on the verification residual value; The traffic verification prediction value is determined based on the first verification prediction result and the second verification prediction result; and The model evaluation value is determined based on the traffic verification prediction value and historical data.
10. A flow prediction device, comprising: The traffic acquisition unit is configured to acquire current traffic data; and The prediction unit is configured as follows: The current traffic data is processed by the first prediction model to obtain the initial prediction value; The prediction residual value is obtained based on the current traffic data and the initial prediction value; The prediction residual value is processed by the second prediction model to obtain the prediction correction value; and Based on the initial prediction value and the correction prediction value, the traffic prediction value is obtained. Wherein, the first prediction model and the second prediction model are generated by training the traffic prediction model according to any one of claims 1 to 6.
11. A data processing apparatus, comprising: Memory; as well as A processor coupled to the memory, the processor being configured to perform the method as described in any one of claims 1 to 7 based on instructions stored in the memory.
12. A non-transitory computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.