Traffic data space-time restoration method based on time domain-frequency domain evolution
By combining time-domain-frequency-domain evolution with multi-layer models, the problems of multi-scale characteristics and emergency handling in traffic data restoration are solved, achieving efficient restoration and accurate prediction of traffic conditions.
Patent Information
- Application Number
- CN202510717725.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing traffic data repair methods are unable to effectively capture the multi-scale characteristics of traffic situations, cannot accurately handle the time-correlated damage caused by traffic emergencies, and cannot fully exploit the spatiotemporal characteristics, affecting the accuracy and completeness of the repair results.
A method based on time-frequency domain evolution is adopted. Traffic flow data is decomposed into high-frequency, medium-frequency and low-frequency signals through fast Fourier transform. Multi-frequency components are integrated in the time dimension using wavelet transform technology. In the spatial dimension, a graph attention network model is used to infer missing area data. The multi-head attention mechanism of the Transformer model is combined to optimize the repair of missing traffic situation.
It accurately captures the dynamic characteristics of traffic conditions at different time scales, improves the accuracy and completeness of repair results, can effectively deal with time-related damage under emergencies, and improves the reliability of traffic flow prediction and management.
Smart Images

Figure CN120744288A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data repair technology, and in particular to a spatiotemporal repair method for traffic data based on time-frequency domain evolution. Background Art
[0002] In Intelligent Transportation Systems (ITS), traffic flow prediction is crucial for traffic management and planning. However, traffic flow data often suffers from spatiotemporal data loss, which poses a huge challenge to accurate traffic situation analysis and prediction.
[0003] Traditional traffic data restoration methods typically focus on a single time scale or spatial dimension, making it difficult to effectively capture the multi-scale characteristics of traffic dynamics and the complex spatiotemporal interactions. Traffic dynamics exhibit multi-scale characteristics that evolve over time, including features at different time scales, such as emergencies, cyclical patterns, and long-term trends. Furthermore, traffic emergencies can disrupt the temporal correlation of traffic flows, further complicating data restoration. Furthermore, existing methods often fail to fully exploit the hidden spatiotemporal features within traffic data when dealing with missing spatiotemporal data, resulting in inaccurate and incomplete restoration results. Summary of the Invention
[0004] The purpose of the present invention is to provide a spatiotemporal repair method for traffic data based on time-frequency domain evolution, aiming to solve the problems that existing traffic data repair methods are difficult to effectively capture the multi-scale characteristics of traffic situations, cannot accurately handle the time correlation damage caused by traffic emergencies, and cannot fully exploit spatiotemporal characteristics, thereby affecting the accuracy and completeness of repair.
[0005] To achieve the above objectives, the present invention provides a spatiotemporal repair method for traffic data based on time-frequency domain evolution, comprising the following steps:
[0006] S1: The time signal of traffic flow data is decomposed into high-frequency, medium-frequency and low-frequency signals based on fast Fourier transform, capturing emergency data, periodic regularity data and long-term trend data respectively;
[0007] S2: The different frequency components are recombined into a time domain signal through inverse Fourier transform, and the wavelet transform technology is introduced to integrate the multiple frequency components in the time dimension to obtain a time-evolving signal;
[0008] S3: In the spatial dimension, the road network structure data is obtained and the graph attention network model is used to infer the missing area data;
[0009] S4: In the time dimension, based on the existing time evolution signals and missing area data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features to optimize the missing traffic situation repair.
[0010] The process of "obtaining the time signal of traffic flow data and decomposing it into high-frequency, medium-frequency and low-frequency signals based on fast Fourier transform to capture emergency event data, periodic regularity data and long-term trend data respectively" includes the following steps:
[0011] S11: Collect traffic flow data of each road node in the urban road network at multiple time points and organize them into the form of time series signals;
[0012] S12: Apply the fast Fourier transform algorithm to the traffic flow time series signal of each road node;
[0013] S13: Convert the time signal to the frequency domain through Fourier transform and decompose it into three signal components: high frequency, medium frequency and low frequency.
[0014]
[0015] Among them, x(t) is the time domain signal of traffic flow, X(f) is the frequency domain signal, j is the imaginary unit, N is the time step, is the basis function, X l (f), X m (f), X h (f) represent the decomposed high-frequency, medium-frequency and low-frequency signals respectively.
[0016] Among them, in "converting the time signal into the frequency domain through Fourier transform and decomposing it into three signal components: high frequency, medium frequency and low frequency", the high-frequency signal component mainly reflects the characteristics of sudden events in traffic flow; the medium-frequency signal component reflects the periodic law of traffic flow; and the low-frequency signal component represents the long-term trend of traffic flow.
[0017] Among them, the process of "recombining different frequency components into time domain signals through inverse Fourier transform and introducing wavelet transform technology to integrate multiple frequency components in the time dimension" includes the following steps:
[0018] S21: Model the decomposed high-frequency, medium-frequency and low-frequency signals independently and extract their respective feature information.
[0019]
[0020] Among them, x l (t) is a low-frequency signal, indicating a long-term trend, and x m (t) is the intermediate frequency signal representing periodic changes, x h (t) is a high-frequency signal, indicating an emergency event;
[0021] S22: Using inverse Fourier transform, the signals of the three frequency components are recombined and converted back into time domain signals;
[0022] S23: Apply wavelet transform technology to the reconstructed time domain signal, select mother wavelet function and scale and time shift parameters;
[0023] S24: By integrating multi-frequency components in the time dimension through wavelet transform, it can not only fit the actual time fluctuations but also retain the diversity characteristics of traffic situation.
[0024]
[0025] Among them, Y x (a, b) is the result of wavelet transformation, x(t) represents the original signal, is the mother wavelet function, a is the scale parameter used to control the frequency; b is the time shift parameter used to control the time shift. In practical applications, the wavelet transform uses Ricker wavelet, and the formula is as follows:
[0026]
[0027] Among them, in "In the spatial dimension, obtaining road network structure data and using the graph attention network model to infer missing area data" includes the following steps:
[0028] S31: Construct a structural diagram of the urban road network, represent each road node as a node in the diagram, and construct an adjacency matrix based on the Euclidean distance between sensors;
[0029] S32: Input traffic flow data and road network structure diagram into the graph attention network model;
[0030] S33: In the GAT model, the feature vector of each node is calculated, and the attention coefficient between adjacent nodes is calculated to measure the spatial dependency between nodes;
[0031] S34: Based on the calculated attention coefficient, the feature vectors of the adjacent nodes are weightedly aggregated to generate a new node feature set, thereby inferring the traffic flow data of the missing area.
[0032] The process of "constructing a structural diagram of the urban road network, representing each road node as a node in the diagram, and constructing an adjacency matrix based on the Euclidean distance between sensors" includes the following steps:
[0033] S311: Input is a set of pixel feature vectors of traffic situation of a road node, and the attention coefficient between adjacent nodes is calculated.
[0034] h={h1,h2,...,h N}
[0035] Among them, h N is the feature input vector of the road nodes in the traffic data after time parallel processing,
[0036] The formula for calculating the attention coefficient between adjacent nodes is as follows:
[0037]
[0038] Among them, the attention coefficient α ij It represents the attention weight of node j to node i; W is the learnable weight matrix; a is the attention weight vector learned by the attention mechanism through the weight vector; || represents the vector splicing operation; k represents the neighbor node set of node i, h i and h j is the eigenvector of nodes i and j;
[0039] S312: Perform weighted aggregation on the feature vectors of adjacent nodes using the attention coefficient to obtain a new node feature set.
[0040] New node feature set
[0041]
[0042] Here, σ is a nonlinear activation function.
[0043] The following steps are included in the process of "using the Transformer model's multi-head attention mechanism to extract temporal and spatial dynamic features based on the existing time-evolving signals and missing area data to optimize the repair of missing traffic conditions":
[0044] S41: Input the existing time-evolving signal into the Transformer model;
[0045] S42: The Transformer model linearly maps the input signal into a query vector, an index vector, and a value vector;
[0046] S43: Use the multi-head attention mechanism to calculate the attention weights between the query vector, index vector, and value vector to capture the temporal and spatial dynamic characteristics of traffic flow data. The attention calculation formula is as follows:
[0047]
[0048] Among them, Q, K, and V are the query vector, index vector, and value vector obtained by mapping the input features of all nodes, respectively. i As an example, linearly map it into query vector, index vector and value vector:
[0049]
[0050] in, are the projection matrices of the Q, K, and V vectors to be learned, is the input traffic matrix;
[0051] S44: Concatenate the outputs of the multi-head attention and integrate the extracted feature information. The multi-head self-attention formula is as follows:
[0052] MultiHead(Q,K,V)=Concat(head1,...,head h )W o
[0053] Among them, h represents multiple attention heads, each of which calculates a set of independent self-attention;
[0054] S45: The spliced features are linearly transformed to obtain the final output, which is used to optimize the missing traffic situation repair results.
[0055] The present invention discloses a spatiotemporal repair method for traffic data based on time-frequency domain evolution. The present invention, through a method based on time-frequency domain evolution, can accurately capture the dynamic characteristics of traffic situations at different time scales, including emergencies, periodic patterns, and long-term trends, thereby improving the modeling capability of complex traffic situations. By utilizing inverse Fourier transform and wavelet transform technology, the time signal can be reconstructed while ensuring the ability to fit actual time fluctuations and retaining the diverse characteristics of traffic situations, effectively improving the quality of time signal reconstruction under emergencies. Combining the GAT model and the Transformer model, missing data can be repaired in the spatiotemporal dimension, making full use of the spatiotemporal interaction characteristics of traffic flow, accurately inferring missing area data, capturing temporal and spatial dynamic characteristics, further optimizing the accuracy and completeness of the repair results, and providing a more reliable basis for traffic flow prediction and management. This solves the problems of existing traffic data repair methods that are difficult to effectively capture the multi-scale characteristics of traffic situations, cannot accurately handle the time correlation damage caused by traffic emergencies, and cannot fully tap into spatiotemporal characteristics, thereby affecting the accuracy and completeness of repairs. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 It is a repair model diagram.
[0058] Figure 2It is a multi-scale analysis diagram.
[0059] Figure 3 It is a schematic diagram of space-time modeling.
[0060] Figure 4 This is a flow chart of a spatiotemporal repair method for traffic data based on time-frequency domain evolution provided by the present invention.
[0061] Figure 5 It is a flow chart that decomposes the time signal of traffic flow data into high-frequency, medium-frequency and low-frequency signals based on fast Fourier transform, and captures emergency data, periodic regularity data and long-term trend data respectively.
[0062] Figure 6 It is a flowchart that recombines different frequency components into time domain signals through inverse Fourier transform and introduces wavelet transform technology to integrate multiple frequency components in the time dimension.
[0063] Figure 7 It is a flowchart for obtaining road network structure data in the spatial dimension and using the graph attention network model to infer missing area data.
[0064] Figure 8 It is a flowchart for constructing a structural diagram of the urban road network, representing each road node as a node in the diagram, and constructing an adjacency matrix based on the Euclidean distance between sensors.
[0065] Figure 9 In the time dimension, based on the existing time evolution signals and missing area data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features, and optimize the flowchart of the missing traffic situation repair. DETAILED DESCRIPTION
[0066] The following describes embodiments of the present invention in detail, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and are not to be construed as limiting the present invention.
[0067] See also Figures 1 to 9 The present invention provides a spatiotemporal repair method for traffic data based on time-frequency domain evolution, comprising the following steps:
[0068] S1: The time signal of traffic flow data is decomposed into high-frequency, medium-frequency and low-frequency signals based on fast Fourier transform, capturing emergency data, periodic regularity data and long-term trend data respectively;
[0069] The high-frequency signal component mainly reflects the characteristics of sudden events in traffic flow; the medium-frequency signal component reflects the periodic law of traffic flow; and the low-frequency signal component represents the long-term trend of traffic flow.
[0070] S11: Collect traffic flow data of each road node in the urban road network at multiple time points and organize them into the form of time series signals;
[0071] Definition 1. Road network structure graph G = (V, E)
[0072] Where V represents the set of N nodes in the urban road network, V={v1,v2,...,v N}, v N is a road node numbered N. In this paper, a node represents a detector deployed at a road checkpoint, E∈R N×N It is the adjacency matrix of the road network structure graph G constructed based on the Euclidean distance between sensors.
[0073] Definition 2. Traffic flow X
[0074] The traffic flow dataset X represents the traffic flow data at different time points in a specific road network. It is defined as follows:
[0075] X∈R N×T
[0076] Where N represents the total number of road nodes and T represents the historical length of the time series.
[0077] Specifically, traffic flow data is collected from various sensor nodes across the urban road network. The data collection interval is determined based on specific needs, for example, every 5, 15, or 30 minutes. The collected data includes traffic flow values at each road node at different time points. The collected traffic flow data is organized chronologically and by road node to form a time series signal. Data integrity and consistency are ensured, and missing or abnormal data is preliminarily processed.
[0078] S12: Apply the fast Fourier transform algorithm to the traffic flow time series signal of each road node;
[0079] Specifically, the parameters of the fast Fourier transform (FFT) are determined according to the length and sampling frequency of the time series signal; the FFT algorithm is applied to the traffic flow time series signal of each road node for frequency domain conversion. Through FFT, the time signal is decomposed into complex forms of different frequency components, including amplitude and phase information; according to the results of Fourier transform, the frequency domain signal is decomposed into three parts: high frequency, medium frequency and low frequency. It can usually be divided according to the frequency threshold. Low-frequency components: mainly reflect the long-term trend of traffic flow, such as the annual growth or decrease trend of urban traffic flow. Medium-frequency components reflect the periodic laws of traffic flow, such as day and night changes, differences between weekdays and weekends, etc. High-frequency components: mainly reflect the characteristics of sudden events in traffic flow, such as traffic accidents, temporary road construction, etc., which cause sharp changes in traffic flow.
[0080] S13: Convert the time signal to the frequency domain through Fourier transform and decompose it into three signal components: high frequency, medium frequency and low frequency.
[0081]
[0082] Among them, x(t) is the time domain signal of traffic flow, X(f) is the frequency domain signal, j is the imaginary unit, N is the time step, is the basis function, X l (f), X m (f), X h (f) represent the decomposed high-frequency, medium-frequency and low-frequency signals respectively.
[0083] Specifically, based on the Fourier transform results, the frequency domain signal is decomposed into three components: high frequency, medium frequency, and low frequency. This division can usually be based on frequency thresholds. For example, low frequency components primarily reflect long-term trends in traffic flow, such as annual increases or decreases in urban traffic flow; medium frequency components reflect cyclical patterns in traffic flow, such as diurnal variations and weekday-weekend differences; and high frequency components primarily reflect sudden events in traffic flow, such as sudden changes in traffic flow caused by traffic accidents or temporary road construction.
[0084] S2: The different frequency components are recombined into a time domain signal through inverse Fourier transform, and the wavelet transform technology is introduced to integrate the multiple frequency components in the time dimension to obtain a time-evolving signal;
[0085] S21: Model the decomposed high-frequency, medium-frequency and low-frequency signals independently and extract their respective feature information.
[0086]
[0087]
[0088] Among them, xl (t) is a low-frequency signal, indicating a long-term trend, and x m (t) is the intermediate frequency signal representing periodic changes, x h (t) is a high-frequency signal, indicating an emergency event;
[0089] Specifically, for the separated high-frequency signals, corresponding mathematical models are established. For example, time series models or machine learning models can be used to extract characteristic information about the emergency, such as the time of occurrence, duration, and intensity of the emergency. Medium-frequency signals are modeled and their periodicity analyzed. Methods such as Fourier series expansion or wavelet analysis can be used to extract characteristic parameters such as the amplitude, frequency, and phase of the periodic components. For low-frequency signals, long-term trend models are established, such as linear regression models, polynomial fitting models, or exponential smoothing models, to extract long-term growth or decline trends in traffic flow.
[0090] S22: Using inverse Fourier transform, the signals of the three frequency components are recombined and converted back into time domain signals;
[0091] Specifically, the parameters of the inverse Fourier transform (IFFT) are initialized based on the FFT results and parameters, preparing to reconstruct the decomposed frequency components into a time-domain signal. The IFFT is used to reconstruct the high-frequency, intermediate-frequency, and low-frequency signals and convert them back into a time-domain signal. The reconstructed time-domain signal is generated by adjusting the amplitude and phase of each frequency component.
[0092] S23: Apply wavelet transform technology to the reconstructed time domain signal, select mother wavelet function and scale and time shift parameters;
[0093] Specifically, select appropriate wavelet functions (such as Ricker wavelet) and scale and time shift parameters. According to the characteristics and requirements of traffic flow signals, determine the scale range and step size of wavelet transform.
[0094] S24: Integrate multi-frequency components in the time dimension through wavelet transform.
[0095]
[0096] Among them, Y x (a, b) is the result of wavelet transformation, x(t) represents the original signal, is the mother wavelet function, a is the scale parameter used to control the frequency; b is the time shift parameter used to control the time shift. In practical applications, the wavelet transform uses Ricker wavelet, and the formula is as follows:
[0097]
[0098] Specifically, wavelet transform technology is applied to the reconstructed time-domain signal for multi-scale analysis. This wavelet transform integrates multiple frequency components along the time dimension, fitting actual temporal fluctuations while preserving the diverse characteristics of traffic conditions. The results of the wavelet transform can be used to further analyze the local characteristics and changing patterns of traffic flow signals.
[0099] S3: In the spatial dimension, the road network structure data is obtained and the graph attention network model is used to infer the missing area data;
[0100] S31: Construct a structural diagram of the urban road network, represent each road node as a node in the diagram, and construct an adjacency matrix based on the Euclidean distance between sensors;
[0101] S311: Input is a set of pixel feature vectors of traffic situation of a road node, and the attention coefficient between adjacent nodes is calculated.
[0102] h={h1,h2,...,h N}
[0103] Among them, h N is the feature input vector of the road nodes in the traffic data after time parallel processing,
[0104] The formula for calculating the attention coefficient between adjacent nodes is as follows:
[0105]
[0106] Among them, the attention coefficient α ij It represents the attention weight of node j to node i; W is the learnable weight matrix; a is the attention weight vector learned by the attention mechanism through the weight vector; || represents the vector splicing operation; k represents the neighbor node set of node i, h i and h j is the eigenvector of nodes i and j;
[0107] Specifically, the location information and sensor deployment information of each road node in the urban road network are collected. The location coordinates of each road node are determined, and the deployment status of sensors at each road node is recorded. Each road node is represented as a node in the graph. The distance weight between nodes is calculated based on the Euclidean distance between sensors, and an adjacency matrix is constructed. The elements in the adjacency matrix represent the connection relationship and distance weight between nodes, providing a basis for the subsequent GAT model to calculate the attention coefficient. The feature input vectors of each road node in the traffic data after time parallel processing are collected. The traffic situation data of each road node is feature extracted and sorted to form a set of feature vectors. Based on the dimension and structure of the feature input vector, the learnable weight matrix and the weight vector of the attention mechanism are initialized. The various parameters and data structures required for the vector splicing operation are prepared to prepare for the calculation of the attention coefficient. For each node, its neighbor node set is traversed. The neighbor nodes of each node are determined according to the adjacency matrix, and the corresponding feature vectors are obtained.
[0108] S312: Perform weighted aggregation on the feature vectors of adjacent nodes using the attention coefficient to obtain a new node feature set.
[0109] New node feature set
[0110]
[0111] Here, σ is a nonlinear activation function.
[0112] Specifically, the node-to-node attention weight is calculated according to a formula. The feature vectors of a node and its neighbors are concatenated, and a linear transformation and activation function are performed using a learnable weight matrix and weight vector to obtain the attention coefficient. This coefficient reflects the spatial correlation and dependence between nodes. Using the calculated attention coefficient, the feature vectors of adjacent nodes are weightedly aggregated. The aggregated feature vectors are then processed using a nonlinear activation function to obtain a new node feature set. This new feature set incorporates traffic situation information from the node itself and its neighbors, more accurately reflecting traffic characteristics in the spatial dimension.
[0113] S32: Input traffic flow data and road network structure diagram into the graph attention network model;
[0114] Specifically, the traffic flow data and road network structure diagram are converted and integrated to meet the input requirements of the GAT model. The data is input into the GAT model to prepare for subsequent feature extraction and missing data inference.
[0115] S33: In the GAT model, the feature vector of each node is calculated, and the attention coefficient between adjacent nodes is calculated to measure the spatial dependency between nodes;
[0116] Specifically, in the GAT model, the feature vector of each node is extracted and updated. Based on the model's structure and parameters, node features are gradually calculated and propagated, continuously optimizing the feature representation to provide a more accurate feature foundation for the final missing data inference. The spatial dependencies between nodes are quantified by calculating the attention coefficient between adjacent nodes. The distribution and variation of the attention coefficient are analyzed to gain a deeper understanding of the spatial propagation and impact mechanisms of traffic trends.
[0117] S34: Based on the calculated attention coefficient, the feature vectors of the adjacent nodes are weightedly aggregated to generate a new node feature set, thereby inferring the traffic flow data of the missing area.
[0118] Specifically, based on the calculated attention coefficient and updated node feature vectors, a specific inference algorithm and model is used to generate traffic flow data for the missing areas. The inference results are evaluated and verified to ensure their accuracy and reliability meet practical application requirements.
[0119] S4: In the time dimension, based on the existing time evolution signals and missing area data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features to optimize the missing traffic situation repair.
[0120] S41: Input the existing time-evolving signal into the Transformer model;
[0121] Specifically, existing time-evolving signals and missing region data are collected, including time-domain signals after frequency-domain deconstruction and reconstruction, as well as traffic situation data after spatial dimensional inference. Preprocessing of the time-evolving signals involves data cleaning, normalization, and format conversion to make them suitable for input into the Transformer model. A preliminary decomposition of the time-evolving signals is performed to extract key features and time-step information. The signal's temporal structure and changing trends are analyzed to provide basic feature input for subsequent Transformer model processing.
[0122] S42: The Transformer model linearly maps the input signal into a query vector, an index vector, and a value vector;
[0123] Specifically, based on the Transformer model's structure and the dimensions of the input features, the projection matrices for the query, index, and value vectors are initialized. These projection matrices are used to linearly map the input features into the query, index, and value spaces. The input flow matrix is linearly transformed using the projection matrices to generate the query, index, and value vectors. This ensures that the dimensions and structure of the vectors meet the requirements of the Transformer model while preserving the key features and information of the original data.
[0124] S43: Use the multi-head attention mechanism to calculate the attention weights between the query vector, index vector, and value vector to capture the temporal and spatial dynamic characteristics of traffic flow data. The attention calculation formula is as follows:
[0125]
[0126] Among them, Q, K, and V are the query vector, index vector, and value vector obtained by mapping the input features of all nodes, respectively. i As an example, linearly map it into query vector, index vector and value vector:
[0127]
[0128] in, are the projection matrices of the Q, K, and V vectors to be learned, is the input traffic matrix;
[0129] Specifically, the attention weights between the query vector, index vector, and value vector are calculated according to the formula of the multi-head attention mechanism. Through dot product operations and scaling factors, the correlation and dependence between different nodes at different time steps are measured, capturing the temporal and spatial dynamic characteristics of traffic flow data.
[0130] S44: Concatenate the outputs of the multi-head attention and integrate the extracted feature information. The multi-head self-attention formula is as follows:
[0131] MultiHead(Q,K,V)=Concat(head1,...,head h )W o
[0132] Among them, h represents multiple attention heads, each of which calculates a set of independent self-attention;
[0133] Specifically, the calculated attention weights are used to perform a weighted summation on the value vector, integrating feature information from different nodes and time steps. Through parallel computation and feature concatenation across multiple attention heads, the rich dynamic features and complex spatiotemporal relationships in traffic flow data are captured. The features of each output head of the multi-head attention mechanism are concatenated to form a complete feature vector. This ensures that the concatenated feature vector fully reflects the temporal and spatial characteristics of the traffic situation and exhibits good expressiveness and discriminability.
[0134] S45: The spliced features are linearly transformed to obtain the final output, which is used to optimize the missing traffic situation repair results.
[0135] Traffic flow after repair Y
[0136] Y∈R N×T
[0137] Among them, Y is the repaired data, which has the same dimension as the original traffic flow X, but the missing values have been filled and the data is smoother.
[0138] Specifically, the concatenated feature vectors are passed through a linear transformation layer to obtain the final output. The output is evaluated and verified to ensure that it can accurately optimize the missing traffic situation repair and improve the accuracy and completeness of the repair.
[0139] Beneficial effects:
[0140] 1. Through the method based on time-frequency domain evolution, it is possible to accurately capture the dynamic characteristics of traffic situations at different time scales, including emergencies, periodic patterns and long-term trends, thereby improving the modeling ability of complex traffic situations.
[0141] Second, by using inverse Fourier transform and wavelet transform techniques, the time signal reconstruction can ensure the ability to fit actual time fluctuations while retaining the diverse characteristics of traffic conditions, effectively improving the quality of time signal reconstruction under emergencies.
[0142] Third, combining the GAT model and the Transformer model to repair missing data in the spatiotemporal dimension can fully utilize the spatiotemporal interaction characteristics of traffic flow, accurately infer missing area data, capture temporal and spatial dynamic characteristics, further optimize the accuracy and completeness of the repair results, and provide a more reliable basis for traffic flow prediction and management.
[0143] The above disclosure is merely a preferred embodiment of the spatiotemporal repair method for traffic data based on time-frequency domain evolution of the present invention. It is certainly not intended to limit the scope of the present invention. A person skilled in the art will understand that implementing all or part of the processes of the above embodiment and making equivalent changes in accordance with the claims of the present invention still fall within the scope of the invention.
Claims
1. A spatiotemporal restoration method for traffic data based on time-frequency domain evolution, characterized in that: The following steps are involved: S1: The time signal of traffic flow data is decomposed into high-frequency, medium-frequency and low-frequency signals based on fast Fourier transform, capturing emergency data, periodic regularity data and long-term trend data respectively; S2: The different frequency components are recombined into a time domain signal through inverse Fourier transform, and the wavelet transform technology is introduced to integrate the multiple frequency components in the time dimension to obtain a time-evolving signal; S3: In the spatial dimension, the road network structure data is obtained and the graph attention network model is used to infer the missing area data; S4: In the temporal dimension, based on the existing time-evolving signals and missing area data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features and optimize the repair of missing traffic situations.
2. The spatiotemporal restoration method for traffic data based on time-frequency domain evolution according to claim 1, characterized in that: In "obtaining the time signal of traffic flow data and decomposing it into high-frequency, medium-frequency, and low-frequency signals based on fast Fourier transform to capture emergency event data, periodic regularity data, and long-term trend data respectively", the following steps are included: S11: Collect traffic flow data of each road node in the urban road network at multiple time points and organize them into the form of time series signals; S12: Apply the fast Fourier transform algorithm to the traffic flow time series signal of each road node; S13: Convert the time signal to the frequency domain through Fourier transform and decompose it into three signal components: high frequency, medium frequency and low frequency. Among them, x(t) is the time domain signal of traffic flow, X(f) is the frequency domain signal, j is the imaginary unit, N is the time step, is the basis function, X l (f), X m (f), X h (f) represent the decomposed high-frequency, medium-frequency and low-frequency signals respectively.
3. The spatiotemporal restoration method for traffic data based on time-frequency domain evolution according to claim 1, characterized in that: In "Recombining different frequency components into time domain signals through inverse Fourier transform and introducing wavelet transform technology to integrate multiple frequency components in the time dimension", the following steps are included: S21: Model the decomposed high-frequency, medium-frequency and low-frequency signals independently and extract their respective feature information. Among them, x l (t) is a low-frequency signal, indicating a long-term trend, and x m (t) is the intermediate frequency signal representing periodic changes, x h (t) is a high-frequency signal, indicating an emergency event; S22: Using inverse Fourier transform, the signals of the three frequency components are recombined and converted back into time domain signals; S23: Apply wavelet transform technology to the reconstructed time domain signal, select mother wavelet function and scale and time shift parameters; S24: Integrate multi-frequency components in the time dimension through wavelet transform. Among them, Y x (a, b) is the result of wavelet transformation, x(t) represents the original signal, is the mother wavelet function, a is the scale parameter used to control the frequency; b is the time shift parameter used to control the time shift. In practical applications, the wavelet transform uses Ricker wavelet, and the formula is as follows:
4. The spatiotemporal restoration method for traffic data based on time-frequency domain evolution according to claim 1, characterized in that: In "Obtaining road network structure data in the spatial dimension and using a graph attention network model to infer missing area data," the following steps are included: S31: Construct a structural diagram of the urban road network, represent each road node as a node in the diagram, and construct an adjacency matrix based on the Euclidean distance between sensors; S32: Input traffic flow data and road network structure diagram into the graph attention network model; S33: In the GAT model, the feature vector of each node is calculated, and the attention coefficient between adjacent nodes is calculated to measure the spatial dependency between nodes; S34: Based on the calculated attention coefficient, the feature vectors of the adjacent nodes are weightedly aggregated to generate a new node feature set, thereby inferring the traffic flow data of the missing area.
5. The spatiotemporal restoration method for traffic data based on time-frequency domain evolution according to claim 4, characterized in that: The following steps are included in the process of "constructing a structural diagram of the urban road network, representing each road node as a node in the diagram, and constructing an adjacency matrix based on the Euclidean distance between sensors": S311: Input is a set of pixel feature vectors of traffic situation of a road node, and the attention coefficient between adjacent nodes is calculated. h={h1,h2,...,h N }; Among them, h N is the feature input vector of the road nodes in the traffic data after time parallel processing, The formula for calculating the attention coefficient between adjacent nodes is as follows: Among them, the attention coefficient α ij It represents the attention weight of node j to node i; W is the learnable weight matrix; a is the attention weight vector learned by the attention mechanism through the weight vector; || represents the vector splicing operation; k represents the neighbor node set of node i, h i and h j is the eigenvector of nodes i and j; S312: Perform weighted aggregation on the feature vectors of adjacent nodes using the attention coefficient to obtain a new node feature set. New node feature set Here, σ is a nonlinear activation function.
6. The spatiotemporal restoration method for traffic data based on time-frequency domain evolution according to claim 1, characterized in that: In the "In the temporal dimension, based on the existing time-evolving signals and missing area data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features and optimize the missing traffic situation restoration" process, the following steps are included: S41: Input the existing time-evolving signal into the Transformer model; S42: The Transformer model linearly maps the input signal into a query vector, an index vector, and a value vector; S43: Use the multi-head attention mechanism to calculate the attention weights between the query vector, index vector, and value vector to capture the temporal and spatial dynamic characteristics of traffic flow data. The attention calculation formula is as follows: Among them, Q, K, and V are the query vector, index vector, and value vector obtained by mapping the input features of all nodes, respectively. i As an example, linearly map it into query vector, index vector and value vector: in, are the projection matrices of the Q, K, and V vectors to be learned, is the input traffic matrix; S44: Concatenate the outputs of the multi-head attention and integrate the extracted feature information. The multi-head self-attention formula is as follows: MultiHead(Q,K,V)=Concat(head1,...,head h )W o ; Among them, h represents multiple attention heads, each of which calculates a set of independent self-attention; S45: The spliced features are linearly transformed to obtain the final output, which is used to optimize the missing traffic situation repair results.
Citation Information
Patent Citations
Method for extracting traffic flow prediction model by combining graph Fourier transform TMGCN
CN116029459A
Multi-dimensional time series data spatio-temporal feature extraction method based on attention mechanism
CN118606682A
Method and apparatus for restoring a target restoration region in an image
US20250029212A1
Cited By
Traffic flow state data time gathering method based on Gaussian mixture probability
CN121456351A