A vehicle trajectory correction method based on the sanitation field
Through preprocessing and correction methods of sanitation vehicle trajectory data, directed graphs and mixed indexes of road networks are constructed, and the transfer probability is calculated, which solves the problem of inaccurate trajectory analysis in the existing technology, and improves the accuracy and efficiency of trajectory correction.
Patent Information
- Application Number
- CN202411282471.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-09-13
AI Technical Summary
The prior art lacks preprocessing and cleaning steps for the original trajectory data in the trajectory correction of sanitation vehicles, resulting in inaccurate trajectory analysis and inability to effectively deal with complex trajectory deviations and abnormal situations, reducing the accuracy of path analysis and prediction.
A vehicle trajectory correction method based on the sanitation field is proposed. By filtering the ordered latitude and longitude coordinates of abnormal formats, a directed graph of the road network is constructed, intersection points and extreme close points are marked, and a mixture of density grid index and R-tree grid index is established. Index, calculates the state space generation probability and transfer probability of road network nodes, and uses ST-MATCHING global map matching algorithm and Viterbi algorithm for trajectory correction.
It improves the quality and accuracy of trajectory data, ensures the connectivity and integrity of road network maps, enhances the accuracy and robustness of trajectory matching and correction, reduces the amount of data and improves storage and transmission efficiency.
Smart Images

Figure CN118779398B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a vehicle track deviation correction method based on the environmental sanitation field, belonging to the technical field of track deviation correction. Background Art
[0002] In urban environmental sanitation management, sanitation vehicles (such as garbage trucks and sweepers) need to collect and clean garbage along predetermined routes. However, in actual operation, due to complex road conditions and unstable GPS signals, the vehicle's GPS trajectory often deviates from the actual road. These deviations may make it impossible to confirm the vehicle's actual driving trajectory through the GPS trajectory when the platform is tracking tasks.
[0003] For vehicles in the field of sanitation, the roads they travel on are usually located in cities and rural roads, and they are not likely to travel on small roads. Therefore, the deviation correction of the vehicle's driving trajectory can also be understood as the road matching of the GPS trajectory.
[0004] Traditional trajectory tracking methods mainly rely on GPS navigation, but GPS signals are easily interfered with in areas with tall buildings and dense trees, resulting in reduced positioning accuracy. In addition, if there is a problem with the accuracy of the vehicle's own GPS device, the uploaded GPS driving trajectory will deviate from the normal road.
[0005] Prior art, such as a Chinese patent with patent number "CN106528589B", discloses a data management method and device. The method includes the following steps: matching the original trajectory points to the road network through a map matching method, obtaining a trajectory set after map matching; determining the minimum support and the minimum number of road sections corresponding to different road types according to training data; establishing a trajectory tree according to the trajectory set, and establishing a trajectory subtree with each node in the trajectory tree as the starting point; the trajectory tree and the trajectory subtree include: at least one node; each node is an intersection in the road network; according to the trajectory subtree, determining the trajectory pattern that passes through each node and satisfies the minimum support and the minimum number of road sections; performing redundancy processing on the trajectory pattern of each node, generating a new trajectory pattern, and storing it.
[0006] The problem with the above prior art is that there is no mention of the steps of preprocessing and cleaning the raw trajectory data, which may lead to inaccuracy in subsequent analysis. Relying solely on the map matching method may not be able to handle complex trajectory deviations and abnormal situations, and there is no calculation of transition probability and state space generation probability, which may reduce the accuracy of path analysis and prediction. Summary of the invention
[0007] In order to solve the above problems existing in the prior art, the present invention proposes a vehicle trajectory correction method based on the sanitation field.
[0008] The technical solution of the present invention is as follows:
[0009] On the one hand, the present invention proposes a vehicle trajectory correction method based on the sanitation field, comprising the following specific steps:
[0010] Obtaining an ordered set of longitude and latitude coordinates according to the trajectory road data, filtering out the ordered set of longitude and latitude coordinates with abnormal formats, and storing the filtered ordered set of longitude and latitude coordinates in a data warehouse;
[0011] Convert the ordered longitude and latitude coordinate sets in the data warehouse into directed node data, construct a road network directed graph through the directed node data, mark intersections and extreme points according to the road network directed graph; repair the disconnected parts of the road network directed graph based on intersections and extreme points;
[0012] Establish a hybrid index including a density grid index and an R-tree grid index, filter abnormal trajectory points in the trajectory road, and compress the filtered trajectory road;
[0013] The road network directed graph is searched according to the mixed index, and the state space generation probability of each node of the road network directed graph is calculated; based on the ST-MATCHING global map matching algorithm, the transition probability from each node of the road network directed graph to the next node is calculated, and the calculation method of the transition probability is:
[0014] Calculate the ratio of the distance between two points to the projected road distance
[0015]
[0016] in, Represents the coordinate vector With coordinate vector The straight-line distance, Represents the coordinate vector of the straight line distance between the two previous and next trajectory points and the current trajectory point, Represents the coordinate vector of the next trajectory point; represents the shortest path distance between two candidate road segments, Indicates candidate road segments To candidate road section The shortest path distance between Representation vector With vector The subtracted modulus length;
[0017] Calculate the cosine similarity between the speed at each point and the speed limit of each road section
[0018]
[0019] in, Indicates the speed limit of the road section. express arrive The average rate of
[0020] ;
[0021] Among them, FV ( ) represents the transition probability from each node mapping the road to the next node mapping the road in the road network directed graph, where t represents the node at the current moment, represents the node at the next moment, Represents the state space of the current node ; express In the state space the way, Represents the state space of the next moment , express In the state space the way; Representing the state space within Road transfer to state within the condition of the roads;
[0022] The transfer probability from each node to the next node of the directed graph of the road network is traversed through a Viterbi-like algorithm. According to the maximum final state generation probability generated by the traversal, the correction path is obtained by backtracking through the maximum final state generation probability.
[0023] As a preferred implementation, the disconnected parts of the road network directed graph are repaired based on the closest points and intersections, specifically:
[0024] Mark nodes with out-degree or in-degree greater than 1 in the road network directed graph as intersections, split roads with lengths greater than a preset value at intersections, and use the intersections as new starting points;
[0025] Split the two-way road of the road network directed graph into two one-way roads that are opposite to each other;
[0026] Set a judgment threshold, mark two points within the judgment threshold as extremely close points, and merge them into one point;
[0027] Repair disconnected parts of the directed graph of the road network based on intersections and extreme points.
[0028] As a preferred implementation, a hybrid index including a density grid index and an R-tree grid index is established, specifically:
[0029] The clustering of directed road network nodes is calculated by a clustering algorithm, and the roads are classified according to the clustering results based on the road network directed graph associated with the road network nodes, and a density grid index is constructed according to the classification results; the clustering algorithm is a K-means clustering algorithm;
[0030] Build an R-tree grid index for each road segment based on the R-tree;
[0031] The specific process of hybrid index search road network directed graph is as follows:
[0032] Set the search range threshold r, trajectory point (x, y) and the maximum number of candidate sections K;
[0033] Search for the nearest center point between the trajectory point (x, y) and the K-means cluster, and take the R-tree grid index associated with the nearest center point cluster;
[0034] The R-tree grid index is used to quickly search for the trajectory point as the center, and the search range threshold r is used as the length and width to construct the range grid and the R-tree grid index to see if there is an intersection; if there is an intersection, all intersection sections are taken out, and the first K sections closest to the trajectory point (x, y) are filtered out as the search result, and the search result is returned .
[0035] As a preferred embodiment, the method for determining abnormal track points in the track road is:
[0036] Abnormal points include points where the instantaneous speed of adjacent nodes exceeds a threshold and points where the angle change between adjacent trajectory segments exceeds a threshold;
[0037] The abnormal points where the instantaneous speed of adjacent nodes exceeds the threshold are obtained by the following method:
[0038] Let the speed threshold be ;
[0039] Let two adjacent points be ;
[0040] Wherein, t represents the timestamp;
[0041] The calculation formula of the instantaneous velocity V of adjacent nodes is:
[0042] ;
[0043] in, Indicates the current time stamp. Indicates the timestamp of the next moment;
[0044] like ,but is an outlier point;
[0045] The outliers where the angle change between adjacent trajectory segments exceeds the threshold are obtained by the following method:
[0046] Let the angle threshold be
[0047] Let any three adjacent trajectory points be in the order of their position in the trajectory path:
[0048] ;
[0049] make:
[0050]
[0051] Among them, a represents the point To point The direction vector of b represents the point To point The direction vector of
[0052] Mould length
[0053] Mould length
[0054] The angle between direction vector a and direction vector b as follows:
[0055] ;
[0056] If the angle , then the current point is an outlier.
[0057] As a preferred implementation, the specific method of using the trajectory compression algorithm to compress the filtered trajectory road is:
[0058] S1, set the distance threshold to ;
[0059] S2, command trajectory , where the starting point is , the end point is ;
[0060] S3, traverse and remove the starting point With the end point The trajectory collection , the traversed points are recorded as points , judgment point To the straight line Vertical distance ;
[0061] S4. If , then the trajectory Split into and ;like , then skip , continue to traverse the next node ;
[0062] S5. Track With trajectory Execute step S2 respectively as trajectory traj until all points are traversed.
[0063] As a preferred implementation, the calculation method of the state space generation probability of each node of the road network directed graph is:
[0064] Set the search radius threshold radius;
[0065] According to the search results Collect road collections:
[0066] ;
[0067] in,{ |i=n} represents the kth candidate road corresponding to the nth point;
[0068] Assume that the probability of each point in the state space follows a normal distribution:
[0069]
[0070] in, represents weight;
[0071] State space generation probability
[0072]
[0073] in, Indicate point To candidate road section The projection distance, The calculation process is expressed as:
[0074] Let vector Indicate point ;
[0075] Let vector Indicates road segment Starting point;
[0076] Let vector Indicates road segment The end point;
[0077] The road segment vector D is expressed as
[0078]
[0079] in, Represents the vector The result of projection onto vector D. The projection operation is to calculate the projection of vector AB on vector D. The result is a vector parallel to D, representing the component of AB in the direction of D.
[0080] As a preferred implementation, the DJSKALA algorithm is used to calculate the candidate road segments. Arrived within the entire road network directed graph The shortest distance between.
[0081] As a preferred implementation, the method for calculating the transition probability from each node to the next node of the directed graph of the road network by traversing the Viterbi-like algorithm is as follows:
[0082] Starting from the initial node, traverse the state space at each time t , calculate the cumulative probability of each possible path from all states at the previous time t-1 to the current time t;
[0083] By considering the transition probability and observation probability, the path with the largest cumulative probability at each time t is selected, and each state records the previous state of the path and the corresponding maximum probability;
[0084] When traversing to the last node, select the terminal state with the largest cumulative probability ,At this point, the optimal path to reach this state and its probability have been recorded;
[0085] From the end state Start by backtracking along the recorded optimal path and gradually find the maximum possible path at each time t-1 , until backtracking to the initial state, the optimal path from the starting point to the end point is obtained;
[0086] The specific steps are:
[0087] Let points be a set of ordered longitude and latitude coordinates (x, y);
[0088] The specific calculation process of the state space is:
[0089] Let the set of roads in the rectangle with point (x, y) as the center and length and width as radius for:
[0090] =search(graph,graph_index,radius,point,k);
[0091] Among them, search() represents the road network index search function, graph represents the road network directed graph, graph_index represents the R-tree grid index, radius represents the search range, and point represents the longitude and latitude coordinates of the point to be searched;
[0092] Let R[ ][ ] be the two-dimensional array of search road set;
[0093] Let S[ ][ ] be the state space two-dimensional array;
[0094] The specific steps to calculate the state space are:
[0095] Let i=0, j=0;
[0096] S1. Calculate the state space probability of each longitude and latitude coordinate point:
[0097] result=search(graph,graph_index,radius,radius,k),i=i+1;
[0098] Among them, result represents a road set ;
[0099] Assign each element of the collection to R[i][0] to R[i][k];
[0100] The search function returns the nearest k roads. , receive each road with R[i][j], j∈[0,k-1];
[0101] S2. Calculate the probability of the jth road searched for each point:
[0102]
[0103] S3, repeat step S2 until all candidate roads corresponding to the current longitude and latitude coordinates are traversed;
[0104] S4, let j = 0, and repeat steps S1 and S3 until all longitude and latitude coordinates are traversed;
[0105] The search function returns the nearest k roads. , S[i][0] represents the probability of r0, S[i][1] represents the probability of r1, and so on;
[0106] The specific calculation steps of the transition probability matrix are:
[0107] Let T[ ][ ][ ] be the three-dimensional array of transition probabilities;
[0108] Let i, j and k be initialized to 0;
[0109] M1, T[i][j][k]=FV(R[i+1]|R[i]);
[0110] Among them, step M1 calculates the road R[i][j] corresponding to the current point and the set of all roads corresponding to point i+1 The transition probability of T[i][j][k] corresponds to the transition probability between the jth road of the i-th point and the kth road of the next node;
[0111] M2, repeat step M1, perform k+1 times each time, until the last candidate road of the next longitude and latitude coordinates corresponding to the current longitude and latitude coordinates is traversed;
[0112] Among them, the M2 step corresponds to the next point R[i+1] of the current i-th point, that is, the candidate road set of the i+1-th point
[0113] M3, let k = 0, repeat step M2, and execute j + 1 times each time until the last candidate road of the current i-th longitude and latitude coordinates is traversed;
[0114] Among them, step M3 corresponds to R[i], that is, the candidate road set of the i-th point
[0115] M4, let k=0, j=0, repeat step M3, execute i+1 each time, until all longitude and latitude coordinates are traversed;
[0116] Among them, step M4 corresponds to the subscript of the corresponding point of points, where T[i][ ][ ] represents the corresponding point of points[i];
[0117] The specific calculation steps of the probability matrix are:
[0118] Let V[ ][ ] be a two-dimensional array of probability matrices;
[0119] Let path[ ][ ] be a two-dimensional array;
[0120] Let i=0,j=0,t=0;
[0121] G1. If t=0, execute step G2, otherwise execute step G3;
[0122] G2, V[t]=S[t];
[0123] G3. If t>1, execute step G4, otherwise execute step G12;
[0124] G4, let max = -∞;
[0125] G5. Let alt=ln(V[t-1][j])+ln(T[t-1][j][i])+ln(S[t][i]);
[0126] Where alt represents the final probability of the cumulative probability state V[t-1][j] of the jth road at the previous node being transferred to the current node;
[0127] G6. If alt>max, execute step G7, otherwise execute step G9;
[0128] G7, max=alt;
[0129] G8, path[t][i]=j;
[0130] G9, repeat step G5, and execute it once j+1 times until the corresponding probabilities of all candidate roads of the previous longitude and latitude coordinates are traversed;
[0131] G10, v[t][i]=max;
[0132] G11, let j = 0, repeat step G4, and execute i + 1 times each time until the corresponding probabilities of all candidate roads at the current longitude and latitude coordinates are traversed;
[0133] G12, let i=0, j=0, repeat step G1, and execute it once every t+1 until all longitude and latitude coordinates are traversed;
[0134] The specific calculation steps of the optimal road array are:
[0135] Let argmax() be the index corresponding to finding the element with the largest value in the set;
[0136] Let n be the maximum value of the first subscript of the probability matrix V[ ][ ];
[0137] Let m be the second maximum subscript of the probability matrix V[ ][ ];
[0138] Initialize the one-dimensional array segments[ ];
[0139] Let i=n;
[0140] F1. Let ci=argmax(V[n]);
[0141] Where ci represents the corresponding subscript of the maximum value in the V[n] element (V[n][0]…V[n][m]);
[0142] F2. Calculate the path c with the highest probability among the nth points:
[0143] c = R[n][ci];
[0144] Among them, ci represents the subscript of the road with the highest probability, and R[n][ci] represents the road with the highest probability in the nth point;
[0145] F3. Add the road with the highest probability into the one-dimensional array segments[ ];
[0146] Take out the index of the previous road that is most likely to be transferred to the current road and reassign it to ci; take out the corresponding road according to the index and assign it to c;
[0147] F4, repeat step F3, each time executing i-1, until i=0;
[0148] F5. Add the road with the highest probability of i=0 to the one-dimensional array segments[ ]; then reorder the roads in the array from back to front to obtain the optimal road.
[0149] On the other hand, the present invention further provides an electronic device having a computer program stored thereon, wherein when the computer program is executed by a processor, a vehicle trajectory correction method based on the sanitation field as described in any embodiment of the present invention is implemented.
[0150] The present invention has the following beneficial effects:
[0151] 1. The present invention ensures data quality by filtering out ordered latitude and longitude coordinate sets with abnormal formats, reducing the error rate and computational burden of subsequent processing. The filtered data is stored in a data warehouse in an orderly manner, which facilitates the rapid retrieval and management of large-scale data. The powerful storage and query capabilities of the data warehouse are used to support efficient processing of massive trajectory data, providing a solid data foundation for subsequent analysis.
[0152] 2. The present invention can more accurately reflect the actual travel direction and structure of the road by converting the ordered longitude and latitude coordinate set into directed node data and constructing a road network directed graph. By marking intersections and extreme points and splitting two-way roads into one-way roads, the disconnection problem in the road network is effectively solved, and the accuracy and practicality of the road network graph are improved. The road network directed graph is repaired based on intersections and extreme points to ensure the connectivity and integrity of the road network graph, providing a reliable basis for subsequent trajectory matching and deviation correction.
[0153] 3. The present invention can quickly locate trajectory points and filter abnormal trajectory points by establishing a hybrid index including density grid index and R-tree grid index, thereby improving the efficiency and accuracy of trajectory processing. The filtered trajectory road is compressed to reduce the amount of data, improve storage and transmission efficiency, and retain the main features and information of the trajectory.
[0154] 4. The present invention searches the road network directed graph through a mixed index and calculates the state space generation probability of each node, providing more comprehensive information support for trajectory matching. The ST-MATCHING global map matching algorithm is used to calculate the transfer probability from each node of the road network directed graph to the next node, thereby improving the accuracy and robustness of trajectory matching. The transfer probability from each node of the road network directed graph to the next node is traversed by a Viterbi-like algorithm, and the path with the maximum final state generation probability is generated, thereby achieving accurate deviation correction of the trajectory. The process of backtracking to obtain the deviation correction path is simple and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0155] Figure 1 The figure is a flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0156] 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 only 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.
[0157] It should be understood that the step numbers used in this document are only for convenience of description and are not intended to limit the order in which the steps are executed.
[0158] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0159] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0160] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.
[0161] Embodiment 1:
[0162] See also Figure 1 The present invention proposes a vehicle trajectory correction method based on the sanitation field, comprising the following specific steps:
[0163] Obtaining an ordered set of longitude and latitude coordinates according to the trajectory road data, filtering out the ordered set of longitude and latitude coordinates with abnormal formats, and storing the filtered ordered set of longitude and latitude coordinates in a data warehouse;
[0164] Convert the ordered longitude and latitude coordinate sets in the data warehouse into directed node data, construct a road network directed graph through the directed node data, mark intersections and extreme points according to the road network directed graph; repair the disconnected parts of the road network directed graph based on intersections and extreme points;
[0165] Establish a hybrid index including a density grid index and an R-tree grid index, filter abnormal trajectory points in the trajectory road, and compress the filtered trajectory road;
[0166] The road network directed graph is searched according to the mixed index, and the state space generation probability of each node of the road network directed graph is calculated; based on the ST-MATCHING global map matching algorithm, the transition probability from each node of the road network directed graph to the next node is calculated, and the calculation method of the transition probability is:
[0167] Calculate the ratio of the distance between two points to the projected road distance
[0168]
[0169] in, Represents the coordinate vector With coordinate vector The straight-line distance, Represents the coordinate vector of the straight line distance between the two previous and next trajectory points and the current trajectory point, Represents the coordinate vector of the next trajectory point; represents the shortest path distance between two candidate road segments, Indicates candidate road segments To candidate road section The shortest path distance between Representation vector With vector The subtracted modulus length;
[0170] Calculate the cosine similarity between the speed at each point and the speed limit of each road section
[0171]
[0172] in, Indicates the speed limit of the road section. express arrive The average rate of
[0173] ;
[0174] Among them, FV ( ) represents the transition probability from each node mapping the road to the next node mapping the road in the road network directed graph, where t represents the node at the current moment, represents the node at the next moment, Represents the state space of the current node ; express In the state space the way, Represents the state space of the next moment , express In the state space the way; Representing the state space within Road transfer to state within the condition of the roads;
[0175] The transfer probability from each node to the next node of the directed graph of the road network is traversed through a Viterbi-like algorithm. According to the maximum final state generation probability generated by the traversal, the correction path is obtained by backtracking through the maximum final state generation probability.
[0176] As a preferred implementation, the disconnected parts of the road network directed graph are repaired based on the closest points and intersections, specifically:
[0177] Mark nodes with out-degree or in-degree greater than 1 in the road network directed graph as intersections, split roads with lengths greater than a preset value at intersections, and use the intersections as new starting points;
[0178] Split the two-way road of the road network directed graph into two one-way roads that are opposite to each other;
[0179] Set a judgment threshold, mark two points within the judgment threshold as extremely close points, and merge them into one point;
[0180] Repair disconnected parts of the directed graph of the road network based on intersections and extreme points.
[0181] As a preferred implementation, a hybrid index including a density grid index and an R-tree grid index is established, specifically:
[0182] The clustering of directed road network nodes is calculated by a clustering algorithm, and the roads are classified according to the clustering results based on the road network directed graph associated with the road network nodes, and a density grid index is constructed according to the classification results; the clustering algorithm is a K-means clustering algorithm;
[0183] Build an R-tree grid index for each road segment based on the R-tree;
[0184] The specific process of hybrid index search road network directed graph is as follows:
[0185] Set the search range threshold r, trajectory point (x, y) and the maximum number of candidate sections K;
[0186] Search for the nearest center point between the trajectory point (x, y) and the K-means cluster, and take the R-tree grid index associated with the nearest center point cluster;
[0187] The R-tree grid index is used to quickly search for the trajectory point as the center, and the search range threshold r is used as the length and width to construct the range grid and the R-tree grid index to see if there is an intersection; if there is an intersection, all intersection sections are taken out, and the first K sections closest to the trajectory point (x, y) are filtered out as the search result, and the search result is returned .
[0188] As a preferred embodiment, the method for determining abnormal track points in the track road is:
[0189] Abnormal points include points where the instantaneous speed of adjacent nodes exceeds a threshold and points where the angle change between adjacent trajectory segments exceeds a threshold;
[0190] The abnormal points where the instantaneous speed of adjacent nodes exceeds the threshold are obtained by the following method:
[0191] Let the speed threshold be ;
[0192] Let two adjacent points be ;
[0193] Where t represents the timestamp;
[0194] The calculation formula of the instantaneous velocity V of adjacent nodes is:
[0195] ;
[0196] in, Indicates the current time stamp. Indicates the timestamp of the next moment;
[0197] like ,but is an outlier point;
[0198] The outliers where the angle change between adjacent trajectory segments exceeds the threshold are obtained by the following method:
[0199] Let the angle threshold be
[0200] Let any three adjacent trajectory points be in the order of their position in the trajectory path:
[0201] ;
[0202] make:
[0203]
[0204] Among them, a represents the point To point The direction vector of b represents the point To point The direction vector of
[0205] Mould length
[0206] Mould length
[0207] The angle between direction vector a and direction vector b as follows:
[0208] ;
[0209] If the angle , then the current point is an outlier.
[0210] As a preferred implementation, the specific method of using the trajectory compression algorithm to compress the filtered trajectory road is:
[0211] S1, set the distance threshold to ;
[0212] S2, command trajectory , where the starting point is , the end point is ;
[0213] S3, traverse and remove the starting point With the end point The trajectory collection , the traversed points are recorded as points , judgment point To the straight line Vertical distance ;
[0214] S4. If , then the trajectory Split into and ;like , then skip , continue to traverse the next node ;
[0215] S5. Track With trajectory Execute step S2 respectively as trajectory traj until all points are traversed.
[0216] As a preferred implementation, the calculation method of the state space generation probability of each node of the road network directed graph is:
[0217] Set the search radius threshold radius;
[0218] According to the search results Collect road collections:
[0219] ;
[0220] in,{ |i=n} represents the kth candidate road corresponding to the nth point;
[0221] Assume that the probability of each point in the state space follows a normal distribution:
[0222]
[0223] in, represents weight;
[0224] State space generation probability
[0225]
[0226] in, Indicate point To candidate road segment The projection distance, The calculation process is expressed as:
[0227] Let vector Indicate point ;
[0228] Let vector Indicates road segment Starting point;
[0229] Let vector Indicates road segment The end point;
[0230] The road segment vector D is expressed as
[0231]
[0232] in, Represents the vector The result of projection onto vector D. The projection operation is to calculate the projection of vector AB on vector D. The result is a vector parallel to D, representing the component of AB in the direction of D.
[0233] As a preferred implementation, the DJSKALA algorithm is used to calculate the candidate road segments. Arrived within the entire road network directed graph The shortest distance between.
[0234] As a preferred implementation, the method for calculating the transition probability from each node to the next node of the directed graph of the road network by traversing the Viterbi-like algorithm is as follows:
[0235] Starting from the initial node, traverse the state space at each time t , calculate the cumulative probability of each possible path from all states at the previous time t-1 to the current time t;
[0236] By considering the transition probability and observation probability, the path with the largest cumulative probability at each time t is selected, and each state records the previous state of the path and the corresponding maximum probability;
[0237] When traversing to the last node, select the terminal state with the largest cumulative probability ,At this point, the optimal path to reach this state and its probability have been recorded;
[0238] From the end state Start by backtracking along the recorded optimal path and gradually find the maximum possible path at each time t-1 , until backtracking to the initial state, the optimal path from the starting point to the end point is obtained;
[0239] The specific steps are:
[0240] Let points be a set of ordered longitude and latitude coordinates (x, y);
[0241] The specific calculation process of the state space is:
[0242] Let the set of roads in the rectangle with point (x, y) as the center and length and width as radius for:
[0243] =search(graph,graph_index,radius,point,k);
[0244] Among them, search() represents the road network index search function, graph represents the road network directed graph, graph_index represents the R-tree grid index, radius represents the search range, and point represents the longitude and latitude coordinates of the point to be searched;
[0245] Let R[ ][ ] be the two-dimensional array of search road set;
[0246] Let S[ ][ ] be the state space two-dimensional array;
[0247] The specific steps to calculate the state space are:
[0248] Let i=0, j=0;
[0249] S1. Calculate the state space probability of each longitude and latitude coordinate point:
[0250] result=search(graph,graph_index,radius,radius,k),i=i+1;
[0251] Among them, result represents a road set ;
[0252] Assign each element of the collection to R[i][0] to R[i][k];
[0253] The search function returns the nearest k roads. , receive each road with R[i][j], j∈[0,k-1];
[0254] S2. Calculate the probability of the jth road searched for each point:
[0255]
[0256] S3, repeat step S2 until all candidate roads corresponding to the current longitude and latitude coordinates are traversed;
[0257] S4, let j = 0, and repeat steps S1 and S3 until all longitude and latitude coordinates are traversed;
[0258] The search function returns the nearest k roads. , S[i][0] represents the probability of r0, S[i][1] represents the probability of r1, and so on;
[0259] The specific calculation steps of the transition probability matrix are:
[0260] Let T[ ][ ][ ] be the three-dimensional array of transition probabilities;
[0261] Let i, j and k be initialized to 0;
[0262] M1, T[i][j][k]=FV(R[i+1]|R[i]);
[0263] Among them, step M1 calculates the road R[i][j] corresponding to the current point and the set of all roads corresponding to point i+1 The transition probability of T[i][j][k] corresponds to the transition probability between the jth road of the i-th point and the kth road of the next node;
[0264] M2, repeat step M1, perform k+1 times each time, until the last candidate road of the next longitude and latitude coordinates corresponding to the current longitude and latitude coordinates is traversed;
[0265] Among them, the M2 step corresponds to the next point R[i+1] of the current i-th point, that is, the candidate road set of the i+1-th point
[0266] M3, let k = 0, repeat step M2, and execute j + 1 times each time until the last candidate road of the current i-th longitude and latitude coordinates is traversed;
[0267] Among them, step M3 corresponds to R[i], that is, the candidate road set of the i-th point
[0268] M4, let k=0, j=0, repeat step M3, execute i+1 each time, until all longitude and latitude coordinates are traversed;
[0269] Among them, step M4 corresponds to the subscript of the corresponding point of points, where T[i][ ][ ] represents the corresponding point of points[i];
[0270] The specific calculation steps of the probability matrix are:
[0271] Let V[ ][ ] be a two-dimensional array of probability matrices;
[0272] Let path[ ][ ] be a two-dimensional array;
[0273] Let i=0,j=0,t=0;
[0274] G1. If t=0, execute step G2, otherwise execute step G3;
[0275] G2, V[t]=S[t];
[0276] G3. If t>1, execute step G4, otherwise execute step G12;
[0277] G4, let max = -∞;
[0278] G5. Let alt=ln(V[t-1][j])+ln(T[t-1][j][i])+ln(S[t][i]);
[0279] Where alt represents the final probability of the cumulative probability state V[t-1][j] of the jth road at the previous node being transferred to the current node;
[0280] G6. If alt>max, execute step G7, otherwise execute step G9;
[0281] G7, max=alt;
[0282] G8, path[t][i]=j;
[0283] G9, repeat step G5, and execute it once j+1 times until the corresponding probabilities of all candidate roads of the previous longitude and latitude coordinates are traversed;
[0284] G10, v[t][i]=max;
[0285] G11, let j = 0, repeat step G4, and execute i + 1 times each time until the corresponding probabilities of all candidate roads at the current longitude and latitude coordinates are traversed;
[0286] G12, let i=0, j=0, repeat step G1, and execute it once every t+1 until all longitude and latitude coordinates are traversed;
[0287] The specific calculation steps of the optimal road array are:
[0288] Let argmax() be the index corresponding to finding the element with the largest value in the set;
[0289] Let n be the maximum value of the first subscript of the probability matrix V[ ][ ];
[0290] Let m be the second maximum subscript of the probability matrix V[ ][ ];
[0291] Initialize the one-dimensional array segments[ ];
[0292] Let i=n;
[0293] F1. Let ci=argmax(V[n]);
[0294] Where ci represents the corresponding subscript of the maximum value in the V[n] element (V[n][0]…V[n][m]);
[0295] F2. Calculate the path c with the highest probability among the nth points:
[0296] c = R[n][ci];
[0297] Among them, ci represents the subscript of the road with the highest probability, and R[n][ci] represents the road with the highest probability in the nth point;
[0298] F3. Add the road with the highest probability into the one-dimensional array segments[ ];
[0299] Take out the index of the previous road that is most likely to be transferred to the current road and reassign it to ci; take out the corresponding road according to the index and assign it to c;
[0300] F4, repeat step F3, each time executing i-1, until i=0;
[0301] F5. Add the road with the highest probability of i=0 to the one-dimensional array segments[ ]; then reorder the roads in the array from back to front to obtain the optimal road.
[0302] Embodiment 2:
[0303] This embodiment provides an electronic device having a computer program stored thereon. When the computer program is executed by a processor, a vehicle trajectory correction method based on the environmental sanitation field as described in any embodiment of the present invention is implemented.
[0304] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0305] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0306] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0307] In several embodiments provided in the present application, if any function 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, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.
[0308] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A vehicle trajectory correction method based on the sanitation field, characterized in that: The specific steps include: Obtaining an ordered set of longitude and latitude coordinates according to the trajectory road data, filtering out the ordered set of longitude and latitude coordinates with abnormal formats, and storing the filtered ordered set of longitude and latitude coordinates in a data warehouse; Convert the ordered longitude and latitude coordinate sets in the data warehouse into directed node data, construct a road network directed graph through the directed node data, mark intersections and extreme points according to the road network directed graph; repair the disconnected parts of the road network directed graph based on intersections and extreme points; Establish a hybrid index including a density grid index and an R-tree grid index, filter abnormal trajectory points in the trajectory road, and compress the filtered trajectory road; Search the road network directed graph according to the mixed index and calculate the state space generation probability of each node of the road network directed graph; Based on the ST-MATCHING global map matching algorithm, the transition probability from each node of the road network directed graph to the next node is calculated. The calculation method of the transition probability is: Calculate the ratio of the distance between two points to the projected road distance in, Represents the coordinate vector With coordinate vector The straight-line distance, Represents the coordinate vector of the straight line distance between the two previous and next trajectory points and the current trajectory point, Represents the coordinate vector of the next trajectory point; represents the shortest path distance between two candidate road segments, Indicates candidate road segments To candidate road segment The shortest path distance between Representation vector With vector The subtracted modulus length; Calculate the cosine similarity between the speed at each point and the speed limit of each road section in, Indicates the speed limit of the road section. express arrive The average rate of ; Among them, FV ( ) represents the transition probability from each node mapping the road to the next node mapping the road in the road network directed graph, where t represents the node at the current moment, represents the node at the next moment, Represents the state space of the current node ; express In the state space the way, Represents the state space of the next moment , express In the state space the way; Representing the state space within Road transfer to state within the condition of the roads; The transfer probability from each node to the next node of the directed graph of the road network is traversed through a Viterbi-like algorithm. According to the maximum final state generation probability generated by the traversal, the correction path is obtained by backtracking through the maximum final state generation probability.
2. According to the vehicle trajectory correction method based on the sanitation field according to claim 1, it is characterized in that: Repair the disconnected parts of the directed graph of the road network based on the closest points and intersections, specifically: Mark nodes with out-degree or in-degree greater than 1 in the road network directed graph as intersections, split roads with lengths greater than a preset value at intersections, and use the intersections as new starting points; Split the two-way road of the road network directed graph into two one-way roads that are opposite to each other; Set a judgment threshold, mark two points within the judgment threshold as extremely close points, and merge them into one point; Repair disconnected parts of the directed graph of the road network based on intersections and extreme points.
3. The vehicle trajectory correction method based on the sanitation field according to claim 1 is characterized in that: Create a hybrid index including a density grid index and an R-tree grid index, specifically: The clustering of directed road network nodes is calculated by a clustering algorithm, and the roads are classified according to the clustering results based on the road network directed graph associated with the road network nodes, and a density grid index is constructed according to the classification results; the clustering algorithm is a K-means clustering algorithm; Build an R-tree grid index for each road segment based on the R-tree; The specific process of hybrid index search road network directed graph is as follows: Set the search range threshold r, trajectory point (x, y) and the maximum number of candidate sections K; Search for the nearest center point between the trajectory point (x, y) and the K-means cluster, and take the R-tree grid index associated with the nearest center point cluster; The R-tree grid index is used to quickly search for the trajectory point as the center, and the search range threshold r is used as the length and width to construct the range grid and the R-tree grid index to see if there is an intersection; if there is an intersection, all intersection sections are taken out, and the first K sections closest to the trajectory point (x, y) are filtered out as the search result, and the search result is returned .
4. The vehicle trajectory correction method based on the sanitation field according to claim 1 is characterized in that: The method for judging abnormal track points in the track road is: Abnormal points include points where the instantaneous speed of adjacent nodes exceeds a threshold and points where the angle change between adjacent trajectory segments exceeds a threshold; The abnormal points where the instantaneous speed of adjacent nodes exceeds the threshold are obtained by the following method: Let the speed threshold be ; Let two adjacent points be ; Wherein, t represents the timestamp; The calculation formula of the instantaneous velocity V of adjacent nodes is: ; in, Indicates the current time stamp. Indicates the timestamp of the next moment; like ,but is an outlier point; The outliers where the angle change between adjacent trajectory segments exceeds the threshold are obtained by the following method: Let the angle threshold be Let any three adjacent trajectory points be in the order of their position in the trajectory path: ; make: Among them, a represents the point To point The direction vector of b represents the point To point The direction vector of Mould length Mould length The angle between direction vector a and direction vector b as follows: ; If the angle , then the current point is an outlier.
5. The vehicle trajectory correction method based on the sanitation field according to claim 1 is characterized in that: The specific method of using the trajectory compression algorithm to compress the filtered trajectory road is: S1, set the distance threshold to ; S2, command trajectory , where the starting point is , the end point is ; S3, traverse and remove the starting point With the end point The trajectory collection , the traversed points are recorded as points , judgment point To the straight line Vertical distance ; S4. If , then the trajectory Split into and ;like , then skip , continue to traverse the next node ; S5. Track With trajectory Execute step S2 respectively as trajectory traj until all points are traversed.
6. The vehicle trajectory correction method based on the sanitation field according to claim 3 is characterized in that: The calculation method of the state space generation probability of each node in the road network directed graph is: Set the search radius threshold radius; According to the search results Collect road collections: ; in,{ |i=n} represents the kth candidate road corresponding to the nth point; Assume that the probability of each point in the state space follows a normal distribution: in, represents weight; State space generation probability in, Indicate point To candidate road segment The projection distance, The calculation process is expressed as: Let vector Indicate point ; Let vector Indicates road segment Starting point; Let vector Indicates road segment The end point; The road segment vector D is expressed as in, Represents the vector The result of projection onto vector D. The projection operation is to calculate the projection of vector AB on vector D. The result is a vector parallel to D, representing the component of AB in the direction of D.
7. The vehicle trajectory correction method based on the sanitation field according to claim 1 is characterized in that: Use DJSKALA algorithm to calculate candidate road sections Arrival within the entire road network directed graph The shortest distance between.
8. The vehicle trajectory correction method based on the sanitation field according to claim 6 is characterized in that: The calculation method of the transition probability from each node to the next node of the directed graph of the road network through the Viterbi-like algorithm is: Starting from the initial node, traverse the state space at each time t , calculate the cumulative probability of each possible path from all states at the previous time t-1 to the current time t; By considering the transition probability and observation probability, the path with the largest cumulative probability at each time t is selected, and the previous state of the path and the corresponding maximum probability are recorded for each state; When traversing to the last node, select the terminal state with the largest cumulative probability ,At this point, the optimal path to reach this state and its probability have been recorded; From the end state Start by backtracking along the recorded optimal path and gradually find the maximum possible path at each time t-1 , until it backtracks to the initial state and obtains the optimal path from the starting point to the end point.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, a vehicle trajectory correction method based on the sanitation field is implemented as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Data Management Method and Device
CN106528589B
Vehicle GPS data map matching method based on hidden markov model
CN106595680A
Road network matching method and device
CN114664104A
Vehicle driving track correction method and device based on road network data
CN115586557A
Vehicle track data processing method, device and equipment and readable storage medium
CN116975184A