Short-term traffic flow prediction method and system

By performing EEMD decomposition and DTW correlation calculation on the traffic flow sequence and combining the LSTM model for prediction, a single method is solved, and a higher prediction accuracy and stability are achieved.

CN119672944AInactive Publication Date: 2025-03-21NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411491539.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-03-21
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Predictive models built on only a single method often find it difficult to meet the requirements of traffic flow prediction accuracy.

Method used

The traffic flow sequence is decomposed and reconstructed by the set empirical modal decomposition method (EEMD), and multiple traffic flow sequence components are obtained; the correlation between the components and the original sequence is calculated according to the dynamic time regularization algorithm (DTW), and high correlation components and low correlation components are obtained; these components are normalized and entered into the LSTM model for training, and finally multiple initial prediction results are superimposed and summed to obtain the prediction results.

Benefits of technology

It improves the accuracy and stability of traffic flow prediction, enhances the time dependence of the model and captures complex changes in complex changes, can better cope with complex changes in traffic flow, and provides more reliable decision-making support for urban traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119672944A_ABST
    Figure CN119672944A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent traffic systems, and particularly provides a short-time traffic flow prediction method and system, and the method comprises the steps: obtaining a traffic flow sequence; decomposing and reconstructing the traffic flow sequence through an ensemble empirical mode decomposition method to obtain a plurality of traffic flow sequence components and residual components; calculating the correlation between the traffic flow sequence component and the traffic flow sequence according to a dynamic time warping algorithm to obtain a high correlation component and a low correlation component; performing calculation according to the high-correlation component and the low-correlation component to obtain normalized data; inputting the normalized data into an LSTM model to obtain a plurality of initial prediction results; and carrying out superposition summation on the plurality of initial prediction results to obtain a prediction result. The prediction accuracy is remarkably improved, the complex and changeable characteristics of the traffic flow can be flexibly handled, and a solid and reliable decision basis is provided for a traffic management department.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent transportation systems, and in particular to a short-term traffic flow prediction method and system. Background Art

[0002] With the acceleration of urbanization and the increasing traffic demand, urban road traffic faces unprecedented challenges. In order to achieve active control and refined management, it is crucial to predict the development trend of road operation status in advance. However, urban road traffic status does not exist in isolation, but is affected by the interaction of multiple complex factors, including but not limited to travel demand, road conditions and environmental factors. The intertwined influence of these factors makes the prediction and identification of traffic status particularly complex.

[0003] In recent years, the application of machine learning technology in the field of transportation has made significant progress. Considering the large volatility and randomness of traffic flow parameters, traditional prediction methods often fail to achieve ideal accuracy. Therefore, in order to further improve the prediction accuracy of traffic flow parameters, many scholars have begun to apply machine learning algorithms to the construction of short-term traffic flow prediction models for urban roads. Through deep mining and analysis of massive data by machine learning algorithms, it is expected to achieve more accurate prediction of traffic status and provide strong technical support for active control and refined management of urban road traffic. In the field of traffic speed prediction, the empirical mode decomposition (EMD) method is successfully combined with the ARIMA model. By using data from highway entrance ramps and exit ramps to conduct traffic speed prediction experiments, the combined model has significantly improved the prediction accuracy compared with a single model. Based on microwave detection data of expressways, traffic flow parameters are extracted, and LSSVM is improved to construct an efficient traffic flow parameter prediction model. Using spatial graph convolutional neural networks to capture the spatiotemporal correlation of road networks, this innovative method has achieved significant prediction results in practical applications and provides new ideas and approaches for traffic flow prediction. In recent years, hybrid traffic flow prediction models have gradually become a hot topic of research. By building a SARIMA-NAR combined model, which combines the advantages of time series analysis and neural networks, the prediction accuracy of traffic flow is effectively improved. However, in actual business applications, prediction models built by relying solely on a single method often fail to meet the requirements of traffic flow prediction accuracy.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] Therefore, the technical problem to be solved by the present invention is that a prediction model constructed by relying solely on a single method often fails to meet the requirements of traffic flow prediction accuracy.

[0006] In order to solve the above technical problems, the first aspect of the present invention provides a short-term traffic flow prediction method, the method comprising:

[0007] Obtain traffic flow sequence;

[0008] Decomposing and reconstructing the traffic flow sequence by using an ensemble empirical mode decomposition method to obtain a plurality of traffic flow sequence components and residual components;

[0009] Calculating the correlation between the traffic flow sequence components and the traffic flow sequence according to a dynamic time warping algorithm to obtain a high correlation component and a low correlation component;

[0010] Calculating according to the high correlation component and the low correlation component to obtain normalized data;

[0011] Inputting the normalized data into the LSTM model to obtain multiple initial prediction results;

[0012] The multiple initial prediction results are superimposed and summed to obtain a prediction result.

[0013] In one embodiment of the present invention, the step of decomposing and reconstructing the traffic flow sequence by using the ensemble empirical mode decomposition method to obtain multiple traffic flow sequence components includes:

[0014] Adding a Gaussian white noise sequence to the traffic flow sequence to generate a target traffic flow sequence;

[0015] Extracting the extreme points of the target traffic flow sequence and fitting the upper and lower envelopes according to the spline function to obtain the sequence average value;

[0016] Obtaining a traffic flow sequence difference according to the sequence average value and the target traffic flow sequence;

[0017] Determine whether the traffic flow sequence difference satisfies the judgment condition of the IMF component, and obtain a judgment result;

[0018] The multiple traffic flow sequence components are obtained according to the judgment result.

[0019] In one embodiment of the present invention, the step of determining whether the traffic flow sequence difference satisfies the determination condition of the IMF component and obtaining the determination result comprises:

[0020] If the traffic flow sequence difference satisfies that the number of extreme value points and the number of zero-crossing points must be equal or differ by at most one, and the average values ​​of the upper envelope formed by the maximum value points and the lower envelope formed by the minimum value points are zero, then the judgment result satisfies the judgment condition of the IMF component;

[0021] If the traffic flow sequence difference does not satisfy that the number of extreme points and the number of zero-crossing points must be equal or differ by at most one and the average values ​​of the upper envelope formed by the maximum points and the lower envelope formed by the minimum points are zero, then the judgment result is that the judgment condition of the IMF component is not met.

[0022] In one embodiment of the present invention, the step of obtaining the plurality of traffic flow sequence components according to the judgment result comprises:

[0023] If the judgment result satisfies the discrimination condition of the IMF component, the traffic flow sequence difference is the first IMF component, and the extreme points of the remaining components are extracted and the upper and lower envelopes are fitted according to the spline function until the remaining components meet the preset conditions to obtain multiple traffic flow sequence components;

[0024] If the judgment result is that the judgment condition of the IMF component is not met, the extreme points of the target traffic flow sequence are extracted and the upper and lower envelopes are fitted according to the spline function to obtain the sequence average value until the judgment result meets the judgment condition of the IMF component.

[0025] In one embodiment of the present invention, the step of calculating the correlation between the traffic flow sequence components and the traffic flow sequence according to the dynamic time warping algorithm to obtain the high correlation component and the low correlation component includes:

[0026] Calculating the correlation between the traffic flow sequence component and the traffic flow sequence according to a dynamic time warping algorithm to obtain a correlation value;

[0027] Sorting the correlation values ​​to obtain a sorting result;

[0028] A high correlation component and a low correlation component are obtained according to the sorting result.

[0029] In one embodiment of the present invention, the step of calculating and obtaining normalized data according to the high correlation component and the low correlation component further includes:

[0030] The high correlation component and the low correlation component are combined and traffic weather factors are added to obtain a subsequence matrix;

[0031] The subsequence matrix is ​​normalized to obtain the normalized data.

[0032] In one embodiment of the present invention, the step of superimposing and summing the multiple initial prediction results to obtain the prediction result includes:

[0033] Obtain error data according to the plurality of prediction results;

[0034] An evaluation result is obtained by comparing the error data with the prediction result.

[0035] A second aspect of the present invention provides a short-term traffic flow prediction system, the system comprising: a decomposition module, a calculation module and a prediction module;

[0036] The decomposition module is configured to: obtain a traffic flow sequence; decompose and reconstruct the traffic flow sequence by using a set empirical mode decomposition method to obtain a plurality of traffic flow sequence components;

[0037] The calculation module is configured to: calculate the correlation between the traffic flow sequence component and the traffic flow sequence according to the dynamic time warping algorithm to obtain a high correlation component and a low correlation component; calculate according to the high correlation component and the low correlation component to obtain normalized data;

[0038] The prediction module is configured to: input the normalized data into the LSTM model to obtain multiple initial prediction results; and superimpose and sum the multiple initial prediction results to obtain a prediction result.

[0039] The third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect or any possible implementation of the first aspect is implemented.

[0040] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.

[0041] The above technical solution of the present invention has the following advantages compared with the prior art:

[0042] A short-term traffic flow prediction method and system described in the present invention deeply decomposes the intersection traffic flow sequence through the ensemble empirical mode decomposition algorithm (EEMD), thereby refining it into a series of components with different frequencies and characteristics. Through this decomposition method, the inherent structure and change law of traffic flow can be more deeply understood, and more accurate data support can be provided for subsequent analysis and prediction. During the decomposition process, the EEMD algorithm can effectively extract different components in the traffic flow sequence, including high-frequency fluctuations, low-frequency trends, etc., laying a solid foundation for subsequent feature extraction and model training. In order to accurately evaluate the correlation between these components and the original traffic flow sequence, the present application introduces a dynamic time warping algorithm (DTW). By calculating the dynamic time warping distance, the similarity and correlation between the decomposed components and the original sequence are accurately measured. This step not only helps to deeply understand the contribution of each component to the original traffic flow, but also effectively divides the high-correlation components and the low-correlation components, providing a more accurate basis for subsequent analysis and prediction. On the basis of successfully dividing the high-correlation components and the low-correlation components, the present application recombines these components, and combines the traffic environment factors as auxiliary features, and inputs them into the long short-term memory network (LSTM) model for training. Through this step, the traffic flow information contained in the decomposed components is fully utilized, and combined with the influence of traffic environment factors, the LSTM model can better capture the time dependence and complex change pattern of traffic flow. This combination method not only improves the prediction accuracy of the model, but also enhances the stability and generalization ability of the model, providing more reliable technical support for short-term traffic flow prediction. By combining the decomposed components with traffic environment factors, the influencing factors of traffic flow are more comprehensively considered, thereby further improving the prediction accuracy. After in-depth training and optimization of the long short-term memory network (LSTM) model, accurate prediction of short-term traffic flow at intersections is achieved. This application not only significantly improves the accuracy of the prediction, but also can flexibly respond to the complex and changeable characteristics of traffic flow, providing a solid and reliable decision-making basis for traffic management departments. In addition, it also helps to optimize the allocation of road resources, improve traffic operation efficiency, effectively alleviate traffic congestion problems, inject new vitality into the sustainable development of urban transportation, and make positive contributions to building a more efficient, convenient and green urban transportation system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0044] Figure 1 It is a flow chart of a short-term traffic flow prediction method and system provided by the present invention;

[0045] Figure 2It is a schematic diagram of a short-term traffic flow prediction method and an IMF1 component in the system provided by the present invention;

[0046] Figure 3 It is a schematic diagram of an IMF2 component in a short-term traffic flow prediction method and system provided by the present invention;

[0047] Figure 4 It is a schematic diagram of a short-term traffic flow prediction method and IMF3 component in the system provided by the present invention;

[0048] Figure 5 It is a schematic diagram of a short-term traffic flow prediction method and IMF4 component in the system provided by the present invention;

[0049] Figure 6 It is a schematic diagram of the IMF5 component in a short-term traffic flow prediction method and system provided by the present invention;

[0050] Figure 7 It is a schematic diagram of a short-term traffic flow prediction method and IMF6 component in the system provided by the present invention;

[0051] Figure 8 It is a schematic diagram of a short-term traffic flow prediction method and IMF7 component in the system provided by the present invention;

[0052] Fig. 9 It is a schematic diagram of a short-term traffic flow prediction method and a residual component in the system provided by the present invention;

[0053] Fig.10 It is a system architecture diagram of a short-term traffic flow prediction method and system provided by the present invention. DETAILED DESCRIPTION

[0054] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0055] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0056] Urban road traffic flow is a large and highly complex system, which is affected and interacted by multiple factors such as travel demand, road conditions, and environmental factors. The dynamic and uncertain nature of these factors makes the prediction and identification of traffic status extremely complex and difficult. Therefore, how to quickly, effectively and accurately extract valuable information from massive amounts of traffic data, and then accurately predict and identify traffic status, has become a key issue that the traffic management department is currently paying close attention to and urgently needs to solve. Solving this problem is of great significance to improving the level of urban road traffic management, optimizing road resource allocation, and improving road traffic efficiency.

[0057] It is crucial for traffic management departments to accurately grasp the traffic status at the target time. This can not only provide strong information support for traffic management departments to achieve refined management and effective guidance of roads, but also enable traffic management departments to flexibly adjust management strategies for various traffic conditions, optimize the use of road resources, and significantly improve road traffic efficiency. At the same time, for traffic travelers, the accuracy of this information is also an important reference for their travel route planning. By understanding the real-time traffic status, travelers can avoid congested sections and choose smoother travel routes, thereby greatly improving the travel experience. Therefore, accurate prediction and identification of traffic status plays an indispensable role in achieving the smooth operation of urban traffic and improving the quality of public travel.

[0058] With the in-depth application of machine learning in the field of transportation, its excellent data processing and learning capabilities have opened up new thinking paths and practical methods for traffic flow prediction. At present, many scholars are actively engaged in the exploration of applying machine learning and deep learning models to traffic flow prediction, and have achieved remarkable results. With powerful data processing capabilities, these models can efficiently cope with large-scale traffic data and deeply explore the potential traffic flow change laws, providing a strong basis for decision-making for traffic management departments. However, in practical applications, a single machine learning or deep learning model still has certain limitations in traffic flow prediction. Due to the complexity and uncertainty of traffic data, a single model is often difficult to fully capture the changing laws of traffic flow. In addition, the impact of data quality on the model is also a factor that cannot be ignored. When there is noise or missing data, the fitting effect of the model may be seriously affected, resulting in deviations in the prediction results. In order to overcome these limitations, it is necessary to comprehensively consider the influence of multiple factors, organically integrate different models, and construct a more efficient and accurate combined prediction model. Such a combined model can not only improve the accuracy and stability of the prediction, but also better cope with the complex changes in traffic flow, and provide more powerful technical support for the active control and refined governance of urban road traffic. This will help to better understand and respond to the changing patterns of traffic flow and promote the development of urban traffic management in a more intelligent and refined direction.

[0059] Reference Figure 1 As shown, the present invention provides a short-term traffic flow prediction method, the method comprising:

[0060] S100, obtaining a traffic flow sequence;

[0061] In step S100, the predicted time granularity is determined, the original data of the intersection traffic flow is cleaned, and the intersection traffic flow sequence Signal is formed.

[0062] S200, decomposing and reconstructing the traffic flow sequence by using an ensemble empirical mode decomposition method to obtain a plurality of traffic flow sequence components and residual components;

[0063] In step S200, the traffic flow sequence is decomposed and reconstructed by the ensemble empirical mode decomposition method to obtain multiple traffic flow sequence components, including: adding a Gaussian white noise sequence to the traffic flow sequence to generate a target traffic flow sequence; extracting the extreme points of the target traffic flow sequence and fitting the upper and lower envelopes according to the spline function to obtain the sequence average; obtaining the traffic flow sequence difference according to the sequence average and the target traffic flow sequence; judging whether the traffic flow sequence difference meets the judgment condition of the IMF component to obtain a judgment result; and obtaining the multiple traffic flow sequence components according to the judgment result.

[0064] The step of judging whether the traffic flow sequence difference satisfies the discrimination condition of the IMF component and obtaining the judgment result comprises: if the traffic flow sequence difference satisfies that the number of extreme value points and the number of zero-crossing points must be equal or differ by at most one and the average values ​​of the upper envelope formed by the maximum value points and the lower envelope formed by the minimum value points are zero, then the judgment result satisfies the discrimination condition of the IMF component; if the traffic flow sequence difference does not satisfy that the number of extreme value points and the number of zero-crossing points must be equal or differ by at most one and the average values ​​of the upper envelope formed by the maximum value points and the lower envelope formed by the minimum value points are zero, then the judgment result does not satisfy the discrimination condition of the IMF component.

[0065] The step of obtaining the multiple traffic flow sequence components according to the judgment result includes: if the judgment result is that the judgment condition of the IMF component is met, the traffic flow sequence difference is the first IMF component, and the extreme points of the remaining components are extracted and the upper and lower envelopes are fitted according to the spline function until the remaining components meet the preset conditions, thereby obtaining multiple traffic flow sequence components; if the judgment result is that the judgment condition of the IMF component is not met, the extreme points of the target traffic flow sequence are extracted and the upper and lower envelopes are fitted according to the spline function to obtain the sequence average value, until the judgment result meets the judgment condition of the IMF component.

[0066] In actual application scenarios, eliminating the interference of noise data on the prediction results is an important step to achieve accurate traffic flow prediction. The traffic flow sequence is actually a set of time series. Decomposing and reconstructing the traffic flow sequence by ensemble empirical mode decomposition can reduce noise to a certain extent. The traffic flow sequence can be regarded as a set of nonlinear and non-stationary time series signals, and the ensemble empirical mode decomposition method (EEMD) is particularly suitable for nonlinear and non-stationary time series signals. Before decomposing the traffic flow sequence, the ensemble empirical mode decomposition method EEMD needs to add Gaussian white noise to offset the additional noise, so that the original sequence is continuous at different scales. In order to achieve noise reduction of the traffic flow sequence, the traffic flow sequence is decomposed by EEMD to obtain n traffic flow sequence components and 1 residual component, which are IMF1, IMF2, ..., IMFn and Res.

[0067] The ensemble empirical mode decomposition algorithm can decompose the traffic flow sequence into multiple traffic flow sequence components, which contain components with obvious periodicity and trend components. The combination of highly correlated IMF components can retain the fluctuation law of the original sequence to a greater extent while removing the interference of noise data on the prediction results. The specific steps of using EEMD to decompose the traffic flow sequence are as follows:

[0068] Add a Gaussian white noise sequence to the traffic flow sequence x(t) to generate the target traffic flow sequence y(t). Find all the local extreme points in the target traffic flow sequence y(t), and use the cubic spline function to fit the upper and lower envelopes to get the sequence average n1(t), and take the difference between the target traffic flow sequence y(t) and the sequence average n1(t) as z1(t).

[0069] z1(t)=y(t)-n1(t) (1);

[0070] Among them, y(t) is the target traffic flow sequence, and n1(t) is the sequence average.

[0071] Determine whether z1(t) is a component that meets the above two IMF component discrimination requirements. Generally speaking, the IMF (intrinsic mode function) component discrimination requirements include the following aspects: within the entire traffic flow sequence difference, the number of extreme points (maximum and minimum) and the number of zero crossing points must be equal or differ by at most one. And the average value of the upper envelope formed by the local maximum points and the lower envelope formed by the local minimum points is zero.

[0072] If so, the result is judged to meet the judgment condition of IMF component, and z1(t) is taken as the first IMF component, and y(t) is replaced by the residual component r1(t), and the extreme points of the residual component are repeatedly extracted and the upper and lower envelopes are fitted according to the spline function until the residual component meets the preset condition, and multiple traffic flow sequence components are obtained, where the preset condition is r n When (t) is a monotonic function or is less than a fixed value, the decomposition is completed.

[0073] r1=y(t)-z1(t) (2);

[0074] Among them, y(t) is the target traffic flow sequence, and z1(t) is the difference of the traffic flow sequence.

[0075] If not, the judgment result is that the judgment condition of the IMF component is not met. The extreme points of the target traffic flow sequence are extracted and the upper and lower envelopes are fitted according to the spline function to obtain the sequence average value until the judgment result meets the judgment condition of the IMF component.

[0076] The traffic flow sequence component z obtained by decomposition j (t)(j=1,2,…,n) and the residual component r n The sum of (t) is the average travel speed sequence.

[0077] This application uses the DTW algorithm to calculate the distance between each component obtained after EEMD decomposition and the original sequence, and then converts it to obtain the correlation between each component and the original sequence. Reasonable selection of component combinations as input for subsequent predictions can achieve the purpose of noise reduction. The DTW algorithm matches all points on the two sequences during the dynamic programming process, calculates the distance between each two points to obtain the minimum cumulative distance, and uses the cumulative distance to measure the correlation between the two sequences. The smaller the cumulative distance, the higher the correlation between the two sequences.

[0078] S300, calculating the correlation between the traffic flow sequence component and the traffic flow sequence according to a dynamic time warping algorithm to obtain a high correlation component and a low correlation component;

[0079] In step S300, the correlation between the traffic flow sequence components and the traffic flow sequence is calculated according to the dynamic time warping algorithm to obtain high correlation components and low correlation components, including: calculating the correlation between the traffic flow sequence components and the traffic flow sequence according to the dynamic time warping algorithm to obtain correlation values; sorting the correlation values ​​to obtain sorting results; and obtaining high correlation components and low correlation components according to the sorting results.

[0080] In actual application scenarios, the dynamic time warping algorithm (DTW) is based on the idea of ​​dynamic matching in dynamic programming. It solves the matching problem between sequences with different time scales by locally stretching or compressing the sequence in time. The dynamic time warping algorithm (DTW) is used to calculate the correlation between each traffic flow sequence component and the traffic flow sequence, and the n correlations calculated from the n traffic flow sequence components are sorted by numerical value to obtain the sorting results. According to the sorting results, they are divided into two categories: high correlation components and low correlation components. Specifically:

[0081] The calculation method of DTW is given two sequences P = [p1, p2…, p N ] and Q = [q1, q2, ..., q M ], where N and M are the total number of discrete points in each sequence. When the DTW algorithm is used to measure the correlation between two sequences, K is the number of alignment points of the two sequences, represented by an N×M path matrix (p i ,q j ), the most important thing is to find a dynamic regular path W, which includes the following three constraints:

[0082] Boundary condition constraints: The starting and ending points of the dynamic regularization path W must be consistent with the starting and ending points of the time series, that is, W1 = (1, 1), W K =(N,M).

[0083] Monotonic continuity constraint: The dynamic regularization path W has monotonic continuity, always keeps moving forward and does not allow jumping, ensuring that all points on the two sequences are matched. K =(i, j), then W K+1 ∈[(i+1, j+1), (i, j+1), (i+1, j)].

[0084] Local optimal constraint: If W K =(i, j), then W K+1 ∈[(i+1, j+1), (i, j+1), (i+1, j)], and select the one with the smallest Euclidean distance among the three matching methods, and then proceed to the next matching until the end point is reached.

[0085] When the above three constraints are met, start matching sequence P and sequence Q from point (0, 0) and calculate the Euclidean distance between any two points in the two sequences to form a matching matrix. The Euclidean distance d(p i ,q j ), that is, calculate the Euclidean distance between the i-th point in sequence P and the j-th point in sequence Q.

[0086] d(p i ,q j)=(p i -q j ) 2 (3);

[0087] According to the above three constraints, the optimal matching path is determined, and the distance of each match is accumulated until the end point (N, M) is reached. The accumulated matching distance is the shortest path of the two sequences and is recorded as the DTW value. The average DTW distance between the matching points on the optimal matching path is calculated to measure the correlation between the two sequences. P,Q The value of is [0, 1]. The larger the value, the stronger the correlation between the two sequences.

[0088] DTW[i,j]=min{DTW[i-1,j], DTW[i,j-1], DTW[i-1,j-1]}+(p i -q j ) 2 (4);

[0089]

[0090] S400, calculating according to the high correlation component and the low correlation component to obtain normalized data;

[0091] In step S400, the step of calculating the normalized data based on the high correlation component and the low correlation component also includes: combining the high correlation component and the low correlation component and adding traffic meteorological factors to obtain a subsequence matrix; normalizing the subsequence matrix to obtain the normalized data.

[0092] In actual application scenarios, high-correlation components and low-correlation components are combined and traffic meteorological factors are added to form a subsequence matrix. The subsequence matrix is ​​normalized to obtain normalized data, and then divided into training set and validation set.

[0093] S500, inputting the normalized data into the LSTM model to obtain a plurality of initial prediction results;

[0094] In step S500, the LSTM model is built, and parameters such as the number of network layers, activation functions, number of neurons in the hidden layer, and time window values ​​in the LSTM model are determined. The normalized data is input into the LSTM model for training and learning to obtain multiple initial prediction results.

[0095] The learning process of LSTM mainly includes three parts: forget gate information screening, memory unit state update and information output. The specific steps are as follows:

[0096] Forget gate information filtering. The unit state of the previous moment is passed to the current moment and filtered through the forget gate. The sigmoid layer will output a value between 0 and 1, where 0 and 1 represent discarding all information in the network unit and retaining all information respectively. After processing, the retained information is:

[0097] f t =σ(W f ·[h t-1 , x t ]+b f ) (6);

[0098] Memory unit state update. First, the sigmoid layer in the input gate is responsible for determining which information will be updated; second, the information to be updated is stored through the calculation of the tanh layer; finally, the current unit is updated. Let i t The weight vector for updating the state is W, which is the new state information after being processed by the input gate. c , the weight vector of the input gate is W i , the threshold of the forget gate is b i , the threshold for updating the status is b c , the updated neural unit state is Ct, and the neural unit state before updating is C t-1 .

[0099] From this we can see that the information stored in the current state is:

[0100] i t =σ(W i ·[h t-1 , x t ]+b i ) (7);

[0101] Among them, W i is the weight vector of the input gate, b i is the threshold of the forget gate.

[0102] The updated unit state can be expressed as:

[0103]

[0104] Among them, C t-1 is the state of the neural unit before updating, W c To achieve the weight vector of the updated state, b c To achieve the threshold of updating status.

[0105] Information output. The state of the unit is judged through the output gate to achieve the final screening of the output information. Let the state of the neural unit to be output be 0 t , the weight vector of the output gate is Wo , the state threshold of the output unit is b o , the output information is h t The neural unit state to be output is expressed as:

[0106] O t =σ(W o ·[h t-1 , x t ]+b o ) (9);

[0107] Among them, W o is the weight vector of the output gate, b o is the state threshold of the output unit.

[0108] The output information is:

[0109] h t =O t tanh(C t ) (10);

[0110] Among them, O t is the state of the neural unit to be output, C t The updated unit status.

[0111] S600, superimposing and summing a plurality of the initial prediction results to obtain a prediction result.

[0112] In step S600, the multiple initial prediction results are superimposed and summed to obtain the prediction result, followed by: obtaining error data based on the multiple prediction results; and obtaining an evaluation result by comparing the error data with the prediction result.

[0113] In actual application scenarios, multiple initial prediction results are superimposed and summed up as the final prediction result output. Error data is obtained based on multiple prediction results; evaluation results are obtained by comparing the error data with the prediction results, which means designing multiple groups of comparative experiments for prediction, analyzing and comparing the prediction results and errors of multiple groups of experiments, and evaluating the model.

[0114] The data used in this embodiment comes from electronic police data, and the statistical interval is 5 minutes. The original intersection traffic sequence is decomposed by EEMD to obtain 7 traffic flow sequence components (IMF components) and 1 residual component Res, as shown in Figures 2 to 9 As shown, Figure 2 A schematic diagram of a short-term traffic flow prediction method and an IMF1 component in the system provided by the present invention, Figure 3 A schematic diagram of a short-term traffic flow prediction method and an IMF2 component in the system provided by the present invention, Figure 4A schematic diagram of a short-term traffic flow prediction method and IMF3 component in the system provided by the present invention, Figure 5 A schematic diagram of a short-term traffic flow prediction method and IMF4 component in the system provided by the present invention, Figure 6 A schematic diagram of a short-term traffic flow prediction method and IMF5 component in the system provided by the present invention, Figure 7 A schematic diagram of a short-term traffic flow prediction method and IMF6 component in the system provided by the present invention, Figure 8 A schematic diagram of a short-term traffic flow prediction method and IMF7 component in the system provided by the present invention, Fig. 9 A schematic diagram of a short-term traffic flow prediction method and residual components in the system provided by the present invention.

[0115] In order to achieve denoising of traffic flow sequences, the DTW algorithm is used to calculate the distance between each IMF component and the traffic flow sequence on the basis of EEMD decomposition, and the correlation between the sequences is calculated. According to the calculation results, the components are divided into two categories: high correlation components and low correlation components. The calculation results of the correlation between the decomposed components and the traffic flow sequence are shown in the following table. As can be seen from Table 1, the correlation between the six components IMF4-IMF8 and Res and the traffic flow sequence is significantly higher than the first three components. Therefore, IMF4-IMF8 and Res are regarded as high correlation components, and IMF1-IMF3 are regarded as low correlation components.

[0116] Table 1:

[0117]

[0118] The combination of highly correlated components can preserve the changing rules of the original sequence to the greatest extent while eliminating the interference of noise data. The calculated combination of highly correlated components and low correlated components are decomposed and reconstructed into the LSTM neural network for prediction, and the prediction results are superimposed to obtain the final prediction results. The LSTM model constructed in this application contains two LSTM layers, and the Dropout ratio of each layer is set to 0.2. The number of neurons in the hidden layer will also affect the learning ability and prediction accuracy of the model. In this application, the number of neurons in the input layer is 11, and the number of neurons in the output layer is 1. According to the number of neurons in the input layer and the output layer in this application, the range of the number of neurons in the hidden layer is determined to be [5, 23]. The number of neurons with different values ​​of hidden layer neurons is brought into the model to obtain the corresponding mean square error, and the number of hidden layer neurons with the minimum error is taken as the final value result. After many experiments, this application finally determined that the number of neurons in each hidden layer is 20. When the amount of data is large, the batch size batch in the LSTM model _size generally adopts the principle of small batch processing. Combined with the actual data situation and the MSE analysis results under the parameter combination, the batch size of this application is batch _ The size value is 32 and the number of iterations Epoch is 40.

[0119] By comparing the difference between the actual value and the predicted value at different time points, it can be found that the combined model performs better in predicting the flow rate at the intersection, and the change curve of the predicted value at the intersection is relatively close to that of the actual value. Further comparison of the floating vehicle data and the predicted value of the intersection flow rate shows that the difference between the two is small in value, and the prediction result is ideal.

[0120] The prediction results of the three intersections are evaluated using evaluation indicators as shown in the following table.

[0121] Table 2:

[0122]

[0123] In order to further verify that the EEMD-DTW-LSTM combined model has improved prediction accuracy compared with the traditional single model, this application selects two models for comparative analysis of prediction results, and the evaluation index calculation results of the three models are shown in Table 3. By comparing and analyzing the evaluation indicators with the other two models, it can be found that the EEMD-DTW-LSTM combined model performs best among the three groups of models, and the values ​​of the three evaluation indicators of RMSE, MAPE and MAE are all small. The prediction accuracy of the combined prediction model is better than that of the traditional prediction model, and the experimental results at different intersections also verify the universality of the model.

[0124] Table 3:

[0125]

[0126] It has been verified that the short-term traffic flow prediction method based on EEMD-DTW-LSTM of the present invention uses the ensemble empirical mode decomposition method (EEMD) to decompose the intersection traffic flow sequence, combines the dynamic time warping algorithm (DTW) to measure the correlation between each component and the original sequence, and realizes denoising of the original sequence through component combination, thereby improving the accuracy of model prediction.

[0127] Reference Fig.10 As shown, the second aspect of the present invention provides a short-term traffic flow prediction system, the system comprising: a decomposition module 100, a calculation module 200 and a prediction module 300;

[0128] The decomposition module 100 is configured to: obtain a traffic flow sequence: decompose and reconstruct the traffic flow sequence by using a set empirical mode decomposition method to obtain a plurality of traffic flow sequence components:

[0129] The calculation module 200 is configured to: calculate the correlation between the traffic flow sequence components and the traffic flow sequence according to the dynamic time warping algorithm to obtain a high correlation component and a low correlation component; calculate according to the high correlation component and the low correlation component to obtain normalized data;

[0130] The prediction module 300 is configured to: input the normalized data into the LSTM model to obtain a plurality of initial prediction results; and superimpose and sum the plurality of initial prediction results to obtain a prediction result.

[0131] The effects of the above-mentioned system when applying the above-mentioned method can be found in the description of the above-mentioned method embodiment, which will not be repeated here.

[0132] The third aspect of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect or any possible implementation of the first aspect is implemented.

[0133] A fourth aspect of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect or any possible implementation of the first aspect.

[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0138] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. A short-term traffic flow prediction method, characterized in that: The method comprises: Obtain traffic flow sequence; Decomposing and reconstructing the traffic flow sequence by using an ensemble empirical mode decomposition method to obtain a plurality of traffic flow sequence components and residual components; Calculating the correlation between the traffic flow sequence components and the traffic flow sequence according to a dynamic time warping algorithm to obtain a high correlation component and a low correlation component; Calculating according to the high correlation component and the low correlation component to obtain normalized data; Inputting the normalized data into the LSTM model to obtain multiple initial prediction results; The multiple initial prediction results are superimposed and summed to obtain a prediction result.

2. A short-term traffic flow prediction method according to claim 1, characterized in that: The steps of decomposing and reconstructing the traffic flow sequence by using the ensemble empirical mode decomposition method to obtain multiple traffic flow sequence components include: Adding a Gaussian white noise sequence to the traffic flow sequence to generate a target traffic flow sequence; Extracting the extreme points of the target traffic flow sequence and fitting the upper and lower envelopes according to the spline function to obtain the sequence average value; Obtaining a traffic flow sequence difference according to the sequence average value and the target traffic flow sequence; Determine whether the traffic flow sequence difference satisfies the judgment condition of the IMF component, and obtain a judgment result; The multiple traffic flow sequence components are obtained according to the judgment result.

3. A short-term traffic flow prediction method according to claim 2, characterized in that: The step of judging whether the traffic flow sequence difference satisfies the judgment condition of the IMF component and obtaining the judgment result comprises: If the traffic flow sequence difference satisfies that the number of extreme value points and the number of zero-crossing points must be equal or differ by at most one, and the average values ​​of the upper envelope formed by the maximum value points and the lower envelope formed by the minimum value points are zero, then the judgment result satisfies the judgment condition of the IMF component; If the traffic flow sequence difference does not satisfy that the number of extreme points and the number of zero-crossing points must be equal or differ by at most one and the average values ​​of the upper envelope formed by the maximum points and the lower envelope formed by the minimum points are zero, then the judgment result is that the judgment condition of the IMF component is not met.

4. A short-term traffic flow prediction method according to claim 3, characterized in that: The step of obtaining the plurality of traffic flow sequence components according to the judgment result comprises: If the judgment result satisfies the discrimination condition of the IMF component, the traffic flow sequence difference is the first IMF component, and the extreme points of the remaining components are extracted and the upper and lower envelopes are fitted according to the spline function until the remaining components meet the preset conditions to obtain multiple traffic flow sequence components; If the judgment result is that the judgment condition of the IMF component is not met, the extreme points of the target traffic flow sequence are extracted and the upper and lower envelopes are fitted according to the spline function to obtain the sequence average value until the judgment result meets the judgment condition of the IMF component.

5. A short-term traffic flow prediction method according to claim 1, characterized in that: The steps of calculating the correlation between the traffic flow sequence components and the traffic flow sequence according to the dynamic time warping algorithm to obtain the high correlation component and the low correlation component include: Calculating the correlation between the traffic flow sequence component and the traffic flow sequence according to a dynamic time warping algorithm to obtain a correlation value; Sorting the correlation values ​​to obtain a sorting result; A high correlation component and a low correlation component are obtained according to the sorting result.

6. A short-term traffic flow prediction method according to claim 1, characterized in that: The step of calculating and obtaining normalized data according to the high correlation component and the low correlation component also includes: The high correlation component and the low correlation component are combined and traffic weather factors are added to obtain a subsequence matrix; The subsequence matrix is ​​normalized to obtain the normalized data.

7. A short-term traffic flow prediction method according to claim 1, characterized in that: The step of superimposing and summing the multiple initial prediction results to obtain the prediction result includes: Obtain error data according to the plurality of prediction results; An evaluation result is obtained by comparing the error data with the prediction result.

8. A short-term traffic flow prediction system, characterized in that: The system comprises: a decomposition module, a calculation module and a prediction module; The decomposition module is configured to: obtain a traffic flow sequence; decompose and reconstruct the traffic flow sequence by using a set empirical mode decomposition method to obtain a plurality of traffic flow sequence components; The calculation module is configured to: calculate the correlation between the traffic flow sequence component and the traffic flow sequence according to the dynamic time warping algorithm to obtain a high correlation component and a low correlation component; calculate according to the high correlation component and the low correlation component to obtain normalized data; The prediction module is configured to: input the normalized data into the LSTM model to obtain multiple initial prediction results; and superimpose and sum the multiple initial prediction results to obtain a prediction result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of a short-term traffic flow prediction method as described in any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a short-term traffic flow prediction method as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Short-term traffic flow prediction method based on time series decomposition

    CN111161538A

  • Urban rail transit short-time passenger flow prediction method based on CEEMDAN-LSTM

    CN115034457A

  • Short-time ship traffic flow prediction method based on EEMD-PE-LSTM

    CN115828736A