Segmented track matching method and device based on graph neural network, equipment and medium

Through the segmented trajectory matching method based on graph neural network, the road network link is constructed as the nodes and edges of the graph data structure, and the encoding trajectory points and attribute information are node feature vectors, which solves the problem of matching errors in the positioning system in large distance drifts and complex scenarios, and achieves a higher road network matching accuracy.

CN119903355APending Publication Date: 2025-04-29上海依时派运输有限公司
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411998978.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The existing road network matching technology is prone to matching errors in the face of large distance drifts of the positioning system and complex scenarios, especially in similar road-shaped scenarios such as parallel roads.

Method used

Using the segmented trajectory matching method based on graph neural network, by constructing a graph structure, the road network link is converted into nodes in the graph data structure, the connection relationship between road network links is converted into edge information, and the trajectory point information and road network attribute information are encoded into node feature vectors, and iterative training is carried out to obtain the trained graph neural network model, which is used to predict the predicted trajectory data.

Benefits of technology

It improves the accuracy of road network matching, can better be compatible with the large distance drift of the positioning system, and reduces matching errors in complex scenarios, especially in similar road-shaped scenarios such as parallel roads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903355A_ABST
    Figure CN119903355A_ABST
Patent Text Reader

Abstract

The invention discloses a segmented track matching method and device based on a graph neural network, equipment and a medium, and the method comprises the steps: obtaining track sample data with a road network matching truth value; a graph structure is constructed based on the trajectory sample data, and nodes of the graph structure represent road network links; encoding the track point information and the road network attribute information corresponding to each road network link into node feature vectors; and carrying out iterative training on a preset graph neural network model based on the node feature vector and the road network matching true value until a preset convergence condition is met, obtaining a trained graph neural network model, and carrying out road matching prediction on the to-be-predicted trajectory data based on the trained graph neural network model. The method can solve the problem that the hidden Markov model cannot be compatible with large-distance drift of a positioning system due to limited receptive field, and is easy to have wrong matching under similar road shape scenes such as parallel roads (such as main and side roads and small-angle branches), thereby improving the road network matching accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a segmented trajectory matching method, device, computer equipment and storage medium based on a graph neural network. Background Art

[0002] With the continuous development of location-based service technology, the market demand for restoring the actual driving position of the vehicle is constantly increasing, so the existence of road network matching technology is crucial. The so-called road network matching is to combine the road network data to accurately map the original trajectory points actually collected by the vehicle to the road network data to truly restore the vehicle's driving position information. However, in actual applications, due to the influence of factors such as the positioning accuracy of hardware equipment and complex scenes (such as building obstructions, viaducts, and tunnels), the positioning signal of the Global Positioning System (GPS) / Global Navigation Satellite System (GNSS) is likely to be interfered with, resulting in inaccurate positioning. At the same time, the actual road conditions are becoming more and more complicated, which makes the actual collected trajectory data and the map road data have serious deviations, resulting in large distance drift.

[0003] Currently, road network matching is usually performed based on the Hidden Markov Model, which calculates the probability of each candidate matching point by considering its position, direction and road network topology, and selects the one with the highest probability as the final matching result. This method is compatible with most scenarios, but because its state information only considers the previous trajectory point, the receptive field of the model is limited and it is not compatible with the drift of the positioning system over a large distance (i.e. the direction is correct but the position drifts equidistantly, the position and direction drift, etc.), so it is easy to match incorrectly in similar road shape scenarios such as parallel roads (such as main and auxiliary roads, small-angle bifurcated roads). Summary of the invention

[0004] Based on this, it is necessary to provide a segmented trajectory matching method, device, computer equipment and storage medium based on graph neural network to address the above technical problems, so as to solve at least one problem existing in the above-mentioned prior art.

[0005] In a first aspect, a segmented trajectory matching method based on a graph neural network is provided, comprising:

[0006] Obtain trajectory sample data with road network matching truth value;

[0007] Based on the trajectory sample data, a graph structure is constructed, wherein nodes of the graph structure represent road network links;

[0008] Encoding the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector;

[0009] The preset graph neural network model is iteratively trained based on the node feature vector and the road network matching true value until the preset convergence condition is met, so as to obtain a trained graph neural network model, and perform road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

[0010] In one embodiment, the step of obtaining trajectory sample data having a road network matching true value includes:

[0011] Collect trajectory point information and road network data;

[0012] Performing road network matching on the trajectory point information and the road network data to obtain a road network matching result;

[0013] Manual error correction and annotation are performed on the road network matching result to obtain the trajectory sample data with the road network matching true value.

[0014] In one embodiment, the obtaining of trajectory sample data having a road network matching true value includes:

[0015] Perform route planning based on the target starting point and the target end point to obtain a road segment set, wherein the road segment set includes all driving road segments between the target starting point and the target end point;

[0016] Extracting a road shape latitude and longitude point set corresponding to each of the driving road sections;

[0017] The road shape longitude and latitude point set is interpolated and noise simulation is added to obtain the trajectory sample data with the road network matching true value.

[0018] In one embodiment, the adding noise simulation to obtain trajectory sample data with a road network matching true value includes:

[0019] By using the trajectory sample data, solving and estimating the Gaussian mixture distribution model parameters of the noise distribution;

[0020] Based on the Gaussian mixture distribution model parameters, corresponding noise is added to each road shape longitude and latitude point in the road shape longitude and latitude point set after interpolation processing to simulate the trajectory sample data with the road network matching true value after being affected by noise.

[0021] In one embodiment, encoding the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector includes:

[0022] Encoding the road network attribute information corresponding to each of the road network links to obtain static features of a preset dimension;

[0023] Based on the trajectory points around each road network link and the multi-dimensional features corresponding to each trajectory point, a dynamic feature matrix is ​​obtained;

[0024] The node feature vector is obtained based on the static features of the preset dimension and the dynamic feature matrix.

[0025] In one embodiment, obtaining the node feature vector based on the static feature of the preset dimension and the dynamic feature matrix includes:

[0026] The attention matrix is ​​obtained through the preset activation function and multi-layer linear transformation;

[0027] Based on the attention matrix and the dynamic feature matrix, an intermediate result matrix is ​​obtained;

[0028] The intermediate result matrix and the static features of the preset dimension are concatenated to obtain the node feature vector.

[0029] In one embodiment, the performing road matching prediction on the trajectory data to be predicted based on the trained graph neural network model includes:

[0030] Acquire the trajectory data to be predicted, and segment the trajectory data to be predicted according to a preset window size;

[0031] Based on the trajectory data in each window after segmentation, the road network data within the preset range is recalled;

[0032] Perform feature extraction on the trajectory data in each window after segmentation and the road network data within a preset range to obtain the features to be predicted;

[0033] Based on the trained graph neural network model, the features to be predicted are predicted to obtain a route matching the trajectory data to be predicted.

[0034] In a second aspect, a segmented trajectory matching device based on a graph neural network is provided, comprising:

[0035] A trajectory sample data acquisition unit, used to acquire trajectory sample data with a road network matching true value;

[0036] A graph structure construction unit, used to construct a graph structure based on the trajectory sample data, wherein the nodes of the graph structure represent road network links;

[0037] A node feature vector encoding unit, used to encode the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector;

[0038] A prediction unit is used to iteratively train a preset graph neural network model based on the node feature vector and the road network matching true value until a preset convergence condition is met, thereby obtaining a trained graph neural network model, and performing road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

[0039] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, wherein when the processor executes the computer-readable instructions, the segmented trajectory matching method based on the graph neural network as described above is implemented.

[0040] In a fourth aspect, a readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the segmented trajectory matching method based on the graph neural network as described above is implemented.

[0041] The above-mentioned segmented trajectory matching method, device, computer equipment and storage medium based on graph neural network, the method implementation includes: obtaining trajectory sample data with road network matching true value; based on the trajectory sample data, constructing a graph structure, the nodes of the graph structure represent road network links; encoding the trajectory point information and road network attribute information corresponding to each road network link into a node feature vector; iteratively training the preset graph neural network model based on the node feature vector and the road network matching true value until the preset convergence condition is met, and obtaining the trained graph neural network model, so as to perform road matching prediction on the trajectory data to be predicted based on the trained graph neural network model. In the embodiment of the present application, the road network matching is realized by the node classification task of the graph neural network, the road network link is the main information carrier, the road network link is converted into a node (Node) in the graph data structure, the trajectory segmentation processing is realized, and the connection relationship between the road network links is converted into the edge information (Edges) in the graph data structure. At the same time, encoding the link attribute information and trajectory point information as node feature information can better apply the topological relationship of the road network and learn the parameter representation of the deviation and drift of the trajectory point information for the road network link data. This can solve the problem that the hidden Markov model is incompatible with the drift of a large distance of the positioning system due to its limited receptive field, and is prone to matching errors in similar road shape scenarios such as parallel roads (such as main and auxiliary roads, small-angle bifurcated roads), thereby improving the accuracy of road network matching. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 It is a schematic diagram of a process of a segmented trajectory matching method based on a graph neural network in one embodiment of the present invention;

[0044] Figure 2 It is a structural schematic diagram of the structure in the figure in one embodiment of the present invention;

[0045] Figure 3 It is a network architecture diagram of a neural network model in an embodiment of the present invention;

[0046] Figure 4 is a schematic diagram of an implementation environment of a road network labeling method in one embodiment of the present invention;

[0047] Figure 5 It is a flowchart of a node feature construction method in one embodiment of the present invention;

[0048] Figure 6 It is a structural schematic diagram of a segmented trajectory matching device based on a graph neural network in one embodiment of the present invention;

[0049] Figure 7 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] In one embodiment, if Figure 1 As shown, a segmented trajectory matching method based on a graph neural network is provided, comprising the following steps:

[0052] In step S110, trajectory sample data with road network matching true value is obtained;

[0053] Optionally, trajectory point information and road network data can be collected, and a preset road network matching algorithm, such as a hidden Markov algorithm, a Kalman filter algorithm, a support vector machine (SVM) algorithm, etc., can be used for road network matching to obtain matching results, and trajectory sample data with road network matching true values ​​can be obtained through manual labeling.

[0054] Optionally, based on the road network data, the starting point and the end point, a preset route specification algorithm, such as the Dijkstra algorithm, the A* algorithm, etc., can be used for route planning to obtain a matching result, which is used as the road network matching true value, and then the matching result is interpolated and noise simulation is added to obtain trajectory points, thereby obtaining the final trajectory sample simulation data with matching true values ​​as trajectory sample data. By simulating the generation of trajectory points by road network matching true value, the cost of manual annotation can be reduced, and sample sets of different scenarios can be constructed to enhance the generalization of the model.

[0055] The track point information may include latitude and longitude, direction, speed, timestamp, and confidence information, etc. The road network data may include information about each road section (i.e., road network link) in the road network, such as the coordinates of the start and end nodes of the road section, the length of the road section, the road grade (such as expressway, urban main road, branch road, etc.), and the direction of travel (one-way or two-way).

[0056] The noise may include position noise, speed noise, direction noise, etc.

[0057] In step S120, a graph structure is constructed based on the trajectory sample data, wherein nodes of the graph structure represent road network links;

[0058] Optionally, a graph structure G = {V, E, W} corresponding to the trajectory sample data can be constructed, where the node information V, edge information E, adjacency information W, node feature vector h v , v∈V, such as Figure 2 As shown in the figure, the road network link is regarded as a node, the directed connection relationship between the road network links is represented as an edge, and the adjacency relationship W is used to represent the directed topological relationship between the road network links. The numbers in the brackets represent the weight of the edge, for example, the edge between node 3 and node 5: (3,5), which represents the weight of the edge, such as the distance between node 3 and node 5, the transmission cost and other weights.

[0059] In step S130, the trajectory point information and the road network attribute information corresponding to each of the road network links are encoded into a node feature vector;

[0060] Optionally, for each node in the graph structure, that is, each road network link, it can be based on the trajectory point information around it and its own attribute information. It should be noted that the attribute information is relatively stable and will not change dramatically over time or at different trajectory points. Therefore, it is usually a static feature. These road network attribute information are converted into a vector of fixed dimension through mapping or encoding. For example, for road types, one-hot encoding can be used. Assuming there are three types of roads: highways, urban main roads and alleys, then highways can be represented as [1, 0, 0], urban main roads can be represented as [0, 1, 0], and alleys can be represented as [0, 0, 1]. For other attributes, such as road width, number of lanes, speed limit, etc., they can be normalized to a certain range and used as other dimensions of the vector, so that static features of preset dimensions can be obtained. The trajectory point information usually includes information such as timestamp, speed, direction, altitude, vehicle status, etc., which reflects the dynamic state of passing through the road network link at different time points and can be used as dynamic features. Since each trajectory point can include multi-dimensional features, a dynamic feature matrix can be obtained after combination. The dynamic feature matrix and the static features of the preset dimension are processed based on the attention mechanism to obtain the attention matrix, and then through further operations (such as matrix operations, splicing, etc.), the node feature vectors corresponding to each node can be obtained. The node feature vectors corresponding to each node can be obtained.

[0061] The road attribute information may include the road grade (such as expressway, urban trunk road, branch road, etc.), road length, road direction (one-way or two-way), number of lanes, etc.

[0062] In step S140, the preset graph neural network model is iteratively trained based on the node feature vector and the road network matching true value until the preset convergence condition is met, so as to obtain a trained graph neural network model, and perform road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

[0063] Optionally, the preset graph neural network model (GAT) can be composed of 4 attention layers. This multi-layer design helps the model to gradually and deeply capture the complex relationships in the input data. Each attention layer works based on the principle of the graph attention network (GAT), that is, by calculating the attention coefficient between nodes, the nodes can selectively aggregate the information of neighboring nodes to update their own feature representations. Among them, the first two layers are equipped with a 2-head attention mechanism. The multi-head attention mechanism can pay attention to input features from multiple different angles. Each head will independently calculate the attention coefficient and aggregate information, and finally merge the results of each head by splicing or averaging. Among them, the last two layers use a 4-head attention mechanism. Compared with the first two layers, the increase in the number of heads means that the information in the input features can be mined from more dimensions, and the relationship between nodes can be captured more finely, so that the model has stronger feature extraction capabilities when processing complex graph structure data, especially for deep feature mining.

[0064] See also Figure 3, a network architecture diagram of a preset graph neural network model (GAT) is provided, which may include graph data input, node feature vector embedding (Node Feature Embedding), padding and normalization (Padding & Norm), dropout (Dropout), graph attention convolution (GATConv), activation function (ELU), weight layer (optional) (WeightLayer), fully connected layer (Dense), activation function (Sigmoid). Its specific workflow may be: first, a graph structure is constructed according to the trajectory point data. The graph structure may include N nodes, each node represents a link link. The node feature vector corresponding to each node can be extracted from the graph structure, and embedded processing is performed to convert the original features of the node into a form suitable for neural network processing to obtain the node feature vector of each node. For example, the dimension of the node feature vector can be 256, then the input dimension is (N, 256). The node features after embedding processing are padded and normalized. Through the padding operation, the vectors are ensured to have the same length. Through the normalization operation, the characteristic values ​​of the data are scaled to a specific range to improve the stability and convergence speed of the model. The padded and normalized node features are input into the graph attention block, which uses the Multi-Heads self-attention mechanism. The Multi-Heads self-attention mechanism can calculate the attention weights between nodes in parallel in multiple subspaces, thereby capturing the relationship between nodes more comprehensively. In the graph attention block, the Dropout operation is first used, which is a regularization technique that prevents the model from overfitting by randomly dropping a portion of neurons. Then the Graph Attention Convolution (GATConv) operation is performed, which aggregates features on the graph structure and updates the feature vector of the node according to the attention weights between nodes. Finally, the Exponential Linear Unit (ELU) activation function can be applied to introduce nonlinearity to help the model learn more complex relationships. You can choose whether to add a weight layer. If added, the weight layer will weight the node features and further adjust the feature vector.

[0065] Finally, the fully connected layer (Dense) and the Sigmoid activation function (Sigmoid) can be used to predict whether there is a matching link. The Sigmoid function compresses the output value to between 0 and 1.

[0066] The training process of the preset graph neural network model is as follows: the node feature vector is normalized (LayerNormalization), and the training set and the test set can be set according to a preset ratio, such as a ratio of 9:1. The parameters of the preset graph neural network model optimizer are configured, for example, the learning rate is set to 0.0001, and the weight decay value is used to be 5x10-6 . Then, the randomly selected node feature vectors in the training data set can be input into the configured preset graph neural network model for prediction, and the predicted value in this prediction process can be obtained. Then, the loss value is calculated based on the predicted value and the true value of the road network matching. If the loss value is greater than the preset threshold, the model parameters can be adjusted, and other node feature vectors can be selected in the training data set again, and input into the adjusted preset graph neural network model for re-prediction, and the loss value in this prediction process can be calculated again based on the prediction result. If the loss value is greater than the preset threshold, the model parameters can be adjusted, and the above steps are repeated until the preset convergence conditions are met, such as when the number of iterations reaches the preset threshold, or the loss value is less than the preset threshold, the training is completed, and the trained graph neural network model is obtained and saved for subsequent model testing and actual prediction process.

[0067] It should be noted that the binary cross entropy loss function (BCEWithLogitsLoss) can be selected as the loss function of the model. This loss function combines the Sigmoid layer and the binary cross entropy loss layer, is suitable for binary classification problems, and has advantages in numerical stability. Feature data is constructed based on the original data set. It is understandable that other loss functions can also be selected, such as mean square error, mean absolute error, etc.

[0068] The embodiment of the present application provides a segmented trajectory matching method based on a graph neural network, and the method is implemented by: obtaining trajectory sample data with a road network matching true value; constructing a graph structure based on the trajectory sample data, wherein the nodes of the graph structure represent road network links; encoding the trajectory point information and road network attribute information corresponding to each road network link into a node feature vector; iteratively training a preset graph neural network model based on the node feature vector and the road network matching true value until a preset convergence condition is met, and a trained graph neural network model is obtained, and road matching prediction is performed on the trajectory data to be predicted based on the trained graph neural network model. In the embodiment of the present application, road network matching is realized through the node classification task of the graph neural network, and the road network link is the main information carrier. The road network link is converted into a node (Node) in the graph data structure, and the connection relationship between the road network links is converted into edge information (Edges) in the graph data structure. At the same time, encoding the link attribute information and trajectory point information as node feature information can better apply the topological relationship of the road network and learn the parameter representation of the deviation and drift of the trajectory point information for the road network link data. This can solve the problem that the hidden Markov model is incompatible with the drift of a large distance of the positioning system due to its limited receptive field, and is prone to matching errors in similar road shape scenarios such as parallel roads (such as main and auxiliary roads, small-angle bifurcated roads), thereby improving the accuracy of road network matching.

[0069] In an embodiment of the present application, the step of obtaining trajectory sample data having a road network matching true value includes:

[0070] Collect trajectory point information and road network data;

[0071] Performing road network matching on the trajectory point information and the road network data to obtain a road network matching result;

[0072] Manual error correction and annotation are performed on the road network matching result to obtain the trajectory sample data with the road network matching true value.

[0073] Collect trajectory point information and road network data, and use preset road network matching algorithms, such as hidden Markov algorithm, Kalman filter algorithm, vector machine algorithm, etc. to perform road network matching to obtain matching results. Figure 4 After processing by the hidden Markov algorithm, the matching result A can be obtained. It can be seen that the matching result A does not match the original GPS / GNSS trajectory point B, and it is affected by the surrounding road network data C. Therefore, it can be seen that due to the drift of the trajectory point, the matching result A is an erroneous redundant result, so it is manually marked as an error. If there are other correct and reasonable results, they are also manually marked as correct matching results. It can also be seen that the hidden Markov algorithm is not compatible with the larger distance drift of the positioning system.

[0074] Therefore, by manually annotating the matching results for error correction, the correct road network matching truth value can be obtained, thereby obtaining trajectory sample data with the road network matching truth value.

[0075] In an embodiment of the present application, the step of obtaining trajectory sample data having a road network matching true value includes:

[0076] Perform route planning based on the target starting point and the target end point to obtain a road segment set, wherein the road segment set includes all driving road segments between the target starting point and the target end point;

[0077] Extracting a road shape latitude and longitude point set corresponding to each of the driving road sections;

[0078] The road shape longitude and latitude point set is interpolated and noise simulation is added to obtain the trajectory sample data with the road network matching true value.

[0079] Optionally, the target starting point and the target end point can be determined, and the route planning can be performed in the target road network through a preset route planning algorithm, such as the Dijkstra algorithm, the A* algorithm, etc., to obtain a planned route, which can be composed of multiple road network links. A link string composed of multiple road network links is a road segment set, which represents the road segment set that the vehicle should travel through from the starting point to the end point under ideal conditions. This road segment set is the road network matching truth value.

[0080] Then, interpolation processing can be performed by a preset interpolation method, such as linear interpolation, spline interpolation, etc. It can be understood that each link in the link string corresponds to the starting point coordinates (latitude and longitude) and the end point coordinates (latitude and longitude). These node coordinates can be extracted and more intermediate point coordinates can be added on the road section according to certain rules as needed to form a complete road shape longitude and latitude point string of the road section, that is, a road shape longitude and latitude point set. For example, for a long straight road section, new point coordinates can be inserted at a certain interval (such as every 10 meters) to make the description of the road section more detailed.

[0081] Since there are many sources of errors in the actual GPS / GNSS positioning system, such as satellite signal propagation error, receiver noise, multipath effect, etc., corresponding noise needs to be added when simulating trajectory points to get closer to the actual situation.

[0082] In one embodiment of the present application, the adding noise simulation to obtain the trajectory sample data with the road network matching true value includes:

[0083] Solve the Gaussian mixture distribution model parameters that estimate the noise distribution through trajectory points with matching true values;

[0084] Based on the Gaussian mixture distribution model parameters, corresponding noise is added to each road shape longitude and latitude point in the road shape longitude and latitude point set after interpolation processing to simulate trajectory sample data with road network matching true value after being affected by noise.

[0085] It should be noted that the noise can be divided into position noise, velocity noise, direction noise, etc. The noise can be estimated and modeled based on trajectory data with matching true values, as shown below:

[0086] The trajectory sample data includes multiple trajectory points, and can be sorted in time order, position order, etc. For the first trajectory point after sorting, it can be assumed to obey N(u 0 ,ξ 0 ), the observed value of the trajectory point minus the true value is Δu 0 =(Δx 0 , Δy 0 ), where x represents the east-west distance difference and y represents the north-south distance difference, that is, the deviation of the noise of the first trajectory point in the east-west and north-south directions conforms to the mean u 0 , is the variance ξ 0 The normal distribution of .

[0087] The second trajectory point follows a Gaussian mixture distribution: α*N(u 1 ,ξ 1 )+(1-α)*N(Δu 0 ,ξ2 ), the observed value of the trajectory point minus the true value is Δu 1 =(Δx 1 , Δy 1 ), the noise distribution of the second trajectory point is a mixture of two normal distributions, the mixing ratio is determined by α, and the parameters of the two normal distributions are (μ 1 ,ξ 1 ) and (μ 0 ,ξ 2 ).

[0088] The third trajectory point obeys the Gaussian mixture distribution: α*N(u1,ξ1)+(1-a)*N(Δu1,ξ2). The observed value of this trajectory point minus the true value is Δu2=(Δx2,Δy2). The noise distribution of the third trajectory point is a mixture of two normal distributions. The mixing ratio is determined by α. The parameters of the two normal distributions are (μ 1 ,ξ 1 ) and (Δu 1 ,ξ 2 ).

[0089] And so on, until the trajectory is processed to the last trajectory point. The Gaussian mixture distribution model parameters (α, u 0 ,u 1 ,ξ 0 ,ξ 1 ,ξ 2 ), where α represents the mixing ratio, u 0 represents the mean of the first Gaussian distribution, u 1 represents the mean of the second Gaussian distribution, ξ 0 , 1 , 2 Indicates the degree of dispersion of Gaussian distribution.

[0090] After solving the parameters of the Gaussian mixture distribution model of the noise, the position noise can be added to the trajectory sample data, the time interval between the two points is specified as Δt, the simulated speed speed = the distance difference between the two points Δd / Δt, and the simulated direction is the direction of the line between the two points, converted to an angle range of [0, 360°). According to the estimated noise model and trajectory sample data, the trajectory data with noise and the corresponding speed and direction information can be simulated. The trajectory sample data with the true value of the road network matching after being affected by the noise is obtained.

[0091] In an embodiment of the present application, encoding the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector includes:

[0092] Encoding the road network attribute information corresponding to each of the road network links to obtain static features of a preset dimension;

[0093] Based on the trajectory points around each road network link and the multi-dimensional features corresponding to each trajectory point, a dynamic feature matrix is ​​obtained;

[0094] The node feature vector is obtained based on the static features of the preset dimension and the dynamic feature matrix.

[0095] Optionally, for each node in the graph structure, i.e., each road network link, the surrounding related trajectory point information, such as longitude and latitude, speed, direction, confidence, and timestamp, etc., as well as the road network link's own attribute information, such as the information of each road section in the road network (i.e., road network link), such as the start and end node coordinates of the road section, the section length, the road grade (such as expressway, urban main road, branch road, etc.), the direction of travel (one-way or two-way), etc. Then, the trajectory point information and its own attribute information are encoded into the node feature vector h of each node v , v∈V.

[0096] It should be noted that for each node, it can have static features and dynamic features. Static features refer to information related to the attributes of the road network link itself, and can be encoded accordingly, such as one-hot encoding, to obtain static features of preset dimensions, that is, fixed a-dimensional features, which may specifically include one-hot encoding of road grade, one-hot encoding of road attributes, road length, length scaling factor, one-hot encoding of road direction, etc. The value of a is a fixed value, because the road grade, attributes and direction are all defined according to the road network specification. The dynamic features are determined based on the trajectory point information. Taking the graph structure size of P trajectory points as an example, each trajectory point information is assigned U-dimensional features (latitude and longitude, timestamp, time scaling factor, speed, direction, projection distance from the trajectory point to the candidate link, candidate matching link direction, etc.). For a node (i.e. a road network link), its related dynamic feature matrix is ​​P×U dimensional, for example, U can be taken as 8.

[0097] For each node, the dimension of its original feature vector is (a+P×U). The dynamic feature matrix is ​​related to the value of P, and its dimension will vary with different P values ​​and cannot be fixed. In order to be compatible with different values ​​of P, the idea of ​​self-attention mechanism is used to embed the dynamic feature matrix of each node (i.e., road network link), and finally the node feature vector can be obtained. By embedding the dynamic feature mean, it can be compatible with different numbers of dynamic features of trajectory points, which is convenient for model application.

[0098] In an embodiment of the present application, obtaining the node feature vector based on the static feature of the preset dimension and the dynamic feature matrix includes:

[0099] The attention matrix is ​​obtained through the preset activation function and multi-layer linear transformation;

[0100] Based on the attention matrix and the dynamic feature matrix, an intermediate result matrix is ​​obtained;

[0101] The intermediate result matrix and the static features of the preset dimension are concatenated to obtain the node feature vector.

[0102] Alternatively, see Figure 5 , take a node as an example (i.e. a road network link), assuming that there are P trajectory points around the node, and each trajectory point is represented by a U-dimensional feature, then the dynamic feature matrix of the link is a P×U-dimensional vector H=(gps 1 , gps2, ... gpsp), according to the multi-dimensional static feature and dynamic feature matrix, a fixed-dimensional vector h can be obtained v .

[0103] Among them, the attention matrix A can be calculated by the following formula:

[0104] ΛttcntionΛ=softmax(W sa tanh(W s2 (W s1 H T )));

[0105] Among them, softmax represents the activation function, T represents transposition, and W s1 , W s2 , W s3 Represents the weight matrix, which can be learned through training data. Three fully connected layers can be constructed. The first fully connected layer uses the weight matrix W s1 , convert the input H into H,, with a dimension of P×U, and the second fully connected layer uses the weight matrix W s2 , convert the input H into an intermediate result, and obtain the attention matrix A after the activation function processing. The third fully connected layer uses the weight matrix W s3 , after being processed by the activation function, the intermediate result matrix M is obtained, with a dimension of r×L.

[0106] Among them, the intermediate result matrix M can be calculated as follows:

[0107] H′=W s1 H T ;

[0108] M = AH′;

[0109] Then we can get M(r*L)

[0110] Then the node feature vector h v The calculation is as follows, where "+" represents splicing:

[0111] h v =[a]+[M];

[0112] The value of r can be customized. In this case, r is 1. The value of L is determined by a and the final dimension. For example, in this case, h v The dimension of is 256, that is, a+r×L=256. So if a=56, r=1, then L is 200.

[0113] In one embodiment of the present application, the road matching prediction for the trajectory data to be predicted based on the trained graph neural network model includes:

[0114] Acquire the trajectory data to be predicted, and segment the trajectory data to be predicted according to a preset window size;

[0115] Based on the trajectory data in each window after segmentation, the road network data within the preset range is recalled;

[0116] Perform feature extraction on the trajectory data in each window after segmentation and the road network data within a preset range to obtain the features to be predicted;

[0117] Based on the trained graph neural network model, the features to be predicted are predicted to obtain a route matching the trajectory data to be predicted.

[0118] Optionally, the trajectory data to be predicted generated by the target driver during driving can be obtained, and the trajectory data to be predicted can be divided according to a preset time length, such as every 5 minutes as a window, or every 100 trajectory points as a window, to obtain the trajectory data in each window. According to the trajectory data in each window, the approximate area where the vehicle or object is located is determined. For example, the geographical area where it is located is determined according to the latitude and longitude coordinates of the trajectory point. Recall relevant road network data from the road network database within the preset range of the area (for example, within a radius of 500 meters with the trajectory point as the center). These road network data may include information such as road connection relationship, road grade, length, etc. Based on the trajectory data and road network data, features to be predicted can be extracted, such as trajectory point density, curvature, vehicle speed, road type, road grade, number of lanes, etc. The extracted features to be predicted are input into a pre-trained graph neural network model, and the model can output a route matching the trajectory data to be predicted. The graph neural network model automatically learns the feature parameter representation in the data, reduces the dependence on the road network data version, has a stronger generalization ability of empirical parameters than the traditional road network matching model, and is compatible with road network matching in complex scenarios.

[0119] In the embodiment of the present application, the road network matching is realized through the node classification task of the graph neural network. The road network link is the main information carrier. The road network link is converted into a node in the graph data structure, and the connection relationship between the road network links is converted into the edge information in the graph data structure. At the same time, the link attribute information and the trajectory point information are encoded as node feature information, which can better apply the topological relationship of the road network and learn the deviation of the trajectory point information for the road network link data and the parameter characterization in the drift scene. It can solve the problem that the hidden Markov model is not compatible with the drift of the positioning system over a long distance due to the limited receptive field, and is easy to match errors in similar road shape scenes such as parallel roads (such as main and auxiliary roads, small angle bifurcations), thereby improving the accuracy of road network matching.

[0120] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0121] In one embodiment, a segmented trajectory matching device based on a graph neural network is provided, and the segmented trajectory matching device based on a graph neural network corresponds one-to-one to the segmented trajectory matching method based on a graph neural network in the above embodiment. Figure 6 As shown, the segmented trajectory matching device based on graph neural network includes a trajectory sample data acquisition unit 10, a graph structure construction unit 20, a node feature vector encoding unit 30 and a prediction unit 40. The functional modules are described in detail as follows:

[0122] A trajectory sample data acquisition unit 10 is used to acquire trajectory sample data with a road network matching true value;

[0123] A graph structure construction unit 20, configured to construct a graph structure based on the trajectory sample data, wherein the nodes of the graph structure represent the links of the road network;

[0124] A node feature vector encoding unit 30, used to encode the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector;

[0125] The prediction unit 40 is used to iteratively train the preset graph neural network model based on the node feature vector and the road network matching true value until a preset convergence condition is met, thereby obtaining a trained graph neural network model, and performing road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

[0126] In one embodiment of the present application, the trajectory sample data acquisition unit 10 is further used to:

[0127] Collect trajectory point information and road network data;

[0128] Performing road network matching on the trajectory point information and the road network data to obtain a road network matching result;

[0129] Manual error correction and annotation are performed on the road network matching result to obtain the trajectory sample data with the road network matching true value.

[0130] In one embodiment of the present application, the trajectory sample data acquisition unit 10 is further used to:

[0131] Perform route planning based on the target starting point and the target end point to obtain a road segment set, wherein the road segment set includes all driving road segments between the target starting point and the target end point;

[0132] Extracting a road shape latitude and longitude point set corresponding to each of the driving road sections;

[0133] The road shape longitude and latitude point set is interpolated and noise simulation is added to obtain the trajectory sample data with the road network matching true value.

[0134] In one embodiment of the present application, the trajectory sample data acquisition unit 10 is further used to:

[0135] By using the trajectory sample data, solving and estimating the Gaussian mixture distribution model parameters of the noise distribution;

[0136] Based on the Gaussian mixture distribution model parameters, corresponding noise is added to each road shape longitude and latitude point in the road shape longitude and latitude point set after interpolation processing to simulate trajectory sample data with road network matching true value after being affected by noise.

[0137] In one embodiment of the present application, the node feature vector encoding unit 30 is further used to:

[0138] Encoding the road network attribute information corresponding to each of the road network links to obtain static features of a preset dimension;

[0139] Based on the trajectory points around each road network link and the multi-dimensional features corresponding to each trajectory point, a dynamic feature matrix is ​​obtained;

[0140] The node feature vector is obtained based on the static features of the preset dimension and the dynamic feature matrix.

[0141] In an embodiment of the present application, the prediction unit 40 is further configured to:

[0142] The attention matrix is ​​obtained through the preset activation function and multi-layer linear transformation;

[0143] Based on the attention matrix and the dynamic feature matrix, an intermediate result matrix is ​​obtained;

[0144] The intermediate result matrix and the static features of the preset dimension are concatenated to obtain the node feature vector.

[0145] In one embodiment of the present application, the node feature vector encoding unit 30 is further used to:

[0146] Acquire the trajectory data to be predicted, and segment the trajectory data to be predicted according to a preset window size;

[0147] Based on the trajectory data in each window after segmentation, the road network data within the preset range is recalled;

[0148] Perform feature extraction on the trajectory data in each window after segmentation and the road network data within a preset range to obtain the features to be predicted;

[0149] Based on the trained graph neural network model, the features to be predicted are predicted to obtain a route matching the trajectory data to be predicted.

[0150] In the embodiment of the present application, the road network matching is realized through the node classification task of the graph neural network. The road network link is the main information carrier. The road network link is converted into a node in the graph data structure, and the connection relationship between the road network links is converted into the edge information in the graph data structure. At the same time, the link attribute information and the trajectory point information are encoded as node feature information, which can better apply the topological relationship of the road network and learn the deviation of the trajectory point information for the road network link data and the parameter characterization in the drift scene. It can solve the problem that the hidden Markov model is not compatible with the drift of the positioning system over a long distance due to the limited receptive field, and is easy to match errors in similar road shape scenes such as parallel roads (such as main and auxiliary roads, small angle bifurcations), thereby improving the accuracy of road network matching.

[0151] For the specific limitations of the segmented trajectory matching device based on graph neural network, please refer to the limitations of the segmented trajectory matching method based on graph neural network above, which will not be repeated here. Each module in the above-mentioned segmented trajectory matching device based on graph neural network can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0152] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 7As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a segmented trajectory matching method based on a graph neural network is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0153] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the above-mentioned segmented trajectory matching method based on graph neural network are implemented.

[0154] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the above-mentioned segmented trajectory matching method based on graph neural network are implemented.

[0155] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0156] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0157] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A segmented trajectory matching method based on graph neural network, characterized in that: The method comprises: Obtain trajectory sample data with road network matching truth value; Based on the trajectory sample data, a graph structure is constructed, wherein nodes of the graph structure represent road network links; Encoding the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector; The preset graph neural network model is iteratively trained based on the node feature vector and the road network matching true value until the preset convergence condition is met, so as to obtain a trained graph neural network model, and perform road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

2. The segmented trajectory matching method of the graph neural network according to claim 1, characterized in that: The step of obtaining trajectory sample data having a road network matching true value includes: Collect trajectory point information and road network data; Performing road network matching on the trajectory point information and the road network data to obtain a road network matching result; Manual error correction and annotation are performed on the road network matching result to obtain the trajectory sample data with the road network matching true value.

3. The segmented trajectory matching method based on graph neural network according to claim 1, characterized in that: The step of obtaining trajectory sample data having a road network matching true value includes: Perform route planning based on the target starting point and the target end point to obtain a road segment set, wherein the road segment set includes all driving road segments between the target starting point and the target end point; Extracting a road shape latitude and longitude point set corresponding to each driving road section; The road shape longitude and latitude point set is interpolated and noise simulation is added to obtain the trajectory sample data with the road network matching true value.

4. The segmented trajectory matching method based on graph neural network according to claim 3, characterized in that: The adding noise simulation to obtain the trajectory sample data with the road network matching true value includes: By using the trajectory sample data, solving and estimating the Gaussian mixture distribution model parameters of the noise distribution; Based on the Gaussian mixture distribution model parameters, corresponding noise is added to each road shape longitude and latitude point in the road shape longitude and latitude point set after interpolation processing to simulate the trajectory sample data with the road network matching true value after being affected by noise.

5. The segmented trajectory matching method of the graph neural network according to claim 1, characterized in that: The step of encoding the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector comprises: Encoding the road network attribute information corresponding to each of the road network links to obtain static features of a preset dimension; Based on the trajectory points around each road network link and the multi-dimensional features corresponding to each trajectory point, a dynamic feature matrix is ​​obtained; The node feature vector is obtained based on the static features of the preset dimension and the dynamic feature matrix.

6. The segmented trajectory matching method of the graph neural network according to claim 5, characterized in that: The obtaining the node feature vector based on the static feature of the preset dimension and the dynamic feature matrix includes: The attention matrix is ​​obtained through the preset activation function and multi-layer linear transformation; Based on the attention matrix and the dynamic feature matrix, an intermediate result matrix is ​​obtained; The intermediate result matrix and the static features of the preset dimension are concatenated to obtain the node feature vector.

7. The segmented trajectory matching method of a graph neural network according to any one of claims 1 to 6, characterized in that: The road matching prediction for the trajectory data to be predicted based on the trained graph neural network model includes: Acquire the trajectory data to be predicted, and segment the trajectory data to be predicted according to a preset window size; Based on the trajectory data in each window after segmentation, the road network data within the preset range is recalled; Perform feature extraction on the trajectory data in each window after segmentation and the road network data within a preset range to obtain the features to be predicted; Based on the trained graph neural network model, the features to be predicted are predicted to obtain a route matching the trajectory data to be predicted.

8. A segmented trajectory matching device based on graph neural network, characterized in that: The device comprises: A trajectory sample data acquisition unit, used to acquire trajectory sample data with a road network matching true value; A graph structure construction unit, used to construct a graph structure based on the trajectory sample data, wherein the nodes of the graph structure represent road network links; A node feature vector encoding unit, used to encode the trajectory point information and the road network attribute information corresponding to each of the road network links into a node feature vector; A prediction unit is used to iteratively train a preset graph neural network model based on the node feature vector and the road network matching true value until a preset convergence condition is met, thereby obtaining a trained graph neural network model, and performing road matching prediction on the trajectory data to be predicted based on the trained graph neural network model.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, characterized in that: When the processor executes the computer-readable instructions, it implements the segmented trajectory matching method based on graph neural network as described in any one of claims 1 to 7.

10. A readable storage medium having computer readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the segmented trajectory matching method based on a graph neural network as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Track restoration method and device and related equipment

    CN121459583A

  • Train running path identification method, device, equipment and medium

    CN122078472A