A short-term traffic flow prediction method based on time series analysis and residual matching

By decomposing traffic flow data into linear and residual parts, and using timing analysis and pattern matching algorithms to process the residual part, the problem of failing to fully utilize the random characteristics of traffic flow in the existing technology is solved, and a higher level of performance is achieved. Traffic flow prediction accuracy and effective capture of non-recurring events.

CN112669599BActive Publication Date: 2024-10-25CHENGDU YISHUQIAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011475868.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2024-10-25
Estimated Expiration
2040-12-14

AI Technical Summary

Technical Problem

Existing traffic flow prediction methods fail to make full use of the stochastic characteristics of traffic flow, resulting in insufficient prediction accuracy, especially in the handling of non-recurring events such as traffic accidents and extreme weather.

Method used

A combined prediction method based on time series analysis and pattern matching is used to decompose the traffic flow data into a linear part and a residual part, use time series analysis technology to determine the linear part, and match the residual part through a pattern matching algorithm to better predict the Random fluctuations in combined traffic flow data.

Benefits of technology

It improves the accuracy of traffic flow prediction, can more effectively capture random fluctuations and non-recurring events in traffic flow data, and provide more accurate prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112669599B_ABST
    Figure CN112669599B_ABST
Patent Text Reader

Abstract

The present invention discloses a short-term traffic flow prediction method based on time series analysis and residual matching. The random characteristics of traffic flow are the fundamental reason why traffic flow is difficult to be accurately predicted. In order to better fit the random fluctuations in traffic flow data, this method adopts the idea of ​​decomposition and divides the original traffic flow data into a linear part and a residual part. First, the linear part of the data is calculated using time series analysis technology, and the remaining residual part is segmented to construct a residual vector library. Then, the residual vectors are matched using a pattern matching algorithm, and the random fluctuations in the traffic flow data are further fitted by finding similar residual vectors. Compared with other methods based on pattern matching algorithms, this method has certain advantages in stability and prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

1. Technical Field

[0001] The present invention relates to the field of intelligent transportation, and in particular to short-term traffic flow prediction, and specifically to a combined prediction method based on time series analysis and residual matching. 2. Background Technology

[0002] An effective traffic flow prediction method is very important for route planning, traffic control and intelligent driving. Traffic flow data is a kind of time series data with characteristics such as trend, periodicity and uncertainty. Among them, trend and periodicity belong to the regular characteristics of traffic flow, which are mainly manifested as trends or fluctuations that change according to time laws, and are the premise for traffic flow to be predicted. Uncertainty belongs to the random characteristics of traffic flow. Non-recurring events (such as traffic accidents, extreme weather and large-scale events, etc.) will cause random fluctuations in traffic flow data, which is the fundamental reason why traffic flow is difficult to be accurately predicted. Non-parametric models have certain advantages in fitting random fluctuations in traffic flow data. Among the many non-parametric models, pattern matching models are widely used in various traffic flow prediction scenarios due to their good accuracy, robustness and generalization ability. Therefore, the present invention selects pattern matching models as the object of optimization.

[0003] The four main steps of the pattern matching model are to construct traffic vectors, measure vector distances, select K similar vectors, and output prediction results. In studies on pattern matching model optimization, the distance measurement function, K value selection, and prediction function have been optimized respectively. These studies directly use raw traffic flow data for modeling, and there is no difference in the way of constructing traffic vectors. This construction method does not fully utilize the random characteristics of traffic flow. In fact, traffic flow data can be decomposed into a relatively stable part and a randomly changing part. If the randomly changing part of the traffic flow data can be separated first and a new traffic vector is constructed for this part, the advantage of the pattern matching model in capturing non-recurring events can be better utilized. Therefore, the present invention adopts the idea of ​​decomposition and proposes a combined prediction model based on time series analysis and residual matching. This method divides the raw traffic flow data into a linear part and a residual part, where the linear part reflects the relatively stable similarity part in the traffic flow data, and the residual part reflects the random fluctuations in the data. 3. Summary of the Invention

[0004] The purpose of this invention is to further utilize the random characteristics of traffic flow to obtain higher traffic flow prediction accuracy, and to further fit the random fluctuations in traffic flow data by combining time series analysis technology and pattern matching algorithm.

[0005] The object of the present invention is achieved in this way:

[0006] To address the problem that existing research has not fully utilized the random characteristics of traffic flow, this paper combines time series analysis techniques with pattern matching algorithms. First, time series analysis techniques are used to calculate the linear portion of the data. Specifically, this includes time series stationarity analysis, time series analysis model determination, and linear portion acquisition steps. The remaining residual portion is then segmented to construct a residual vector library. Then, a pattern matching algorithm is used to match the residual vectors. Specifically, this includes distance measurement, K value selection, predicted value output, and predicted value mapping steps, thereby further fitting the random fluctuations in traffic flow data.

[0007] The specific steps are:

[0008] Since there are problems such as loss, anomaly and redundancy in the original traffic flow data, corresponding data preprocessing is required, which includes data aggregation, data interpolation and data screening steps, such as Figure 2 shown.

[0009] Data aggregation is divided into time aggregation and space aggregation. In the time dimension, the default data sampling interval is 30 seconds. The present invention accumulates the traffic flow observation values ​​every 10 times to obtain traffic flow data with a sampling interval of 5 minutes; in the space dimension, since different ring coil sensor nodes detect different numbers of lanes, for the sake of uniformity, the multiple lanes detected by the sensor nodes are aggregated, and the aggregated traffic flow is used as traffic flow data. Since the ring coil sensor is exposed to the outdoor environment for a long time, it cannot provide accurate traffic flow data when encountering environmental interference or fault repair, and data loss and data anomalies may occur. In order to solve the discontinuity problem caused by data loss, the present invention uses the linear mean of adjacent nodes for filling, and adopts the 3-sigma principle to regard observations outside 3 times the standard deviation of the mean as outliers and eliminate them. Data screening means that in order to avoid the influence of irrelevant traffic patterns on the prediction results, predictions are only made for weekday data.

[0010] After data preprocessing, time series stationarity analysis is required. Because time series analysis techniques are based on time series stationarity, before performing time series analysis on traffic flow data, it is necessary to first ensure that the traffic flow data is stationary. Common analysis methods include observation and unit root testing. The observation method involves observing whether the traffic flow has the properties of a stationary time series and whether the traffic flow data fluctuates within a bounded range. If the traffic flow exhibits obvious trends (such as gradual increases) or periodicity (i.e., regular changes), it is not a stationary time series. The unit root test method tests whether a unit root exists in the traffic flow. The presence of a unit root indicates that the traffic flow is not a stationary time series. Assuming that the traffic flow has a unit root (i.e., the traffic flow is non-stationary), if the null hypothesis can be rejected at a given confidence level, it indicates that the traffic flow is stationary. The present invention first uses observation to preliminarily determine whether the traffic flow is stationary, and then uses the unit root test method to further confirm the accuracy of the observation results. If the traffic flow is non-stationary, a difference operation is performed until it becomes stationary.

[0011] On the basis that the traffic flow data has been stabilized, the time series analysis model can be determined, which is mainly divided into two steps: determining the order and determining the parameters.

[0012] The time series analysis model ARIMA (p, d, q) first needs to determine the values ​​of the three orders p, d, and q, where the d value refers to the number of times the original traffic flow data is differentiated. Commonly used differencing methods include first-order differencing, second-order differencing, and periodic differencing.

[0013] The p-value refers to the number of historical observations used in the model, and its size is determined by the partial auto-correlation function (PACF). PACF describes the t-1 ,y t-2 ,y t-3 ,…,y t-k+1 Afterwards, t-k y t The coefficient obtained by PACF is called the partial autocorrelation coefficient. The calculation formula is as follows:

[0014]

[0015] Where: y t is the observed value of traffic volume in the tth time interval; corr is the correlation function.

[0016] The q value refers to the number of historical noise error terms used in the model, and its size is determined by the auto-correlation function (ACF). The ACF describes the correlation between different observations and is a function of the similarity between two observations with respect to the time difference between the observations. The autocorrelation coefficient r can be obtained from the ACF. k , the calculation formula is as follows:

[0017]

[0018] Where: y t is the observed value of traffic volume in the tth time interval; n is the number of populations; is the population mean.

[0019] The final step is to estimate the parameters of the model, which has been determined (i.e., the relevant order has been determined). Common parameter estimation methods include maximum likelihood estimation and least squares estimation. The idea of ​​maximum likelihood estimation is to maximize the joint probability of all known observations, that is, to maximize the probability of generating the observation, thereby obtaining the optimal parameter estimates. The idea of ​​least squares estimation is to minimize the error, that is, to minimize the sum of the squares of the errors between the observed and predicted values, thereby finding an optimal set of parameter values.

[0020] The linear portion of the traffic flow data is then calculated using the established ARIMA (p, d, q) model. This method employs an iterative multi-step prediction method based on observations, continuously updating the traffic flow data with new observations without updating the model. This method achieves high accuracy while controlling computational costs. The prediction process is as follows:

[0021]

[0022] Where: a t+1 is the linear part of the traffic volume in the t+1th time interval predicted by the ARIMA model; t is the observed value of traffic volume in the tth time interval; p is the number of historical observations used for modeling; z is the step size of multi-step prediction.

[0023] In this method, the pattern matching object is not the traffic vector, but the residual vector. This method takes the difference between the original traffic flow data and the linear part calculated by the time series analysis model to obtain the residual part, then divides the residual part to establish a residual vector library, and finally uses the residual vector for matching. This can further utilize the random fluctuations in the traffic flow data. The residual vector is represented as follows:

[0024] Y=[y t ,y t-1 ,y t-2,...y t-n ]

[0025] Where: y t is the observed value of traffic volume in the tth time interval.

[0026] The linear part is expressed as follows:

[0027] A=[a t , a t-1 , a t-2 ,…a t-n ]

[0028] Where: a t It is the linear part of the traffic volume in the tth time interval predicted by the ARIMA model.

[0029] The residual part is expressed as follows:

[0030] R=YA=[r t , r t-1 , r t-2 ,...r t-n ]

[0031] Where: r t is the residual of the traffic volume in the tth time interval.

[0032] The residual vector is constructed in sequence by slicing as follows:

[0033]

[0034] Where: [r t-n , r t-n-1 ] is the nth residual vector; r t-n+1 is the state value corresponding to the nth residual vector.

[0035] When the number of observations in traffic flow data is m and the time delay is d, up to md residual vectors can be constructed through segmentation, each of which represents a pattern. When predicting a prediction point, the input traffic vector needs to be converted into an input residual vector, which is then matched with the historical residual vectors in the residual vector library.

[0036] The positive effects of the present invention are:

[0037] 1. A combined prediction model is a novel model synthesized from multiple technologies and models. This type of model combines the advantages of different technologies and models, resulting in better prediction results than a single prediction model. This model is a future development direction. This paper constructs an effective combined prediction model based on residual matching.

[0038] 2. Different from other related studies, this method decomposes the original traffic flow data into a linear part and a residual part, and uses the residual part to construct a new traffic vector to further fit the random fluctuations in the traffic flow data. IV. Description of the Figures

[0039] Figure 1 This is a schematic diagram of traffic flow data preprocessing.

[0040] Figure 2 It is a schematic diagram of the invention steps. V. Specific Implementation Methods

[0041] Residual matching refers to the process of pattern matching using input residual vectors and historical residual vectors. In the pattern matching model, the distance between two traffic vectors is first calculated using a distance metric function. Then, the K historical traffic vectors closest to the input traffic vector are selected. Finally, a prediction function is used to aggregate the state values ​​of these K historical traffic vectors to obtain the final prediction result. Residual matching is similar to the pattern matching process, so the matching process needs to consider issues such as the selection of the distance metric function, the selection of the K value, and the selection of the prediction function. In addition, since the matching object has changed from a traffic vector to a residual vector, the actual predicted value must be mapped after the matching is completed.

[0042] (1) Distance metric function

[0043] The distance metric function is used to measure the closeness between the input residual vector and the historical residual vector. The commonly used distance metric function is the Euclidean distance metric:

[0044]

[0045] Where: is the input residual vector; is the historical residual vector; d is the time delay; is an element in the input residual vector; are the elements in the historical residual vector.

[0046] The Euclidean distance metric does not consider the impact of time on the measurement results. Researchers believe that the closer the observation point is to the predicted point in time, the greater the impact on the measurement results. Therefore, different weights should be assigned based on the distance between the observation point and the predicted point in the residual vector. Researchers propose using an exponential distance metric as a distance metric function, which is as follows:

[0047]

[0048] Where: is the input residual vector; is the historical residual vector; d is the time delay; wi is the index weight coefficient; is an element in the input residual vector; are the elements in the historical residual vector.

[0049] (2) K value selection

[0050] The K value refers to the number of historical residual vectors closest to the input residual vector, obtained through screening using a distance metric function. The K value is largely dependent on traffic flow data, and different data distributions will have different impacts on the K value. Selecting the K value is a process of continuous experimentation and optimization; values ​​that are too large or too small will affect the accuracy of the prediction. This invention uses a control variable method to vary the K value between 1 and 20, then comprehensively considers error evaluation indicators and computational costs to determine the optimal K value.

[0051] (3) Prediction function

[0052] The prediction function is used to describe how to make predictions using K historical residual vectors. This paper uses two different prediction functions for comparison. The first is a simple average prediction function, which uses the mean of the state values ​​corresponding to the historical residual vectors as the prediction result. The specific form is as follows:

[0053]

[0054] Where: is the prediction result; K is the number of selected historical residual vectors; is the state value corresponding to the i-th historical residual vector.

[0055] The second is the ranking weighted prediction function, which assigns different ranking weight coefficients according to the distance between the historical residual vector and the input residual vector. The specific form is as follows:

[0056]

[0057]

[0058] Where: W i is the ranking weight coefficient; l i is the ranking of the i-th historical residual vector (the smaller the distance, the higher the ranking); K is the number of selected historical residual vectors; z is the adjustment factor (z=2 in the present invention).

[0059] (4) Prediction value mapping

[0060] Since the matching object in this method changes from traffic vector to residual vector, the output result of the prediction function changes from traffic flow prediction value to residual prediction value, so it is necessary to add a mapping step from residual prediction value to traffic flow prediction value.

[0061] This invention considers two methods for mapping predicted values. The first method first obtains a traffic vector through residual vector mapping, and then uses the state value corresponding to the traffic vector as the input to the prediction function. Experimental results show that this method does not have high prediction accuracy, which may be due to the loss of accuracy caused by multiple transformations of the traffic vector. The other method directly uses the state value corresponding to the residual vector as the input to the prediction function, and then accumulates the output of the prediction function and the linear part corresponding to the residual vector to obtain the traffic flow prediction value. This method restores the decomposition operation and has better experimental results than the first method. Therefore, this invention adopts the second method to map the residual prediction value.

[0062] Examples of user usage scenarios of the present invention:

[0063] An effective traffic flow prediction model is crucial for route planning, traffic control, and intelligent driving. Travelers can use traffic flow prediction information to predict future road congestion and develop more efficient travel plans. Real-time traffic forecast analysis also helps travelers adjust their routes and reduce traffic congestion. Traffic managers can use prediction models to monitor traffic conditions and proactively implement measures such as traffic signal control in areas where congestion is likely. In the event of an emergency, such as a traffic accident, future traffic flow trends on surrounding roads can help traffic managers allocate resources more effectively, thereby accelerating evacuation and rescue efforts. For applications such as intelligent driving and the Internet of Vehicles, accurate speed prediction information is the foundation of intelligent vehicle cooperative systems and a crucial factor in improving road capacity and safety.

[0064] In summary, traffic flow forecasting research has irreplaceable significance in improving traffic problems and enhancing travel efficiency.

Claims

1. A short-term traffic flow prediction method based on time series analysis and residual matching, characterized by: By dividing the original traffic flow data into a linear part and a residual part, and constructing a new traffic vector for the residual part, the advantage of the pattern matching model in capturing non-recurring events can be better utilized; this method includes five steps: data preprocessing, time series stationarity analysis, time series analysis model determination, residual vector library establishment and residual matching; in order to capture the random fluctuations in traffic flow data, this method adopts the idea of ​​decomposition and divides the original traffic flow data into a linear part and a residual part; first, the linear part of the data is calculated using time series analysis technology, and the remaining residual part is segmented to construct a residual vector library; then the residual vector is matched using a pattern matching algorithm to further fit the random fluctuations in traffic flow data: The specific steps are: The first step is traffic flow data preprocessing. Since there are loss, anomalies and redundancy problems in the original traffic flow data, corresponding data preprocessing is required, which includes four steps: data aggregation, data interpolation and data screening. The second step is to analyze the time series stability of traffic flow data; Its purpose is to ensure that the existing traffic flow data can be used to judge the future traffic status. Commonly used methods for judging time series stationarity include observation method and unit root test method (Augmented Dickey-Fuller, ADF); The third step is to determine the time series analysis model. The time series analysis model ARIMA (p, d, q) first needs to determine the values ​​of the three orders of p, d, and q, where the d value refers to the number of times the original traffic flow data is differentiated, and its size is determined by the difference method; the p value refers to the number of historical observations used in the model, and its size is determined by the partial autocorrelation function (PACF); the q value refers to the number of historical noise error terms used in the model, and its size is determined by the autocorrelation function (ACF); then the parameters of the model that has been determined (that is, the correlation order has been determined) are estimated. Commonly used parameter estimation methods include maximum likelihood estimation and least squares estimation; The fourth step is to establish a residual vector library. First, the original traffic flow data and the linear part calculated by the time series analysis model are subtracted to obtain the residual part, and then the residual part is segmented to establish a residual vector library. Finally, the residual vector is used for matching. This method adopts the observation value iteration multi-step prediction method. This method also continuously updates the traffic flow data through new observation values, but does not update the model. The prediction process is shown in the following formula: Where: a t+1 is the linear part of the traffic volume in the t+1th time interval predicted by the ARIMA model; y t is the observed value of traffic volume in the tth time interval; p is the number of historical observations used for modeling; z is the step size of multi-step prediction; The fifth step is residual matching. Residual matching refers to the process of pattern matching using input residual vectors and historical residual vectors. It should be noted that since the matching object is changed from a traffic vector to a residual vector, the actual predicted value needs to be mapped after the matching is completed.

2. The method according to claim 1, characterized in that: First, the linear part of the data is calculated using time series analysis techniques, and then the residual vector is matched using a pattern matching algorithm: The four main steps of the pattern matching model are to construct traffic vectors, measure vector distances, select K similar vectors, and output prediction results. In the research on the optimization of the pattern matching model, relevant researchers have optimized the preprocessing process, distance measurement function, K value selection, and prediction function respectively. These studies directly use the original traffic flow data for modeling, and there is no difference in the way of constructing traffic vectors, and this construction method does not fully utilize the random characteristics of traffic flow. In fact, traffic flow data can be decomposed into a relatively stable part and a randomly changing part. This method adopts the idea of ​​decomposition to divide the original traffic flow data into a linear part and a residual part, in which the linear part reflects the relatively stable similarity part in the traffic flow data, and the residual part reflects the random fluctuations in the data. This method constructs a new traffic vector for the randomly changing residual part, which can better play the advantage of the pattern matching model in capturing non-recurring events.

3. The method according to claim 2, characterized in that: Use time series analysis techniques to obtain the linear part of traffic flow data: Since the residual part is the difference between the original traffic flow data and the linear part, this method needs to obtain the linear part of the data first; the long-term trend in the traffic flow data can be obtained by a simple averaging method, but this method can only simply count the historical data and get a rough estimate; related research proposes a model based on stochastic differential equations, which can model long-term trends and short-term changes respectively; however, when faced with traffic flow data with different traffic modes, the prediction error of this model is large; this method believes that time series analysis technology, as a linear time series prediction technology, can be used to calculate the linear part of traffic flow data; this technology is in the form of The formula is similar to the linear regression model, but the application premise of the linear regression model is that the independent variables used for modeling need to be independent of each other; in traffic flow data, there is an obvious time correlation between the historical observations used for modeling, so the linear regression model is not suitable for the research scenario of traffic flow prediction; time series analysis technology is based on the assumption that independent variables are interrelated, and it is believed that historical data have hinted at the laws of future data development and change, and has the advantages of simple construction, convenient calculation and easy deployment; in summary, this method uses time series analysis technology to calculate the linear part of traffic flow data, and subtracts it from the original data to obtain the residual part, so as to achieve the purpose of decomposition.