Long-term traffic prediction method and device based on discrete wavelet decomposition

By decomposing the traffic time series into trend and event components based on discrete wavelet decomposition, and extracting features with the spatiotemporal encoder, the problem of poor accuracy of long-term traffic prediction is solved, and a more robust and efficient prediction model is achieved.

CN119649604APending Publication Date: 2025-03-18HUBEI CHUTIAN HIGH SPEED DIGITAL TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411859940.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The accuracy of long-term traffic prediction in the prior art is poor, it is difficult to deal with the distribution offset problem in non-stationary traffic time series, and it is difficult to simultaneously capture the global and local dynamic spatial correlations in the traffic sequence, resulting in high computational costs.

Method used

The original traffic time series is decomposed into stable trend components and fluctuating event components by using discrete wavelet decomposition method, and the time change characteristics and spatial characteristics are extracted through the spatiotemporal encoder, and long-term traffic prediction is performed through the integration of potential spatiotemporal features.

Benefits of technology

The robustness of the prediction model for different structural changes is enhanced, the distribution offset problem of non-steady state traffic data is effectively alleviated, the calculation complexity is reduced, and the accuracy and robustness of long-term traffic prediction are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119649604A_ABST
    Figure CN119649604A_ABST
Patent Text Reader

Abstract

The invention provides a long-term traffic prediction method and device based on discrete wavelet decomposition, and the method comprises the steps: obtaining an original traffic time sequence, and decomposing the original traffic time sequence through discrete wavelet decomposition, obtaining a stable trend component and a fluctuating event component; calling a preset space-time encoder, and extracting time change features and space features of the trend component and the event component through the space-time encoder; codes of historical traffic signals are converted based on the predicted time dimension of future signals, and spatial-temporal variations in a potential space are captured by a preset spatial-temporal decoder to generate potential temporal features and potential spatial features. According to the invention, the robustness of the prediction model to different structure changes can be enhanced, and the problem of distribution offset of unsteady traffic data is effectively relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent transportation technology, and in particular to a long-term traffic prediction method and device based on discrete wavelet decomposition. Background Art

[0002] Intelligent transportation systems integrate advanced technologies and data analysis, playing a key role in optimizing transportation systems to improve efficiency and safety. Among the core components of intelligent transportation systems, traffic forecasting is the cornerstone of intelligent traffic scheduling and management, which can bring benefits to various traffic-related applications such as route planning and congestion relief. Traffic forecasting is generally divided into short-term forecasting and long-term forecasting. If the forecast time span is less than one hour, it is classified as a short-term forecast; otherwise, it is classified as a long-term forecast.

[0003] Compared with short-term forecasts, long-term forecasts play a key role in improving the efficiency of transportation systems and improving the overall travel experience. For example, long-term forecasts can reveal trends and patterns in traffic flow, helping traffic managers optimize traffic flow and develop signal control strategies to alleviate traffic congestion. In addition, long-term forecasts can provide traffic forecasts for the next few hours, providing more accurate travel information. In this way, travelers can make more informed route choices in advance, thereby shortening travel time and reducing travel stress.

[0004] The difficulties in traffic data prediction are mainly reflected in two aspects. First, previous prediction models cannot handle the distribution shift problem in non-stationary traffic time series, mainly because these models are trained end-to-end. Traffic time series may cause end-to-end prediction models to overfit because they are intertwined with local independent components, which may experience distribution shifts. Distribution shifts directly affect the generalization and robustness of the model, making the application of the model in practical scenarios challenging; second, existing prediction models are difficult to capture the global and local dynamic spatial correlations in traffic sequences at the same time. In addition, existing prediction models usually use more flexible attention mechanisms to simulate the global dynamic correlations of traffic sequences. However, attention-based models require quadratic computational complexity, resulting in high computational costs for training.

[0005] There is currently no effective solution to the problem of poor accuracy in long-term traffic prediction in existing related technologies.

[0006] The following first explains and illustrates the technical terms of the present invention: Discrete wavelet decomposition: Discrete wavelet decomposition (DWT) is a signal processing technique used to decompose a signal into components of different frequencies and analyze these components at different resolutions. Unlike the Fourier transform, which decomposes a signal into sine waves of different frequencies, the wavelet transform performs a localized analysis of the signal in the time and frequency domain through a wavelet function. The approximate coefficients of the decomposed part represent the low-frequency part of the signal, providing the overall shape or trend information of the signal, while the detail coefficients represent the high-frequency part of the signal, capturing the details or rapidly changing information in the signal.

[0007] Graph Attention Network: A deep learning model for graph data that can learn the relationship between nodes and the representation of nodes. GAT introduces an attention mechanism that assigns different weights to the relationship between nodes, allowing the model to automatically focus on nodes that are meaningful to the current task.

[0008] Mean Absolute Error (MAE): An evaluation metric to measure the accuracy of a prediction model. It measures the average absolute deviation between the model's predicted values ​​and the actual values.

[0009] Root mean square error (RMSE): An evaluation indicator for measuring the accuracy of the prediction model. It is used to measure and evaluate the quality of reconstruction and estimation of unused spatial environmental variable values, that is, the error measure between the estimated value and the reference point value.

[0010] Mean absolute percentage error (MAPE): An evaluation indicator to measure the accuracy of a forecasting model. It measures the forecasting accuracy of a model by calculating the average value of the relative error between the forecasted value and the actual value. Summary of the invention

[0011] The present invention provides a long-term traffic prediction method and device based on discrete wavelet decomposition, which are used to solve the defect of poor accuracy of long-term traffic prediction in the prior art.

[0012] In a first aspect, the present invention provides a long-term traffic prediction method based on discrete wavelet decomposition, comprising: Obtaining an original traffic time series, and decomposing the original traffic time series using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; Calling a preset spatiotemporal encoder, and extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the temporal variation characteristics and the spatial characteristics constitute the spatiotemporal characteristics; Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured by a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and the latent space features constitute latent spatiotemporal features; The spatiotemporal features and the potential spatiotemporal features are integrated, and long-term traffic forecasting is performed based on the integration results to generate forecasting results.

[0013] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, the original traffic time series is decomposed by discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component, including: Inputting the original traffic time series into a low-frequency filter and a high-frequency filter for convolution to generate a layer of components; Further convolving the layer of components to generate low-frequency components and high-frequency components; Performing inverse discrete wavelet transform and up-sampling processing on the low-frequency component and the high-frequency component to obtain decomposed trend representation and event representation; The trend representation and the event representation are processed through linear change to obtain the trend component and the event component.

[0014] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, the spatiotemporal encoder includes a method for extracting a time component and a space component; Extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component by the spatiotemporal encoder includes: Concatenating the trend component and the event component with a preset spatiotemporal embedding to obtain an input of the spatiotemporal encoder; Extracting time variation characteristics and spatial characteristics of the trend component and the event component; The event change feature and the spatial feature are added and input into the spatiotemporal encoder for iterative processing.

[0015] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, setting the spatiotemporal embedding includes: Encoding the time periodicity of the original traffic time series, simulating the periodicity of traffic signals, and obtaining periodic coding; The spatial features are encoded using spatial graph Laplace embedding, the road network structure is simulated, and the graph position encoding is obtained; The spatiotemporal embedding is determined based on the period encoding and the graph position encoding.

[0016] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, the time variation characteristics of the trend component and the event component are extracted, including: extracting temporal variation characteristics of the trend component using trend-aware temporal attention; The time variation characteristics of the event components are extracted through event causal convolution.

[0017] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, the spatial characteristics of the trend component and the event component are extracted, including: Extracting global spatial dynamic correlations between the trend component and the event component by spatial contraction attention; Extracting the local spatial dynamic correlation of the trend component and the event component by querying the sampling graph attention; The global spatial dynamic correlation and the local spatial dynamic correlation constitute the spatiotemporal feature.

[0018] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, including: The historical traffic signal is connected with the predicted future signal through the self-attention mechanism, so that the time dimension of the historical traffic signal is consistent with the time dimension of the predicted future signal.

[0019] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, long-term traffic prediction is performed based on the integration result to generate a prediction result, including: Based on the integration results of the spatiotemporal features and the potential spatiotemporal features, weighted summation is performed on the events corresponding to the relevant time slices, and optimization is performed through back propagation to output a high-dimensional representation of the future long-term traffic time series; The prediction result is determined based on a high-dimensional representation of the future long-term traffic time series.

[0020] According to a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, the prediction method is implemented by a prediction model; An objective function of the prediction model is defined, and multi-supervision training is performed on the prediction model with the goal of minimizing the objective function.

[0021] In a second aspect, the present invention further provides a long-term traffic prediction device based on discrete wavelet decomposition, comprising: A decomposition module, used for obtaining an original traffic time series, and decomposing the original traffic time series by using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; An encoding module, used for calling a preset spatiotemporal encoder, and extracting the time variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the time variation characteristics and the spatial characteristics constitute the spatiotemporal characteristics; A decoding module, for converting the encoding of the historical traffic signal based on the time dimension of the predicted future signal, and capturing the spatiotemporal changes in the latent space through a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and the latent space features constitute latent spatiotemporal features; The prediction module is used to integrate the spatiotemporal features and the potential spatiotemporal features, and perform long-term traffic prediction based on the integration results to generate prediction results.

[0022] In a third aspect, the present invention further 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 long-term traffic prediction method based on discrete wavelet decomposition as described in the first aspect above is implemented.

[0023] In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the long-term traffic prediction method based on discrete wavelet decomposition as described in the first aspect above.

[0024] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the long-term traffic prediction method based on discrete wavelet decomposition as described in the first aspect above.

[0025] Compared with the prior art, the present invention has the following beneficial effects: 1. The long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention can enhance the robustness of the prediction model to different structural changes by utilizing discrete wavelet decomposition to decompose the complex original traffic time series into a stable trend component and a fluctuating event component, effectively alleviate the distribution offset problem of non-steady-state traffic data, and make the model have satisfactory generalization ability and robustness. In addition, by extracting spatial features, the computational complexity is effectively reduced, thus solving the problem of poor accuracy of long-term traffic prediction in existing related technologies.

[0026] 2. In the present invention, spatial shrinkage attention is used to extract global spatial correlation and effectively reduce the computational complexity. In addition, query sampling graph attention is combined with road network topology to extract local spatial correlation. The combination of global and local features improves the effectiveness of the long-term traffic prediction model.

[0027] 3. In the present invention, the spatiotemporal encoder is used to capture stable and fluctuating temporal changes, as well as global and local dynamic spatial correlations. In addition, the Transformer attention and spatiotemporal prediction decoder are used to capture the spatiotemporal changes in the latent space, and the trend-event fusion module integrates useful information to effectively improve the prediction accuracy and robustness. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 It is a flow chart of a long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention; Figure 2 is a schematic diagram of traffic prediction in an embodiment of the present invention; Figure 3 It is a comparison chart of MAE, RMSE and MAPE indicators of the present invention (STWAN) and the prior art on the Seattle Loop data set; Figure 4 It is a comparison chart of MAE, RMSE and MAPE indicators of the present invention (STWAN) and the prior art on PEMS04 and PEMS08 data sets; Figure 5 This is a comparison diagram of MAE in the 36-step prediction scenario of the PEMS04 dataset; Figure 6 This is a schematic diagram of the comparison of RMSE in the 36-step prediction scenario of the PEMS04 dataset; Figure 7 This is a comparison diagram of MAPE in the 36-step prediction scenario of the PEMS04 dataset; Figure 8 This is a comparison diagram of MAE in the 36-step prediction scenario of the PEMS08 dataset; Fig. 9 This is a schematic diagram of the comparison of RMSE in the 36-step prediction scenario of the PEMS08 dataset; Fig.10 This is a comparison diagram of MAPE in the 36-step prediction scenario of the PEMS08 dataset; Fig.11 This is a comparison diagram of MAE in the 36-step prediction scenario of the Seattle Loop dataset; Fig.12 This is a comparison diagram of RMSE in the 36-step prediction scenario of the Seattle Loop dataset; Fig.13 This is a comparison diagram of MAPE in the 36-step prediction scenario of the Seattle Loop dataset; Fig.14This is a schematic diagram of MAE comparison on the PEMS04 dataset when the amount of training data is 60%, 40%, and 20%; Fig.15 This is a schematic diagram of RMSE comparison when the amount of training data is 60%, 40%, and 20% on the PEMS04 dataset; Fig.16 This is a schematic diagram of MAPE comparison on the PEMS04 dataset when the amount of training data is 60%, 40%, and 20%; Fig.17 This is a schematic diagram of MAE comparison on the PEMS08 dataset when the amount of training data is 60%, 40%, and 20%; Fig.18 This is a schematic diagram of MAPE comparison when the amount of training data is 60%, 40%, and 20% on the PEMS08 dataset; Fig.19 This is a schematic diagram of MAPE comparison when the amount of training data is 60%, 40%, and 20% on the PEMS08 dataset; Fig. 20 A schematic diagram of MAE comparison on the PEMS04 dataset when adding 10%, 30%, and 90% noise to the training data; Fig.21 This is a schematic diagram of RMSE comparison when adding 10%, 30%, and 90% noise to the training data on the PEMS04 dataset; Fig. 22 This is a schematic diagram of MAPE comparison when adding 10%, 30%, and 90% noise to the training data on the PEMS04 dataset; Fig.23 A schematic diagram of MAE comparison on the PEMS08 dataset when adding 10%, 30%, and 90% noise to the training data; Fig.24 This is a schematic diagram of RMSE comparison when adding 10%, 30%, and 90% noise to the training data on the PEMS08 dataset; Fig.25 This is a schematic diagram of MAPE comparison when adding 10%, 30%, and 90% noise to the training data on the PEMS08 dataset; Fig.26 is a schematic diagram of the results of an ablation experiment in a 36-step length scenario in an embodiment of the present invention; Fig. 27 It is a structural block diagram of a long-term traffic prediction device based on discrete wavelet decomposition provided by the present invention; Fig.28 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The present invention provides a long-term traffic prediction method based on discrete wavelet decomposition, which is implemented through a prediction model. Figure 1 is a flow chart of the long-term traffic prediction method based on discrete wavelet decomposition provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: Step S101, obtaining the original traffic time series, and decomposing the original traffic time series by using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component.

[0032] Step S102, calling a preset space-time encoder, and extracting the time-varying features and space-varying features of the trend component and the event component through the space-time encoder; the time-varying features and space-varying features constitute the space-time features.

[0033] Step S103, based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured through a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and latent space features constitute the latent spatiotemporal features.

[0034] Step S104, integrating the spatiotemporal features and the potential spatiotemporal features, and performing long-term traffic prediction based on the integration results to generate prediction results.

[0035] In this method, the complex original traffic time series is first decomposed into a stable trend component and a fluctuating event component by using discrete wavelet decomposition, which effectively alleviates the distribution shift problem and enhances the versatility and robustness of the prediction model. Then, the space-time encoder is used to capture the stable and fluctuating time change characteristics and spatial characteristics. Then, the potential space-time characteristics in the latent space are captured by converting the signal dimension and using the space-time prediction decoder. Finally, the trend-event integration of the space-time characteristics and the potential space-time characteristics is performed to extract effective information and generate prediction results, thereby improving the accuracy and robustness of the traffic data prediction results. Through the above method, the robustness of the prediction model to different structural changes can be enhanced, the distribution shift problem of non-steady-state traffic data can be effectively alleviated, and the model has satisfactory generalization ability and robustness. In addition, by extracting spatial features, the computational complexity is effectively reduced, and the problem of poor accuracy in long-term traffic prediction in existing related technologies is solved.

[0036] Figure 2 Schematic diagram of long-term traffic prediction in an embodiment of the present invention. Figure 2 As shown, in some of the embodiments, step S101, using discrete wavelet decomposition to decompose the original traffic time series to obtain a stable trend component and a fluctuating event component, includes: inputting the original traffic time series into a low-frequency filter and a high-frequency filter for convolution to generate a layer of components; further convolving a layer of components to generate a low-frequency component and a high-frequency component; performing inverse discrete wavelet transform and upsampling processing on the low-frequency component and the high-frequency component to obtain a decomposed trend representation and event representation; processing the trend representation and the event representation through linear changes to obtain a trend component and an event component.

[0037] For example, first, the original traffic time series The input low-frequency filter and high-frequency filter are convolved, where represents the historical traffic time series, represents the time step of the historical traffic time series, represents the number of sensor nodes, Represents the number of features of the traffic time series, the first layer of high-frequency filters generates Then, the components generated by the first layer of low-frequency filters are further input into the second layer of filters for further convolution to generate low-frequency components. and high frequency components In order to make the output length consistent with the input length, the inverse discrete wavelet transform and upsampling operation are used to obtain the decomposed trend representation and event representation The formula is as follows:

[0038] in, represents the inverse low-frequency filter, Then, a linear transformation is used to transform the one-dimensional trend and event representation into a high-dimensional representation. .

[0039] In some embodiments, the spatiotemporal encoder includes a method for extracting a time component and a space component. Step S102, extracting the time variation characteristics and space characteristics of the trend component and the event component through the spatiotemporal encoder, including: splicing the trend component and the event component with the pre-set spatiotemporal embedding to obtain the input of the spatiotemporal encoder; extracting the time variation characteristics and space characteristics of the trend component and the event component; adding the event variation characteristics and the space characteristics, and inputting them into the spatiotemporal encoder for iterative processing.

[0040] In this embodiment, setting the spatiotemporal embedding includes: encoding the time periodicity of the original traffic time series, simulating the periodicity of the traffic signal, and obtaining the periodic code; encoding the spatial features by using the spatial graph Laplace embedding, simulating the road network structure, and obtaining the graph position code; and determining the spatiotemporal embedding based on the periodic code and the graph position code.

[0041] Specifically, the time-varying characteristics of the trend component and the event component are extracted, including: extracting the time-varying characteristics of the trend component by using trend-aware time attention; extracting the time-varying characteristics of the event component by event causal convolution.

[0042] Correspondingly, the spatial features of the trend component and the event component are extracted, including: extracting the global spatial dynamic correlation of the trend component and the event component by spatial shrinkage attention; extracting the local spatial dynamic correlation of the trend component and the event component by querying the sampling graph attention. The global spatial dynamic correlation and the local spatial dynamic correlation constitute the spatiotemporal features.

[0043] For example, a spatiotemporal embedding mechanism is designed to incorporate basic knowledge into the prediction model. This mechanism encodes the temporal periodicity to simulate the periodicity of traffic signals and uses spatial graph Laplace embedding to simulate the road network structure. The details are as follows: First, the temporal periodicity of the historical input sequence is encoded, and the weekly and daily periodicities of the input sequence are represented as , similarly, we can get the periodic encoding of the output sequence . Then the spatial features are encoded using the Laplacian eigenvector of the graph, which can effectively capture the structural information of the graph. The normalized Laplacian matrix can be obtained by the formula:

[0044] in,L represents the Laplacian matrix, I is the identity matrix, A represents the adjacency matrix of the road network nodes, D is the adjacency matrix A The corresponding degree matrix. Then, perform eigenvalue decomposition , and get the eigenvalue matrix and the eigenvector matrix Finally, Set to graph position encoding , which not only captures the structural information, but also represents the positional attributes of the graph. Finally, the embedding of the input sequence and the output sequence is obtained as shown in the following formula:

[0045] Where E represents spatiotemporal embedding.

[0046] For time-varying features: concatenate the high-dimensional trend component and event component obtained by discrete wavelet decomposition with the spatiotemporal embedding to obtain the first Layer Input Then, a trend-aware temporal attention mechanism is designed to capture the temporal variation of the trend component. This is a variant of convolutional self-attention, which uses convolution operations with kernel size greater than 1 to calculate query and key. The trend-aware temporal attention mechanism can be expressed as follows:

[0047] in, , , is a learnable parameter, Representation Node Inputs at all time slices. A trend-aware temporal attention mechanism is used to process the input of each node in parallel and output the temporal encoding representation of all nodes, expressed as .

[0048] Unlike trends, the temporal dynamics of events show volatility and suddenness, and we need to focus on the continuous time segments in the event. Causal convolution with a small kernel size contains limited historical information, so it is very suitable for temporal feature extraction in event analysis. Therefore, we use a kernel size of , a causal convolution with a step size of 1 to capture fluctuations and sudden time changes. This is done by sliding a local window filter over the historical time slices with a time step of The mathematical formula for the causal convolution operation is:

[0049] in, Represents a given one-dimensional sequence input, are the convolution filter weights, i Represents the index within the filter, from 0 to by The causal convolution of the event component of the input is expressed as:

[0050] in, represents the convolution result, is a learnable parameter, is the activation function.

[0051] For spatial features: Define Vector As the space contraction point, the space contraction point is a trainable parameter of the prediction model. All nodes in the space are mapped to these space contraction points. The process can be expressed by the formula:

[0052] in, Represents the spatial contraction representation of traffic flow data, Indicates time slice The input of all nodes on head i The multi-head attention The space contraction of the head indicates that represents the total number of heads of multi-head attention, W o represents the trainable parameters, , , Indicates The trainable parameters corresponding to the head. At this time, The contraction points in have encoded the generalized global pattern of the flow data. Then, they are compared with the original input Together, for a time slice All nodes on it generate spatial encoding representation , the specific formula is as follows:

[0053] in, represents the spatial encoding representation, head i The multi-head attention The output of the spatial shrinkage attention mechanism is represented as , which is the global spatial encoding representation of all time slices.

[0054] For local spatial dynamic correlation: First, graph attention is used to propagate information between original traffic time series. The information propagation process is expressed as:

[0055] in, Indicated in Time Node The local spatial characteristics of Indicated in Time Node and nodes The correlation coefficient of express Midpoint In time step The value of Representation Node The set of neighbor nodes on the road network is the set of all nodes at the time step Then, by selecting the sampling nodes, we use top-K to select The most representative nodes are used as query samples, and the formula is as follows:

[0056] in, ind t represents a query sample, is a sorting function, Is a trainable mapping variable, usually set In order to use the sampled nodes to copy the unsampled nodes, it is necessary to use the self-attention calculation node and nodes In time slice The correlation between , the specific formula is as follows:

[0057] in, Representation Node and nodes In time slice Finally, use the following formula to perform the copy operation:

[0058] Through the above copy operation, we get the output representation of the query sampling graph attention mechanism, which is expressed as .

[0059] Based on the above operations, the temporal features and spatial features are added and sent to the Layer spatiotemporal encoder, and iterate the spatiotemporal encoder The details are as follows: The output of the spatiotemporal encoder of the layer can be expressed as the sum of temporal features, global spatial dynamic correlation, and local spatial dynamic correlation, as follows:

[0060] in, Represents time characteristics, represents the global spatial dynamic correlation, represents the local spatial dynamic correlation. Then, the spatiotemporal encoder is The long-term spatiotemporal dynamic characteristics of the trend component and the event component are finally obtained by stacking and residual connection. and .

[0061] In some of the embodiments, step S103, based on the time dimension of the predicted future signal, converts the encoding of the historical traffic signal, including: connecting the historical traffic signal with the predicted future signal through a self-attention mechanism, so that the time dimension of the historical traffic signal is consistent with the time dimension of the predicted future signal.

[0062] In this embodiment, the Transformer module is used to transform the encoding of historical traffic signals so that it is consistent with the time dimension of the predicted future signals. The Transformer module adopts a self-attention mechanism that can adaptively connect each step of the historical traffic signal with each step of the predicted signal, thereby strengthening the integration of various spatiotemporal features in the past. The process of Transformer self-attention can be expressed as:

[0063] in, Representation Node The potential spatiotemporal characteristics of Representation Node The spatiotemporal embedding of the input sequence, Representation Node The spatiotemporal embedding of the output sequence of is the output of the Transformer module.

[0064] On this basis, the spatiotemporal decoder module is designed. The components of the spatiotemporal decoder are the same as those of the spatiotemporal encoder. The stacking and residual connection further captures the spatiotemporal changes in the latent space and generates the latent temporal features of the spatiotemporal decoder. and latent space features .

[0065] In some of the embodiments, step S104 performs long-term traffic forecasting based on the integration results to generate forecast results, including: based on the integration results of spatiotemporal features and potential spatiotemporal features, weighted summing of events corresponding to relevant time slices, optimizing through back propagation, and outputting a high-dimensional representation of future long-term traffic time series; determining the forecast results based on the high-dimensional representation of future long-term traffic time series.

[0066] The decomposed trend component is usually stable and persistent, so it can make fairly accurate predictions in most cases. However, the event component is often unstable and sudden, which will cause distribution changes and thus affect the accuracy of the prediction. Therefore, in this embodiment, a trend-event fusion module is designed to retain valuable events and discard irrelevant events. The trend-event fusion module performs a weighted summation of events corresponding to relevant time slices in the trend, where the weights are determined by the attention mechanism and optimized by back propagation. This data-driven approach can adaptively evaluate the accuracy of event predictions. The input of the trend-event fusion module includes the out-of-control decoder outputs of trends and events, represented as and The trend-event fusion can be expressed as follows:

[0067] in, Represents the time step in the future for all nodes The high-dimensional representation of the sequence when Indicates that all nodes are in the time step The trend component of Represents all nodes The time step and The correlation coefficient of the time step, Indicates that all nodes in The event component of time steps, Indicates that all nodes in The output of the trend-time fusion module is the traffic time series The future high-dimensional representation.

[0068] In addition, in order to improve the performance of the prediction model, the objective function of the prediction model can also be defined, and the prediction model can be trained with multi-supervision to minimize the objective function, so that the prediction model can acquire knowledge from more stable time changes and effectively handle the distribution changes of events.

[0069] Specifically, first, use linear projection to transform The high-dimensional trend component in is projected into a one-dimensional representation Then, L1 loss is used to supervise the trend part. The specific formula is as follows:

[0070] in, represents the loss of trend series prediction, T q represents the time step of prediction, Representation Node In the future time step The real trend component at time Representation Node In the future time step The predicted trend component at that time. Then use the linear projection layer to convert the high-dimensional representation of the predicted traffic data into Convert to one-dimensional representation . And L1 loss is used to supervise the traffic data. The specific formula is as follows:

[0071] in, represents the prediction loss of the traffic flow sequence, Representation Node In the future time step The real traffic sequence at Representation Node In the future time step Finally, considering the traffic prediction loss and trend supervision loss, the prediction model aims to jointly minimize the following objective function:

[0072] in, Represents the model loss.

[0073] In order to verify the effectiveness of the above method, experiments were conducted on the Seattle Loop dataset in three scenarios. The experimental results are as follows: Figure 3 As shown, Figure 3 This is a comparison chart of MAE, RMSE and MAPE indicators of the present invention (STWAN) and the prior art on the Seattle Loop dataset. Figure 3 It can be seen that STWAN is the most competitive model in most scenarios of Seattle Loop, with similar results to PEMS04. Compared with SSTBAN, STWAN reduces MAE, RMSE and MAPE by 3.37%, 2.66% and 6.18% respectively in the 24-step scenario. However, in the case of 48-step, our prediction is not as accurate as SSTBAN, with only a slight improvement in MAE.

[0074] Figure 4This is a comparison chart of MAE, RMSE and MAPE indicators of the present invention (STWAN) and the prior art on the PEMS04 and PEMS08 data sets. Figure 4 It can be seen that STWAN significantly outperforms all baselines in all indicators on the PEMS04 and PEMS08 datasets. More specific data are as follows Figure 5-13 As shown in the figure, the horizontal axis of the schematic diagram is the predicted time step, and the vertical axis is the MAE, RMSE and MAPE values. Compared with the second best method SSTBAN, STWAN reduces MAPE by 10.81% and 11.88% in the 24-step scenario, 6.00% and 2.95% in the 36-step scenario, and 5.00% and 10.26% in the 48-step scenario. Not only that, both MAE and RMSE are improved. The time series prediction models of traditional methods, such as HA and VAR, perform the worst because they ignore the complex spatial dependencies in traffic data. DCRNN and DMSTGCN, which consider spatial correlation modeling, are better than traditional algorithms, but they do not consider the distribution shift of data when the time span is long, so STWAN achieves better performance. GWNet and AGCRN use adaptive graph structures to improve performance, however, these methods only describe static spatial correlation. STWAN uses GAT to extract dynamic dependencies between nodes to achieve better performance. Models based on self-attention mechanisms, such as GMAN and SSTBAN, also show strong performance. Compared with these methods, STWAN can more accurately capture the trend changes of time series and thus achieve more accurate results.

[0075] from Figure 3 and Figure 4 From the prediction errors shown in , it is found that the traffic speed prediction error is significantly lower than the traffic flow prediction error. This result is consistent with the actual situation on highways, where the changes in vehicle speed are usually small due to specific speed limits. In contrast, traffic flow is more complex and more difficult to predict, so the error is also larger.

[0076] In order to actually deploy STWAN for long-term traffic prediction, the robustness of STWAN is also tested, because in practical scenarios, the high requirements of the model on the quantity and quality of training data may not be met. Figure 14-25 The prediction error of STWAN under different quantity and quality conditions is shown. Experiments were conducted in two scenarios, a 36-step prediction scenario on the PEMS04 dataset and a 36-step prediction scenario on the PEMS08 dataset. The results are shown in Figure 14-19As shown. It is worth noting that each dataset is divided into training set, validation set and test set with the ratio of 6:2:2, 4:2:2 and 2:2:2 respectively. By removing the earliest time slice, the training data is reduced from 60% to 40% and 20%, while the validation and test datasets remain unchanged. In addition, the proposed STWAN model is compared with the SSTBAN and AGCRN models. Figure 14-19 The comparison results of MAE, RMSE and MAPE of STWAN, SSTBAN and AGCRN models under different data segmentation ratios on PEMS04 and PEMS08 are shown. The results show that the STWAN model can still maintain higher prediction accuracy than AGCRN and SSTBAN when facing different data segmentation ratios, highlighting its excellent robustness and wide applicability in prediction tasks.

[0077] To further evaluate the impact of data quality on model performance, we designed a noise impact experiment. Figure 20-25 Considering that the recorded data in real applications are often corrupted due to network transmission errors and detector failures, we randomly added noise sampled from a Gaussian distribution (mean = 10, standard deviation = 100) to 10%, 30%, and 90% of the training data. Figure 20-25 The performance comparison of STWAN, SSTBAN, and AGCRN at different noise levels in a 36-step scenario on PEMS04 and PEMS08 is shown. Regardless of the noise ratio, STWAN consistently outperforms SSTBAN and AGCRN. This shows that STWAN can maintain a high level of prediction even when there is heavy noise interference, highlighting its excellent robustness.

[0078] In order to verify the effectiveness of the present invention, Fig.26 As shown in the figure, some ablation experiments are also designed: (1) The STWAN model without decomposition layer follows the end-to-end paradigm and directly inputs the traffic data into the model. It can be seen that the prediction performance has decreased slightly, which shows that the decomposition mechanism is effective in solving the distribution shift; (2) In the STWAN model, the trend event fusion module is replaced by a simple addition operation, which directly sums the event and trend components and ignores the potential false predictions in the event component. The prediction performance has decreased slightly, indicating that the processing of false predictions in the event component is effective; (3) STWAN is no longer equipped with query sampling GAT, so it cannot capture local dynamic spatial dependencies, and the prediction performance has decreased, indicating that local dynamic spatial dependencies are very effective for extracting spatial features; (4) STWAN is not equipped with trend-aware attention and event causal convolution modules, so it cannot capture dynamic temporal changes, and the performance has decreased, indicating that temporal changes are very important for prediction.

[0079] The present invention also provides a long-term traffic prediction device based on discrete wavelet decomposition. The long-term traffic prediction device based on discrete wavelet decomposition provided by the present invention is described below. The long-term traffic prediction device based on discrete wavelet decomposition described below and the long-term traffic prediction method based on discrete wavelet decomposition described above can be referred to each other. Fig. 27 is a structural block diagram of a long-term traffic prediction device based on discrete wavelet decomposition provided by the present invention, such as Fig. 27 As shown, the device comprises: Decomposition module 2701, used to obtain the original traffic time series, and decompose the original traffic time series using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; The encoding module 2702 is used to call a preset spatiotemporal encoder to extract the time variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the time variation characteristics and spatial characteristics constitute the spatiotemporal characteristics; The decoding module 2703 is used to convert the codes of the historical traffic signals based on the time dimension of the predicted future signals, and to capture the spatiotemporal changes in the latent space through a preset spatiotemporal decoder to generate latent time features and latent space features; the latent time features and the latent space features constitute the latent spatiotemporal features; The prediction module 2704 is used to integrate the spatiotemporal features and potential spatiotemporal features, and perform long-term traffic prediction based on the integration results to generate prediction results.

[0080] When the device is used, first, the decomposition module 2701 uses discrete wavelet decomposition to decompose the complex original traffic time series into a stable trend component and a fluctuating event component, which effectively alleviates the distribution offset problem and enhances the versatility and robustness of the prediction model. Then, the encoding module 2702 uses a spatiotemporal encoder to capture stable and fluctuating time change characteristics and spatial characteristics. The decoding module 2703 then captures the potential spatiotemporal features in the latent space by converting the signal dimension and the spatiotemporal prediction decoder. Finally, the prediction module 2704 integrates the spatiotemporal features and the potential spatiotemporal features with trends and events, extracts effective information, and generates prediction results, thereby improving the accuracy and robustness of the traffic data prediction results. Through the above process, the robustness of the prediction model to different structural changes can be enhanced, the distribution offset problem of non-steady-state traffic data can be effectively alleviated, and the model has satisfactory generalization ability and robustness. In addition, by extracting spatial features, the computational complexity is effectively reduced, and the problem of poor accuracy in long-term traffic prediction in the existing related technologies is solved.

[0081] Fig.28 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.28As shown, the electronic device may include: a processor 2801, a communications interface 2802, a memory 2803 and a communication bus 2804, wherein the processor 2801, the communications interface 2802 and the memory 2803 communicate with each other via the communication bus 2804. The processor 2801 may call the logic instructions in the memory 2803 to execute a long-term traffic prediction method based on discrete wavelet decomposition, the method comprising: Obtain the original traffic time series, and decompose it using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; Calling a preset spatiotemporal encoder, extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the temporal variation characteristics and spatial characteristics constitute the spatiotemporal characteristics; Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured by a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and latent space features constitute the latent spatiotemporal features; The spatiotemporal characteristics and potential spatiotemporal characteristics are integrated, and long-term traffic forecasting is performed based on the integration results to generate forecast results.

[0082] In addition, the logic instructions in the above-mentioned memory 2803 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0083] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored in a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the long-term traffic prediction method based on discrete wavelet decomposition provided by the above methods, and the method includes: Obtain the original traffic time series, and decompose it using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; Calling a preset spatiotemporal encoder, extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the temporal variation characteristics and spatial characteristics constitute the spatiotemporal characteristics; Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured by a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and latent space features constitute the latent spatiotemporal features; The spatiotemporal characteristics and potential spatiotemporal characteristics are integrated, and long-term traffic forecasting is performed based on the integration results to generate forecast results.

[0084] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the long-term traffic prediction method based on discrete wavelet decomposition provided by the above methods, the method comprising: Obtain the original traffic time series, and decompose it using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; Calling a preset spatiotemporal encoder, extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the temporal variation characteristics and spatial characteristics constitute the spatiotemporal characteristics; Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured by a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and latent space features constitute the latent spatiotemporal features; The spatiotemporal characteristics and potential spatiotemporal characteristics are integrated, and long-term traffic forecasting is performed based on the integration results to generate forecast results.

[0085] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0086] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A long-term traffic prediction method based on discrete wavelet decomposition, characterized in that: include: Obtaining an original traffic time series, and decomposing the original traffic time series using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; Calling a preset spatiotemporal encoder, and extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; the temporal variation characteristics and the spatial characteristics constitute the spatiotemporal characteristics; Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, and the spatiotemporal changes in the latent space are captured through a pre-set spatiotemporal decoder to generate latent time features and latent space features; The latent temporal feature and the latent spatial feature constitute a latent spatiotemporal feature; The spatiotemporal features and the potential spatiotemporal features are integrated, and long-term traffic forecasting is performed based on the integration results to generate forecasting results.

2. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 1 is characterized in that: The original traffic time series is decomposed by discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component, including: Inputting the original traffic time series into a low-frequency filter and a high-frequency filter for convolution to generate a layer of components; Further convolving the layer of components to generate low-frequency components and high-frequency components; Performing inverse discrete wavelet transform and up-sampling processing on the low-frequency component and the high-frequency component to obtain decomposed trend representation and event representation; The trend representation and the event representation are processed through linear change to obtain the trend component and the event component.

3. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 1 is characterized in that: The spatiotemporal encoder includes a device for extracting a temporal component and a spatial component; Extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component by the spatiotemporal encoder includes: Concatenating the trend component and the event component with a preset spatiotemporal embedding to obtain an input of the spatiotemporal encoder; Extracting time variation characteristics and spatial characteristics of the trend component and the event component; The event change feature and the spatial feature are added and input into the spatiotemporal encoder for iterative processing.

4. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 3 is characterized in that: Setting the spatiotemporal embedding includes: Encoding the time periodicity of the original traffic time series, simulating the periodicity of traffic signals, and obtaining periodic coding; The spatial features are encoded using spatial graph Laplace embedding, the road network structure is simulated, and the graph position encoding is obtained; The spatiotemporal embedding is determined based on the period encoding and the graph position encoding.

5. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 3 is characterized in that: Extracting the time variation characteristics of the trend component and the event component includes: extracting temporal variation characteristics of the trend component using trend-aware temporal attention; The time variation characteristics of the event components are extracted through event causal convolution.

6. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 3 is characterized in that: Extracting the spatial features of the trend component and the event component includes: Extracting global spatial dynamic correlations between the trend component and the event component by spatial contraction attention; Extracting the local spatial dynamic correlation of the trend component and the event component by querying the sampling graph attention; The global spatial dynamic correlation and the local spatial dynamic correlation constitute the spatiotemporal feature.

7. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 1 is characterized in that: Based on the time dimension of the predicted future signal, the encoding of the historical traffic signal is converted, including: The historical traffic signal is connected with the predicted future signal through the self-attention mechanism, so that the time dimension of the historical traffic signal is consistent with the time dimension of the predicted future signal.

8. The long-term traffic prediction method based on discrete wavelet decomposition according to claim 1 is characterized in that: Based on the integrated results, long-term traffic forecasts are generated to generate forecast results, including: Based on the integration results of the spatiotemporal features and the potential spatiotemporal features, weighted summation is performed on the events corresponding to the relevant time slices, and optimization is performed through back propagation to output a high-dimensional representation of the future long-term traffic time series; The prediction result is determined based on a high-dimensional representation of the future long-term traffic time series.

9. The long-term traffic prediction method according to claim 1, characterized in that: The prediction method is implemented by a prediction model; An objective function of the prediction model is defined, and multi-supervision training is performed on the prediction model with the goal of minimizing the objective function.

10. A long-term traffic prediction device based on discrete wavelet decomposition, characterized in that: include: A decomposition module, used for obtaining an original traffic time series, and decomposing the original traffic time series by using discrete wavelet decomposition to obtain a stable trend component and a fluctuating event component; An encoding module, used for calling a preset spatiotemporal encoder, and extracting the temporal variation characteristics and spatial characteristics of the trend component and the event component through the spatiotemporal encoder; The time variation feature and the space feature constitute a spatiotemporal feature; A decoding module, for converting the encoding of the historical traffic signal based on the time dimension of the predicted future signal, and capturing the spatiotemporal changes in the latent space through a pre-set spatiotemporal decoder to generate latent time features and latent space features; the latent time features and the latent space features constitute latent spatiotemporal features; The prediction module is used to integrate the spatiotemporal features and the potential spatiotemporal features, and perform long-term traffic prediction based on the integration results to generate prediction results.

Citation Information

Cited By

  • Traffic flow prediction method based on dual-channel spatial-temporal feature fusion

    CN120319021A

  • Traffic flow prediction method based on multi-scale decomposition and dynamic graph modeling

    CN120998030A