Traffic state data interpolation method and device, electronic equipment and readable storage medium
By constructing a heterogeneous graph attention network model and integrating spatial and temporal characteristics, the problem of ignoring the structure and temporal heterogeneity of road network in the prior art is solved, and robust traffic state interpolation is achieved in the case of sparse data.
Patent Information
- Application Number
- CN202510297338.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing traffic data missing interpolation technology ignores the complex road network structure information and time heterogeneity, making it difficult to obtain better interpolation performance when traffic data is extremely sparse.
By constructing a heterogeneous graph attention network model that takes into account spatial and temporal factors, potential features of spatial and temporal perspectives are extracted, and missing traffic state data is interpolated through feature fusion.
Provide robust traffic state interpolation at different missing ratios, improving the accuracy and robustness of interpolation, and enhancing the interpretability and adaptability of the model.
Smart Images

Figure CN119811094A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of traffic data analysis and prediction, and in particular to a traffic status data interpolation method, device, electronic device and readable storage medium. Background Art
[0002] Intelligent transportation systems and navigation applications rely on real-time data of traffic status, which is usually collected through urban GPS trajectories. However, due to observation uncertainty and limitations of crowdsourcing systems, the collected traffic data has serious missing value problems, which poses a challenge to the accurate estimation of traffic status.
[0003] Currently, existing research on the problem of missing traffic data can be divided into two categories: (1) Tensor-based methods: Although they can discover spatiotemporal patterns from partially observed matrices or tensors and interpolate missing values, these models are sensitive to observation noise and sparse uncertainty, and have limited interpolation accuracy when dealing with extremely sparse observation tensors; (2) Methods based on deep learning models: Although they can learn spatiotemporal patterns from existing spatiotemporal data, they are difficult to implement in complex spatiotemporal scenarios, and some methods ignore low-level road sections when simplifying the road network, which limits their ability to interpolate the entire network in sparse scenarios.
[0004] Therefore, existing traffic data missing interpolation techniques ignore the complex road network structure information and temporal heterogeneity, making it difficult to obtain better interpolation performance when traffic data is extremely sparse. Summary of the invention
[0005] The main technical problem solved by the present invention is to provide a traffic status data interpolation method, device, electronic device and readable storage medium, which can provide robust interpolation of traffic status under different missing ratios by integrating spatial and temporal heterogeneous features.
[0006] In order to solve the above technical problems, a technical solution adopted by the present invention is to provide a traffic status data interpolation method, the method comprising: Acquire original GPS data, preprocess the original GPS data to obtain a preprocessed vehicle trajectory data set, and generate a traffic speed tensor based on the preprocessed vehicle trajectory data set; Based on the traffic speed tensor, a heterogeneous graph attention network model considering spatial and temporal factors is constructed in spatial and temporal perspectives; Utilizing the heterogeneous graph attention network model, extracting latent features from spatial and temporal perspectives, and interpolating missing traffic status data by fusing the latent features; and Output the interpolation results of traffic status data to achieve accurate estimation of missing data.
[0007] Among them, based on the traffic speed tensor, a heterogeneous graph attention network model considering spatial and temporal factors is constructed in spatial and temporal perspectives, specifically including: Obtain a road segment mapping dataset, and take each road in the road network as a node, create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph; wherein the road segment mapping dataset is obtained by mapping the GPS data after cleaning abnormal GPS data points to the corresponding road segment of the road network; Extracting a time series data set from the road segment mapping data set, taking each time segment on the time dimension as a node, and defining dynamic connections between capture time segments according to the periodicity and continuity of time to construct a time heterogeneous graph; According to the road characteristics of the spatial nodes and the time attributes of the time nodes, a complete spatiotemporal feature description is provided for each node in the spatial heterogeneous graph and the time heterogeneous graph to obtain the node characteristics of the spatial heterogeneous graph and the time heterogeneous graph; Based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependencies between spatial and temporal nodes are learned and refined through the unit path and multi-path attention mechanisms, and a heterogeneous graph attention network model that considers spatial and temporal factors is constructed.
[0008] Among them, the road segment mapping dataset is obtained, and each road in the road network is used as a node to create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph, including: Based on the road segment mapping dataset, each road is defined as a node in the graph, and links between nodes are established according to actual connectivity between roads to form a basic node and link framework of the spatial heterogeneous graph; and Utilizing Meta Paths Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments to construct a spatially heterogeneous graph that captures and analyzes the spatial connections and interactions between roads; A time series data set is extracted from the road segment mapping data set, and each time segment on the time dimension is used as a node. Dynamic connections between capture time periods are defined according to the periodicity and continuity of time to construct a time heterogeneous graph, which specifically includes: Extracting a time series data set from the road segment mapping data set, identifying and dividing time windows, and recording traffic state observation information in each time window; Each time segment is regarded as a node in the graph to define the time node in the time heterogeneous graph, and the links and meta-paths are defined according to the relative order and periodicity of the time windows to transform them into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships; defines metapaths Represents the connection between adjacent time segments based on hourly relations; For each meta path and Create a 0-1 adjacency matrix respectively ; Wherein, the adjacency matrix represents the connection status between time nodes; The graph is constructed using nodes and links to reflect the spatiotemporal relationship between time periods, and the time nodes, links and adjacency matrix are integrated to form a complete time-heterogeneous graph.
[0009] Among them, based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependency relationship between spatial and temporal nodes is learned and refined through the unit path and multi-path attention mechanism, and a heterogeneous graph attention network model considering spatial and temporal factors is constructed, which specifically includes: Based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, a unit path attention mechanism is applied to evaluate and integrate the importance of the node neighborhood, and the original feature representation of the node is transformed and weightedly aggregated to generate a unit path-based node representation; and Based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate a node potential feature vector with comprehensive spatiotemporal characteristics.
[0010] Among them, based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate a node potential feature vector with comprehensive spatiotemporal features, specifically including: Use a multi-layer perceptron to perform nonlinear transformation on the node feature representation of each unit path to obtain the node representation transformed by the multi-layer perceptron; The attention vector is used to weight the node representation after the multi-layer perceptron transformation, and the importance score of each node in a specific meta-path is obtained by calculating the weighted sum of each meta-path. The importance score of each node in a specific meta-path is calculated by formula (4). represents a specific meta-path in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector in the multilayer perceptron, Representation Node i In the meta path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents a nonlinear activation function in the multilayer perceptron; represents the importance score; (4) According to the importance score of each node in a specific meta-path, the node representations of all meta-paths are weighted summed to obtain the final potential feature vector of each node F ; Among them, the final potential feature vector of each node is calculated by formula (5) F ; Indicates that the node is in the meta path The nodes on represent, p The number of paths representing the meta-path set; (5).
[0011] The established heterogeneous graph model is used to extract potential features from spatial and temporal perspectives, and the missing traffic status data is interpolated by fusing the potential features, specifically including: The inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models is calculated by inner product fusion to generate a fused traffic state fusion matrix; wherein the inner product is calculated by formula (6); represents the spatial latent feature matrix output by the spatial heterogeneous graph model, represents the temporal latent feature matrix output by the temporal heterogeneous graph model, b represents the batch size, k Indicates the number of spatial attributes / temporal attributes, represents the inner product fusion function; (6) The spatial and temporal potential features are mapped and fused into a high-dimensional tensor through low-rank multimodal fusion, and a low-dimensional feature representation that integrates multimodal information is generated through tensor outer product calculation and weight tensor decomposition; wherein, the tensor outer product calculation is performed through formula (7); the weight tensor decomposition calculation is performed through formula (8); and the low-dimensional feature representation is generated through formula (9); represents the high-dimensional tensor obtained by calculating the outer product of tensors, representing the input feature vector of each mode, M represents the number of modes, For all modes m Perform tensor outer product calculations; Indicates i The decomposition factor is m vector on the modes, r Represents the weight tensor W The decomposition rank of h Representing the low-dimensional feature representation; (7) (8) (9) The low-dimensional feature representation of the multimodal information is used to interpolate missing traffic status data.
[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is to provide a traffic status data interpolation device, the device comprising: A trajectory preprocessing unit, configured to obtain raw GPS data, preprocess the raw GPS data to obtain a preprocessed vehicle trajectory data set, and generate a traffic speed tensor based on the preprocessed vehicle trajectory data set; A heterogeneous graph model building unit, configured to build a heterogeneous graph attention network model that considers spatial and temporal factors in spatial and temporal perspectives based on the traffic speed tensor generated by the trajectory preprocessing unit; a spatiotemporal feature fusion unit, configured to extract latent features from spatial and temporal perspectives by using the heterogeneous graph attention network model established by the heterogeneous graph model establishment unit, and interpolate missing traffic status data by fusing the latent features; and The interpolation result output unit is used to output the interpolation result of the traffic status data according to the spatiotemporal features fused by the spatiotemporal feature fusion unit, so as to achieve accurate estimation of the missing data.
[0013] Wherein, the heterogeneous graph model building unit includes: A spatial heterogeneous graph construction module is used to obtain the road segment mapping data set generated by the trajectory preprocessing unit, and take each road in the road network as a node, create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph; wherein the road segment mapping data set is obtained by the trajectory preprocessing unit mapping the GPS data after cleaning the abnormal GPS data points to the corresponding road segment of the road network; A time heterogeneous graph construction module is used to obtain the road segment mapping data set generated by the trajectory preprocessing unit, extract the time series data set from the road segment mapping data set, take each time segment on the time dimension as a node, define the dynamic connection between the capture time periods according to the periodicity and continuity of time, so as to construct a time heterogeneous graph; A node feature representation module, for providing a complete spatiotemporal feature description for each node in the spatial heterogeneous graph and the temporal heterogeneous graph according to the road features of the spatial nodes captured by the spatial heterogeneous graph construction module and the time attributes of the time nodes captured by the temporal heterogeneous graph construction module, so as to obtain the node features of the spatial heterogeneous graph and the temporal heterogeneous graph; The attention learning module is used to learn and refine the dependencies of spatial and temporal nodes based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module through unit path and multi-path attention mechanisms, and to build a heterogeneous graph attention network model that takes spatial and temporal factors into consideration.
[0014] Wherein, the spatial heterogeneous graph construction module is specifically used for: Based on the road segment mapping dataset, each road is defined as a node in the graph, and links between nodes are established according to actual connectivity between roads to form a basic node and link framework of the spatial heterogeneous graph; and Utilizing Meta Paths Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments to construct a spatially heterogeneous graph that captures and analyzes the spatial connections and interactions between roads; The temporal heterogeneous graph construction module is specifically used for: Extracting a time series data set from the road segment mapping data set, identifying and dividing time windows, and recording traffic state observation information in each time window; Each time segment is regarded as a node in the graph to define the time node in the time heterogeneous graph, and the links and meta-paths are defined according to the relative order and periodicity of the time windows to transform them into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships; defines metapaths Represents the connection between adjacent time segments based on hourly relations; For each meta path and Create a 0-1 adjacency matrix respectively ; Wherein, the adjacency matrix represents the connection status between time nodes; The graph is constructed using nodes and links to reflect the spatiotemporal relationship between time periods, and the time nodes, links and adjacency matrix are integrated to form a complete time-heterogeneous graph.
[0015] Wherein, the attention learning module includes: a unit path attention learning submodule, for evaluating and integrating the importance of node neighborhoods based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module, applying a unit path attention mechanism, and transforming and weightedly aggregating the original feature representation of the node to generate a unit path-based node representation; and The multi-path attention learning submodule is used to perform multi-path attention weight calculation and weighted aggregation processing of semantic information based on the node representation of the unit path generated by the unit path attention learning submodule to generate a node potential feature vector with comprehensive spatiotemporal features.
[0016] The multi-path attention learning submodule is specifically used for: Use a multi-layer perceptron to perform nonlinear transformation on the node feature representation of each unit path to obtain the node representation transformed by the multi-layer perceptron; The attention vector is used to weight the node representation after the multi-layer perceptron transformation, and the importance score of each node in a specific meta-path is obtained by calculating the weighted sum of each meta-path. The importance score of each node in a specific meta-path is calculated by formula (4). represents a specific meta-path in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector in the multilayer perceptron, Representation Node i In the meta path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents a nonlinear activation function in the multilayer perceptron; represents the importance score; (4) According to the importance score of each node in a specific meta-path, the node representations of all meta-paths are weighted summed to obtain the final potential feature vector of each node F ; Among them, the final potential feature vector of each node is calculated by formula (5) F ; Indicates that the node is in the meta path The nodes on represent, p The number of paths representing the meta-path set; (5).
[0017] Wherein, the spatiotemporal feature fusion unit comprises: An inner product fusion module is used to calculate the inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models through inner product fusion to generate a fused traffic state fusion matrix; wherein the inner product is calculated by formula (6); represents the spatial latent feature matrix output by the spatial heterogeneous graph model, represents the temporal latent feature matrix output by the temporal heterogeneous graph model, b represents the batch size, k Indicates the number of spatial attributes / temporal attributes, represents the inner product fusion function; (6) A low-rank multimodal fusion module is used to map and fuse the potential features of space and time into a high-dimensional tensor through low-rank multimodal fusion, and generate a low-dimensional feature representation that integrates multimodal information through tensor outer product calculation and weight tensor decomposition; wherein, the tensor outer product calculation is performed through formula (7); the weight tensor decomposition calculation is performed through formula (8); and the low-dimensional feature representation is generated through formula (9); Z represents a high-dimensional tensor obtained by calculating the outer product of tensors, represents the input feature vector for each mode, M represents the number of modes, For all modes m Perform tensor outer product calculations; Indicates i The decomposition factor is m vector on the modes, r Represents the weight tensor W The decomposition rank of h Representing the low-dimensional feature representation; (7) (8) (9) The interpolation result generation module is used to interpolate the missing traffic status data using the low-dimensional feature representation of the multimodal information.
[0018] To solve the above technical problems, another technical solution adopted by the present invention is: to provide an electronic device, including: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes the steps of the traffic status data interpolation method as described above.
[0019] In order to solve the above technical problems, another technical solution adopted by the present invention is: providing a readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the steps of the traffic status data interpolation method as described above.
[0020] The present invention provides a method, device, electronic device and readable storage medium for interpolating traffic status data. By using the heterogeneous graph attention mechanism, the model can learn the importance of adjacent nodes in space and time, so that the model can still maintain a high prediction accuracy when facing sparse data or noise data, thereby more accurately predicting the traffic status and revealing the pattern of evaluating the importance of adjacent road sections or time periods, providing the interpretability of model prediction; providing two strategies of inner product fusion and low-rank multimodal fusion, providing more accurate traffic status interpolation under different missing ratios. Combining deep learning technology with graph networks, the model can learn complex patterns from large-scale spatiotemporal data and effectively process missing data to adapt to different traffic scenarios and data missing situations, and has good generalization ability; improves the accuracy and robustness of missing interpolation of traffic status data, and also enhances the interpretability and adaptability of the model, providing more accurate and real-time traffic status information for intelligent transportation systems and navigation applications, and helps to improve the efficiency and effectiveness of traffic management. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a traffic status data interpolation method in an embodiment of the present invention; Figure 2 yes Figure 1 A schematic diagram of a method flow chart of an embodiment of step S10; Figure 3 yes Figure 2 A schematic diagram of a method flow of an embodiment of step S101; Figure 4 yes Figure 2 A method flow diagram of an embodiment of step S102; Figure 5 yes Figure 1 A schematic diagram of a method flow chart of an embodiment of step S11; Figure 6 yes Figure 5 A schematic diagram of a method flow of an embodiment of step S113; Figure 7 yes Figure 6 A method flow diagram of an embodiment of step S1131; Figure 8 yes Figure 1 A method flow diagram of an embodiment of step S12; Fig. 9 is a functional structure diagram of a traffic status data interpolation device in an embodiment of the present invention; Fig.10 yes Fig. 9 A functional structural diagram of an embodiment of a trajectory preprocessing unit in FIG. Fig.11 yes Fig. 9 A functional structure diagram of an embodiment of a heterogeneous graph model building unit in; Fig.12 yes Fig.11 A functional structural diagram of an embodiment of an attention learning module in FIG. Fig.13 yes Fig. 9 A functional structure diagram of an embodiment of a spatiotemporal feature fusion unit in FIG. Fig.14 It is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present invention.
[0022] The reference numerals in the above drawings are described as follows: 30. Traffic status data interpolation device; 31. Trajectory preprocessing unit; 310. Data cleaning module; 311. Map matching module; 312. Velocity tensor calculation module; 32. Heterogeneous graph model building unit; 320. Spatial heterogeneous graph building module; 321. Temporal heterogeneous graph building module; 322. Node feature representation module; 323. Attention learning module; 3230. Unit path attention learning submodule; 3231. Multi-path attention learning submodule; 33. Spatiotemporal feature fusion unit; 330. Inner product fusion module; 331. Low-rank multimodal fusion module; 332. Interpolation result generation module; 34. Interpolation result output unit; 4. Electronic device; 41. Processor; 42. Input device; 43. Output device; 44. Memory; 45. Computer program; DETAILED DESCRIPTION
[0023] In order to explain in detail the possible application scenarios, technical principles, specific schemes that can be implemented, and the purposes and effects that can be achieved, the following is a detailed description of the specific embodiments listed in conjunction with the accompanying drawings. The embodiments described herein are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0024] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The term "embodiment" appearing in various places in the specification does not necessarily refer to the same embodiment, nor does it particularly limit its independence or association with other embodiments. In principle, in the present application, as long as there is no technical contradiction or conflict, the various technical features mentioned in the embodiments can be combined in any way to form a corresponding implementable technical solution.
[0025] Unless otherwise defined, the technical terms used in this document have the same meanings as those generally understood by those skilled in the art to which this application belongs; the use of relevant terms in this document is only for describing specific embodiments and is not intended to limit this application.
[0026] In the description of this application, the term "and / or" is an expression used to describe the logical relationship between objects, indicating that three relationships may exist, for example, A and / or B, which means: A exists, B exists, and A and B exist at the same time. In addition, the character " / " in this article generally indicates that the objects before and after are in an "or" logical relationship.
[0027] In the present application, terms such as “first” and “second” are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship of quantity, priority or sequence between these entities or operations.
[0028] Without further limitations, in this application, the words "include", "comprises", "has" or other similar open-ended expressions used in sentences are intended to cover non-exclusive inclusion. These expressions do not exclude the presence of additional elements in the process, method or product including the elements, so that the process, method or product including a series of elements may include not only those limited elements, but also other elements not explicitly listed, or also include elements inherent to such process, method or product.
[0029] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than", "less than", "exceed" and the like are understood to exclude the number itself; expressions such as "above", "below", "within" and the like are understood to include the number itself. In addition, in the description of the embodiments of this application, "multiple" means more than two (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups", "multiple times", etc., unless otherwise clearly and specifically limited.
[0030] In the description of the embodiments of the present application, space-related expressions used, such as "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "vertical", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc., indicate the orientation or position relationship based on the orientation or position relationship shown in the specific embodiments or drawings, and are only for the convenience of describing the specific embodiments of the present application or facilitating the reader's understanding, and do not indicate or imply that the referred device or component must have a specific position, a specific orientation, or be constructed or operated in a specific orientation, and therefore cannot be understood as a limitation on the embodiments of the present application.
[0031] Traffic status is an important factor in intelligent transportation systems and navigation applications. Complex and dynamic time series traffic status needs to be collected from many traffic sensors. Traffic data collected through observation or crowdsourcing systems have serious missing values, making it difficult to make a good estimate of traffic status. In the existing technology, the problem of missing traffic data is usually solved by tensor-based methods or deep learning model-based methods.
[0032] Tensor-based methods, i.e., discover spatiotemporal patterns from partial observation matrices or tensors with spatial and temporal resolution and interpolate missing values based on these dependencies. To this end, most studies apply matrix or tensor factorization techniques to complete the missing traffic volume, for example, by capturing the statistical information of dynamic traffic flow and temporal periodicity to analyze the probabilistic components to estimate the missing traffic volume; or, convert the spatiotemporal traffic data into observed tensors to capture the temporal correlation of adjacent road segments. However, these models are sensitive to observation noise and sparse uncertainty, and their interpolation accuracy is quite limited when dealing with extremely sparse observation tensors. Methods based on deep learning models, i.e., learn spatiotemporal patterns from existing spatiotemporal data and then use the learned dependencies to interpolate missing values. For example, a single spatiotemporal structure is analyzed from missing traffic data, but they are difficult to implement in complex spatiotemporal scenarios, which also makes it impossible to interpolate the entire road network well in extremely sparse scenarios.
[0033] It can be seen that the existing traffic data missing interpolation technology ignores the complex road network structure information and temporal heterogeneity, which makes it difficult to achieve better performance when the traffic data is extremely sparse. If the road network is used as prior knowledge to regulate the traffic status of adjacent road sections and explore the relationship between adjacent nodes in heterogeneous space or time graphs, the model can provide robust interpolation for missing traffic status under various missing ratios.
[0034] The traffic status data interpolation method provided in the embodiment of the present invention constructs a multi-view heterogeneous graph network model with space and time, and by integrating spatial and temporal heterogeneous features, the model can provide robust interpolation for traffic status under different missing ratios.
[0035] See also Figure 1 , is a flow chart of a traffic status data interpolation method according to an embodiment of the present invention, the method comprising: Step S10, acquiring original GPS data, preprocessing the original GPS data to obtain a preprocessed vehicle trajectory data set, and generating a traffic speed tensor based on the preprocessed vehicle trajectory data set.
[0036] Step S11, based on the traffic speed tensor, construct a heterogeneous graph attention network model that considers spatial and temporal factors in spatial and temporal perspectives.
[0037] Specifically, "constructing heterogeneous graph models in spatial and temporal perspectives" means: in the spatial perspective, constructing a spatial heterogeneous graph model based on the connectivity and traffic tensor data of the road sections; in the temporal perspective, constructing a temporal heterogeneous graph model based on the traffic speed tensor data of the time series.
[0038] Step S12, using the established heterogeneous graph attention network model to extract potential features from spatial and temporal perspectives, and interpolating missing traffic status data by fusing the potential features.
[0039] Specifically, "by performing feature fusion on the latent features" is specifically: calculating the dot product of spatial and temporal features through inner product fusion to capture the interaction between spatial and temporal features; performing tensor decomposition through low-rank multimodal fusion (LMF) to map high-dimensional features to low-dimensional space, process high-dimensional sparse data and enhance the generalization ability of the model to perform feature fusion on the latent features.
[0040] Step S13: output the interpolation result of the traffic status data to achieve accurate estimation of the missing data.
[0041] Please also see Figure 2 Specifically, the GPS data preprocessing tasks include: data cleaning, map matching and speed tensor calculation. Step S10, i.e., obtaining the original GPS data, preprocessing the original GPS data to obtain a preprocessed vehicle trajectory data set, and generating a traffic speed tensor based on the preprocessed vehicle trajectory data set, specifically includes: Step S100, obtaining original GPS data, setting a normal driving speed threshold range, identifying and deleting abnormal GPS data points in the original GPS data that exceed the speed threshold range, and obtaining GPS data after data cleaning.
[0042] In GPS data, outliers are usually manifested as data points that do not conform to normal driving speeds. For example, speed anomalies may be manifested as speeds that are too fast or too slow, exceeding the normal driving speed range (10 km / h to 120 km / h). In order to filter these outliers, it is first necessary to set a reasonable speed threshold range, which should be determined based on traffic rules and actual driving conditions to ensure that the data filtered out is indeed data generated by abnormal driving behavior. In GPS data, each GPS data point records the location and speed of the vehicle at a specific time. The data cleaning process needs to check these continuous GPS data points to determine whether they are all within the set speed threshold range. If any point in the continuous GPS data points is found to have a speed that exceeds the preset normal speed range, then these points will be considered outliers. In order to ensure the accuracy of the data, these abnormal points and the points before and after them (i.e., abnormal road sections) will be deleted from the original trajectory data.
[0043] Through this process, abnormal data that may be caused by equipment errors, signal interference or abnormal driving behaviors (such as sudden braking, sudden acceleration or GPS recording in non-driving areas) can be removed, thereby improving data quality and providing more reliable basic data for subsequent map matching and velocity tensor calculations.
[0044] Step S101, mapping the cleaned GPS data to the corresponding road sections of the road network to obtain a corresponding road section mapping data set.
[0045] The road segment mapping data set includes the correspondence between GPS data points and road network segments, that is, GPS trajectory information obtained by matching the GPS data after data cleaning with the actual road network data.
[0046] In this embodiment, an open source Java map matching library Barefoot is used as a map matching tool to process the cleaned GPS data; the library applies a map matching algorithm based on a hidden Markov model (HMM) to support online and offline map matching.
[0047] Step S102, based on the road segment mapping data set, calculate the average traffic speed of each road segment on the road network and generate a traffic speed tensor.
[0048] Please also see Figure 3 Step S101, i.e., mapping the cleaned GPS data to the corresponding road sections of the road network to obtain the corresponding road section mapping data set, specifically includes: Step S1010, processing the GPS data after data cleaning, identifying and deleting road section types that are not suitable for vehicle driving from the road network database of OpenStreetMap (OSM), so as to obtain an effective road network suitable for vehicle driving.
[0049] Among them, the types of road sections that are not suitable for vehicle driving may be living streets, residential areas, and unclassified types, etc.
[0050] Step S1011 , applying a density-based clustering algorithm (DBSCAN) to sample the data in the effective road network and remove outliers, so as to obtain a road network after outlier filtering.
[0051] The abnormal value represents erroneous or inaccurate road data.
[0052] Step S1012, comparing the road network filtered by outliers with the road connection information in the historical version of OSM, checking and correcting the road network topology errors, and obtaining optimized GPS data and road network.
[0053] By preprocessing the cleaned GPS data as described in steps S1010 to S1012, the quality of the OSM road network is improved.
[0054] Step S1013, performing offline map matching on the optimized GPS data and the road network, matching the GPS data with the OSM road network database, and obtaining the road segment mapping data set.
[0055] As described above, through step S101, the accuracy and reliability of map matching can be ensured, thereby providing high-quality basic data for subsequent traffic data analysis and missing value interpolation.
[0056] Please also see Figure 4 Step S102, i.e., based on the road segment mapping data set, calculating the average traffic speed of each road segment on the road network and generating a traffic speed tensor, specifically includes: Step S1020, based on the road segment mapping data set, calculate the continuous road segment { r 1→ r 2 →……→ r n The distance and time interval of each road section in} are calculated, and the average speed of each road section is obtained by dividing the distance by the time interval.
[0057] in, r 1. r 2.…… r n is the identifier of the road segment, → indicates the continuity from one road segment to the next; { r1→ r 2 →……→ r n} represents a series of consecutive road segments connected in sequence, i.e., the vehicle r 1Departure, passing r 2. r 3... Continue driving until the section r n .
[0058] Step S1021, calculate the first distance of the original GPS trajectory formed by the GPS data after data cleaning at the specific road ID, and the second distance of the road segment mapping data set at the specific road ID, and determine whether the difference between the first distance and the second distance is not greater than the first threshold; if so, enter step S1022; otherwise, enter step S1023.
[0059] Among them, the specific road ID is a unique identifier assigned to each road in the road network database, which is used to identify and distinguish different road segments, so that each trajectory in the dataset can be accurately associated with a specific road segment.
[0060] In this embodiment, the first threshold is 10%.
[0061] Step S1022, confirming that the original GPS track is reasonable, and calculating the speed according to the first distance and the corresponding time to obtain a reasonable speed value. Then, proceeding to step S1024.
[0062] The time is the time the vehicle travels the first distance, which has been pre-recorded in the GPS data.
[0063] Step S1023, confirming that the GPS original trajectory is unreasonable, identifying the GPS original trajectory containing abnormal values, calculating the unreasonable speed value of the GPS original trajectory containing the abnormal value, and filtering the unreasonable speed value.
[0064] Among them, when the original GPS trajectory is unreasonable, it contains outliers. For example, the vehicle may not be traveling on the road ID but may mistakenly enter other non-vehicle areas, such as sidewalks in the community.
[0065] Step S1024, within each time window, aggregate all the screened reasonable speed values of the specific road segment to obtain a traffic speed tensor record.
[0066] The time window is a specified time length parameter. In this embodiment, the time window is 30 minutes, that is, all speed calculations are performed within a continuous 30-minute time period.
[0067] Specifically, for continuous roads { r 1→r 2 →……→ r n}, summarize i In the time window j Road sections r j All reasonable speed values are obtained by recording the traffic speed tensor ( i , j ).
[0068] It should be noted that if there is no reasonable speed sample in a certain time window, that is, no speed data can be used for aggregation, the corresponding traffic speed tensor record ( i , j ) has a value of zero.
[0069] Please also see Figure 5 , step S11, i.e., based on the traffic speed tensor, a heterogeneous graph attention network model considering spatial and temporal factors is constructed in spatial and temporal perspectives, specifically including: Step S110, obtaining the road segment mapping dataset, and taking each road in the road network as a node, creating a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph.
[0070] Specifically, based on the road segment mapping dataset, each road is defined as a node in the graph, and links between nodes are established according to the actual connectivity between roads to form the basic node and link framework of the spatial heterogeneous graph. Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments, so as to construct a spatially heterogeneous graph that can capture and analyze the spatial connections and interactions between roads.
[0071] Spatially heterogeneous graphs are used to represent and analyze complex systems with spatial attributes and relationships. In the fields of traffic data analysis, urban planning, social network analysis, etc., spatially heterogeneous graphs can capture and express the spatial connections and interactions between different entities. In a spatially heterogeneous graph, each road is regarded as a node in the graph (that is, each node represents a road segment in the actual road network); the connectivity between roads is regarded as a link in the graph, that is, if two roads are connected, then in the graph, they are connected to each other by a link; different link types are distinguished by checking whether the link is a connection between nodes of the same road type. Metapath and metapath are used here respectively. and Define two types of spatial adjacency, each meta-path has a corresponding adjacency matrix , which is a 0-1 matrix used to represent the connection relationship between road segments. If two road segments are connected by a certain link type, the corresponding position in the adjacency matrix is 1; if they are not connected, it is 0. and The difference lies in the type of adjacency they represent, A non-zero value in indicates that the road type of adjacent road segments is the same, for example, both are main roads; A non-zero value in indicates that adjacent road segments have different road types, for example, one is a main road and the other is a secondary road.
[0072] Step S111, extracting a time series data set from the road segment mapping data set, taking each time segment on the time dimension as a node, and defining dynamic connections between capture time periods according to the periodicity and continuity of time to construct a time heterogeneous graph.
[0073] The time series data set includes traffic status observation time information divided into fixed time windows, as well as the relative order and periodicity relationship between these time windows.
[0074] Specifically, a time series dataset is extracted from the road segment mapping dataset, time windows are identified and divided, and traffic state observation information of each time window is recorded. Each time segment (time slot) is regarded as a node in the graph to define the time node in the time heterogeneous graph, and links and meta-paths are defined according to the relative order and periodicity of the time windows to be converted into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships (e.g., the same time segment on different days of the same week); defines a metapath Represents the connection between adjacent time segments (e.g., different hours of the same day) based on hourly relationships. For each meta-path and Create a 0-1 adjacency matrix respectively , the adjacency matrix is used to represent the connection status between time nodes. The graph is constructed using nodes and links to reflect the spatiotemporal relationship between time periods. A complete time-heterogeneous graph is formed by integrating time nodes, links and adjacency matrix.
[0075] A time-heterogeneous graph is a graph model specifically designed to analyze and represent complex network structures that change over time. It not only captures the interactions between entities in the network, but also considers the evolution of these interactions over time. In a time-heterogeneous graph, each time slot in the time dimension is regarded as a node in the graph (that is, each node represents a specific time interval). The connectivity between adjacent time slots is regarded as links in the graph. Adjacent time slots can be adjacent time periods on the same day or the same time periods on different days. Metapaths are used here to represent the time intervals of the network. and Two types of temporal adjacencies are defined. In , the adjacency relationship based on the week relationship is used to define the links, that is, the same time period (such as 8 am to 9 am) on different days of the week is considered as connected nodes. In , the hourly-based adjacency relationship is used to define links, i.e., within the same day, adjacent time periods (e.g., 8:00-9:00 AM, 9:00-10:00 AM) are considered as connected nodes.
[0076] By constructing spatially heterogeneous graphs and temporally heterogeneous graphs as described above, complex spatial and temporal dependencies in traffic data can be simulated and analyzed.
[0077] Step S112, providing a complete spatiotemporal feature description for each node in the spatial heterogeneous graph and the temporal heterogeneous graph according to the road features of the spatial nodes and the time attributes of the temporal nodes, so as to obtain the node features of the spatial heterogeneous graph and the temporal heterogeneous graph.
[0078] Among them, the road characteristics at least include road type, number of lanes, one-way street status, and road length; the time attributes at least include time slots, days of the week, and holidays.
[0079] Specifically, the node features of the spatially heterogeneous graph are represented as follows.
[0080] When constructing spatial heterogeneous graphs and temporal heterogeneous graphs, each node (whether it is a road in a spatial heterogeneous graph or a time slot in a temporal heterogeneous graph) needs to have a feature representation in order to capture and analyze their attributes and relationships in the graph. In the embodiment of the present invention, four types of road features are considered to help capture different attributes and driving conditions of road sections, as follows: (1) Road type, such as primary road, primary connecting road, secondary road, secondary connecting road, tertiary road, etc.; (2) Number of lanes: how many traffic lines there are on the road; (3) Whether it is a one-way street; (4) Road length.
[0081] For the categorical features of categories (1), (2), and (3), i.e., road type, number of lanes, and whether it is a one-way street, different spatial embedding matrices are used D 1. D 2 and D 3 (size is c 1* d 1, c 2* d 2, c 3* d 3). The size of each matrix is determined by the number of possible values of the classification feature. c 1. c 2 and c3 and embedding dimension d 1. d 2 and d 3. Decision.
[0082] For the fourth type of categorical feature, i.e., road length, it is directly added to the node feature representation as a numerical feature.
[0083] Thus, for each segment node i , whose spatial node feature representation h i It is the concatenation of the embedding matrix features and the road length, forming a vector whose dimension is the sum of all embedding dimensions and road length, expressed as: (1) Specifically, the node features of the time-heterogeneous graph are,represented as follows.
[0084] Time series data set, including time ID, week ID, and holiday information; the classification attributes are converted into feature representation vectors through the embedding method, and timeID, weekID, and holidayID are used to represent the characteristics of the time node to obtain the feature representation vector of the time node. These features reflect the specific time, week, and whether the time node is a holiday.
[0085] As described in steps S110-S112, the element path in the spatial heterogeneous graph ( and ) distinguishes different types of spatial adjacency relations, while the feature representation of nodes provides the specific contextual information of these adjacency relations. Metapaths in temporally heterogeneous graphs ( and ) defines different types of temporal adjacency relationships, and the feature representation of time nodes reflects the specific properties of these time slots. By combining spatial and temporal feature representations, we can more comprehensively analyze the spatiotemporal dependencies in traffic data, for example, studying the changes in traffic flow on different road types in different time periods.
[0086] Step S113, based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependencies of the spatial and temporal nodes are learned and refined through the unit path and multi-path attention mechanisms, and a heterogeneous graph attention network model that considers spatial and temporal factors is constructed.
[0087] Please also see Figure 6 , step S113, that is, based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependencies of the spatial and temporal nodes are learned and refined through the unit path and multi-path attention mechanisms, and a heterogeneous graph attention network model considering spatial and temporal factors is constructed, which specifically includes: Step S1130, based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the unit path attention mechanism is applied to evaluate and integrate the importance of the node neighborhood, and the original feature representation of the node is transformed and weightedly aggregated to generate a node representation based on the unit path.
[0088] In a graph network, each node (such as a traffic segment) has its neighbors, i.e., other nodes that are directly connected to it. These neighboring nodes may have different correlations with the central node (object segment) in terms of speed distribution. Different neighboring nodes may have different effects on the speed distribution of the central node. For example, in a traffic network, the neighboring segments of a congested segment may have a significant impact on its traffic flow, while segments that are farther away or not directly connected may have less impact. In order to quantify this correlation and determine the degree of influence of each neighboring node on the central node, the unit path attention mechanism is introduced. This is an approach similar to the graph attention network that can learn and emphasize neighboring nodes that are more correlated with the central node.
[0089] Unit path attention works by calculating the importance score of each neighborhood node relative to the central node. These scores are based on the interactions and relationships between nodes, reflecting the contribution of the neighborhood nodes to the feature inference of the central node.
[0090] Specifically, each node i Metapath in space or time There is an original feature representation h i These original feature representations are usually obtained by embedding the matrix, as described in step S112 above, and will not be repeated here. The original feature representation of each node is transformed using the transformation matrix h i Mapped to a new feature space, the projection is obtained h’ i For each node i , the self-attention mechanism calculates its relationship with neighbor nodes through formula (2) j The correlation measure between .
[0091] (2) For each node pair ( i , j ), in the meta path Calculate an attention score on , reflecting the neighbor nodes j For the central node i The importance of.
[0092] It should be noted that the connection node pair ( i , j) is asymmetric because the nodes i and nodes j have different neighbors. Each node represents Unit Path Neighbors are aggregated in , and unit paths are captured by attention importance. specific relationship.
[0093] Furthermore, the softmax function is used to normalize the attention score of each node to ensure that the sum of the attention weights of all neighboring nodes is equal to 1.
[0094] In order to capture different aspects of nodes and reduce the variance of the model, the unit path attention is extended to multi-head attention. This involves performing the unit path attention multiple times in parallel, each time focusing on a different representation subspace, i.e., repeating the unit path attention k times, and will k The sub-node representations are connected to the final unit path representation, merging the multiple outputs obtained from the multi-head attention into a single node representation, usually achieved through concatenation and activation functions (such as ReLU).
[0095] Finally, each node i In the meta path On the representation is the weighted projection feature of its neighbor nodes The aggregated value is expressed by formula (3): (3) In formula (3), represents the activation function, Indicates a connection.
[0096] Through the above process, each node has a representation on each unit path , these representations integrate the neighborhood information of nodes on different meta-paths. Furthermore, the unit path representation based on the meta-path set is .
[0097] Step S1131, based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate a node potential feature vector with comprehensive spatiotemporal features.
[0098] In a heterogeneous graph, each node is connected to other nodes through different meta-paths, which carry different semantic information and reflect different types of relationships. In order to obtain a comprehensive node representation, the semantic information on different meta-paths needs to be aggregated, which helps the model understand the multi-dimensional role and importance of the node in the graph. Therefore, the semantic importance of multi-paths is measured by the attention structure, which can capture various types of semantic context information from the heterogeneous graph. Finally, the representation and semantic importance based on the unit path are summarized to obtain the final latent features from the spatial and temporal perspectives.
[0099] Please also see Figure 7 , step S1131, i.e., based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate a node potential feature vector of comprehensive spatiotemporal features, specifically including: Step S20, using a multi-layer perceptron (MLP) to perform nonlinear transformation on the node feature representation of each unit path to obtain a node representation after MLP transformation.
[0100] Step S21, using the attention vector q The node representations after MLP transformation are weighted, and the importance score of each node in a specific meta-path is evaluated by calculating the weighted sum of each meta-path.
[0101] Specifically, given a set of meta-paths , for each meta-path , the importance score of each node in a specific meta-path is calculated by formula (4) .
[0102] (4) In formula (4), p represents the number of paths in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector of the MLP, Representation Node i In the meta path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents the nonlinear activation function in the multilayer perceptron, Represents a meta path Contributions of specific spatial and temporal perspectives in this interpolation task.
[0103] This score is based on the dot product of the representation of all nodes on the meta-path and the attention vector, and is normalized by the softmax function to ensure that the importance scores of all meta-paths add up to 1, so that the weight of each meta-path can be reasonably distributed during aggregation.
[0104] Step S22: performing weighted summation on the node representations of all meta-paths according to the importance score of each node in a specific meta-path to obtain a final potential feature vector F of each node.
[0105] Among them, the final potential feature vector of each node is calculated by formula (5): F Specifically, the nodes of each meta-path are represented by formula (5): Its corresponding normalized importance score Multiply and sum to get the final potential feature vector that integrates the multivariate path information F .
[0106] (5) Through this logical sequence, multi-path attention allows the model to identify and emphasize the most important semantic information when considering multiple adjacencies of nodes, thereby providing a comprehensive representation of the node that integrates spatial and temporal perspectives.
[0107] Please also see Figure 8 Step S12, i.e., using the established heterogeneous graph model to extract potential features from spatial and temporal perspectives, and interpolating missing traffic status data by fusing the potential features, specifically includes: Step S120, calculating the inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models through inner product fusion to generate a fused traffic state fusion matrix.
[0108] The traffic status fusion matrix is used to interpolate missing traffic status data.
[0109] In the common missing value imputation problem, non-negative matrix factorization ( NMF ) method converts the target matrix Decompose into two matrices and ,in W and H represents the non-negative latent component. is the interpolation result based on the target matrix. NMF Inspired by W represents the spatial latent features output by the spatial heterogeneous graph module ( ),use H represents the temporal latent features output by the temporal heterogeneous graph module ( ), the spatial and temporal latent features are regarded as non-negative matrices and decomposed to extract the latent components.
[0110] Specifically, ( ) represents the spatial latent features output by the spatial heterogeneous graph module, which is a b × k dimensional matrix, where b is the batch size, k is the number of spatial attributes considered. ( ) represents the temporal latent features output by the temporal heterogeneous graph module, and is also a b × k dimensional matrix, k Indicates the number of temporal attributes considered.
[0111] An inner product fusion strategy is used to capture the interaction between spatial and temporal latent feature matrices, which is achieved by computing and This is done by the dot product of .
[0112] Specifically, the inner product fusion function is described in formula (6), which obtains the interaction between spatial and temporal features through dot products, and then uses a diagonal matrix to extract effective information: (6) In formula (6), and Through non-negative activation functions (such as softplus ) processing to ensure the non-negativity of the result, which is necessary for the traffic state feature representation that cannot be negative in the physical sense.
[0113] After the above steps, the feature representation for missing state interpolation is obtained, which combines the potential features of space and time and ensures non-negativity.
[0114] Step S121, mapping and fusion of spatial and temporal latent features into high-dimensional tensors through low-rank multimodal fusion (LMF), and generating low-dimensional feature representations that integrate multimodal information through tensor outer product calculation and weight tensor decomposition.
[0115] Specifically, according to the generated fused traffic state feature representation, that is, the spatial latent feature matrix ( ) and the temporal latent feature matrix ( ), convert the input features into high-dimensional tensors, and use the tensor outer product to represent the fusion of different modalities. Specifically, the tensor outer product is calculated using formula (7).
[0116] (7) In formula (7), represents the outer product of tensors on a set of vectors, is the input representation with 1 appended.
[0117] Through the linear layer Map the high-dimensional tensor back to the low-dimensional output space; W is the weight, b is the bias of the linear layer.
[0118] The weight vector W Decompose into M Group-specific modal factors, using fixed rank r .
[0119] Multimodal fusion using tensor representation is a multilinear function ,in, is the vector space of input modes, H is the output vector space. The tensor representation first converts the input representation into a high-dimensional tensor and then maps it back to the low-dimensional output vector space. For ordinary fusion using tensor representation, the input representation tensor Z formed by the single-modal representation is calculated as shown in formula (7).
[0120] In formula (7), the fusion representation is obtained by linear layer Convert the tensor representation to W is the weight, b is the bias of the linear layer.
[0121] The principle of low-rank multimodal fusion (LMF) is to transform the weight vector W Decompose into M The group-specific modal factors, specifically, use a fixed rank r , and use r The weight tensor is parameterized by decomposition factors, so that ,in yes h Dimension.
[0122] The weight tensor is decomposed and calculated by formula (8); (8) In the interpolation task, for LMF-based fusion, from and Get the outer product with 1 added Z , and then the weight tensor W Decompose into r The low-rank decomposition factors are output h Here, for a given input record , the output dimension of h is 1.
[0123] The LMF-based fusion function can be defined as follows, and the low-dimensional feature representation is generated by formula (9): (9) In the heterogeneous graph model described above, the spatial perspective latent features are integrated and temporal perspective latent features The process is to generate a comprehensive feature representation, which helps to improve the interpolation performance of the model in different missing situations.
[0124] Obtaining spatial perspective latent features by building a heterogeneous graph model and temporal perspective latent features Finally, the fuse function is used to fuse the above potential features to obtain the interpolation result of the model. In order to improve the robust interpolation in different missing situations, two spatiotemporal feature fusion strategies are used. The first is inner product fusion, and the second is low-order multimodal fusion (LMF) with specific modal factors. The LMF strategy converts the input features into high-dimensional tensors, which can effectively enrich the feature representation when the input is extremely sparse.
[0125] Step S122: interpolating missing traffic status data using the low-dimensional feature representation of the multimodal information.
[0126] As described above, the embodiment of the present invention provides a method for interpolating traffic status data using a graph network that combines spatial and temporal heterogeneous features. By using the heterogeneous graph attention mechanism, the model can learn the importance of adjacent nodes in space and time, so that the model can still maintain a high prediction accuracy when facing sparse data or noise data, thereby more accurately predicting traffic status and revealing the pattern of evaluating the importance of adjacent road sections or time periods, providing the interpretability of model prediction; providing two strategies of inner product fusion and low-rank multimodal fusion, providing more accurate traffic status interpolation under different missing ratios. Combining deep learning technology with graph networks enables the model to learn complex patterns from large-scale spatiotemporal data and effectively handle missing data to adapt to different traffic scenarios and data missing situations, and has good generalization ability; improves the accuracy and robustness of missing traffic status data interpolation, and also enhances the interpretability and adaptability of the model, providing more accurate and real-time traffic status information for intelligent transportation systems and navigation applications, and helps to improve the efficiency and effectiveness of traffic management.
[0127] See also Fig. 9 , which is a functional structure diagram of a traffic status data interpolation device in an embodiment of the present invention. Corresponding to the above-mentioned traffic status data interpolation method, an embodiment of the present invention provides a traffic status data interpolation device 30, including: a trajectory preprocessing unit 31, a heterogeneous graph model building unit 32, a spatiotemporal feature fusion unit 33 and an interpolation result output unit 34.
[0128] The trajectory preprocessing unit 31 is used to obtain original GPS data, preprocess the original GPS data to obtain a preprocessed vehicle trajectory data set, and generate a traffic speed tensor based on the preprocessed vehicle trajectory data set.
[0129] The heterogeneous graph model building unit 32 is used to build a heterogeneous graph attention network model that considers spatial and temporal factors in spatial and temporal perspectives based on the traffic speed tensor generated by the trajectory preprocessing unit 31.
[0130] The spatiotemporal feature fusion unit 33 is used to extract latent features from spatial and temporal perspectives using the heterogeneous graph attention network model established by the heterogeneous graph model establishment unit 32, and perform feature fusion on the latent features to obtain fused spatiotemporal features.
[0131] Specifically, the spatiotemporal feature fusion unit 33 is used to: Compute the dot product of spatial and temporal features through inner product fusion to capture the interaction between time and space; and Tensor decomposition is performed through low-rank multimodal fusion (LMF), high-dimensional features are mapped to low-dimensional space, high-dimensional sparse data is processed and the generalization ability of the model is enhanced to perform feature fusion on the latent features.
[0132] The interpolation result output unit 34 is used to output the interpolation result of the traffic status data according to the spatiotemporal features fused by the spatiotemporal feature fusion unit 33, so as to achieve accurate estimation of the missing data.
[0133] Please also see Fig.10 The trajectory preprocessing unit 31 includes: a data cleaning module 310, a map matching module 311 and a velocity tensor calculation module 312.
[0134] The data cleaning module 310 is used to obtain original GPS data, set a normal driving speed threshold range, identify and delete abnormal GPS data points in the original GPS data that exceed the speed threshold range, and obtain GPS data after data cleaning.
[0135] In GPS data, each GPS data point records the location and speed of the vehicle at a specific time. The data cleaning process needs to check these consecutive GPS data points to determine whether they are all within the set speed threshold range. If the speed of any point in the consecutive GPS data points is found to be outside the preset normal speed range, then these points will be considered outliers. In order to ensure the accuracy of the data, these outliers and the points before and after them (i.e., abnormal road sections) will be deleted from the original trajectory data.
[0136] The map matching module 311 is used to map the GPS data cleaned by the data cleaning module 310 to the corresponding road section of the road network to obtain the corresponding road section mapping data set.
[0137] The road segment mapping data set includes the correspondence between GPS data points and road network segments, that is, GPS trajectory information obtained by matching the GPS data after data cleaning with the actual road network data.
[0138] In this embodiment, the map matching module 311 uses the open source Java map matching library Barefoot as a map matching tool. The library uses an HMM-based algorithm to perform map matching and supports online and offline map matching.
[0139] The speed tensor calculation module 312 is used to calculate the average traffic speed of each road section on the road network based on the road section mapping data set obtained by the map matching module 311, and generate a traffic speed tensor.
[0140] Furthermore, the map matching module 311 maps the cleaned GPS data to the corresponding road sections of the road network to obtain the corresponding road section mapping data set, which specifically includes: For the GPS data cleaned by the data cleaning module 310, the road segment types that are not suitable for vehicle driving are identified and deleted from the road network database of OpenStreetMap (OSM) to obtain a valid road network suitable for vehicle driving; wherein the road segment types that are not suitable for vehicle driving may be living streets, residential areas, and unclassified types, etc.; Applying a density-based clustering algorithm (DBSCAN) to sample the data in the valid road network and remove outliers to obtain an outlier-filtered road network; wherein the outliers represent erroneous or inaccurate road data; Compare the outlier-filtered road network with the road connection information in the historical version of OSM to check and correct the road network topology errors and obtain the optimized GPS data and road network; and Offline map matching is performed on the optimized GPS data and the road network, and the GPS data is matched with the OSM road network database to obtain the road segment mapping data set.
[0141] Furthermore, the speed tensor calculation module 312 calculates the average traffic speed of each road section on the road network based on the road section mapping data set obtained by the map matching module 311, and generates a traffic speed tensor, which specifically includes: Based on the road segment mapping dataset, calculate the continuous road segment { r 1→ r 2 →……→r n The distance and time interval of each road section in} are divided by the distance and time interval to get the average speed of each road section; where, r 1. r 2.…… r n is the identifier of the road segment, → indicates the continuity from one road segment to the next; { r 1→ r 2 →……→ r n} represents a series of consecutive road segments connected in sequence, i.e., the vehicle r 1Departure, passing r 2. r 3... Continue driving until the section r n ; Calculate a first distance of a GPS original track formed by the GPS data after data cleaning at a specific road ID, and a second distance of a road segment mapping data set at the specific road ID, and determine whether a difference between the first distance and the second distance is not greater than a first threshold; When the difference between the first distance and the second distance is not greater than a first threshold, confirm that the GPS original trajectory is reasonable, calculate the speed according to the first distance and the corresponding time to obtain a reasonable speed value; when the difference between the first distance and the second distance is greater than the first threshold, confirm that the GPS original trajectory is unreasonable, identify the GPS original trajectory containing the abnormal value, calculate the unreasonable speed value of the GPS original trajectory containing the abnormal value, and filter the unreasonable speed value; wherein the time is the time when the vehicle travels the first distance, which is pre-recorded in the GPS data; and In each time window, all filtered reasonable speed values for a specific road segment are aggregated to obtain a traffic speed tensor record.
[0142] The time window is a specified time length parameter. In this embodiment, the time window is 30 minutes.
[0143] Please also see Fig.11 The heterogeneous graph model building unit 32 includes: a spatial heterogeneous graph building module 320, a temporal heterogeneous graph building module 321, a node feature representation module 322 and an attention learning module 323.
[0144] The spatial heterogeneous graph construction module 320 is used to obtain the road segment mapping dataset generated by the map matching module 311, and take each road in the road network as a node, create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph.
[0145] Specifically, the spatial heterogeneous graph construction module 320 defines each road as a node in the graph based on the road segment mapping data set, and establishes links between nodes according to the actual connectivity between the roads to form the basic node and link framework of the spatial heterogeneous graph; Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments, so as to construct a spatially heterogeneous graph that can capture and analyze the spatial connections and interactions between roads.
[0146] The temporal heterogeneous graph construction module 321 is used to obtain the road segment mapping dataset generated by the map matching module 311, extract the time series dataset from the road segment mapping dataset, take each time segment on the time dimension as a node, and define the dynamic connection between the capture time periods according to the periodicity and continuity of time to construct a temporal heterogeneous graph.
[0147] The time series data set includes traffic status observation time information divided into fixed time windows, as well as the relative order and periodicity relationship between these time windows.
[0148] Specifically, the temporal heterogeneous graph construction module 321 extracts a time series data set from the road segment mapping data set, identifies and divides time windows, and records traffic state observation information of each time window. Each time segment (time slot) is regarded as a node in the graph to define a time node in the temporal heterogeneous graph, and links and meta-paths are defined according to the relative order and periodicity of the time windows to be converted into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships (e.g., the same time segment on different days of the same week); defines a metapath Represents the connection between adjacent time segments (e.g., different hours of the same day) based on hourly relationships. For each meta-path and Create a 0-1 adjacency matrix respectively , the adjacency matrix is used to represent the connection status between time nodes. The graph is constructed using nodes and links to reflect the spatiotemporal relationship between time periods. A complete time-heterogeneous graph is formed by integrating time nodes, links and adjacency matrix.
[0149] The node feature representation module 322 is used to provide a complete spatiotemporal feature description for each node in the spatial heterogeneous graph and the temporal heterogeneous graph based on the road features of the spatial nodes captured by the spatial heterogeneous graph construction module 320 and the time attributes of the time nodes captured by the temporal heterogeneous graph construction module 321, so as to obtain the node features of the spatial heterogeneous graph and the temporal heterogeneous graph.
[0150] Among them, the road characteristics at least include road type, number of lanes, one-way street status, and road length; the time attributes at least include time slots, days of the week, and holidays.
[0151] For each segment node i , whose spatial node feature representation h i It is the concatenation of the embedding matrix features and the road length, forming a vector whose dimension is the sum of all embedding dimensions and road length, expressed as: (1) Time series data set, including time ID, week ID, and holiday information; the classification attributes are converted into feature representation vectors through the embedding method, and timeID, weekID, and holidayID are used to represent the characteristics of the time node to obtain the feature representation vector of the time node. These features reflect the specific time, week, and whether the time node is a holiday.
[0152] The attention learning module 323 is used to learn and refine the dependencies of spatial and temporal nodes based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module 322 through unit path and multi-path attention mechanisms, and to construct a heterogeneous graph attention network model that considers spatial and temporal factors.
[0153] For further information, please also refer to Fig.12 The attention learning module 323 includes: a unit path attention learning sub-module 3230 and a multi-path attention learning sub-module 3231.
[0154] The unit path attention learning submodule 3230 is used to evaluate and integrate the importance of node neighborhoods based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module 322, and to transform and weightedly aggregate the original feature representation of the node to generate a unit path-based node representation.
[0155] Specifically, each node i Metapath in space or time There is an original feature representation h i , these original feature representations are usually obtained through embedding matrices, and the unit path attention learning submodule 3230 uses a transformation matrix to transform the original feature representation of each node h i Mapped to a new feature space, the projection is obtained h’ i For each nodei , the self-attention mechanism calculates its relationship with neighbor nodes through formula (2) j The correlation measure between .
[0156] (2) For each node pair ( i , j ), in the meta path Calculate an attention score on , reflecting the neighbor nodes j For the central node i The importance of.
[0157] Each node i In the meta path On the representation is the weighted projection feature of its neighbor nodes The aggregated value is expressed by formula (3): (3) In formula (3), represents the activation function, Indicates a connection.
[0158] Through the above process, each node has a representation on each unit path , these representations integrate the neighborhood information of nodes on different meta-paths. Furthermore, the unit path representation based on the meta-path set is .
[0159] Furthermore, the softmax function is used to normalize the attention score of each node to ensure that the sum of the attention weights of all neighboring nodes is equal to 1.
[0160] The multi-path attention learning submodule 3231 is used to perform multi-path attention weight calculation and weighted aggregation processing of semantic information based on the node representation of the unit path generated by the unit path attention learning submodule 3230 to generate a node potential feature vector with comprehensive spatiotemporal features.
[0161] Furthermore, the multi-path attention learning submodule 3231 is specifically used for: Using a multi-layer perceptron (MLP) to perform nonlinear transformation on the node feature representation on each meta-path to obtain the node representation after MLP transformation; and Using Attention Vector q The node representations after MLP transformation are weighted, and the importance score of each node in a specific meta-path is evaluated by calculating the weighted sum of each meta-path.
[0162] Among them, given the meta-path set , for each meta-path , the importance score of each node in a specific meta-path is calculated by formula (4) .
[0163] (4) In formula (4), p represents the number of paths in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector of the MLP, Representation Node i In the meta path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents the nonlinear activation function in the multilayer perceptron, Represents a meta path Contributions of specific spatial and temporal perspectives in this interpolation task.
[0164] This score is based on the dot product of the representation of all nodes on the meta-path and the attention vector, and is normalized by the softmax function to ensure that the importance scores of all meta-paths add up to 1, so that the weight of each meta-path can be reasonably distributed during aggregation.
[0165] The multi-path attention learning submodule 3231 is also used to: perform weighted summation of the node representations of all meta-paths according to the importance score of each node in a specific meta-path, so as to obtain a final potential feature vector F of each node.
[0166] Among them, the final potential feature vector of each node is calculated by formula (5): F Specifically, the nodes of each meta-path are represented by formula (5): Its corresponding normalized importance score Multiply and sum to get the final potential feature vector that integrates the multivariate path information F .
[0167] (5) Through this logical sequence, multi-path attention allows the model to identify and emphasize the most important semantic information when considering multiple adjacencies of nodes, thereby providing a comprehensive representation of the node that integrates spatial and temporal perspectives.
[0168] Please also see Fig.13The spatiotemporal feature fusion unit 33 includes: an inner product fusion module 330, a low-rank multimodal fusion module 331, and an interpolation result generation module 332.
[0169] The inner product fusion module 330 is used to calculate the inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models through inner product fusion to generate a fused traffic state fusion matrix.
[0170] in, ( ) represents the spatial latent features output by the spatial heterogeneous graph module, which is a b × k dimensional matrix, where b is the batch size, k is the number of spatial attributes considered. ( ) represents the temporal latent features output by the temporal heterogeneous graph module, and is also a b × k dimensional matrix, k Indicates the number of temporal attributes considered.
[0171] An inner product fusion strategy is used to capture the interaction between spatial and temporal latent feature matrices, which is achieved by computing and This is done by the dot product of .
[0172] Specifically, the inner product fusion function is described in formula (6), which obtains the interaction between spatial and temporal features through dot products, and then uses a diagonal matrix to extract effective information: (6) In formula (6), and Through non-negative activation functions (such as softplus ) processing to ensure the non-negativity of the result, which is necessary for the traffic state feature representation that cannot be negative in the physical sense.
[0173] The low-rank multimodal fusion module 331 is used to map and fuse spatial and temporal latent features into high-dimensional tensors through low-rank multimodal fusion (LMF), and generate a low-dimensional feature representation that integrates multimodal information through tensor outer product calculation and weight tensor decomposition.
[0174] Specifically, according to the generated fused traffic state feature representation, that is, the spatial latent feature matrix ( ) and the temporal latent feature matrix ( ), convert the input features into high-dimensional tensors, and use the tensor outer product to represent the fusion of different modalities. Specifically, the tensor outer product is calculated using formula (7).
[0175] (7) In formula (7), represents the outer product of tensors on a set of vectors, is the input representation with 1 appended.
[0176] Through the linear layer Map the high-dimensional tensor back to the low-dimensional output space; where W is the weight, b is the bias of the linear layer.
[0177] The weight vector W Decompose into M Group-specific modal factors, using fixed rank r .
[0178] Multimodal fusion using tensor representation is a multilinear function ,in, is the vector space of input modes, H is the output vector space. The tensor representation first converts the input representation into a high-dimensional tensor and then maps it back to the low-dimensional output vector space. For ordinary fusion using tensor representation, the input representation tensor Z formed by the single-modal representation is calculated as shown in formula (7).
[0179] In formula (7), the fusion representation is obtained by linear layer Convert the tensor representation to W is the weight, b is the bias of the linear layer.
[0180] The principle of low-rank multimodal fusion (LMF) is to transform the weight vector W Decompose into M The group-specific modal factors, specifically, use a fixed rank r , and use r The weight tensor is parameterized by decomposition factors, so that ,in yes h Dimension.
[0181] The low-rank multimodal fusion module 331 performs weight tensor decomposition calculation on by formula (8); (8) In the interpolation task, for LMF-based fusion, from and Get the outer product with 1 added Z , and then the weight tensor W Decompose into r The low-rank decomposition factors are output h Here, for a given input record , the output dimension of h is 1.
[0182] The LMF-based fusion function can be defined as follows. The low-rank multimodal fusion module 331 generates the low-dimensional feature representation through formula (9): (9) The interpolation result generation module 332 is used to interpolate missing traffic status data using the low-dimensional feature representation of the multimodal information.
[0183] The advantages and beneficial effects of a ship flow prediction method based on a spatiotemporal multi-graph convolutional network have been explained above and will not be repeated here. Moreover, since a ship flow prediction device based on a spatiotemporal multi-graph convolutional network is applied to a ship flow prediction method based on a spatiotemporal multi-graph convolutional network, it satisfies the same advantages and beneficial effects as the ship flow prediction method based on a spatiotemporal multi-graph convolutional network.
[0184] One of the embodiments of the present invention further provides a readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes the steps of the multi-perspective heterogeneous traffic state interpolation method described in any of the above embodiments.
[0185] One of the embodiments of the present invention also provides an electronic device, including: a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, when the processor executes the computer instructions, the electronic device executes the steps of the multi-perspective heterogeneous traffic state interpolation method described in any of the above embodiments.
[0186] See also Fig.14 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0187] The electronic device 4 includes a processor 41, an input device 42, an output device 43, and a memory 44. The processor 41, the input device 42, the output device 43, and the memory 44 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.
[0188] The processor 41 described in the embodiment of the present application can be implemented by hardware, firmware, software or a combination thereof, and can use a circuit, a single or multiple application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic Device, PLD), a field programmable gate array (Field Programmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, at least one of a microprocessor, and also includes other physical, biological or chemical structures that can achieve similar or equivalent functions to the processors listed above, such as biological neurons, quantum computing units, DNA computing units, etc., so that the processor can execute some or all of the steps in the computer program or method involved in the various embodiments of the present application, or any combination of the steps mentioned therein. In the electronic device 4 of this embodiment, the processor 41 can be a single processor or a combination of two or more processors in terms of physical entity, such as a combination of a CPU and a GPU, a combination of a CPU and an FPGA, a combination of a CPU and an ASIC, a combination of a CPU and a coprocessor, and a combination of a CPU and a DSP, etc. In the embodiment, these combinations are collectively referred to as processors like a single processor.
[0189] The computer program 45 involved in the embodiment can be stored in a computer device readable storage medium, which includes but is not limited to a disk, a tape, a magnetic card, a floppy disk, a flash memory, an optical disk, an optical card, a read-only memory (ROM), a random access memory (RAM), an erasable programmable ROM (EPROM) and an electrically erasable programmable ROM (EEPROM), etc., and also includes other biological, physical or chemical structures that can achieve similar or equivalent functions to the storage media listed above, such as DNA, RNA, protein and other units with information storage capabilities. In a specific embodiment, the storage medium involved can be one of the above-mentioned media types, or a combination of the above-mentioned media types. In different embodiments, the computer program involved in the embodiment can be stored in a single medium in a centralized manner, or can be stored in multiple media in a distributed manner.
[0190] The memory 44 containing a computer device readable storage medium may be a non-volatile memory or a random access memory. These computer device readable storage media may be built into the device, or may be connected to the device involved in the embodiment as an external device or part of an external device. In some embodiments, the memory with a computer device readable storage medium is deployed locally; in other embodiments, a scheme of deploying the memory away from the processor may also be adopted, such as a network attached memory accessed via an RF circuit or an external port and a communication network, wherein the communication network may be the Internet, one or more intranets, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), etc., or a suitable combination thereof, as long as the computer device can access the memory. In addition, the computer program involved in the embodiment may be stored in plaintext / ciphertext form, or may be designed as training data, which may be integrated and reorganized by model training and implicitly stored in the parameter state of a deep neural network or other machine learning model.
[0191] like Fig.14 In the illustrated embodiment, the computer program 45 is stored in the memory 44 of the electronic device 4, but the reader should be aware that other solutions that can enable the processor to execute the computer program are feasible.
[0192] The input device 42 is used to input data and / or signals, and the output device 43 is used to output data and / or signals. The input device 42 and the output device 43 may be independent devices or an integrated device.
[0193] It can be understood that in the embodiment of the present invention, the memory 44 can be used not only to store relevant instructions, and the embodiment of the present invention does not limit the specific data stored in the memory.
[0194] Understandably, Fig.14 Only a simplified design of an electronic device is shown. In practical applications, the electronic device may also include other necessary components, including but not limited to any number of input / output devices, processors, memories, etc., and all multi-view heterogeneous traffic state interpolation methods that can implement the embodiments of the present invention are within the protection scope of the present invention.
[0195] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical or other forms.
[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0198] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the present invention can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a management server, or a network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: read-only memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0199] Finally, it should be noted that although the above embodiments have been described in the specification and drawings of this application, this does not limit the scope of patent protection of this application. All technical solutions generated by replacing or modifying equivalent structures or equivalent processes based on the essential concept of this application using the contents recorded in the specification and drawings of this application, as well as directly or indirectly implementing the technical solutions of the above embodiments in other related technical fields, are included in the scope of patent protection of this application.
Claims
1. A traffic status data interpolation method, characterized in that: The method comprises: Acquire original GPS data, preprocess the original GPS data to obtain a preprocessed vehicle trajectory data set, and generate a traffic speed tensor based on the preprocessed vehicle trajectory data set; Based on the traffic speed tensor, a heterogeneous graph attention network model considering spatial and temporal factors is constructed in spatial and temporal perspectives; Utilizing the heterogeneous graph attention network model, extracting latent features from spatial and temporal perspectives, and interpolating missing traffic status data by fusing the latent features; and Output the interpolation results of traffic status data to achieve accurate estimation of missing data.
2. The traffic status data interpolation method according to claim 1, characterized in that: Based on the traffic speed tensor, a heterogeneous graph attention network model considering spatial and temporal factors is constructed in spatial and temporal perspectives, specifically including: Obtain a road segment mapping dataset, and take each road in the road network as a node, create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph; wherein the road segment mapping dataset is obtained by mapping the GPS data after cleaning abnormal GPS data points to the corresponding road segment of the road network; Extracting a time series data set from the road segment mapping data set, taking each time segment on the time dimension as a node, and defining dynamic connections between capture time segments according to the periodicity and continuity of time to construct a time heterogeneous graph; According to the road characteristics of the spatial nodes and the time attributes of the time nodes, a complete spatiotemporal feature description is provided for each node in the spatial heterogeneous graph and the time heterogeneous graph to obtain the node characteristics of the spatial heterogeneous graph and the time heterogeneous graph; Based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependencies between spatial and temporal nodes are learned and refined through the unit path and multi-path attention mechanisms, and a heterogeneous graph attention network model that considers spatial and temporal factors is constructed.
3. The traffic status data interpolation method according to claim 2, characterized in that: Obtain a road segment mapping dataset, and take each road in the road network as a node, create spatial adjacency relationships based on road type and connectivity to construct a spatial heterogeneous graph, including: Based on the road segment mapping dataset, each road is defined as a node in the graph, and links between nodes are established according to actual connectivity between roads to form a basic node and link framework of the spatial heterogeneous graph; and Utilizing Meta Paths Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments to construct a spatially heterogeneous graph that captures and analyzes the spatial connections and interactions between roads; A time series data set is extracted from the road segment mapping data set, and each time segment on the time dimension is used as a node. Dynamic connections between capture time periods are defined according to the periodicity and continuity of time to construct a time heterogeneous graph, which specifically includes: Extracting a time series data set from the road segment mapping data set, identifying and dividing time windows, and recording traffic state observation information in each time window; Each time segment is regarded as a node in the graph to define the time node in the time heterogeneous graph, and the links and meta-paths are defined according to the relative order and periodicity of the time windows to transform them into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships; defines metapaths Represents the connection between adjacent time segments based on hourly relations; For each meta path and Create a 0-1 adjacency matrix respectively ; Wherein, the adjacency matrix represents the connection status between time nodes; The graph is constructed using nodes and links to reflect the spatiotemporal relationship between time periods, and the time nodes, links and adjacency matrix are integrated to form a complete time-heterogeneous graph.
4. The traffic status data interpolation method according to claim 3, characterized in that: Based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, the dependencies between spatial and temporal nodes are learned and refined through the unit path and multi-path attention mechanisms, and a heterogeneous graph attention network model considering spatial and temporal factors is constructed, which specifically includes: Based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph, a unit path attention mechanism is applied to evaluate and integrate the importance of the node neighborhood, and the original feature representation of the node is transformed and weightedly aggregated to generate a unit path-based node representation; and Based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate a node potential feature vector with comprehensive spatiotemporal characteristics.
5. The traffic status data interpolation method according to claim 4, characterized in that: Based on the node representation of the unit path, multi-path attention weight calculation and weighted aggregation processing of semantic information are performed to generate node potential feature vectors with comprehensive spatiotemporal features, including: Use a multi-layer perceptron to perform nonlinear transformation on the node feature representation of each unit path to obtain the node representation transformed by the multi-layer perceptron; The attention vector is used to weight the node representation after the multi-layer perceptron transformation, and the importance score of each node in a specific meta-path is obtained by calculating the weighted sum of each meta-path. The importance score of each node in a specific meta-path is calculated by formula (4). represents a specific meta-path in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector in the multilayer perceptron, Indicates that node i is in the meta-path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents a nonlinear activation function in the multilayer perceptron; represents the importance score; Represents the metapath The importance scores of all nodes on the network are normalized so that the sum of the weights of each meta-path is 1; (4) According to the importance score of each node in a specific meta-path, the node representations of all meta-paths are weighted summed to obtain the final potential feature vector of each node F ; Among them, the final potential feature vector of each node is calculated by formula (5) F ; Indicates that the node is in the meta path The nodes on represent, p The number of paths representing the meta-path set; (5)。 6. The traffic status data interpolation method according to claim 5, characterized in that: The established heterogeneous graph model is used to extract potential features from spatial and temporal perspectives, and the missing traffic status data is interpolated by fusing the potential features, including: The inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models is calculated by inner product fusion to generate a fused traffic state fusion matrix; wherein the inner product is calculated by formula (6); represents the spatial latent feature matrix output by the spatial heterogeneous graph model, represents the temporal latent feature matrix output by the temporal heterogeneous graph model, b represents the batch size, k Indicates the number of spatial attributes / temporal attributes, represents the inner product fusion function; (6) The spatial and temporal potential features are mapped and fused into a high-dimensional tensor through low-rank multimodal fusion, and a low-dimensional feature representation that integrates multimodal information is generated through tensor outer product calculation and weight tensor decomposition; wherein, the tensor outer product calculation is performed through formula (7); the weight tensor decomposition calculation is performed through formula (8); and the low-dimensional feature representation is generated through formula (9); Z represents a high-dimensional tensor obtained by calculating the outer product of tensors, represents the input feature vector for each mode, M represents the number of modes, For all modes m Perform tensor outer product calculations; Indicates that the i-th decomposition factor is in m vector on the modes, r Represents the weight tensor W The decomposition rank of h represents the low-dimensional feature representation, Indicates m The latitude of the input feature vector for each mode; (7) (8) (9) The low-dimensional feature representation of the multimodal information is used to interpolate missing traffic status data.
7. A traffic status data interpolation device, characterized in that: The device comprises: A trajectory preprocessing unit, configured to obtain raw GPS data, preprocess the raw GPS data to obtain a preprocessed vehicle trajectory data set, and generate a traffic speed tensor based on the preprocessed vehicle trajectory data set; A heterogeneous graph model building unit, configured to build a heterogeneous graph attention network model that considers spatial and temporal factors in spatial and temporal perspectives based on the traffic speed tensor generated by the trajectory preprocessing unit; a spatiotemporal feature fusion unit, configured to extract latent features from spatial and temporal perspectives by using the heterogeneous graph attention network model established by the heterogeneous graph model establishment unit, and interpolate missing traffic status data by fusing the latent features; and The interpolation result output unit is used to output the interpolation result of the traffic status data according to the spatiotemporal features fused by the spatiotemporal feature fusion unit, so as to achieve accurate estimation of the missing data.
8. The traffic status data interpolation device according to claim 7, characterized in that: The heterogeneous graph model building unit includes: A spatial heterogeneous graph construction module is used to obtain the road segment mapping data set generated by the trajectory preprocessing unit, and take each road in the road network as a node, create a spatial adjacency relationship based on road type and connectivity to construct a spatial heterogeneous graph; wherein the road segment mapping data set is obtained by the trajectory preprocessing unit mapping the GPS data after cleaning the abnormal GPS data points to the corresponding road segment of the road network; A time heterogeneous graph construction module is used to obtain the road segment mapping data set generated by the trajectory preprocessing unit, extract the time series data set from the road segment mapping data set, take each time segment on the time dimension as a node, define the dynamic connection between the capture time periods according to the periodicity and continuity of time, so as to construct a time heterogeneous graph; A node feature representation module, for providing a complete spatiotemporal feature description for each node in the spatial heterogeneous graph and the temporal heterogeneous graph according to the road features of the spatial nodes captured by the spatial heterogeneous graph construction module and the time attributes of the time nodes captured by the temporal heterogeneous graph construction module, so as to obtain the node features of the spatial heterogeneous graph and the temporal heterogeneous graph; The attention learning module is used to learn and refine the dependencies of spatial and temporal nodes based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module through unit path and multi-path attention mechanisms, and to build a heterogeneous graph attention network model that takes spatial and temporal factors into consideration.
9. The traffic status data interpolation device according to claim 8, characterized in that: The spatial heterogeneous graph construction module is specifically used for: Based on the road segment mapping dataset, each road is defined as a node in the graph, and links between nodes are established according to actual connectivity between roads to form a basic node and link framework of a spatial heterogeneous graph; as well as Utilizing Meta Paths Distinguish connections between roads of the same type, using meta-paths Distinguish the connections between different types of roads and form an adjacency matrix , using 0-1 values to represent the connection status between road segments to construct a spatially heterogeneous graph that captures and analyzes the spatial connections and interactions between roads; The temporal heterogeneous graph construction module is specifically used for: Extracting a time series data set from the road segment mapping data set, identifying and dividing time windows, and recording traffic state observation information in each time window; Each time segment is regarded as a node in the graph to define the time node in the time heterogeneous graph, and the links and meta-paths are defined according to the relative order and periodicity of the time windows to transform them into edges in the graph; wherein, the meta-path is defined Represents connections between adjacent time segments based on week relationships; defines metapaths Represents the connection between adjacent time segments based on hourly relations; For each meta path and Create a 0-1 adjacency matrix respectively ; Wherein, the adjacency matrix represents the connection status between time nodes; Nodes and links are used to construct a graph to reflect the spatiotemporal relationship between time periods, and time nodes, links and adjacency matrices are integrated to form a complete time-heterogeneous graph.
10. The traffic status data interpolation device according to claim 9, characterized in that: The attention learning module comprises: a unit path attention learning submodule, for evaluating and integrating the importance of node neighborhoods based on the node features of the spatial heterogeneous graph and the temporal heterogeneous graph generated by the node feature representation module, applying a unit path attention mechanism, and transforming and weightedly aggregating the original feature representation of the node to generate a unit path-based node representation; and The multi-path attention learning submodule is used to perform multi-path attention weight calculation and weighted aggregation processing of semantic information based on the node representation of the unit path generated by the unit path attention learning submodule to generate a node potential feature vector with comprehensive spatiotemporal features.
11. The traffic status data interpolation device according to claim 10, characterized in that: The multi-path attention learning submodule is specifically used for: Use a multi-layer perceptron to perform nonlinear transformation on the node feature representation of each unit path to obtain the node representation transformed by the multi-layer perceptron; The attention vector is used to weight the node representation after the multi-layer perceptron transformation, and the importance score of each node in a specific meta-path is obtained by calculating the weighted sum of each meta-path. The importance score of each node in a specific meta-path is calculated by formula (4). represents a specific meta-path in the meta-path set, W is the weight matrix used in the multilayer perceptron, b is the bias vector in the multilayer perceptron, Representation Node i In the meta path The node representation after the transformation by the multi-layer perceptron is: V Represents the set of all nodes in the graph, | V | represents the total number of nodes in the graph, represents a nonlinear activation function in the multilayer perceptron; represents the importance score; Represents the metapath The importance scores of all nodes on the network are normalized so that the sum of the weights of each meta-path is 1; (4) According to the importance score of each node in a specific meta-path, the node representations of all meta-paths are weighted summed to obtain the final potential feature vector of each node F ; Among them, the final potential feature vector of each node is calculated by formula (5) F ; Indicates that the node is in the meta path The nodes on represent, p The number of paths representing the meta-path set; (5)。 12. The traffic status data interpolation device according to claim 11, characterized in that: The spatiotemporal feature fusion unit comprises: An inner product fusion module is used to calculate the inner product of the potential feature matrix output by the spatial and temporal heterogeneous graph models through inner product fusion to generate a fused traffic state fusion matrix; wherein the inner product is calculated by formula (6); represents the spatial latent feature matrix output by the spatial heterogeneous graph model, represents the temporal latent feature matrix output by the temporal heterogeneous graph model, b represents the batch size, k Indicates the number of spatial attributes / temporal attributes, represents the inner product fusion function; (6) A low-rank multimodal fusion module is used to map and fuse the potential features of space and time into a high-dimensional tensor through low-rank multimodal fusion, and generate a low-dimensional feature representation that integrates multimodal information through tensor outer product calculation and weight tensor decomposition; wherein, the tensor outer product calculation is performed through formula (7); the weight tensor decomposition calculation is performed through formula (8); and the low-dimensional feature representation is generated through formula (9); Z represents a high-dimensional tensor obtained by calculating the outer product of tensors, represents the input feature vector for each mode, M represents the number of modes, For all modes m Perform tensor outer product calculations; Indicates i The decomposition factor is m vector on the modes, r Represents the weight tensor W The decomposition rank of h represents the low-dimensional feature representation, Indicates m The latitude of the input feature vector for each mode; (7) (8) (9) The interpolation result generation module is used to interpolate the missing traffic status data using the low-dimensional feature representation of the multimodal information.
13. An electronic device comprising: A processor and a memory, characterized in that the memory is used to store computer program codes, the computer program codes include computer instructions, and when the processor executes the computer instructions, the electronic device executes the steps of the traffic status data interpolation method as described in any one of claims 1 to 6.
14. A readable storage medium having a computer program stored therein, characterized in that: The computer program includes program instructions, and when the program instructions are executed by a processor of an electronic device, the processor executes the steps of the traffic status data interpolation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-element asynchronous time series data classification method and device
CN115329166A
Customer portrait key data mining method and system based on space-time big data
CN118797542A
Federal heterogeneous graph representation learning method and system based on pseudo element path generation
CN119005300A
Traffic analysis method, related device, and readable storage medium
WO2023273724A1
Cited By
Method and system for complementing traffic flow data based on priori knowledge and Transform
CN120216932A
A traffic flow data completion method and system based on prior knowledge and Transformer
CN120216932B
Semiconductor section structure detection method and system based on etching technology
CN120635050A
Communication engineering whole-process safety production risk dynamic assessment method
CN121279810A