A traffic data space-time repairing method based on time-frequency domain evolution

CN120744288BActive Publication Date: 2026-09-18CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510717725.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2026-09-18
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

[0004]本发明的目的在于提供一种基于时域-频域演变的交通数据时空修复方法,旨在解决现有的交通数据修复方法难以有效捕捉交通态势多尺度特性、无法准确处理交通突发事件导致的时间相关性破坏以及不能充分挖掘时空特征从而影响修复准确性和完整性的问题

Benefits of technology

[0055] This invention presents a spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution. By employing this method, the dynamic characteristics of traffic conditions at different time scales can be accurately captured, including sudden events, periodic patterns, and long-term trends, thus improving the modeling capability for complex traffic situations. Utilizing inverse Fourier transform and wavelet transform techniques, the reconstructed time signal ensures both the ability to fit actual time fluctuations and the preservation of diverse traffic conditions, effectively improving the quality of time signal reconstruction under sudden events. Combining the GAT model and the Transformer model to repair missing data in the spatiotemporal dimension fully leverages the spatiotemporal interaction characteristics of traffic flow, accurately infers data in missing areas, captures temporal and spatial dynamic characteristics, and further optimizes the accuracy and completeness of the repair results, providing a more reliable basis for traffic flow prediction and management. This addresses the problems of existing traffic data repair methods, such as their inability to effectively capture the multi-scale characteristics of traffic conditions, their inability to accurately handle the disruption of time correlation caused by sudden traffic events, and their inability to fully exploit spatiotemporal features, which affects the accuracy and completeness of the repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120744288B_ABST
    Figure CN120744288B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data repair, in particular to a traffic data space-time repair method based on time-frequency evolution, the present application can accurately capture the dynamic characteristics of traffic situation on different time scales by the method based on time-frequency evolution, and improve the modeling ability of complex traffic situation. Using inverse Fourier transform and wavelet transform technology, when reconstructing the time signal, it can not only ensure the fitting ability of the actual time fluctuation, but also retain the diversity characteristics of the traffic situation, effectively improving the quality of time signal reconstruction under the sudden event. Combined with GAT model and Transformer model, the missing data is repaired in space-time dimension, which can fully utilize the space-time interaction characteristics of traffic flow, accurately infer the missing area data, capture the time and space dynamic characteristics, further optimize the accuracy and integrity of the repair result, and provide a more reliable basis for traffic flow prediction and management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data restoration technology, and in particular to a spatiotemporal restoration method for traffic data based on time-frequency domain evolution. Background Technology

[0002] In Intelligent Transportation Systems (ITS), traffic flow prediction is crucial for traffic management and planning. However, traffic flow data often suffers from missing spatiotemporal data, posing a significant 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 and complex spatiotemporal interactions of traffic situations. Traffic situations exhibit multi-scale characteristics that evolve over time, including features at different time scales such as emergencies, periodic patterns, and long-term trends. Furthermore, traffic emergencies can disrupt the temporal correlation of traffic flows, further increasing the difficulty of data restoration. In addition, existing methods often fail to fully exploit the hidden spatiotemporal features within traffic data when dealing with missing spatiotemporal data, resulting in insufficient accuracy and completeness of the restoration results. Summary of the Invention

[0004] The purpose of this invention is to provide a spatiotemporal repair method for traffic data based on time-frequency domain evolution, which aims to solve the problems that existing traffic data repair methods are unable to effectively capture the multi-scale characteristics of traffic conditions, cannot accurately handle the time correlation damage caused by traffic emergencies, and cannot fully explore spatiotemporal features, thus affecting the accuracy and completeness of the repair.

[0005] To achieve the above objectives, this invention provides a spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution, comprising the following steps:

[0006] S1: The time signal for acquiring traffic flow data is decomposed into high-frequency, medium-frequency, and low-frequency signals based on Fast Fourier Transform, which respectively capture sudden event data, periodic pattern data, and long-term trend data;

[0007] S2: Different frequency components are recombined into a time-domain signal through inverse Fourier transform, and wavelet transform technology is introduced to integrate multiple frequency components in the time dimension to obtain a time-evolved signal;

[0008] S3: In the spatial dimension, the missing area data is inferred by using a graph attention network model to obtain road network structure data;

[0009] S4: In the time dimension, based on existing time evolution signals and missing regional 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 conditions.

[0010] The step of "obtaining traffic flow data by decomposing the time signal into high-frequency, mid-frequency, and low-frequency signals based on Fast Fourier Transform to capture sudden event data, periodic pattern 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 it into the form of a time series signal;

[0012] S12: Apply the Fast Fourier Transform algorithm to the traffic flow time series signal of each road node;

[0013] S13: The time signal is converted to the frequency domain using Fourier transform, decomposing it into three signal components: high frequency, intermediate frequency, and low frequency.

[0014]

[0015] Where x(t) is the time-domain signal of traffic flow, X(f) is the frequency-domain signal, j is the imaginary unit, and N is the time step. Let X be a basis function. l (f), X m (f), X h (f) represents the high-frequency, mid-frequency and low-frequency signals decomposed, respectively.

[0016] Specifically, in the section "converting the time signal to the frequency domain through Fourier transform and decomposing it into three signal components: high frequency, mid frequency, and low frequency", the high frequency signal component mainly reflects the characteristics of sudden events in traffic flow; the mid frequency signal component reflects the periodic pattern of traffic flow; and the low frequency signal component represents the long-term trend of traffic flow.

[0017] The step of "recombining different frequency components into a time-domain signal through inverse Fourier transform and introducing wavelet transform technology to integrate multiple frequency components in the time dimension" includes the following steps:

[0018] S21: Independently model the decomposed high-frequency, mid-frequency, and low-frequency signals, and extract their respective feature information.

[0019]

[0020] Where, x l (t) is a low-frequency signal, representing a long-term trend, x m (t) represents the periodic change of the intermediate frequency signal, x h (t) is a high-frequency signal representing a sudden event;

[0021] S22: Use inverse Fourier transform to recombine the signals of these three frequency components and convert them back to time domain signals;

[0022] S23: Apply wavelet transform technology to the reconstructed time-domain signal, and select the mother wavelet function and scale and time-shift parameters;

[0023] S24: By integrating multiple frequency components in the time dimension through wavelet transform, it can both fit the actual time fluctuations and preserve the diverse characteristics of traffic conditions.

[0024]

[0025] Among them, Y x (a,b) represents the wavelet transform result, and x(t) represents the original signal. Here, 'a' is the mother wavelet function, 'a' is the scaling parameter used to control the frequency, and 'b' is the time shift parameter used to control the time shift. In practical applications, the Ricker wavelet is used for wavelet transform, as shown in the following formula:

[0026]

[0027] The section on "In the spatial dimension, obtaining road network structure data and using a graph attention network model to infer missing region data" includes the following steps:

[0028] S31: Construct a structural diagram of the urban road network, representing 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 map 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 adjacent nodes are weighted and aggregated to generate a new set of node features, thereby inferring the traffic flow data of the missing area.

[0032] The section on "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 traffic situation pixel feature vectors for a road node; calculate the attention coefficient between adjacent nodes.

[0034] h = {h1, h2, ..., h} N}

[0035] Among them, h N This is the feature input vector of road nodes in traffic data after time-parallel processing.

[0036] The formula for calculating the attention coefficient between adjacent nodes is as follows:

[0037]

[0038] Wherein, the attention coefficient α ij Let be the attention weight of node j towards node i; W be the learnable weight matrix; a be the attention weight vector learned by the attention mechanism through the weight vector; || denotes the vector concatenation operation; k denotes the set of neighboring nodes of node i; h be the set of neighboring nodes of node i. i and h j These are the feature vectors of nodes i and j;

[0039] S312: Weighted aggregation of the feature vectors of neighboring nodes is performed using attention coefficients to obtain a new set of node features.

[0040] New node feature set

[0041]

[0042] Where σ is a nonlinear activation function.

[0043] Specifically, the section on "Extracting temporal and spatial dynamic features based on existing temporal evolution signals and missing region data using the multi-head attention mechanism of the Transformer model to optimize the repair of missing traffic conditions" includes the following steps:

[0044] S41: Input the existing time evolution 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: Utilizing a multi-head attention mechanism, the attention weights among the query vector, index vector, and value vector are calculated to capture the temporal and spatial dynamic features in traffic flow data. The attention calculation formula is as follows:

[0047]

[0048] Where Q, K, and V are the query vector, index vector, and value vector obtained by mapping the input features of all nodes, respectively, with road network node e as an example. i For example, it can be linearly mapped into a query vector, an index vector, and a value vector:

[0049]

[0050] in, Let Q, K, and V be the projection matrices to be learned, respectively. The input flow matrix;

[0051] S44: Perform a concatenation operation on the outputs of multi-head attention to integrate the extracted feature information. The self-attention formula for multi-head attention is as follows:

[0052] MultiHead(Q,K,V)=Concat(head1,...,head h W o

[0053] Where h represents multiple attention heads, each of which computes an independent set of self-attentions;

[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] This invention presents a spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution. By employing this method, the dynamic characteristics of traffic conditions at different time scales can be accurately captured, including sudden events, periodic patterns, and long-term trends, thus improving the modeling capability for complex traffic situations. Utilizing inverse Fourier transform and wavelet transform techniques, the reconstructed time signal ensures both the ability to fit actual time fluctuations and the preservation of diverse traffic conditions, effectively improving the quality of time signal reconstruction under sudden events. Combining the GAT model and the Transformer model to repair missing data in the spatiotemporal dimension fully leverages the spatiotemporal interaction characteristics of traffic flow, accurately infers data in missing areas, captures temporal and spatial dynamic characteristics, and further optimizes the accuracy and completeness of the repair results, providing a more reliable basis for traffic flow prediction and management. This addresses the problems of existing traffic data repair methods, such as their inability to effectively capture the multi-scale characteristics of traffic conditions, their inability to accurately handle the disruption of time correlation caused by sudden traffic events, and their inability to fully exploit spatiotemporal features, which affects the accuracy and completeness of the repair. Attached Figure Description

[0056] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0057] Figure 1 It's a repair model diagram.

[0058] Figure 2It is a multi-scale analysis diagram.

[0059] Figure 3 This is a schematic diagram of spatiotemporal modeling.

[0060] Figure 4 This is a flowchart 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 flowchart that obtains traffic flow data by decomposing the time signal into high-frequency, medium-frequency, and low-frequency signals based on Fast Fourier Transform, and capturing sudden event data, periodic pattern data, and long-term trend data respectively.

[0062] Figure 6 It is a flowchart that uses inverse Fourier transform to recombine different frequency components into a time-domain signal and introduces wavelet transform technology to integrate multiple frequency components in the time dimension.

[0063] Figure 7 This is a flowchart illustrating how a graph attention network model is used to infer data for missing regions when acquiring road network structure data in the spatial dimension.

[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 existing time evolution signals and missing regional data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features and optimize the flowchart for missing traffic situation repair. Detailed Implementation

[0066] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0067] Please see Figures 1 to 9 This invention provides a spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution, comprising the following steps:

[0068] S1: The time signal for acquiring traffic flow data is decomposed into high-frequency, medium-frequency, and low-frequency signals based on Fast Fourier Transform, which respectively capture sudden event data, periodic pattern data, and long-term trend data;

[0069] The high-frequency signal components mainly reflect the characteristics of sudden events in traffic flow; the mid-frequency signal components reflect the periodic patterns of traffic flow; and the low-frequency signal components represent the long-term trends of traffic flow.

[0070] S11: Collect traffic flow data of each road node in the urban road network at multiple time points and organize it into the form of a time series signal;

[0071] Definition 1. Road network structure diagram G = (V, E)

[0072] Where V represents the set of N nodes in the urban road network, V = {v1, v2, ..., v...} N}, v N Let N be a road node. 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] Traffic flow dataset X represents traffic flow data at different times within 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 in the urban road network. The data collection interval is determined according to specific needs, such as every 5 minutes, every 15 minutes, or every 30 minutes. The collected data includes traffic flow values ​​at each road node at different times. The collected traffic flow data is then organized chronologically and by road node to form a time-series signal. Data integrity and consistency are ensured, and missing or abnormal data undergoes preliminary processing.

[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 based on the length and sampling frequency of the time-series signal. For the traffic flow time-series signal at each road node, the FFT algorithm is applied for frequency domain transformation. Through FFT, the time signal is decomposed into complex forms of different frequency components, including amplitude and phase information. Based on the Fourier transform results, the frequency domain signal is decomposed into three parts: high frequency, mid frequency, and low frequency. This division is typically based on frequency thresholds. Low-frequency components mainly reflect long-term trends in traffic flow, such as the year-on-year increase or decrease in urban traffic flow. Mid-frequency components reflect periodic patterns in traffic flow, such as diurnal variations and differences between weekdays and weekends. High-frequency components mainly reflect the characteristics of sudden events in traffic flow, such as traffic accidents and rapid changes in flow caused by temporary road construction.

[0080] S13: The time signal is converted to the frequency domain using Fourier transform, decomposing it into three signal components: high frequency, intermediate frequency, and low frequency.

[0081]

[0082] Where x(t) is the time-domain signal of traffic flow, X(f) is the frequency-domain signal, j is the imaginary unit, and N is the time step. Let X be a basis function. l (f), X m (f), X h (f) represents the high-frequency, mid-frequency and low-frequency signals decomposed, respectively.

[0083] Specifically, based on the results of the Fourier transform, the frequency domain signal is decomposed into three parts: high frequency, mid frequency, and low frequency. This division is typically based on frequency thresholds. For example: low-frequency components primarily reflect long-term trends in traffic flow, such as the year-on-year increase or decrease in urban traffic flow; mid-frequency components reflect periodic patterns in traffic flow, such as diurnal variations and differences between weekdays and weekends; high-frequency components primarily reflect the characteristics of sudden events in traffic flow, such as traffic accidents or rapid changes in flow caused by temporary road construction.

[0084] S2: Different frequency components are recombined into a time-domain signal through inverse Fourier transform, and wavelet transform technology is introduced to integrate multiple frequency components in the time dimension to obtain a time-evolved signal;

[0085] S21: Independently model the decomposed high-frequency, mid-frequency, and low-frequency signals, and extract their respective feature information.

[0086]

[0087]

[0088] Where, xl (t) is a low-frequency signal, representing a long-term trend, x m (t) represents the periodic change of the intermediate frequency signal, x h (t) is a high-frequency signal representing a sudden 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 of sudden events, such as the occurrence time, duration, and intensity of the sudden events. For mid-frequency signals, modeling is performed to analyze their periodicity. Methods such as Fourier series expansion or wavelet analysis can be used to extract characteristic parameters such as amplitude, frequency, and phase of 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: Use inverse Fourier transform to recombine the signals of these three frequency components and convert them back to time domain signals;

[0091] Specifically, based on the FFT results and parameters, the parameters of the Inverse Fourier Transform (IFFT) are initialized to prepare for recombination of the decomposed frequency components into a time-domain signal. The IFFT is used to recombine the high-frequency, mid-frequency, and low-frequency signals, converting them back to time-domain signals. By adjusting the amplitude and phase of each frequency component, the reconstructed time-domain signal is generated.

[0092] S23: Apply wavelet transform technology to the reconstructed time-domain signal, and select the mother wavelet function and scale and time-shift parameters;

[0093] Specifically, select appropriate wavelet functions (such as Ricker wavelets) and scale and time-shift parameters. Determine the scale range and step size of the wavelet transform based on the characteristics and requirements of the traffic flow signal.

[0094] S24: Integrating multiple frequency components in the time dimension through wavelet transform.

[0095]

[0096] Among them, Y x (a,b) represents the wavelet transform result, and x(t) represents the original signal. Here, 'a' is the mother wavelet function, 'a' is the scaling parameter used to control the frequency, and 'b' is the time shift parameter used to control the time shift. In practical applications, the Ricker wavelet is used for wavelet transform, as shown in the following formula:

[0097]

[0098] Specifically, wavelet transform technology is applied to the reconstructed time-domain signal for multi-scale analysis. Through wavelet transform, multiple frequency components are integrated in the time dimension, fitting actual time fluctuations while preserving the diverse characteristics of traffic conditions. The results of the wavelet transform can be used to further analyze the local features and variation patterns of traffic flow signals.

[0099] S3: In the spatial dimension, the missing area data is inferred by using a graph attention network model to obtain road network structure data;

[0100] S31: Construct a structural diagram of the urban road network, representing 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 traffic situation pixel feature vectors for a road node; calculate the attention coefficient between adjacent nodes.

[0102] h = {h1, h2, ..., h} N}

[0103] Among them, h N This is the feature input vector of road nodes in traffic data after time-parallel processing.

[0104] The formula for calculating the attention coefficient between adjacent nodes is as follows:

[0105]

[0106] Wherein, the attention coefficient α ij Let be the attention weight of node j towards node i; W be the learnable weight matrix; a be the attention weight vector learned by the attention mechanism through the weight vector; || denotes the vector concatenation operation; k denotes the set of neighboring nodes of node i; h be the set of neighboring nodes of node i. i and h j These are the feature vectors of nodes i and j;

[0107] Specifically, the process involves collecting location information and sensor deployment information for each road node in the urban road network. The coordinates of each road node are determined, and the sensor deployment at each node is recorded. Each road node is represented as a node in a graph. Distance weights between nodes are calculated based on the Euclidean distance between sensors, and an adjacency matrix is ​​constructed. Elements in the adjacency matrix represent the connection relationships and distance weights between nodes, providing a foundation for calculating the attention coefficient in the subsequent GAT model. The process also involves collecting time-parallelized feature input vectors from each road node in the traffic data. Features are extracted and organized from the traffic situation data of each road node to form a set of feature vectors. Based on the dimension and structure of the feature input vectors, a learnable weight matrix and the weight vectors for the attention mechanism are initialized. The necessary parameters and data structures for the vector concatenation operation are prepared to prepare for calculating the attention coefficient. For each node, its set of neighboring nodes is traversed. The neighboring nodes of each node are determined based on the adjacency matrix, and the corresponding feature vectors are obtained.

[0108] S312: Weighted aggregation of the feature vectors of neighboring nodes is performed using attention coefficients to obtain a new set of node features.

[0109] New node feature set

[0110]

[0111] Where σ is a nonlinear activation function.

[0112] Specifically, the attention weights between nodes are calculated according to the formula. The feature vectors of the node and its neighbors are concatenated, and then processed by a learnable weight matrix and weight vector through linear transformation and activation function to obtain the attention coefficient. This coefficient reflects the spatial correlation and dependence between nodes. Using the calculated attention coefficient, the feature vectors of neighboring nodes are weighted and aggregated. The aggregated feature vectors are then processed through a non-linear activation function to obtain a new set of node features. This new feature set integrates traffic situation information from the node itself and its neighbors, more accurately reflecting the spatial traffic characteristics.

[0113] S32: Input traffic flow data and road network structure map into the graph attention network model;

[0114] Specifically, traffic flow data and road network structure maps are formatted and integrated to meet the input requirements of the GAT model. The data is then 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 progressively calculated and propagated, continuously optimizing the feature representation to provide a more accurate feature foundation for the final inference of missing data. The spatial dependencies between nodes are quantified by calculating the attention coefficients between adjacent nodes. Analyzing the distribution and variation patterns of the attention coefficients provides a deeper understanding of the spatial propagation and influence mechanisms of traffic conditions.

[0117] S34: Based on the calculated attention coefficient, the feature vectors of adjacent nodes are weighted and aggregated to generate a new set of node features, thereby inferring the traffic flow data of the missing area.

[0118] Specifically, based on the calculated attention coefficients and updated node feature vectors, specific inference algorithms and models are used to generate traffic flow data for missing areas. The inference results are evaluated and verified to ensure that their accuracy and reliability meet the needs of practical applications.

[0119] S4: In the time dimension, based on existing time evolution signals and missing regional 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 conditions.

[0120] S41: Input the existing time evolution signal into the Transformer model;

[0121] Specifically, existing temporal evolution signals and missing region data are collected, including time-domain signals after frequency domain deconstruction and reconstruction, and traffic situation data after spatial dimension inference. The temporal evolution signals are preprocessed, including data cleaning, normalization, and format conversion, to make them suitable for input into the Transformer model. The temporal evolution signals are initially decomposed to extract key features and time step information. The temporal structure and trends of the signals are analyzed to provide basic feature inputs 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 structure of the Transformer model and the dimensions of the input features, projection matrices for the query vector, index vector, and value vector are initialized. These projection matrices will be used to linearly map the input features to the query, index, and value spaces. The input flow matrix is ​​linearly transformed through the projection matrices to generate the query vector, index vector, and value vector. It is ensured that the dimensions and structure of the vectors conform to the requirements of the Transformer model, while preserving the key features and information from the original data.

[0124] S43: Utilizing a multi-head attention mechanism, the attention weights among the query vector, index vector, and value vector are calculated to capture the temporal and spatial dynamic features in traffic flow data. The attention calculation formula is as follows:

[0125]

[0126] Where Q, K, and V are the query vector, index vector, and value vector obtained by mapping the input features of all nodes, respectively, with road network node e as an example. i For example, it can be linearly mapped into a query vector, an index vector, and a value vector:

[0127]

[0128] in, Let Q, K, and V be the projection matrices to be learned, respectively. The input flow matrix;

[0129] Specifically, based on the formula for the multi-head attention mechanism, the attention weights among the query vector, index vector, and value vector are calculated. 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: Perform a concatenation operation on the outputs of multi-head attention to integrate the extracted feature information. The self-attention formula for multi-head attention is as follows:

[0131] MultiHead(Q,K,V)=Concat(head1,...,head h W o

[0132] Where h represents multiple attention heads, each of which computes an independent set of self-attentions;

[0133] Specifically, the calculated attention weights are used to perform a weighted summation operation on the value vector, integrating feature information from different nodes and time steps. Through parallel computation and feature concatenation using multiple attention heads, the rich dynamic features and complex spatiotemporal relationships in traffic flow data are captured. The features from each output head of the multi-head attention mechanism are concatenated to form a complete feature vector. This ensures that the concatenated feature vector comprehensively reflects the temporal and spatial characteristics of the traffic situation and possesses good expressive power and discriminative power.

[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] Here, Y is the repaired data, which has the same dimensions as the original traffic flow X, but missing values ​​have been filled, making the data smoother.

[0138] Specifically, the concatenated feature vectors are passed through a linear transformation layer to obtain the final output. The output is then evaluated and validated to ensure it accurately optimizes the missing traffic situation repair and improves the accuracy and completeness of the repair.

[0139] Beneficial effects:

[0140] First, by using a time-domain-frequency-domain evolution-based approach, we can accurately capture the dynamic characteristics of traffic conditions at different time scales, including sudden events, periodic patterns, and long-term trends, thereby improving our ability to model complex traffic conditions.

[0141] Second, by utilizing inverse Fourier transform and wavelet transform techniques, the reconstruction of time signals can both ensure the ability to fit actual time fluctuations and retain the diverse characteristics of traffic conditions, effectively improving the quality of time signal reconstruction under emergencies.

[0142] Third, by combining the GAT model and the Transformer model to repair missing data in the spatiotemporal dimension, we can make full use of the spatiotemporal interaction characteristics of traffic flow, accurately infer data in missing areas, capture dynamic features in time and space, 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-disclosed embodiments are merely preferred embodiments of the spatiotemporal repair method for traffic data based on time-frequency domain evolution of the present invention. Of course, they should not be construed as limiting the scope of the present invention. Those skilled in the art can understand that implementing all or part of the above embodiments and making equivalent changes in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution, characterized in that, Includes the following steps: S1: The time signal for acquiring traffic flow data is decomposed into high-frequency, medium-frequency, and low-frequency signals based on Fast Fourier Transform, which respectively capture sudden event data, periodic pattern data, and long-term trend data; S2: Different frequency components are recombined into a time-domain signal through inverse Fourier transform, and wavelet transform technology is introduced to integrate multiple frequency components in the time dimension to obtain a time-evolved signal; S3: In the spatial dimension, the missing area data is inferred by using a graph attention network model to obtain road network structure data; S4: In the time dimension, based on 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 missing traffic situation repair results. In terms of spatial dimension, the process of obtaining road network structure data and inferring missing region data using a graph attention network model includes the following steps: S31: Construct a structural diagram of the urban road network, representing 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 map 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 adjacent nodes are weighted and aggregated to generate a new set of node features, thereby inferring the traffic flow data of the missing area; In the time dimension, based on existing temporal evolution signals and missing region data, the multi-head attention mechanism of the Transformer model is used to extract temporal and spatial dynamic features, optimizing the missing traffic situation repair results, including the following steps: S41: Input the existing time evolution 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: Utilizing a multi-head attention mechanism, the attention weights among the query vector, index vector, and value vector are calculated to capture the temporal and spatial dynamic features of traffic flow data. S44: Perform a concatenation operation on the output of multi-head attention to integrate the extracted feature information. S45: The spliced ​​features are linearly transformed to obtain the final output, which is used to optimize the missing traffic situation repair results.

2. The spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution as described in claim 1, characterized in that, The process of "acquiring traffic flow data by decomposing the time signal into high-frequency, mid-frequency, and low-frequency signals based on Fast Fourier Transform to capture sudden event data, periodic pattern data, and long-term trend data respectively" includes the following steps: S11: Collect traffic flow data of each road node in the urban road network at multiple time points and organize it into the form of a time series signal; S12: Apply the Fast Fourier Transform algorithm to the traffic flow time series signal of each road node; S13: The time signal is converted to the frequency domain using Fourier transform, decomposing it into three signal components: high frequency, intermediate frequency, and low frequency. ; ; ; ; in, For traffic flow time domain signals, It is a frequency domain signal. The imaginary unit, For time step, As basis functions, , , These represent the low-frequency, mid-frequency, and high-frequency signals, respectively.

3. The spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution as described in claim 1, characterized in that, The process of "recombining different frequency components into a time-domain signal through inverse Fourier transform and integrating multiple frequency components in the time dimension by introducing wavelet transform technology" includes the following steps: S21: Independently model the decomposed high-frequency, mid-frequency, and low-frequency signals, and extract their respective feature information. ; ; ; in, It is a low-frequency signal, indicating a long-term trend. The intermediate frequency signal represents periodic changes. It is a high-frequency signal, indicating a sudden event. The imaginary unit, For time step, , , These represent the low-frequency, mid-frequency, and high-frequency signals, respectively. S22: Use inverse Fourier transform to recombine the signals of these three frequency components and convert them back to time domain signals; S23: Apply wavelet transform technology to the reconstructed time-domain signal, and select the mother wavelet function and scale and time-shift parameters; S24: Integrating multiple frequency components in the time dimension through wavelet transform. ; in, The result is the wavelet transform. The time-domain signal representing traffic flow, For the mother wavelet function, It is a scale parameter used to control the frequency; This is the time shift parameter, used to control the time shift. In practical applications, the wavelet transform uses the Ricker wavelet, as shown in the following formula: 。 4. The spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution as described in claim 3, characterized in that, The section "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. Based on the calculated attention coefficient, the feature vectors of adjacent nodes are weighted and aggregated to generate a new set of node features, thereby inferring traffic flow data for the missing area" includes the following steps: S311: Input is a set of traffic situation pixel feature vectors for a road node; calculate the attention coefficient between adjacent nodes. ; in, This is the feature input vector of road nodes in traffic data after time-parallel processing. The formula for calculating the attention coefficient between adjacent nodes is as follows: ; Among them, attention coefficient Represented as nodes For nodes Attention weights; The weight matrix is ​​a learnable matrix; This refers to the attention weight vector learned by the attention mechanism through the weight vector; This represents a vector concatenation operation; Represents a node The set of neighboring nodes, and It is a node and eigenvectors; S312: Weighted aggregation of the feature vectors of neighboring nodes is performed using attention coefficients to obtain a new set of node features. New node feature set ; ; in, It is a non-linear activation function.

5. The spatiotemporal repair method for traffic data based on time-domain-frequency domain evolution as described in claim 1, characterized in that, The section "On the time dimension, based on existing temporal evolution signals and missing region 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 restoration results" also includes the following steps: The formula for calculating attention is as follows: ; The query vector, index vector, and value vector are obtained by mapping the input features of all nodes, respectively, with road network nodes as the basis. For example, it can be linearly mapped into a query vector, an index vector, and a value vector: ; They are respectively The projection matrix of the vector to be learned. The input flow matrix; The formula for the self-attention of bulls is as follows: ; This represents multiple attention heads, each of which computes an independent set of self-attentions.

Citation Information

Patent Citations

  • 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