Traffic data repairing method, device and equipment, storage medium and program product
Patent Information
- Application Number
- CN202611071568.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-17
- Publication Date
- 2026-10-23
AI Technical Summary
然而,无法显式建模交通数据中周期内(如单日波动)与周期间(如跨周期趋势)的双重依赖关系,导致修复结果与真实周期模式偏离,使得数据修复的可靠性较低
[0066]本申请实施例提供的交通数据修复方法、装置、设备、存储介质及程序产品,通过可以对初始交通数据进行线性插值处理生成粗略修复数据,再将粗略修复数据映射至频域空间,得到各频率分量的流量振幅特征。可以对各频率分量的流量振幅特征进行筛选处理,得到至少一个关键频率分量,再根据至少一个关键频率分量,对粗略修复数据进行重构处理,得到多个周期重构张量,最后对多个周期重构张量进行数据修复处理,生成初始交通数据对应的修复交通数据。上述执行过程中,可以通过显式建模交通数据的多周期时空依赖关系,并结合频域分析与扩散框架,实现高精度、低延迟的交通流数据修复,提高数据修复的可靠性。
Smart Images

Figure CN122967462A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, storage medium, and program product for traffic data repair. Background Technology
[0002] In intelligent transportation systems, traffic flow data is typically collected in real time by sensors deployed in the road network (such as loop detectors, cameras, and geomagnetic sensors) to form spatiotemporal sequence data, covering key indicators such as flow amplitude characteristics, speed, and occupancy. However, due to factors such as sensor failure, communication interruption, data packet loss, or environmental interference, the actual traffic data collected generally suffers from random missing (RM) and non-random missing (NM) problems.
[0003] In existing technologies, CSDI combines a fractional diffusion model with a Transformer to generate missing data through a conditional diffusion process, while PriSTI utilizes a spatiotemporal conditional diffusion framework to model feature correlations. However, it cannot explicitly model the dual dependencies within traffic data (such as daily fluctuations) and during the week (such as cross-cycle trends), leading to deviations between the repair results and the actual cyclical patterns, resulting in low reliability of data repair. Summary of the Invention
[0004] This application provides a traffic data repair method, apparatus, device, storage medium, and program product to improve the reliability of data repair.
[0005] In a first aspect, embodiments of this application provide a traffic data repair method, including:
[0006] The initial traffic data is linearly interpolated to generate coarsely repaired data.
[0007] Based on the rough repair data, the flow amplitude characteristics of each frequency component are determined;
[0008] The flow amplitude characteristics of each frequency component are screened to obtain at least one key frequency component.
[0009] Based on the at least one key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors;
[0010] Data repair processing is performed on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
[0011] In one possible implementation, data repair processing is performed on the plurality of periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data, including:
[0012] The multiple periodic reconstructed tensors are subjected to frequency filtering to obtain multiple periodic filtered data.
[0013] The repaired traffic data is obtained by performing feature integration processing on the multiple periodically filtered data.
[0014] In one possible implementation, frequency filtering is performed on the plurality of periodic reconstruction tensors to obtain plurality of periodic filtered data, including:
[0015] Perform a Fast Fourier Transform on the multiple periodic reconstruction tensors to generate frequency domain traffic data corresponding to each frequency domain component;
[0016] By using an adaptive mask tensor, the frequency domain traffic data corresponding to each frequency domain component is filtered to obtain the filtered traffic data corresponding to each frequency domain component.
[0017] Perform an inverse Fourier transform on the filtered traffic data corresponding to each frequency domain component to generate the multiple periodic filtered data.
[0018] In one possible implementation, the coarsely repaired data is reconstructed based on the at least one key frequency component to obtain multiple periodic reconstruction tensors, including:
[0019] Determine the timing segmentation points and period lengths corresponding to each key frequency component;
[0020] Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the coarsely repaired data is reconstructed to obtain the multiple period reconstruction tensors.
[0021] In one possible implementation, the initial traffic data is reconstructed based on the temporal segmentation points and period lengths corresponding to each key frequency component to obtain the plurality of period reconstruction tensors, including:
[0022] Based on the time segmentation points and period lengths corresponding to each key frequency component, determine the initial tensor data corresponding to each periodic mode;
[0023] For any given cycle pattern, the zero-padding length of the cycle pattern is determined based on the initial length of the initial traffic data and the cycle length.
[0024] Based on the zero-padding length of each periodic pattern, the initial tensor data corresponding to the periodic pattern is zero-padding processed to obtain the multiple periodic reconstructed tensors.
[0025] In one possible implementation, determining the flow amplitude characteristics of each frequency component based on the coarsely repaired data includes:
[0026] The coarsely repaired data is aggregated to obtain time-series feature data;
[0027] The time-series feature data is mapped to the frequency domain space to obtain frequency domain feature data;
[0028] The absolute values of the frequency domain feature data are averaged along the feature channel dimension to obtain the flow amplitude characteristics of each frequency component.
[0029] In one possible implementation, the flow amplitude characteristics of each frequency component are screened to obtain at least one key frequency component, including:
[0030] Based on the flow amplitude characteristics, the frequency components are sorted to obtain multiple sorted frequency components;
[0031] Determine the number K of key components corresponding to the key frequency components, where K is an integer greater than or equal to 1;
[0032] The first K frequency components among the plurality of sorted frequency components are determined as at least one key frequency component.
[0033] Secondly, embodiments of this application provide a traffic data repair device, including a linear interpolation module, a mapping module, a filtering module, a reconstruction module, and a repair module:
[0034] The linear interpolation module is used to perform linear interpolation on the initial traffic data to generate coarsely repaired data;
[0035] The mapping module is used to map the coarse repair data to the frequency domain space to obtain the flow amplitude characteristics of each frequency component;
[0036] The filtering module is used to filter the flow amplitude characteristics of each frequency component to obtain at least one key frequency component.
[0037] The reconstruction module is used to reconstruct the initial traffic data based on the at least one key frequency component to obtain multiple periodic reconstruction tensors.
[0038] The repair module is used to perform data repair processing on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
[0039] In one possible implementation, the repair module is specifically used for:
[0040] The multiple periodic reconstructed tensors are subjected to frequency filtering to obtain multiple periodic filtered data.
[0041] The repaired traffic data is obtained by performing feature integration processing on the multiple periodically filtered data.
[0042] In one possible implementation, the repair module is specifically used for:
[0043] Perform a Fast Fourier Transform on the multiple periodic reconstruction tensors to generate frequency domain traffic data corresponding to each frequency domain component;
[0044] By using an adaptive mask tensor, the frequency domain traffic data corresponding to each frequency domain component is filtered to obtain the filtered traffic data corresponding to each frequency domain component.
[0045] Perform an inverse Fourier transform on the filtered traffic data corresponding to each frequency domain component to generate the multiple periodic filtered data.
[0046] In one possible implementation, the reconstruction module is specifically used for:
[0047] Determine the timing segmentation points and period lengths corresponding to each key frequency component;
[0048] Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the coarsely repaired data is reconstructed to obtain the multiple period reconstruction tensors.
[0049] In one possible implementation, the reconstruction module is specifically used for:
[0050] Based on the time segmentation points and period lengths corresponding to each key frequency component, determine the initial tensor data corresponding to each periodic mode;
[0051] For any given cycle pattern, the zero-padding length of the cycle pattern is determined based on the initial length of the initial traffic data and the cycle length.
[0052] Based on the zero-padding length of each periodic pattern, the initial tensor data corresponding to the periodic pattern is zero-padding processed to obtain the multiple periodic reconstructed tensors.
[0053] In one possible implementation, the mapping module is specifically used for:
[0054] The coarsely repaired data is aggregated to obtain time-series feature data;
[0055] The time-series feature data is mapped to the frequency domain space to obtain frequency domain feature data;
[0056] The absolute values of the frequency domain feature data are averaged along the feature channel dimension to obtain the flow amplitude characteristics of each frequency component.
[0057] In one possible implementation, the filtering module is specifically used for:
[0058] Based on the flow amplitude characteristics, the frequency components are sorted to obtain multiple sorted frequency components;
[0059] Determine the number K of key components corresponding to the key frequency components, where K is an integer greater than or equal to 1;
[0060] The first K frequency components among the plurality of sorted frequency components are determined as at least one key frequency component.
[0061] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0062] The memory stores computer-executed instructions;
[0063] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0064] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0065] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0066] The traffic data repair method, apparatus, device, storage medium, and program product provided in this application can generate coarsely repaired data by performing linear interpolation on initial traffic data, and then map the coarsely repaired data to the frequency domain to obtain the flow amplitude characteristics of each frequency component. The flow amplitude characteristics of each frequency component can be filtered to obtain at least one key frequency component. Based on this key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors. Finally, data repair processing is performed on these multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data. In the above execution process, by explicitly modeling the multi-period spatiotemporal dependencies of traffic data and combining frequency domain analysis and a diffusion framework, high-precision, low-latency traffic flow data repair can be achieved, improving the reliability of data repair. Attached Figure Description
[0067] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0068] Figure 1 A schematic diagram illustrating one application scenario provided in this application;
[0069] Figure 2 A flowchart illustrating the traffic data repair method provided in this application embodiment. Figure 1 ;
[0070] Figure 3 Flowchart of the traffic data repair method provided in this application Figure 2 ;
[0071] Figure 4 A schematic diagram of time decoupling provided for an embodiment of this application;
[0072] Figure 5 A schematic diagram of the architecture of a traffic data repair method provided in an embodiment of this application;
[0073] Figure 6 A convolutional comparison diagram provided for an embodiment of this application;
[0074] Figure 7 This is a schematic diagram of the structure of a traffic data repair device provided in an embodiment of this application;
[0075] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0076] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0077] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0078] Figure 1 This is a schematic diagram illustrating one application scenario provided by this application. For example... Figure 1 As shown, this application is applicable to large-scale traffic flow data repair scenarios in intelligent transportation systems. The application scenario may include sensor 101 and processing device 102.
[0079] Sensors 101 in the road network acquire initial traffic data in real time, such as flow amplitude characteristics and speed. Sensors 101 can be ring detectors, cameras, etc. After acquiring the initial traffic data, processing device 102 performs linear interpolation to generate coarse repair data. Based on the coarse repair data, it determines the flow amplitude characteristics of each frequency component. Processing device 102 can filter the flow amplitude characteristics of each frequency component to obtain at least one key frequency component. Then, based on at least one key frequency component, it reconstructs the coarse repair data to obtain multiple periodic reconstruction tensors. Finally, it performs data repair processing on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
[0080] In existing technologies, the Conditional Diffusion-based temporal completion model (CSDI) combines a fractional diffusion model with a transformer to generate missing data through a conditional diffusion process. The Spatiotemporal Aware Diffusion (PriSTI) model utilizes a spatiotemporal conditional diffusion framework to model feature correlations. However, these technologies often rely on fixed convolutions, manually preset periods, or traditional frequency domain decomposition, failing to explicitly model the dual dependencies within traffic data (e.g., intra-cycle fluctuations and inter-cycle trends). This leads to deviations between the repaired data and the actual cyclical patterns, resulting in low reliability of the data repair.
[0081] The traffic data restoration method provided in this application can perform linear interpolation on initial traffic data to generate coarse restored data, and then map the coarse restored data to the frequency domain to obtain the flow amplitude characteristics of each frequency component. The flow amplitude characteristics of each frequency component can be filtered to obtain at least one key frequency component. Based on this key frequency component, the coarse restored data is then reconstructed to obtain multiple periodic reconstruction tensors. Finally, data restoration processing is performed on these multiple periodic reconstruction tensors to generate restored traffic data corresponding to the initial traffic data. In the above process, by explicitly modeling the multi-period spatiotemporal dependencies of traffic data and combining frequency domain analysis and a diffusion framework, high-precision, low-latency traffic flow data restoration can be achieved, improving the reliability of data restoration.
[0082] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0083] Figure 2 A flowchart illustrating the traffic data repair method provided in this application embodiment. Figure 1 .like Figure 2 As shown, the method may include:
[0084] S201. Perform linear interpolation on the initial traffic data to generate coarse repair data.
[0085] Initial traffic data One-dimensional time-series data collected by road sensors can include information such as traffic flow and vehicle speed at different times at various traffic nodes. However, the data may contain varying degrees of missing or abnormal information.
[0086] Rough data repair The complete one-dimensional time series data obtained after filling in missing values for coarse interpolation.
[0087] in, Represents the total timing length. This represents the number of traffic nodes in the road network.
[0088] For missing points in the initial traffic data, the basic values are filled in by using the effective time-series data adjacent to the missing locations, thus completing the data dimension.
[0089] The interpolation method can be a lightweight, shallow processing method that only repairs data gaps without performing deep noise reduction and feature reconstruction. It preserves the original periodic variation characteristics, random noise, and temporal correlation of traffic data to the greatest extent, providing continuous and complete one-dimensional time-series input for subsequent core processes such as node information aggregation, frequency domain periodic analysis, and temporal decoupling reconstruction.
[0090] S202. Based on the rough repair data, determine the flow amplitude characteristics of each frequency component.
[0091] The frequency domain is an analytical space that uses frequency as the independent variable to characterize the periodic changes of a signal. It corresponds to the time domain (which uses time as the independent variable) and can intuitively distinguish the components of different speeds and periods in traffic time series data.
[0092] Each frequency component refers to the fundamental harmonic component corresponding to different oscillation periods after the traffic time sequence signal is decomposed. Different components correspond to traffic change patterns at different time scales, such as short-term fluctuations, intraday fluctuations, and interday fluctuations.
[0093] Traffic flow amplitude characteristics are the magnitudes of the amplitudes corresponding to each frequency component. The higher the amplitude, the more significant the periodic pattern corresponding to that frequency is in the original traffic data.
[0094] Data can be roughly repaired The input message-passing neural network (MPNN) aggregates information from multiple traffic nodes to obtain temporal feature data that integrates node association features. ,in, This represents the number of feature channels.
[0095] Perform a Fast Fourier Transform (FFT) on the aggregated time-series feature data to transform the time-series feature data. The frequency domain is transformed to the frequency domain to obtain frequency domain feature data. The absolute value of the frequency domain feature data is taken and averaged along the feature channel dimension to finally obtain the flow amplitude characteristics of each frequency component, which is a one-dimensional amplitude sequence. This allows for the quantification of the intensity of each frequency component, thus completing the extraction of frequency components and flow amplitude characteristics.
[0096]
[0097] in, This represents the flow amplitude characteristics of each frequency component. To represent the Fast Fourier Transform, use and To get The average value of the channel.
[0098] The amplitude characteristics of the flow rate of each frequency component in the frequency domain represent the intensity of that frequency component, and the stronger its periodicity, the larger the amplitude.
[0099] For example, a certain road section has a total of 5 traffic nodes ( ), continuously collected 168 hours of traffic time-series data ( After aggregating node information via MPNN, a Fourier transform is performed to decompose the data into multiple frequency components, including daily, weekly, and short-term random fluctuations. Among these, the frequency component corresponding to intraday traffic fluctuations within 24 hours has the largest amplitude, representing the most prominent cyclical pattern of intraday morning and evening peak hours; the high-frequency component corresponding to minute-level abrupt changes has a smaller amplitude and is mostly random noise.
[0100] S203. The flow amplitude characteristics of each frequency component are screened to obtain at least one key frequency component.
[0101] Key frequency components are used to indicate the dominant and most regular periodic change patterns in traffic data, corresponding to the actual operating cycles of traffic flow within a day, during the day, and on a weekly basis.
[0102] In some embodiments, the frequency components are sorted according to the flow amplitude characteristics to obtain multiple sorted frequency components; the number of key components corresponding to the key frequency components is determined. , It is an integer greater than or equal to 1; among multiple sorted frequency components, the first... One frequency component is identified as at least one key frequency component.
[0103] Because some meaningless high frequencies are present in the frequency domain characteristics, thus introducing noise, only the flow amplitude characteristics of each frequency component are considered. Before the election Large amplitude .
[0104] The frequency components are sorted in descending order of amplitude value, with larger amplitudes indicating more significant periodic patterns in traffic data.
[0105] Based on business needs or preset rules, select the number of components K, remove high-frequency noise components with low amplitude (these components correspond to short-term random disturbances and sensor noise, and do not have effective periodic patterns), and retain only the top K high-frequency amplitude components as key frequency components.
[0106] Based on the amplitude magnitude, effective periodic signals and invalid noise are distinguished, and the core periodic features are screened and purified, providing a reliable basis for subsequent calculation of period length and time sequence reconstruction.
[0107] For example, traffic data for a city's road network was collected continuously for 168 hours. After frequency domain transformation, all frequency components and their corresponding amplitudes were obtained. All components were sorted in descending order of amplitude, with K=2. The components with the highest amplitudes after sorting corresponded to the 24-hour intraday cycle and the 7-day weekly cycle, respectively, representing the mainstream traffic flow patterns. The remaining high-order components were mostly minute-level random fluctuations and high-frequency noise generated by equipment interference, with extremely low amplitudes. Finally, these two components were selected as the key frequency components.
[0108] In this embodiment, high-frequency noise can be filtered out, reducing the impact of invalid interference on subsequent periodic modeling and improving the accuracy of periodic identification; the number of features can be simplified, redundant components can be eliminated, the amount of subsequent computation can be reduced, and the efficiency of algorithm operation can be guaranteed.
[0109] S204. Based on at least one key frequency component, reconstruct the coarsely repaired data to obtain multiple periodic reconstruction tensors.
[0110] In some embodiments, the timing segmentation point and period length corresponding to each key frequency component are determined; based on the timing segmentation point and period length corresponding to each key frequency component, the coarse repair data is reconstructed to obtain multiple period reconstruction tensors.
[0111] The specific process is as follows:
[0112]
[0113]
[0114] in, Before selecting amplitude value The amplitudes were determined, and the corresponding time points were used as time series segmentation points. , To select the period length corresponding to the amplitude value.
[0115] The Topk function is used to extract the original time series positions corresponding to the top K largest amplitudes selected from the data, which are then used as time series segmentation points. Combined with the total time series length L, the period length corresponding to each critical component is calculated using a formula. .
[0116] Tensor row dimension represents the traffic flow change characteristics within a single cycle, while column dimension represents the temporal correlation characteristics across cycles, achieving decoupling and separation of features within and between cycles.
[0117] In this embodiment, the conversion from one-dimensional time series to two-dimensional tensor can be completed, and the two types of change characteristics within and during the period can be explicitly decoupled, which is convenient for subsequent targeted modeling. The nonlinear coupling relationship between different periodic components is preserved, which is different from the traditional frequency domain decomposition method and restores the true correlation characteristics of traffic data.
[0118] S205. Perform data repair processing on multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
[0119] Repairing traffic data involves completing missing value imputation, noise filtering, and multi-period feature fusion to obtain complete one-dimensional time-series data that accurately reflects real traffic changes. The dimension is consistent with the initial traffic data. The instructions can be directly used for downstream operations such as traffic analysis and situation assessment.
[0120] In some embodiments, frequency filtering is performed on multiple periodic reconstruction tensors to obtain multiple periodic filtered data; feature integration processing is performed on the multiple periodic filtered data to obtain repaired traffic data.
[0121] The frequency domain filter is a lightweight frequency domain operation sub-network designed based on the convolution theorem. It consists of a single-channel mixer and multiple sets of 1×1 convolutions to form a learnable mask tensor. It can transform time-domain convolution operations into frequency-domain Hadamard products, effectively achieving the effect of dynamic large kernel convolution, while taking into account both global feature modeling capabilities and low computational overhead.
[0122] In this embodiment, time-series dependencies can be modeled globally, noise and real traffic flow changes can be distinguished, and the nonlinear coupling relationship of multi-period components can be fully preserved, significantly improving the quality of traffic data repair.
[0123] The traffic data restoration method provided in this application can perform linear interpolation on initial traffic data to generate coarse restored data, and then map the coarse restored data to the frequency domain to obtain the flow amplitude characteristics of each frequency component. The flow amplitude characteristics of each frequency component can be filtered to obtain at least one key frequency component. Based on this key frequency component, the coarse restored data is then reconstructed to obtain multiple periodic reconstruction tensors. Finally, data restoration processing is performed on these multiple periodic reconstruction tensors to generate restored traffic data corresponding to the initial traffic data. In the above execution process, by explicitly modeling the multi-period spatiotemporal dependencies of traffic data and combining frequency domain analysis and a diffusion framework, high-precision, low-latency traffic flow data restoration can be achieved, improving the reliability of data restoration.
[0124] Figure 3 Flowchart of the traffic data repair method provided in this application Figure 2 ,like Figure 3 As shown, in this embodiment... Figure 2 Based on the examples, the traffic data repair method is described in detail, which includes:
[0125] S301. Perform linear interpolation on the initial traffic data to generate coarse repair data.
[0126] S302. Based on the rough repair data, determine the flow amplitude characteristics of each frequency component.
[0127] S303. The flow amplitude characteristics of each frequency component are screened to obtain at least one key frequency component.
[0128] The execution process of S301-S304 can be found in the execution process of S201-S203, and will not be repeated here.
[0129] S304. Determine the timing segmentation point and period length corresponding to each key frequency component.
[0130] The time sequence segmentation point is the original time sequence position corresponding to the high amplitude frequency component in the frequency domain. It is the boundary point for periodically dividing the one-dimensional traffic time sequence and is used to divide different periodic units.
[0131] The cycle length is the time step contained in a single complete cycle, representing the time span required for traffic flow to complete one periodic change.
[0132] Example: Total time series length of the acquisition Hours, set the number of key components to select The two time-series segmentation points corresponding to the maximum amplitude were obtained through Topk filtering. ; Calculate the period length sequentially: , .in, , Corresponding to the 24-hour intraday cycle, , It corresponds to a 7-day weekly cycle.
[0133] S305. Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors.
[0134] The periodic reconstruction tensor is a multidimensional data tensor obtained by dividing, padding, and reshaping one-dimensional coarsely repaired data according to different period lengths. The tensor rows correspond to traffic flow changes within a single period, and the columns correspond to traffic flow changes across periods, thus achieving decoupling of features within and between periods.
[0135] In some embodiments, the initial tensor data corresponding to each cycle pattern is determined based on the time-series segmentation point and cycle length corresponding to each key frequency component; for any cycle pattern, the zero-padding length of the cycle pattern is determined based on the initial length and cycle length of the initial traffic data; and the initial tensor data corresponding to each cycle pattern is zero-padding processed according to the zero-padding length of each cycle pattern to obtain multiple cycle reconstruction tensors.
[0136] Based on the length of each period For rough repair data Perform length verification: If the total timing length cannot be divided by the period length, pad the data with zeros to make it an integer multiple of the period length.
[0137] The zero-padding one-dimensional time series data is reshaped according to the corresponding period length to generate multiple sets of two-dimensional periodic reconstruction tensors.
[0138] The refactoring process is as follows:
[0139]
[0140]
[0141] in, Indicates to The length of the roughly repaired data of the periodic pattern after zero-padding, and the reconstructed length of the th periodic pattern. The sequence in the periodic pattern is ,in, This represents the number of cycles in this cycle pattern. This represents the number of traffic nodes.
[0142] Figure 4 This is a schematic diagram illustrating time decoupling as provided in an embodiment of this application. Please refer to... Figure 4The light blue area at the bottom represents traffic time-series data within a one-dimensional continuous time interval. Through reshaping operations, this data is converted into two-dimensional data under different periodic patterns, forming the decoupled space above, including multiple sets of reconstruction results such as period 1, period 2, ..., period K. Taking period 1 as an example... The row relationships (indicated by orange arrows) correspond to changes within a single period, while the column relationships (indicated by green arrows) correspond to changes across periods. In this way, the intra-period changes coupled with the inter-period changes in the original one-dimensional time series are decoupled, ultimately yielding a set of reconstructed tensors. .
[0143] For example, assuming the total timing length Hour, , For period length , The length is divisible and does not require zero padding. The one-dimensional data is reshaped into a 24-row × 7-column tensor, where each row represents the traffic flow changes over a single day (24 hours) and each column represents the traffic flow changes over the same period (7 consecutive days). Regarding the period length... , The length is divisible and no zero padding is needed. The one-dimensional data is reshaped into a 7-row × 24-column tensor. Each row represents the traffic flow changes over 7 days of the week, and each column represents the traffic flow changes over 24 weekly periods at the same time. Finally, two sets of periodic reconstruction tensors are obtained, corresponding to the two typical periodic patterns of intraday and weekly.
[0144] S306. Perform frequency filtering on multiple periodic reconstructed tensors to obtain multiple periodic filtered data.
[0145] In some embodiments, a fast Fourier transform is performed on multiple periodic reconstruction tensors to generate frequency domain traffic data corresponding to each frequency domain component; the frequency domain traffic data corresponding to each frequency domain component is filtered using an adaptive mask tensor to obtain filtered traffic data corresponding to each frequency domain component; and an inverse Fourier transform is performed on the filtered traffic data corresponding to each frequency domain component to generate multiple periodic filtered data.
[0146] The frequency domain traffic data corresponding to each frequency domain component is a complex feature matrix containing global frequency information obtained by mapping the periodic reconstruction tensor from the time domain to the frequency domain. The components at different positions in the matrix correspond to traffic flow change components of different frequencies and phases.
[0147] The adaptive mask tensor is a weight matrix composed of learnable parameters, generated by a single-channel mixer and a 1×1 convolutional layer. It can adaptively adjust the weights for different frequency components, thereby enhancing the effective signal and suppressing noise.
[0148] The filtered traffic data corresponding to each frequency domain component is frequency domain feature data that has been processed by adaptive mask tensor weighting to remove invalid high-frequency noise and retain and enhance effective periodic components.
[0149] For any period, the reconstructed tensor is subjected to a Fast Fourier Transform (FFT) to convert the two-dimensional time-domain tensor into frequency-domain traffic data, thus fully preserving the global frequency information under that periodic pattern.
[0150] The specific process is as follows:
[0151]
[0152] in, Features at different locations in the frequency domain correspond to Different frequency components in the time domain, these components are processed by a time complexity of O(n). Transformation and from The global information is integrated together.
[0153] The frequency domain eigenvalues obtained by fast Fourier transforming the two-dimensional periodic reconstruction tensor are in complex form and represent the amplitude and phase of the corresponding frequency components. For frequency domain dimension index, the frequency number of the corresponding dimension within the period; This is a frequency domain dimension index, corresponding to the frequency number across the period dimension.
[0154] Reconstructing the tensor in the time domain period at position The original value at that location; For time-domain row indexes, the range of values is... , representing the temporal position within a single period; For time-domain column indexes, the value range is... , representing the sequence position across periods; The length of a single cycle; This represents the total number of cycles; The imaginary unit satisfies .
[0155] Applying the convolution theorem, frequency domain traffic data is combined with an adaptive mask tensor. The Hadamard product operation is performed, and the frequency domain components are filtered using learnable weights: invalid high-frequency components such as sensor noise and random fluctuations are suppressed, and effective frequency components corresponding to real changes in traffic flow (such as morning and evening peak hours and cross-cycle trends) are strengthened.
[0156] Perform an inverse Fourier transform (IFFT) on the filtered frequency domain traffic data to restore it to time domain data, thus obtaining the periodic filtered data in the corresponding periodic mode.
[0157] It can be represented as:
[0158]
[0159] in, This represents the Hadamard product. This represents the inverse Fourier transform, which is used to make the network as lightweight as possible. Composed of a single-channel mixer and Group Convolutional layer implementation.
[0160] Since the product of two signals in the Fourier domain is equal to the Fourier transform of their convolution in the time domain:
[0161]
[0162] So,
[0163]
[0164] in, It is a with Tensors of the same shape.
[0165] Therefore, the proposed adaptive frequency domain filter can be regarded as... Dynamic convolutional kernels of the same size.
[0166] In this embodiment, based on the convolution theorem, the Hadamard product in the frequency domain is equivalent to the dynamic large kernel convolution in the time domain, which can achieve global spatiotemporal dependency modeling without stacking multiple layers of convolutional networks.
[0167] For example, taking the intraday cycle reconstruction tensor corresponding to cycle 1 as an example, firstly, an FFT is performed on the 24-row × 7-column two-dimensional tensor to obtain the corresponding frequency domain traffic data, where the low-frequency components correspond to the intraday morning and evening peak patterns, and the high-frequency components correspond to short-term random noise. An adaptive masking tensor is used to weight the frequency domain components, assigning high weights to the low-frequency components representing morning and evening peaks and low weights to the high-frequency components representing noise, resulting in filtered frequency domain traffic data. An IFFT is then performed on the filtered frequency domain data to restore the time domain data, i.e., the cycle-filtered data under the intraday cycle pattern. This data retains the intraday peak variation pattern while effectively filtering out short-term noise interference. The above operations are repeated for other cycle reconstruction tensors such as cycle 2 and cycle k, ultimately obtaining the cycle-filtered data corresponding to all cycle patterns.
[0168] S307. Perform feature integration processing on multiple periodic filtered data to obtain repaired traffic data.
[0169] Multiple periodically filtered data can be fused into the overall temporal features to obtain repaired traffic data. And output it.
[0170] Based on the periodic rules corresponding to the filtered data of each period, the data in the two-dimensional tensor format is inversely mapped back to the original one-dimensional time series structure.
[0171] Based on the time-series location alignment method, the multi-scale periodic features such as intraday and weekly are weighted and fused to retain the effective traffic flow change patterns under each periodic mode and remove residual noise and invalid interference.
[0172] The data is uniformly standardized into a complete one-dimensional time series with the same dimension as the initial collected data, a time series length of L, and a number of traffic nodes of N, which is the traffic data to be repaired.
[0173] The Conditional Multi-Period Diffusion Network (CMDN) model provided in this application embodiment can achieve the above execution process. Below, in conjunction with... Figure 6 Explain the overall architecture.
[0174] Figure 5 This is a schematic diagram illustrating the architecture of a traffic data repair method provided in an embodiment of this application. Please refer to [link / reference]. Figure 5 Spatial topology information is extracted based on the road network adjacency matrix A, and the original traffic time series data is processed. Masking is performed, and coarsely repaired data is obtained through linear interpolation. Next, The input features are concatenated with the noise ξ obtained from noise sampling to obtain the input features. ; then, The input conditional information module mines spatial relationships in the road network using a graph convolutional network (GCN), and simultaneously decouples and filters intra- and inter-period features of traffic flow through a frequency decomposition transform (FDT) module (including a time decomposition module and an adaptive frequency domain filter), outputting conditional features. Simultaneously, the diffusion time is embedded into T and incorporated into the conditional features, which are then input into the noise prediction module. Finally, the noise prediction module predicts and removes noise in multiple iterations, ultimately outputting repaired traffic data. The intermediate layer features can be passed to the next layer for further optimization.
[0175] Figure 6 This is a schematic diagram illustrating a convolutional comparison provided for an embodiment of this application. Please refer to... Figure 6 ,exist Figure 6 On the left is the traditional temporal convolution operation, which is limited by local perception and has difficulty distinguishing high-frequency noise from real traffic flow changes (such as congestion caused by accidents). If stacking dynamic large kernel convolutions improves perception, it will significantly increase computational complexity.
[0176] exist Figure 6The right side shows an adaptive frequency domain filter with a sub-network structure equivalent to dynamic large kernel convolution. This network structure is designed based on the convolution theorem of inverse Fourier transform, which states that convolution in the time domain is mathematically equivalent to the Hadamard product in the Fourier domain. By mapping the convolution operation to the Fourier domain, targeted denoising and missing data repair are achieved by utilizing the spectral consistency across multiple periods, effectively modeling global features and significantly reducing computational overhead.
[0177] The traffic data restoration method provided in this application improves the reliability of data restoration by performing key frequency screening, multi-scale period segmentation, and period length calculation on coarsely restored data, combined with time-domain tensor reconstruction, frequency-domain mask filtering, and multi-period feature integration. This achieves bidirectional decoupling and accurate modeling of subtle fluctuations within a traffic time series data period and global changes across periods. Frequency-domain screening extracts the inherent core periodic components of traffic flow and accurately calculates the time series segmentation points and period length, solving the problem that traditional time series modeling cannot adaptively match multi-scale traffic periodic patterns. Dimensional reconstruction converts the one-dimensional coupled time series into a two-dimensional periodic tensor, achieving decoupling of features within and during periods, fully releasing the potential spatiotemporal characteristics of traffic time series. Adaptive frequency-domain mask filtering accurately filters out invalid high-frequency components such as random noise and abrupt interference, preserving the true traffic periodic change patterns within days and weeks. Finally, multiple sets of periodic filtering features at different scales are globally integrated and restored, achieving complementary fusion of effective features at multiple scales. It effectively avoids problems such as noise overfitting, loss of periodic features, insufficient modeling of long time-series dependencies, and distortion of smoothness in repair results. It significantly improves the repair accuracy and robustness of traffic data in complex missing and noisy scenarios. At the same time, it greatly reduces the computational cost of the model by relying on lightweight frequency domain operations, and can efficiently output high-quality repaired traffic data that is dimensionally regular, temporally continuous, and conforms to the real traffic evolution law.
[0178] Figure 7 This is a schematic diagram of a traffic data repair device provided in an embodiment of this application. Please refer to... Figure 7 The traffic data repair device 700 may include a linear interpolation module 701, a mapping module 702, a filtering module 703, a reconstruction module 704, and a repair module 705.
[0179] The linear interpolation module 701 is used to perform linear interpolation on the initial traffic data to generate coarsely repaired data;
[0180] The mapping module 702 is used to map the coarse repair data to the frequency domain space to obtain the flow amplitude characteristics of each frequency component;
[0181] The filtering module 703 is used to filter the flow amplitude characteristics of each frequency component to obtain at least one key frequency component.
[0182] The reconstruction module 704 is used to reconstruct the initial traffic data based on at least one key frequency component to obtain multiple periodic reconstruction tensors.
[0183] The repair module 705 is used to perform data repair processing on multiple periodic reconstructed tensors to generate repaired traffic data corresponding to the initial traffic data.
[0184] In one possible implementation, the repair module 705 is specifically used for:
[0185] Frequency filtering is performed on multiple periodic reconstructed tensors to obtain multiple periodic filtered data;
[0186] Feature integration processing is performed on multiple periodically filtered data to obtain repaired traffic data.
[0187] In one possible implementation, the repair module 705 is specifically used for:
[0188] Perform a fast Fourier transform on the reconstructed tensors of multiple cycles to generate frequency domain traffic data corresponding to each frequency domain component;
[0189] By using an adaptive mask tensor, the frequency domain traffic data corresponding to each frequency domain component is filtered to obtain the filtered traffic data corresponding to each frequency domain component.
[0190] Perform an inverse Fourier transform on the filtered traffic data corresponding to each frequency domain component to generate multiple periodic filtered data.
[0191] In one possible implementation, the reconstruction module 704 is specifically used for:
[0192] Determine the timing segmentation points and period lengths corresponding to each key frequency component;
[0193] Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors.
[0194] In one possible implementation, the reconstruction module 704 is specifically used for:
[0195] Based on the time segmentation points and period lengths corresponding to each key frequency component, determine the initial tensor data corresponding to each periodic pattern;
[0196] For any given cycle pattern, the zero-padding length of the cycle pattern is determined based on the initial length and cycle length of the initial traffic data.
[0197] Based on the zero-padding length of each periodic pattern, the initial tensor data corresponding to the periodic pattern is zero-padding to obtain multiple periodic reconstructed tensors.
[0198] In one possible implementation, the mapping module 702 is specifically used for:
[0199] The roughly repaired data is aggregated to obtain time-series feature data;
[0200] Time-series feature data is mapped to the frequency domain space to obtain frequency domain feature data;
[0201] The absolute values of the frequency domain feature data are averaged along the feature channel dimension to obtain the flow amplitude characteristics of each frequency component.
[0202] In one possible implementation, the filtering module 703 is specifically used for:
[0203] Based on the characteristics of the flow amplitude, the frequency components are sorted to obtain multiple sorted frequency components.
[0204] Determine the number K of key components corresponding to key frequency components, where K is an integer greater than or equal to 1;
[0205] Among multiple sorted frequency components, the top K frequency components are identified as at least one key frequency component.
[0206] The traffic data repair device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0207] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 8 The electronic device 800 may include at least one processor 801 and a memory 802. Exemplarily, the processor 801 and the memory 802 are interconnected via a bus 803.
[0208] The 802 memory stores instructions executed by the computer;
[0209] The processor 801 executes computer execution instructions stored in the memory 802, causing the processor 801 to perform the traffic data repair method as shown in the above method embodiment.
[0210] Accordingly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the traffic data repair method of the above-described method embodiments.
[0211] Accordingly, embodiments of this application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the traffic data repair method shown in the above method embodiments.
[0212] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0213] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0214] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0215] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0216] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0217] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0218] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0219] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0220] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of this application.
Claims
1. A traffic data repair method, characterized in that, include: The initial traffic data is linearly interpolated to generate coarsely repaired data. Based on the rough repair data, the flow amplitude characteristics of each frequency component are determined; The flow amplitude characteristics of each frequency component are screened to obtain at least one key frequency component. Based on the at least one key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors; Data repair processing is performed on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
2. The method according to claim 1, characterized in that, Data repair processing is performed on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data, including: The multiple periodic reconstructed tensors are subjected to frequency filtering to obtain multiple periodic filtered data. The repaired traffic data is obtained by performing feature integration processing on the multiple periodically filtered data.
3. The method according to claim 2, characterized in that, Frequency filtering is performed on the multiple periodic reconstruction tensors to obtain multiple periodic filtered data, including: Perform a Fast Fourier Transform on the multiple periodic reconstruction tensors to generate frequency domain traffic data corresponding to each frequency domain component; By using an adaptive mask tensor, the frequency domain traffic data corresponding to each frequency domain component is filtered to obtain the filtered traffic data corresponding to each frequency domain component. Perform an inverse Fourier transform on the filtered traffic data corresponding to each frequency domain component to generate the multiple periodic filtered data.
4. The method according to any one of claims 1-3, characterized in that, Based on the at least one key frequency component, the coarsely repaired data is reconstructed to obtain multiple periodic reconstruction tensors, including: Determine the timing segmentation points and period lengths corresponding to each key frequency component; Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the coarsely repaired data is reconstructed to obtain the multiple period reconstruction tensors.
5. The method according to claim 4, characterized in that, Based on the time-series segmentation points and period lengths corresponding to each key frequency component, the initial traffic data is reconstructed to obtain the multiple periodic reconstruction tensors, including: Based on the time segmentation points and period lengths corresponding to each key frequency component, determine the initial tensor data corresponding to each periodic mode; For any given cycle pattern, the zero-padding length of the cycle pattern is determined based on the initial length of the initial traffic data and the cycle length. Based on the zero-padding length of each periodic pattern, the initial tensor data corresponding to the periodic pattern is zero-padding processed to obtain the multiple periodic reconstructed tensors.
6. The method according to any one of claims 1-3, characterized in that, Based on the coarsely repaired data, the flow amplitude characteristics of each frequency component are determined, including: The coarsely repaired data is aggregated to obtain time-series feature data; The time-series feature data is mapped to the frequency domain space to obtain frequency domain feature data; The absolute values of the frequency domain feature data are averaged along the feature channel dimension to obtain the flow amplitude characteristics of each frequency component.
7. The method according to any one of claims 1-3, characterized in that, The flow amplitude characteristics of each frequency component are filtered to obtain at least one key frequency component, including: Based on the flow amplitude characteristics, the frequency components are sorted to obtain multiple sorted frequency components; Determine the number K of key components corresponding to the key frequency components, where K is an integer greater than or equal to 1; The first K frequency components among the plurality of sorted frequency components are determined as at least one key frequency component.
8. A traffic data repair device, characterized in that, It includes a linear interpolation module, a mapping module, a filtering module, a reconstruction module, and a repair module: The linear interpolation module is used to perform linear interpolation on the initial traffic data to generate coarsely repaired data; The mapping module is used to determine the flow amplitude characteristics of each frequency component based on the coarse repair data. The filtering module is used to filter the flow amplitude characteristics of each frequency component to obtain at least one key frequency component. The reconstruction module is used to reconstruct the initial traffic data based on the at least one key frequency component to obtain multiple periodic reconstruction tensors. The repair module is used to perform data repair processing on the multiple periodic reconstruction tensors to generate repaired traffic data corresponding to the initial traffic data.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.