A traffic flow forecasting method integrating trend and seasonality
By constructing a predictive network model of sequence-to-sequence architecture, integrating trends and seasonal factors, the problem of insufficient accuracy and robustness of existing traffic flow prediction methods under single-year data conditions is solved, and more efficient traffic flow prediction is achieved.
Patent Information
- Application Number
- CN202510299901.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-03-14
AI Technical Summary
The existing traffic flow forecasting methods are difficult to effectively integrate trends and seasonal factors, especially when only a single-year historical observation data is available, the prediction accuracy and robustness are insufficient.
A fusion trend and seasonal traffic flow prediction method is adopted to construct a predictive network model based on a sequence-to-sequence framework, including a trend predictor sub-model and a fusion predictor sub-model. The trend predictor sub-model uses the LSTM model to capture the long-term dependence of the time series. Seasonal factors are reflected by calculating the seasonal prediction difference, while the fusion predictor sub-model performs nonlinear fusing the trend factor sequence and the seasonal factor sequence.
With only a single-year historical observation data, the effective integration of trends and seasonal factors has improved the accuracy and robustness of traffic flow forecasts, overcome the limitations of traditional linear methods, and is suitable for complex dynamics and limited data conditions.
Abstract
Description
Technical Field
[0001] The invention belongs to the field of traffic control, and in particular relates to a traffic flow prediction method. Background Art
[0002] Reasonable traffic flow forecasting can not only help traffic management departments deploy traffic diversion plans in advance, but also effectively improve the utilization efficiency of road resources and alleviate traffic congestion. However, in reality, traffic flow data often presents multiple periodic, trend and random volatility characteristics at the same time, such as daily fluctuations, weekly fluctuations, holiday effects, etc., and may also be affected by special events (such as traffic accidents, weather changes, large-scale events, etc.). This significantly increases the difficulty and uncertainty of forecasting.
[0003] In traffic flow forecasting, trend and seasonality are two core features that cannot be ignored. Trend reflects the long-term change of traffic flow. For example, with the development of cities or population migration, the traffic flow in certain areas may show a trend of continuous growth or decline. Seasonality reflects the cyclical fluctuations of traffic flow, such as morning and evening peaks, weekend effects, and traffic changes during holidays.
[0004] Time series prediction methods based on periodic laws are usually classified as seasonal prediction methods. Among them, the seasonal autoregressive integrated moving average (SARIMA) model is a typical seasonal prediction method. Although such methods can achieve a certain degree of prediction accuracy under the situation of relatively stable seasonal structure, their core assumption is that the seasonal cycles are independent of each other and basically unchanged. Once the periodic distribution is misplaced or complex noise and sudden factors are superimposed, the model performance may drop significantly. In addition, it is difficult to fully cover all periodic components and temporary events by relying solely on a single seasonal modeling, which will cause prediction bias.
[0005] In contrast to seasonal forecasting, trend forecasting methods focus on the overall trend or long-term changes in traffic flow time series. When traffic flow data presents multiple cycles and highly nonlinear fluctuations, it is difficult for modeling based solely on trends to capture frequent cycle jumps and sudden interference.
[0006] With the maturity of deep learning theory, recurrent neural networks (RNN) and their improved structures, such as long short-term memory (LSTM) and gated recurrent units (GRU), have brought new opportunities for traffic flow time series prediction. By introducing a gating mechanism, they can preserve historical information over a longer period of time and extract potential nonlinear features in the data. However, when time series are superimposed with complex cycles and random factors, or when there are large differences between different categories, deep learning models still face great challenges in network structure design and training strategies, and need to strike a balance between data diversity and model capacity.
[0007] Moreover, when only a single year of historical observation data is available, all of the above methods will face further limitations: seasonal models are difficult to maintain the persistence of the periodic laws of traffic flow through cross-year comparisons, and trend forecasts are prone to mistakenly regard occasional fluctuations as long-term signals. Deep learning models are prone to overfitting due to insufficient data or inability to effectively integrate common characteristics between different geographical regions. Therefore, traditional linear or low-order models alone are often unable to fully characterize the complex dynamics under multi-period and multi-interference backgrounds. If limited single-year data is directly put into a deep learning network, it may be difficult to extract key laws. Summary of the invention
[0008] The present invention proposes a traffic flow prediction method integrating trend and seasonality, the purpose of which is to effectively integrate trend and seasonal factors and improve the accuracy and robustness of the prediction under the condition of only having a single year of historical observation data.
[0009] The technical solution of the present invention is as follows:
[0010] A traffic flow prediction method integrating trend and seasonality, the data processed is time series data, the element value in the time series data represents the traffic flow size at the corresponding time; one time series data corresponds to one year, and each time series data covers one normal period and T special periods of the corresponding year, T is greater than or equal to 2; each period corresponds to a subsequence in the time series data, which is called time subsequence data;
[0011] All years are periodized in the same way, and all time series data are aligned by date;
[0012] The goal of the traffic flow prediction method is to predict the traffic flow data of a target special period of the current year based on the complete time series data of a previous year and the time series data of the current year that lacks the target special period data;
[0013] The steps of the traffic flow prediction method include:
[0014] Step 1: construct a prediction network model based on a sequence-to-sequence framework; the prediction network model includes a trend prediction sub-model and a fusion prediction sub-model;
[0015] Step 2: Based on the known and complete time series data of previous years and the time series data of the target special period missing in the current year, the trend factor sequence and the seasonal factor sequence corresponding to the reference special period are calculated through the trend prediction sub-model, and then training samples are constructed to train the fusion prediction sub-model; the reference special period refers to another special period in a year selected in advance except the target special period;
[0016] Step 3: Based on the known and complete time series data of previous years and the time series data of the current year that lacks the target special period, the trend factor sequence and seasonal factor sequence corresponding to the target special period are calculated through the trend prediction sub-model, and then input into the trained fusion prediction sub-model to obtain the traffic flow forecast data for the target special period of the current year.
[0017] As a further improvement of the traffic flow prediction method integrating trend and seasonality: the trend prediction sub-model is an LSTM model.
[0018] As a further improvement of the traffic flow prediction method integrating trend and seasonality: the input of the trend prediction sub-model is the time sub-series data corresponding to the normal period of a certain year, and the output is the time sub-series prediction data of the reference special period of the year and the time sub-series prediction data of the target special period of the year.
[0019] As a further improvement of the traffic flow prediction method integrating trend and seasonality: the difference between the real time subseries data and the time subseries prediction data in a special period is defined as the seasonal prediction difference in the special period.
[0020] As a further improvement of the traffic flow prediction method that integrates trend and seasonality: the input of the fusion prediction sub-model includes a trend factor sequence and a seasonal factor sequence, the trend factor sequence is the time sub-series prediction data of a special period of the year, and the seasonal factor sequence is the seasonal prediction difference of the special period; the output of the fusion prediction sub-model is the traffic flow prediction data of the special period corresponding to the input in the year, also recorded as the time sub-series fusion prediction data of the special period.
[0021] As a further improvement of the traffic flow prediction method integrating trend and seasonality: the fusion prediction sub-model includes two parts: an encoder and a decoder.
[0022] As a further improvement of the traffic flow prediction method integrating trend and seasonality: in the fusion prediction sub-model, the encoder part is constructed based on the LSTM network, which receives two input sequences - the trend factor sequence and the seasonal factor sequence, and obtains a hidden state vector of fixed length after calculation by multiple layers of LSTM. and the cell state vector .
[0023] As a further improvement of the traffic flow prediction method integrating trend and seasonality: in the fusion prediction sub-model, the decoder part is based on the LSTM network, and the hidden state vector output by the encoder is first calculated. and the cell state vector Set as the initial value of the hidden state vector and cell state vector in the decoder, and then calculate through the multi-layer LSTM network; when a new hidden state vector and cell state vector are calculated at each step, the hidden state vector and cell state vector of this step are used to obtain the corresponding output value; set The hidden state vector and cell state vector obtained by the step are and , then the output value corresponding to this step is ; Among them, the nonlinear function It represents the nonlinear relationship between trend factor and seasonal factor; , and is the trainable weight matrix, is a trainable bias term; is the Sigmoid activation function, which is used for nonlinear mapping of the LSTM gating mechanism; It is also the Sigmoid activation function, which is used to control the LSTM output form; the output value of all steps The constructed sequence is the time subsequence fusion prediction data output by the fusion prediction sub-model.
[0024] As a further improvement of the traffic flow prediction method integrating trend and seasonality, step 2 specifically includes:
[0025] Step 2-1, collect the time series data of previous years and the time series data of the current year for multiple geographical areas; among which, the time subseries data of the target special period in the time series data of the current year is missing;
[0026] Step 2-2, preprocessing the collected time series data;
[0027] Step 2-3: Input the time subseries data of the normal period in the time series data of previous years into the trend prediction sub-model to obtain the time subseries prediction data of the special period in previous years ;
[0028] Step 2-4: Reference the real time subseries data of special periods in previous years Reference to time subseries forecast data for special periods in previous years Calculate the difference and get the seasonal forecast difference of previous years with reference to special periods ; This difference is the seasonal factor series;
[0029] Step 2-5: Input the time subseries data of the normal period in the time series data of the current year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the current year , That is the trend factor sequence;
[0030] Step 2-6: Construct training samples according to previous years. The training samples are represented as , where the trend factor sequence and seasonal factor series is the input of the training sample, The output of the training sample represents the real time subseries data of the reference special period in the current year;
[0031] Step 2-7: Sequence the trend factors of each training sample and seasonal factor series Input into the fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the year , then let ,Will The sum of the absolute values of each element is used as the loss function of the training sample, and the parameters of the fusion prediction sub-model are adjusted according to the loss function.
[0032] As a further improvement of the traffic flow forecasting method integrating trend and seasonality, assuming that it is currently necessary to forecast the traffic flow forecast data of a certain geographical area during a special target period of the year, the specific steps of step 3 are:
[0033] Step 3-1: Input the time subseries data of the normal period in the time series data of the geographical area in previous years into the trend prediction sub-model to obtain the time subseries prediction data of the target special period in previous years. ;
[0034] Step 3-2: Subsequent real time subseries data of special target periods in previous years Time subseries forecast data for special target periods in previous years Calculate the difference and get the seasonal forecast difference of the target special period in previous years , the difference is the seasonal factor sequence;
[0035] Step 3-3: Input the time subseries data of the normal period in the time series data of the year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the target year , That is the trend factor sequence;
[0036] Step 3-4: Sequence trend factors and seasonal factor series Input into the trained fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the target year , which is the traffic flow forecast data for the special target period of the year.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] 1. Dual modeling of trend and seasonality: This method first performs trend forecasting through the trend forecasting sub-model to capture the long-term dependency and overall trend of the time series; then, based on the difference between historical data and trend forecast values, the seasonal forecast difference is calculated to reflect the impact of seasonal factors on the time series. The trend factor sequence and the seasonal factor sequence are then input into the fusion forecasting sub-model to obtain the forecast results. In this way, trend and seasonal factors are effectively integrated under the condition of only having a single year of historical observation data, thereby improving the accuracy and robustness of the forecast.
[0039] 2. Sequence-to-sequence model architecture: Through end-to-end nonlinear modeling, the model is able to capture the complex nonlinear dynamics of time series while overcoming the limitations of traditional linear methods.
[0040] 3. Multi-category unified learning: In order to improve the accuracy and robustness of predictions, this method adopts a multi-category (geographical region) unified learning strategy, integrating time series data from different geographical regions into a unified training set for learning. In this way, the model can learn the common features between regions, thereby improving the overall prediction ability and achieving more efficient training when the amount of data is limited.
[0041] 4. Applicable to complex dynamic and limited data conditions: The present invention effectively integrates trend prediction with seasonal factors and uses network models to automatically learn nonlinear relationships. It can obtain more accurate time series prediction results under the condition of only a single year of historical observation data. DETAILED DESCRIPTION
[0042] The technical solution of the present invention is described in detail below. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments.
[0043] A traffic flow prediction method that integrates trend and seasonality. The data processed is time series data. The element value in the time series data represents the traffic flow size at the corresponding time. One time series data corresponds to one year, and each time series data covers one normal period and T special periods of the corresponding year, where T is greater than or equal to 2. Each period corresponds to a subsequence in the time series data, which is called time subsequence data.
[0044] In this embodiment, there are two special periods in a year, which are respectively recorded as special period 1 and special period 2. "Time sub-series data of normal periods in previous years", "time sub-series data of special period 1 in previous years", "time sub-series data of special period 2 in previous years", "time sub-series data of normal periods in the current year", "time sub-series data of special period 1 in the current year", and "time sub-series data of special period 2 in the current year" are respectively used. , , , , and express. , , are the lengths of the time subsequences corresponding to the normal period, special period 1, and special period 2, respectively.
[0045] All years are divided into periods in the same way, and all time series data must be aligned by date. There is no strict order relationship between special periods and normal periods. The length of the time series between normal periods and special periods can be different, but the length of the same period in previous years and the current year must be the same. Among them, special periods refer to time periods when traffic flow fluctuates during specific events or activities, including holidays, peak periods or major events, as well as time periods affected by traffic control, major accidents or other special events. Normal periods refer to periods outside special periods, which are used to capture basic trends and seasonal fluctuations in traffic flow. Data in normal periods have relatively stable periodic changes.
[0046] The objective of the traffic flow prediction method is to predict the traffic flow data of a target special period of the current year based on the complete time series data of a previous year and the time series data of the current year that lacks the target special period data.
[0047] In this embodiment, “the time sub-series data of normal periods in previous years ","Special period 1 time sub-series data in previous years ","Special period 2 time sub-series data in previous years ", "Time sub-series data for normal period of the year " and "Special period 1 time sub-series data of the year " are all known, and "the special period 2 time sub-series data of the year " is unknown and to be predicted, so the target special period refers to special period 2.
[0048] The steps of the traffic flow prediction method include:
[0049] Step 1: Construct a prediction network model based on a sequence-to-sequence framework. The prediction network model includes a trend prediction sub-model and a fusion prediction sub-model.
[0050] The trend prediction sub-model is an LSTM model, whose input is the time sub-series data corresponding to the normal period of a certain year, and whose output is the time sub-series prediction data of the reference special period of the year and the time sub-series prediction data of the target special period of the year. The reference special period refers to another special period other than the target special period in a year selected in advance. The trend prediction sub-model is a pre-trained model, and its model structure and training process can refer to the traditional method of trend prediction through the LSTM model, which will not be described in detail here. The trend prediction sub-model generates trend predictions for a specific time period in the future by learning the time dependency and trend information in the historical data, providing a basis for the subsequent calculation of seasonal factors.
[0051] As can be seen from the foregoing, the reference special period in this embodiment must be special period 1. When there are more than three special periods, another special period can also be selected as the reference special period.
[0052] The difference between the actual time subseries data and the time subseries forecast data for a special period is defined as the seasonal forecast difference for that special period.
[0053] The input of the fusion prediction sub-model includes a trend factor sequence and a seasonal factor sequence. The trend factor sequence is the time sub-series prediction data of a special period of the year, and the seasonal factor sequence is the seasonal prediction difference of the special period. The output of the fusion prediction sub-model is the traffic flow prediction data of the special period corresponding to the input in the year, which is also recorded as the time sub-series fusion prediction data of the special period.
[0054] Specifically, the fusion prediction sub-model consists of two parts: an encoder and a decoder. The encoder part is built based on the LSTM network, which receives two input sequences - a trend factor sequence and a seasonal factor sequence. After multi-layer LSTM calculations, a hidden state vector of fixed length is obtained. and the cell state vector The decoder is also based on the LSTM network. When calculating, the hidden state vector output by the encoder is first and the cell state vector Set as the initial value of the hidden state vector and cell state vector in the decoder, and then calculate through the multi-layer LSTM network. When a new hidden state vector and cell state vector are calculated at each step, the hidden state vector and cell state vector of this step are used to obtain the corresponding output value. The hidden state vector and cell state vector obtained by the step are and , then the output value corresponding to this step is Among them, the nonlinear function Represents the nonlinear relationship between trend factors and seasonal factors. , and is the trainable weight matrix, is a trainable bias term, is the Sigmoid activation function, which is used for nonlinear mapping of the LSTM gating mechanism. It is also the Sigmoid activation function, which is used to control the LSTM output form. The output value of all steps The constructed sequence is the time subsequence fusion prediction data output by the fusion prediction sub-model.
[0055] The fusion prediction sub-model automatically learns the complex nonlinear relationship between trend factors and seasonal factors through nonlinear functions, overcomes the limitations of traditional linear formulas, and achieves more accurate time series prediction.
[0056] Step 2: Based on the known and complete time series data of previous years and the time series data of the current year that lacks the target special period, the trend factor sequence and seasonal factor sequence corresponding to the reference special period are calculated through the trend prediction sub-model, and then the training samples are constructed to train the fusion prediction sub-model.
[0057] Step 2 specifically includes:
[0058] Step 2-1: Collect the time series data of previous years and the time series data of the current year for multiple geographical regions. Among them, the time subseries data of the target special period in the time series data of the current year is missing.
[0059] Step 2-2: Preprocess the collected time series data, including data cleaning, missing value filling, and date alignment.
[0060] The data cleaning includes removing outliers and noise data.
[0061] The missing value filling is only for the time series data of previous years and the time subseries data outside the target special period in the time series data of the current year. The time subseries data of the target special period in the time series data of the current year remain blank and are not filled. The filling includes forward filling and backward filling. Forward filling refers to filling the value of the element before the missing value into the missing part, and backward filling refers to filling the value of the element after the missing value into the missing part.
[0062] Align data by date to ensure that each time series data in the same time period corresponds accurately, providing a high-quality data foundation for subsequent model training.
[0063] Step 2-3: Input the time subseries data of the normal period in the time series data of previous years into the trend prediction sub-model to obtain the time subseries prediction data of the special period in previous years .
[0064] In this embodiment, the time subseries data of normal periods in previous years Input into the trend prediction sub-model to obtain the time sub-series prediction data of the special period 1 (reference special period) in previous years and the time subseries forecast data of special period 2 (target special period) in previous years ,in That is .
[0065] Step 2-4: Reference the real time subseries data of special periods in previous years Reference to time subseries forecast data for special periods in previous years Calculate the difference and get the seasonal forecast difference of previous years with reference to special periods The difference is the seasonal factor sequence, which reflects the deviation between the actual data of the same period in previous years and the trend forecast, and represents the degree of influence of seasonal factors on the time series.
[0066] In this embodiment, .
[0067] Step 2-5: Input the time subseries data of the normal period in the time series data of the current year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the current year , That is the trend factor sequence.
[0068] In this embodiment, the time subseries data of the normal period of the year Input into the trend prediction sub-model to obtain the time sub-series prediction data for the special period 1 (reference special period) of the year And the time subseries forecast data of special period 2 (target special period) of the year ,in That is .
[0069] Step 2-6: Construct training samples according to previous years. The training samples are represented as , where the trend factor sequence and seasonal factor series is the input of the training sample, It is the output of the training sample, which represents the real time subseries data of the reference special period in that year.
[0070] In this embodiment, The training samples corresponding to different geographical areas constitute the training set.
[0071] Step 2-7: Sequence the trend factors of each training sample and seasonal factor series Input into the fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the year , then let ,Will The sum of the absolute values of each element is used as the loss function of the training sample, and the parameters of the fusion prediction sub-model are adjusted according to the loss function.
[0072] In this embodiment, the Adam optimizer is selected to continuously adjust the weight parameters of the parameters of the fusion prediction sub-model through the back propagation algorithm. During the training process, it is ensured that the model can effectively learn under limited historical data conditions, and the loss value and parameter combination of each round of training are recorded until the model converges to the optimal state and minimizes the error.
[0073] Step 3: Based on the known and complete time series data of previous years and the time series data of the current year that lacks the target special period, the trend factor sequence and seasonal factor sequence corresponding to the target special period are calculated through the trend prediction sub-model, and then input into the trained fusion prediction sub-model to obtain the traffic flow forecast data for the target special period of the current year.
[0074] Assume that it is necessary to predict the traffic flow forecast data of a certain geographical area during a special target period of the year. The specific steps are as follows:
[0075] Step 3-1: Input the time subseries data of the normal period in the time series data of the geographical area in previous years into the trend prediction sub-model to obtain the time subseries prediction data of the target special period in previous years. .
[0076] In this embodiment, the time subseries data of normal periods in previous years Input into the trend prediction sub-model to obtain the time sub-series prediction data of the special period 1 (reference special period) in previous years and the time subseries forecast data of special period 2 (target special period) in previous years ,in That is .
[0077] Step 3-2: Subsequent real time subseries data of special target periods in previous years Time subseries forecast data for special target periods in previous years Calculate the difference and get the seasonal forecast difference of the target special period in previous years . This difference is the seasonal factor series.
[0078] In this embodiment, .
[0079] Step 3-3: Input the time subseries data of the normal period in the time series data of the year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the target year , That is the trend factor sequence.
[0080] In this embodiment, the time subseries data of the normal period of the year Input into the trend prediction sub-model to obtain the time sub-series prediction data for the special period 1 (reference special period) of the year And the time subseries forecast data of special period 2 (target special period) of the year ,in That is .
[0081] Step 3-4: Sequence trend factors and seasonal factor series Input into the trained fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the target year , which is the traffic flow forecast data for the special target period of the year.
[0082] This method is applicable to sequences of different lengths, ensuring that the model can be flexibly applied to longer prediction sequences based on the sequence length used during training, and achieve accurate predictions for other special periods. The model uses normal periods and special periods 1 in training, fully exploring the complex nonlinear relationship between seasonality and cycles. The determination of the optimal network weights ensures the optimal configuration relationship between seasonal factors and cyclical factors during the prediction process, so as to predict special period 2 with high accuracy. Similarly, in the case of more than two special periods, this method can also be used to accurately predict the results of any other special period based on the normal period data of the current year and previous years and one of the special periods.
[0083] It should be noted that it is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. The scope of the present invention is defined by the claims rather than the above description.
Claims
1. A traffic flow prediction method integrating trend and seasonality, characterized by: The data processed is time series data. The element value in the time series data represents the traffic volume at the corresponding time. One time series data corresponds to one year, and each time series data covers one normal period and T special periods of the corresponding year, where T is greater than or equal to 2. Each period corresponds to a subsequence in the time series data, which is called time subsequence data. All years are periodized in the same way, and all time series data are aligned by date; The goal of the traffic flow prediction method is to predict the traffic flow data of a target special period of the current year based on the complete time series data of a previous year and the time series data of the current year that lacks the target special period data; The steps of the traffic flow prediction method include: Step 1: construct a prediction network model based on a sequence-to-sequence framework; the prediction network model includes a trend prediction sub-model and a fusion prediction sub-model; The trend prediction sub-model is an LSTM model; The input of the trend prediction sub-model is the time sub-series data corresponding to the normal period of a certain year, and the output is the time sub-series prediction data of the reference special period of the year and the time sub-series prediction data of the target special period of the year; The difference between the real time subseries data and the time subseries forecast data in a special period is defined as the seasonal forecast difference in that special period; The input of the fusion prediction sub-model includes a trend factor sequence and a seasonal factor sequence, wherein the trend factor sequence is the time sub-series prediction data of a special period of the year, and the seasonal factor sequence is the seasonal prediction difference of the special period; the output of the fusion prediction sub-model is the traffic flow prediction data of the special period corresponding to the input in the year, which is also recorded as the time sub-series fusion prediction data of the special period; The fusion prediction sub-model includes two parts: an encoder and a decoder; In the fusion prediction sub-model, the encoder part is built based on the LSTM network. It receives two input sequences - the trend factor sequence and the seasonal factor sequence. After multi-layer LSTM calculation, it obtains a hidden state vector of fixed length. and the cell state vector ; In the fusion prediction sub-model, the decoder part is based on the LSTM network. When calculating, the hidden state vector output by the encoder is first and the cell state vector Set as the initial value of the hidden state vector and cell state vector in the decoder, and then calculate through the multi-layer LSTM network; when a new hidden state vector and cell state vector are calculated at each step, the hidden state vector and cell state vector of this step are used to obtain the corresponding output value; set The hidden state vector and cell state vector obtained by the step are and , then the output value corresponding to this step is ; Among them, the nonlinear function It represents the nonlinear relationship between trend factor and seasonal factor; , and is the trainable weight matrix, is a trainable bias term; is the Sigmoid activation function, which is used for nonlinear mapping of the LSTM gating mechanism; It is also the Sigmoid activation function, which is used to control the LSTM output form; the output value of all steps The constructed sequence is the time subsequence fusion prediction data output by the fusion prediction sub-model; Step 2: Based on the known and complete time series data of previous years and the time series data of the target special period missing in the current year, the trend factor sequence and the seasonal factor sequence corresponding to the reference special period are calculated through the trend prediction sub-model, and then training samples are constructed to train the fusion prediction sub-model; the reference special period refers to another special period in a year selected in advance except the target special period; Step 3: Based on the known and complete time series data of previous years and the time series data of the current year that lacks the target special period, the trend factor sequence and seasonal factor sequence corresponding to the target special period are calculated through the trend prediction sub-model, and then input into the trained fusion prediction sub-model to obtain the traffic flow forecast data for the target special period of the current year.
2. The method for predicting traffic flow integrating trend and seasonality as claimed in claim 1, characterized in that: Step 2 specifically includes: Step 2-1, collect the time series data of previous years and the time series data of the current year for multiple geographical areas; among which, the time subseries data of the target special period in the time series data of the current year is missing; Step 2-2, preprocessing the collected time series data; Step 2-3: Input the time subseries data of the normal period in the time series data of previous years into the trend prediction sub-model to obtain the time subseries prediction data of the special period in previous years ; Step 2-4: Reference the real time subseries data of special periods in previous years Reference to time subseries forecast data for special periods in previous years Calculate the difference and get the seasonal forecast difference of previous years with reference to special periods ; This difference is the seasonal factor series; Step 2-5: Input the time subseries data of the normal period in the time series data of the current year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the current year , That is the trend factor sequence; Step 2-6: Construct training samples according to previous years. The training samples are represented as , where the trend factor sequence and seasonal factor series is the input of the training sample, The output of the training sample represents the real time subseries data of the reference special period in the current year; Step 2-7: Sequence the trend factors of each training sample and seasonal factor series Input into the fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the year , then let ,Will The sum of the absolute values of each element is used as the loss function of the training sample, and the parameters of the fusion prediction sub-model are adjusted according to the loss function.
3. The method for predicting traffic flow integrating trend and seasonality as claimed in claim 1, characterized in that If we need to predict the traffic flow forecast data of a certain geographical area during a special target period of the year, the specific steps of step 3 are: Step 3-1: Input the time subseries data of the normal period in the time series data of the geographical area in previous years into the trend prediction sub-model to obtain the time subseries prediction data of the target special period in previous years. ; Step 3-2: Subsequent real time subseries data of special target periods in previous years Time subseries forecast data for special target periods in previous years Calculate the difference and get the seasonal forecast difference of the target special period in previous years , the difference is the seasonal factor sequence; Step 3-3: Input the time subseries data of the normal period in the time series data of the year into the trend prediction sub-model to obtain the time subseries prediction data of the special period of the target year , That is the trend factor sequence; Step 3-4: Sequence trend factors and seasonal factor series Input into the trained fusion prediction sub-model to obtain the time sub-series fusion prediction data for the special period of the target year , which is the traffic flow forecast data for the special target period of the year.
Citation Information
Patent Citations
Traffic prediction method and system based on elastic learning framework
CN112216101A
Short-term traffic flow prediction method based on gradient boosting decision tree
CN113096388A