A floating vehicle data trajectory restoration method based on hidden Markov model

By improving the map matching algorithm of the Hidden Markov model, considering the spatiotemporal characteristics of floating vehicle data, the problems of spatial connectivity and sampling frequency in floating vehicle data trajectory matching are solved, efficient and accurate trajectory restoration is achieved, and data availability is improved .

CN114462609BActive Publication Date: 2024-12-20SHENZHEN DIGITAL CITY ENG RES CENT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111482841.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-07
Publication Date
2024-12-20
Estimated Expiration
2041-12-07

AI Technical Summary

Technical Problem

The existing map matching algorithm based on the Hidden Markov model is easy to ignore spatial connectivity in the matching of floating vehicle data trajectory, and is susceptible to GPS position jitter and changes in road shape, resulting in weak connectivity of matching results and difficult to deal with. Floating vehicle data with different sampling frequencies.

Method used

The map matching algorithm of the Hidden Markov model has been improved. By introducing spatiotemporal feature probability calculation and additional algorithm logic, considering the spatiotemporal characteristics of floating vehicle data, a more accurate trajectory restoration method is constructed to ensure the connectivity and efficiency of the matching results.

Benefits of technology

It improves the accuracy and coherence of floating vehicle trajectory matching, can quickly obtain accurate floating vehicle trajectory, and enhances the availability and value of multi-source floating vehicle data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114462609B_ABST
    Figure CN114462609B_ABST
Patent Text Reader

Abstract

The present invention proposes a floating vehicle data trajectory restoration method based on a hidden Markov model. Starting from the spatiotemporal characteristics of floating vehicle data and urban road data, the present invention fills in the information of the floating vehicle's route while matching the floating vehicle data to the urban road. Specifically, the present invention has the following innovations: the length of the shortest path between all current candidate point pairs is considered in the calculation of any transition probability of the hidden Markov model; the point-line relationship function is introduced to screen all candidate points on each candidate road, and used to supplement the observation probability of the hidden Markov model; the shortest path between candidate point pairs and the length of the straight line between the corresponding original trajectory points are considered again outside the hidden Markov model to avoid the probability model ignoring the consideration of connectivity when other probabilities are larger. The method proposed by the present invention can efficiently and accurately restore the driving trajectory of the floating vehicle, thereby improving the sampling frequency and value of the floating vehicle data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of GPS track processing, and in particular relates to a floating vehicle data track restoration method based on a hidden Markov model. Background Art

[0002] Floating vehicle data is a widely used data source in traffic supervision and urban research, but floating vehicle data generally have problems such as unstable sampling frequency and large position offset. Map matching algorithms can be used to correct the offset floating vehicle trajectory records based on the urban road network, and match the floating vehicle trajectory data to adjacent road sections so that it has the topological information of the urban road network. Hidden Markov models are often used to solve map matching problems, taking into account the position, angle, travel time of the original trajectory points to be matched, as well as the spatial connectivity and road information between the adjacent trajectory records in its probability definition. The map matching algorithm based on the hidden Markov model has the following defects: only the shortest path between candidate point pairs is considered in the comprehensive evaluation function. When the scores of position and angle are high, the consideration of spatial connectivity may be ignored, resulting in weak connectivity between the matched records; the straight-line distance between the original trajectory points is usually used as a reference for the shortest path between candidate points. Due to the position jitter of GPS and the shape changes of the passing roads, the matching results are easily affected by neighboring similar roads; the original trajectory points will be on the candidate sections within a certain range around them, and the candidate points will be selected according to the position of the projection points on the sections. The projection point or the end point of the section close to the original trajectory point is determined. Since the hidden Markov model is a probabilistic model, in the process of probability accumulation, there will be a situation where the probability between the offset candidate point pairs is higher than that between the projection point pairs, resulting in the matching results being easily affected by multiple similar candidate points on the same road in probability calculation and accumulation. In order to improve the accuracy of trajectory point matching, and obtain the coherent driving trajectory of the floating vehicle while matching the map, while taking into account the floating vehicle data with different sampling frequencies, the present invention proposes a floating vehicle data trajectory restoration method based on the hidden Markov model, which fully considers the spatiotemporal characteristics of each original trajectory point of the floating vehicle data, modifies the observation probability and transition probability of the traditional map matching algorithm based on the hidden Markov model, and introduces additional algorithm logic to ensure the accuracy and efficiency of the algorithm. The present invention not only matches the original trajectory record to the urban road network, but also fills in the key records of the floating vehicle driving, so that it can quickly obtain a coherent and accurate floating vehicle trajectory when processing floating vehicle data with different sampling frequencies, thereby improving the availability and value of multi-source floating vehicle data. Summary of the invention

[0003] The purpose of the present invention is to provide a floating vehicle data trajectory restoration method based on a hidden Markov model, which fully considers the spatiotemporal characteristics of each original trajectory point of the floating vehicle data, takes into account efficiency and accuracy while taking into account spatial connectivity, and not only matches the original trajectory points to the urban road network, but also fills in the key trajectory records of the floating vehicle.

[0004] The technical solution of the present invention is a method for restoring the trajectory of floating vehicle data based on a hidden Markov model, which is characterized by comprising the following steps:

[0005] Step 1, preprocessing the floating vehicle data to obtain preprocessed floating vehicle data, and preprocessing the urban road data to obtain pre-preprocessed urban road data;

[0006] Step 2: for the floating vehicle data and the urban road data preprocessed in step 1, select the corresponding spatiotemporal features between the two data that can be used for trajectory restoration, and define the probability calculation method of these spatiotemporal features, and then determine the specific road section where the floating vehicle data travels according to the product of all probabilities;

[0007] Step 3, further construct a hidden Markov model based on the spatial position probability of the original trajectory point of the floating vehicle, the probability of the driving direction, the probability of the relationship between the original trajectory point and the candidate road section, the probability of the shortest path between the candidate points of the floating vehicle, and the probability of the driving speed between the candidate points of the floating vehicle;

[0008] Step 4, take the preprocessed floating vehicle data, traverse each preprocessed floating vehicle data in turn, and combine it with the preprocessed urban road data, use the overall trajectory probability of the hidden Markov model to calculate all possible candidate paths for the floating vehicle to travel and the probability score of the path;

[0009] Preferably, the original format of the floating vehicle data in step 1 includes vehicle identification, spatial position, driving direction angle, and recorded collection time;

[0010] The spatial position is composed of longitude and latitude;

[0011] In step 1, the floating vehicle data is preprocessed as follows:

[0012] The plurality of groups of floating vehicle data are grouped into different floating vehicle data sets according to the vehicle identifications of the floating vehicles, and the floating vehicle data with the same vehicle identifications are grouped into the same floating vehicle data set;

[0013] In each floating vehicle data set, the trajectory record information of each floating vehicle is sorted in chronological order according to the corresponding recording time to obtain the sorted floating vehicle data set. The data set is composed of p i =(idi , x i ,y i , a i , t i ), where i represents the order of the trajectory records in the data set;

[0014] In each floating car data set after sorting, the Euclidean distance between two adjacent moments is calculated based on the position information of each floating car at two adjacent moments;

[0015] In each floating car data set after sorting, the time interval is calculated according to the time recorded at two adjacent moments, and the speed of the floating car at two adjacent moments is calculated by combining the Euclidean distance between the two adjacent moments;

[0016] Taking the city's maximum speed limit of 120km / h as the threshold, we preliminarily screened outliers and interrupted the trajectory at the locations where the outliers existed. After interruption, we obtained multiple sets of floating vehicle data that met the maximum speed limit conditions.

[0017] Finally, the obtained multiple floating vehicle data sets that meet the maximum speed limit conditions are traversed, and only the data sets with more than 5 trajectory records in the data sets are retained;

[0018] In step 1, the urban road data is preprocessed, specifically:

[0019] According to the topological relationship of urban road data, road nodes in urban road data are extracted, and roads are broken according to their breaking points, from which nodes are extracted and separated (N = [n1...n p ]), shape point (SP = [sp1...sp q ]), road section (S = [s1...s m ]) and the path (R = [r1...r n ]) and other elements. A node is the intersection of three or more line segments, and an endpoint that is not associated with other line segments. The node is mainly used to construct a directed graph in the shortest path algorithm; a road is a polyline or line segment between two nodes, which is connected to other roads end to end and is not interrupted by other roads; the endpoints of the polyline other than the nodes in the road represent the shape of the road, which is mainly used for the calculation of candidate points and the filling of passing points during trajectory restoration; a line segment composed of one or two shape points (a road without shape points is also called a segment when obtaining candidate road segments during trajectory restoration).

[0020] R* tree is used to perform spatial indexing on road segment information, so that the road segment information contained or intersected within the range can be obtained according to the spatial range; red-black tree is used to perform attribute indexing on road and node information, so that detailed information of the feature can be queried according to the feature ID or associated ID, so as to facilitate the call of data in the trajectory restoration method during the solution;

[0021] Using the topological relationship between nodes and paths, the weighted directed graph required in the shortest path algorithm is constructed, with nodes as nodes of the weighted directed graph, paths as edges of the weighted directed graph, and weights as the length of the paths.

[0022] The preprocessing results of the urban road data can be reused in all floating vehicle trajectory records under the current city, so it only needs to be executed once before the trajectory restoration method starts.

[0023] Preferably, the step 2 is specifically divided into the following steps:

[0024] Step 2.1, calculate the probability of the spatial position of the original trajectory point of the floating car;

[0025] The distance between the original trajectory point of the floating car and the candidate point satisfies the normal distribution, and the probability function F of the floating car's spatial position d The definition is as follows:

[0026]

[0027] in, represents the jth candidate point of the i-th original trajectory point, represents the distance between the i-th original trajectory point and the candidate point on its j-th candidate path, μ d and σ d Represent the mean and standard deviation of the distance respectively;

[0028] Step 2.2, calculate the probability of the driving direction of the original trajectory point of the floating car;

[0029] The angle between the direction of the floating vehicle and the direction of the candidate road section also satisfies the normal distribution, so the probability function F of the floating vehicle's direction is θ The definition is as follows:

[0030]

[0031] in, Represents the i-th original trajectory point p i The jth candidate point of represents the angle between the driving direction of the i-th original trajectory point of the floating vehicle and the direction of the j-th candidate road segment, μ θ and σ θ Represent the mean and standard deviation of the angles respectively;

[0032] Step 2.3, calculate the probability of the relationship between the original trajectory points of the floating car and the candidate road sections

[0033]

[0034] in, Represents the i-th original trajectory point p i The jth candidate point of Represents the point-line relationship function value between the i-th original trajectory point and the j-th candidate road segment. The point-line relationship function is defined as follows:

[0035]

[0036] Among them, the coordinates of the original trajectory point are (x, y), the line segment starts from A(x1, y1) and ends at B(x2, y2). If the original trajectory point can be projected vertically on the line segment, the range of the point-line relationship function value is [0, 1], then the current probability score of the trajectory is not penalized, otherwise the current probability score of the trajectory will be reduced to a certain extent.

[0037] Step 2.4, calculate the probability of the shortest path between the candidate points of the floating car

[0038]

[0039] in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of the shortest path between Represents the candidate point and The shortest path distance between the original trajectory point p i There are multiple candidate points, c i Represents p i All candidate points of min(c i-1 , c i ) and max(c i-1 , c i ) represent the i and c i-1 The minimum and maximum values ​​of the shortest path distances between all candidate point pairs formed by all candidate points in . The above formula normalizes the shortest path distance to between |0.5, 1].

[0040] Step 2.5, calculate the probability of the speed between the candidate points of the floating car

[0041]

[0042] in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of traveling at speeds between Represents the candidate point To the candidate point The average speed is calculated by dividing the shortest path value between two candidate points by the travel time between two original trajectory points. u represents the maximum speed limit of the current road u, and k represents the candidate point and The number of road segments that the shortest path passes through.

[0043] Preferably, the step 3 is specifically as follows:

[0044] Step 3.1 The observation probability is used to describe the probability of a certain state type of an implicit node generating a certain observation value. In the trajectory restoration problem, the observation probability represents the probability of the floating car generating the current trajectory point record when driving on the current road section. Therefore, it is necessary to consider the relationship between the current original trajectory point and the candidate road section, including position, angle, and point-line relationship function value, etc.:

[0045]

[0046] in, Represents the i-th original trajectory point p i The jth candidate point of is the probability of the spatial position of the original trajectory point of the floating car described in step 2.1; is the probability of the driving direction of the original trajectory point of the floating car described in step 2.2; is the probability of the relationship between the original trajectory points of the floating vehicle and the candidate road segments described in step 2.3.

[0047] Step 3.2: Transition probability. Transition probability is used to describe the probability of transitioning from one implicit state to another implicit state. In the trajectory restoration problem, the transition probability represents the probability of transitioning from one candidate road segment to another candidate road segment. Therefore, it is necessary to consider not only the shortest path between two candidate road segments, but also the relationship between the driving time between adjacent original trajectory points of the floating vehicle, the instantaneous speed and the speed limit of urban roads:

[0048]

[0049] in, Represents the i-th original trajectory point p i The tth candidate point of Represents a candidate point To the candidate point The transition probability between is the probability of the shortest path between the candidate points of the floating car described in step 2.4; is the probability of the traveling speed between the candidate points of the floating vehicle described in step 2.5.

[0050] Step 3.3, the overall probability of the trajectory of the hidden Markov model. In order to weaken the impact of some outliers on the probability of the entire state trajectory, the probability accumulation method is used to calculate the final probability value of the state sequence, and it is assumed that the probability calculation process of each current original trajectory point is independent; therefore, the observation probability and transition probability can be renamed as observation score and transition score. According to the logic of the hidden Markov model, the overall probability of the trajectory of the hidden Markov model is calculated:

[0051]

[0052] in, Represents the jth state type of the i-th state node. In the map matching problem, it represents the jth candidate segment selected by the i-th original trajectory point. j, s, t represent the sequence numbers of the candidate segments selected at different original trajectory points.

[0053] Preferably, the step 4 is specifically as follows:

[0054] Step 4.1, candidate road segment acquisition, traverse all original trajectory points in turn. In each round of calculation, take the currently traversed original trajectory point as the center of the circle, search for road segments within a certain threshold range, and after screening according to the driving direction and road direction. According to the point selection relationship function between the original trajectory point and the candidate road segment, determine the candidate point of the current candidate road segment.

[0055] Step 4.2, grouping candidate road segments, adding candidate points to candidate set and alternative set respectively according to point-line relationship function and the distance between original trajectory point and candidate point. The candidate set retains road segments with point-line relationship function between [0, 1], or line relationship function value between [-0.1, 0)∪(1, 1.1], or the distance between original trajectory point and candidate point is less than a certain threshold. The candidate set ensures that only one candidate point with the best matching position is retained for each road, and other candidate road segments will be temporarily added to the alternative set. When the candidate set is empty or all candidate points in the candidate set are not connected to the previous original trajectory point, they will be further considered.

[0056] Step 4.3, candidate road segment screening, after the candidate road segment grouping is completed, if there is no candidate road segment in the candidate set, the candidate road segment in the candidate set will be added to the candidate set to deal with the complex scene caused by the abnormal position of the floating vehicle trajectory point. Then, each candidate road segment is comprehensively evaluated based on the position and angle information of the current original trajectory point and the candidate road segment, and then the first few candidate points are retained according to the evaluation score to enter the hidden Markov model for further solution, and the other candidate points will be put into the candidate set.

[0057] Step 4.4, observation probability calculation, using the Viterbi algorithm with dynamic programming idea to solve the prediction problem of the hidden Markov model. Traverse all candidate points of the current original trajectory point in turn, calculate the observation probability of the current candidate point, if there is no previous candidate point, mark the one with the highest observation probability score among the current candidate points, and execute step 4.4 for the next original trajectory point; otherwise, go to step 4.5.

[0058] Step 4.5, shortest path solution, solve the shortest path between all candidate points of the current original trajectory point and all previous candidate points. The travel time is introduced into the shortest path algorithm to control the solution range of the algorithm. While solving the shortest path, the maximum and minimum values ​​of the shortest path length of all candidate points are recorded. If the path is found successfully, the route section information is returned at the same time.

[0059] Step 4.6, shortest path judgment, consider the straight-line distance between the original trajectory points outside the hidden Markov model. If the shortest path solution fails, or the ratio of the shortest path length to the straight-line distance of the original trajectory points exceeds a certain threshold, it is considered that the current candidate point pair is not connected. If there is no shortest path between all the previous candidate points and all the candidate points of the current original trajectory points, go to step 4.9 to record the currently solved path, and regard the current original trajectory point as the first original trajectory point of the new path and start the calculation from step 4.3.

[0060] Step 4.7, transfer probability calculation, after the current original trajectory point traversal is completed, determine the maximum and minimum values ​​of the shortest path length recorded in step 4.6. If the difference between the maximum and minimum values ​​is less than a certain threshold, in order to avoid the influence of errors on the results, the shortest path scores of all current candidate points will no longer be calculated and compared, and the shortest path scores of all candidate points will be set to the same score; otherwise, for each set of candidate point pairs, the shortest path score is calculated according to step 2.4. Combined with the route section information returned in step 4.5, the driving speed score is calculated according to step 2.5, and finally the transfer probability score is calculated according to step 3.2.

[0061] Step 4.8, trajectory overall probability calculation and previous candidate point retention: According to the observation probability score and transition probability score obtained in step 4.4 and step 4.7, calculate the score of each candidate point of the current original trajectory point according to step 3.3. For each candidate point, only the previous candidate point with the highest overall probability score and the current highest score are recorded. Among all candidate points, mark the one with the highest score, go to step 4.3, and solve the next original trajectory point; if the current one is the last original trajectory point, go to step 4.9.

[0062] Step 4.9, recursive solution: starting from the candidate point with the highest score in the last original trajectory point, continuously recursively solve its predecessor candidate points to obtain the map matching results of each original trajectory point in turn. While obtaining the map matching results, according to the information of the passing roads recorded in the candidate points and the driving direction of the floating vehicle on the current road, splice them in a certain order to obtain the restored trajectory.

[0063] Compared with the prior art, the method of the present invention has higher efficiency, higher precision and better consistency, is applicable to floating vehicle data with different sampling frequencies, fills in the shape point information of the floating vehicle path, and has a better trajectory restoration effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 : Logic flow chart of trajectory restoration method;

[0065] Figure 2 : Viterbi algorithm probability calculation flow chart;

[0066] Figure 3 : Logic flow chart of the recursive solution process. DETAILED DESCRIPTION

[0067] In order to facilitate ordinary technicians in the field to understand and implement the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0068] Combine the following Figures 1 to 3 The specific implementation modes of the present invention are introduced.

[0069] A trajectory restoration method for floating vehicle data based on hidden Markov model. The overall flow chart is as follows: Figure 1 As shown, the specific steps include:

[0070] Step 1, preprocessing the floating vehicle data to obtain preprocessed floating vehicle data, and preprocessing the urban road data to obtain pre-preprocessed urban road data;

[0071] The original format of the floating vehicle data in step 1 includes vehicle identification, spatial position, driving direction angle, and recorded collection time;

[0072] The spatial position is composed of longitude and latitude;

[0073] In step 1, the floating vehicle data is preprocessed as follows:

[0074] The plurality of groups of floating vehicle data are grouped into different floating vehicle data sets according to the vehicle identifications of the floating vehicles, and the floating vehicle data with the same vehicle identifications are grouped into the same floating vehicle data set;

[0075] In each floating vehicle data set, the trajectory record information of each floating vehicle is sorted in chronological order according to the corresponding recording time to obtain the sorted floating vehicle data set. The data set is composed of p i =(id i , x i ,y i , a i , t i ), where i represents the order of the trajectory records in the data set;

[0076] In each floating car data set after sorting, the Euclidean distance between two adjacent moments is calculated based on the position information of each floating car at two adjacent moments;

[0077] In each floating car data set after sorting, the time interval is calculated according to the time recorded at two adjacent moments, and the speed of the floating car at two adjacent moments is calculated by combining the Euclidean distance between the two adjacent moments;

[0078] Taking the city's maximum speed limit of 120km / h as the threshold, we preliminarily screened outliers and interrupted the trajectory at the locations where the outliers existed. After interruption, we obtained multiple sets of floating vehicle data that met the maximum speed limit conditions.

[0079] Finally, the obtained multiple floating vehicle data sets that meet the maximum speed limit conditions are traversed, and only the data sets with more than 5 trajectory records in the data sets are retained;

[0080] In step 1, the urban road data is preprocessed, specifically:

[0081] According to the topological relationship of urban road data, road nodes in urban road data are extracted, and roads are broken according to their breaking points, from which nodes are extracted and separated (N = [n1...n p ]), shape point (SP = [sp1...sp q ]), road section (S = [s1...s m ]) and the path (R = [r1...r n ]) and other elements. A node is the intersection of three or more line segments, and an endpoint that is not associated with other line segments. The node is mainly used to construct a directed graph in the shortest path algorithm; a road is a polyline or line segment between two nodes, which is connected to other roads end to end and is not interrupted by other roads; the endpoints of the polyline other than the nodes in the road represent the shape of the road, which is mainly used for the calculation of candidate points and the filling of passing points during trajectory restoration; a line segment composed of one or two shape points (a road without shape points is also called a segment when obtaining candidate road segments during trajectory restoration).

[0082] R* tree is used to perform spatial indexing on road segment information, so that the road segment information contained or intersected within the range can be obtained according to the spatial range; red-black tree is used to perform attribute indexing on road and node information, so that detailed information of the feature can be queried according to the feature ID or associated ID, so as to facilitate the call of data in the trajectory restoration method during the solution;

[0083] Using the topological relationship between nodes and paths, the weighted directed graph required in the shortest path algorithm is constructed, with nodes as nodes of the weighted directed graph, paths as edges of the weighted directed graph, and weights as the length of the paths.

[0084] The preprocessing results of the urban road data can be reused in all floating vehicle trajectory records under the current city, so it only needs to be executed once before the trajectory restoration method starts.

[0085] Step 2: for the floating vehicle data and the urban road data preprocessed in step 1, select the corresponding spatiotemporal features between the two data that can be used for trajectory restoration, and define the probability calculation method of these spatiotemporal features, and then determine the specific road section where the floating vehicle data travels according to the product of all probabilities;

[0086] The step 2 is specifically divided into the following steps:

[0087] Step 2.1, calculate the probability of the spatial position of the original trajectory point of the floating car;

[0088] The distance between the original trajectory point of the floating car and the candidate point satisfies the normal distribution, and the probability function F of the floating car's spatial position d The definition is as follows:

[0089]

[0090] in, represents the jth candidate point of the i-th original trajectory point, represents the distance between the i-th original trajectory point and the candidate point on its j-th candidate path, μ d =0 represents the mean of the distance, σ d =50 represents the standard deviation of the distance;

[0091] Step 2.2, calculate the probability of the driving direction of the original trajectory point of the floating car;

[0092] The angle between the direction of the floating vehicle and the direction of the candidate road section also satisfies the normal distribution, so the probability function F of the floating vehicle's direction is θ The definition is as follows:

[0093]

[0094] in, Represents the i-th original trajectory point p i The jth candidate point of represents the angle between the driving direction of the i-th original trajectory point of the floating vehicle and the direction of the j-th candidate road segment, μ θ =0 represents the mean value of the angle, σ θ = 0.5236 (30° in radians) represents the standard deviation of the angle;

[0095] Step 2.3, calculate the probability of the relationship between the original trajectory points of the floating car and the candidate road sections

[0096]

[0097] in, Represents the i-th original trajectory point p i The jth candidate point of Represents the point-line relationship function value between the i-th original trajectory point and the j-th candidate road segment. The point-line relationship function is defined as follows:

[0098]

[0099] Among them, the coordinates of the original trajectory point are (x, y), the line segment starts from A(x1, y1) and ends at B(x2, y2). If the original trajectory point can be projected vertically on the line segment, the range of the point-line relationship function value is [0, 1], then the current probability score of the trajectory is not penalized, otherwise the current probability score of the trajectory will be reduced to a certain extent.

[0100] Step 2.4, calculate the probability of the shortest path between the candidate points of the floating car

[0101]

[0102] in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of the shortest path between Represents the candidate point and The shortest path distance between the original trajectory point p i There are multiple candidate points, c i Represents p i All candidate points of min(c i-1 , c i ) and max(c i-1 , c i ) represent the i and c i-1The minimum and maximum values ​​of the shortest path distances between all candidate point pairs formed by all candidate points in . The above formula normalizes the shortest path distance to between [0.5, 1].

[0103] Step 2.5, calculate the probability of the speed between the candidate points of the floating car

[0104]

[0105] in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of traveling at speeds between Represents the candidate point To the candidate point The average speed is calculated by dividing the shortest path value between two candidate points by the travel time between two original trajectory points. u represents the maximum speed limit of the current road u, and k represents the candidate point and The number of road segments that the shortest path passes through.

[0106] Step 3, further construct a hidden Markov model based on the spatial position probability of the original trajectory point of the floating vehicle, the probability of the driving direction, the probability of the relationship between the original trajectory point and the candidate road section, the probability of the shortest path between the candidate points of the floating vehicle, and the probability of the driving speed between the candidate points of the floating vehicle;

[0107] Step 3.1 The observation probability is used to describe the probability of a certain state type of an implicit node generating a certain observation value. In the trajectory restoration problem, the observation probability represents the probability of the floating car generating the current trajectory point record when driving on the current road section. Therefore, it is necessary to consider the relationship between the current original trajectory point and the candidate road section, including position, angle, and point-line relationship function value, etc.:

[0108]

[0109] in, Represents the i-th original trajectory point p i The jth candidate point of is the probability of the spatial position of the original trajectory point of the floating car described in step 2.1; is the probability of the driving direction of the original trajectory point of the floating car described in step 2.2; is the probability of the relationship between the original trajectory points of the floating vehicle and the candidate road segments described in step 2.3.

[0110] Step 3.2: Transition probability. Transition probability is used to describe the probability of transitioning from one implicit state to another implicit state. In the trajectory restoration problem, the transition probability represents the probability of transitioning from one candidate road segment to another candidate road segment. Therefore, it is necessary to consider not only the shortest path between two candidate road segments, but also the relationship between the driving time between adjacent original trajectory points of the floating vehicle, the instantaneous speed and the speed limit of urban roads:

[0111]

[0112] in, Represents the i-th original trajectory point p i The tth candidate point of Represents a candidate point To the candidate point The transition probability between is the probability of the shortest path between the candidate points of the floating car described in step 2.4; is the probability of the traveling speed between the candidate points of the floating vehicle described in step 2.5.

[0113] Step 3.3, the overall probability of the trajectory of the hidden Markov model. In order to weaken the impact of some outliers on the probability of the entire state trajectory, the probability accumulation method is used to calculate the final probability value of the state sequence, and it is assumed that the probability calculation process of each current original trajectory point is independent; therefore, the observation probability and transition probability can be renamed as observation score and transition score. According to the logic of the hidden Markov model, the overall probability of the trajectory of the hidden Markov model is calculated:

[0114]

[0115] in, Represents the jth state type of the i-th state node. In the map matching problem, it represents the jth candidate segment selected by the i-th original trajectory point. j, s, t represent the sequence numbers of the candidate segments selected at different original trajectory points.

[0116] Step 4: Take the preprocessed floating vehicle data, traverse each preprocessed floating vehicle data in turn, and combine it with the preprocessed urban road data, use the overall trajectory probability of the hidden Markov model to calculate all possible candidate paths for the floating vehicle and the probability score of the path, which can be specifically divided into the following steps:

[0117] Step 4.1, candidate road segment acquisition: traverse all original trajectory points in sequence. With the currently traversed original trajectory point as the center of the circle, search all road segments within a radius of 150 meters. According to the driving direction of the original trajectory point and the direction of the road, the road segments with an angle difference of more than 60° are first excluded. Then obtain the candidate point. If the projection point of the original trajectory point can be vertically projected onto the candidate road segment (point-line relationship function value r∈[0,1]), the projection point is selected as the candidate point of the current candidate road segment. The calculation formula is as follows:

[0118] x=x1+r*(x2-x1)

[0119] y=y1+r*(y2-y1)

[0120] Step 4.2, grouping of candidate sections: according to the point-line relationship function and the distance between the original trajectory point and the candidate point, the candidate sections with the point-line relationship function value between [0, 1] are directly added to the candidate set; if the point-line relationship function value is between [-0.1, 0)∪(1, 1.1] or the distance between the original trajectory point and the candidate point is less than 50 meters, it is necessary to further determine whether the road id to which the current candidate section belongs already exists in the candidate set. If not, add the current candidate section to the candidate set. If so, compare the distance between the original trajectory point and the candidate point, and only retain the one with the smallest distance in the candidate set; other candidate sections that do not meet the above conditions will be added to the candidate set.

[0121] Step 4.3, Candidate road segment screening: After the candidate road segments are grouped, if there are no candidate road segments in the candidate set, the candidate road segments in the alternative set are added to the candidate set to deal with the complex scenarios caused by the abnormal position of the floating vehicle trajectory point. Then, each candidate road segment is comprehensively evaluated based on the position and angle information of the current original trajectory point and the candidate road segment. The calculation formula is as follows:

[0122]

[0123] That is, the probability score of the point-line relationship function is removed from the observed probability. The top 10 candidate points are retained according to the evaluation score and further solved in the hidden Markov model, and the other candidate points are put into the candidate set.

[0124] The following steps are 4.4-4.8, and the detailed flow chart can be found in Figure 2 .

[0125] Step 4.4, observation probability calculation: Use the Viterbi algorithm with dynamic programming idea to solve the prediction problem of the hidden Markov model. Traverse all candidate points of the current original trajectory point in turn, calculate the observation probability of the current candidate point, if there is no previous candidate point, mark the one with the highest observation probability score among the current candidate points, and execute step 4.4 for the next original trajectory point; otherwise, go to step 4.5.

[0126] Step 4.5, shortest path solution: Calculate the shortest path between all candidate points of the current original trajectory point and all previous candidate points, introduce the driving time factor in the shortest path algorithm, and when expanding a new node, if the actual cost (shortest distance) exceeds the theoretically possible maximum cost (the maximum distance that can be traveled in driving time under the maximum speed limit of 120km / h in the city), the shortest path search is considered to have failed; if the search is successful, the route section information is returned. In the process of solving the shortest path, record the maximum and minimum values ​​of the shortest path length for all candidate points.

[0127] Step 4.6, shortest path judgment: If the shortest path solution fails, or the ratio of the shortest path length to the straight-line distance of the original trajectory point exceeds a certain threshold (set to 3 in this solution), the current candidate point pair is considered to be disconnected, and the result is no longer recorded and retained; if the previous and next candidate points are at the same location, the length is corrected to a smaller distance value (set to 1 meter in this solution) to ensure the correctness of the algorithm logic. Then update the maximum and minimum values ​​of the currently recorded shortest path length, and record the candidate point pairs that have successfully solved the shortest path; if there is no shortest path between all the previous candidate points and all the candidate points of the current original trajectory point, go to step 4.9 to record the currently solved path, then delete the currently recorded previous candidate points, and regard the current original trajectory point as the first original trajectory point of the new path and start calculating from step 4.3.

[0128] Step 4.7, transfer probability calculation: After the current original trajectory point traversal is completed, determine the maximum and minimum values ​​of the shortest path length recorded in step 9. If the difference between the maximum and minimum values ​​is less than 3 meters, in order to avoid the influence of errors on the results, the shortest path scores of all current candidate points will no longer be calculated and compared, and the shortest path scores of all candidate points will be set to 1; otherwise, for each set of candidate point pairs, the shortest path score is calculated according to step 2.4. Combined with the route section information returned in step 8, the driving speed score is calculated according to step 2.5, and finally the transfer probability score is calculated according to step 3.2.

[0129] Step 4.8, trajectory overall probability calculation and previous candidate point retention: According to the observation probability score and transition probability score obtained in step 4.4 and step 4.7, calculate the score of each candidate point of the current original trajectory point according to step 3.3. For each candidate point, only the previous candidate point with the highest overall probability score and the current highest score are recorded. Among all candidate points, mark the one with the highest score, go to step 4.3, and solve the next original trajectory point; if the current one is the last original trajectory point, go to step 4.9.

[0130] Step 4.9, recursive solution, see the process details Figure 3 : Starting from the candidate point with the highest score in the last original trajectory point, continuously recurse its predecessor candidate points, and fill in the route segment information returned by step 4.5 and saved in the current candidate point. Since the trajectory order obtained by recursive solution is reversed, the traversal order of the road should also be reversed when filling in the shape points. Then, according to the information of the route road recorded in the candidate point and the specific driving direction of the current road, all sections on this road are traversed in the order opposite to the road direction, and the shape points at one end of the section are added in sequence. For example, if the road is traveling in the forward direction, all sections are traversed in reverse order, and the starting endpoint of the section is added to the result set each time; after all the shape points of the current candidate point are added, the last added shape point should be removed to avoid repeated addition of the same node. After the recursive solution of the candidate point is completed, the result set is flipped to obtain the restored trajectory result.

[0131] The specific implementation cases described in the present invention are merely examples of the spirit of the present invention. Those skilled in the art of the present invention may make various modifications or additions to the specific implementation cases described or replace them with similar methods, but they will not deviate from the spirit of the present invention or exceed the scope defined by the attached claims.

Claims

1. A trajectory restoration method for floating car data based on hidden Markov model, It is characterized in that The following steps are involved: Step 1, preprocessing the floating vehicle data to obtain preprocessed floating vehicle data, and preprocessing the urban road data to obtain pre-preprocessed urban road data; Step 2: for the floating vehicle data and the urban road data preprocessed in step 1, select the corresponding spatiotemporal features between the two data that can be used for trajectory restoration, and define the probability calculation method of these spatiotemporal features, and then determine the specific road section where the floating vehicle data travels according to the product of all probabilities; Step 3, further construct a hidden Markov model based on the spatial position probability of the original trajectory point of the floating vehicle, the probability of the driving direction, the probability of the relationship between the original trajectory point and the candidate road section, the probability of the shortest path between the candidate points of the floating vehicle, and the probability of the driving speed between the candidate points of the floating vehicle; Step 4, take the preprocessed floating vehicle data, traverse each preprocessed floating vehicle data in turn, and combine it with the preprocessed urban road data, use the overall trajectory probability of the hidden Markov model to calculate all possible candidate paths for the floating vehicle to travel and the probability score of the path; The step 2 is specifically divided into the following steps: Step 2.1, calculate the probability of the spatial position of the original trajectory point of the floating car; The distance between the original trajectory point of the floating car and the candidate point satisfies the normal distribution, and the probability function F of the floating car's spatial position d The definition is as follows: in, represents the jth candidate point of the i-th original trajectory point, represents the distance between the i-th original trajectory point and the candidate point on its j-th candidate path, μ d and σ d Represent the mean and standard deviation of the distance respectively; Step 2.2, calculate the probability of the driving direction of the original trajectory point of the floating car; The angle between the direction of the floating vehicle and the direction of the candidate road section also satisfies the normal distribution, so the probability function F of the floating vehicle's direction is θ The definition is as follows: in, Represents the i-th original trajectory point p i The jth candidate point of represents the angle between the driving direction of the i-th original trajectory point of the floating vehicle and the direction of the j-th candidate road segment, μ θ and σ θ Represent the mean and standard deviation of the angles respectively; Step 2.3, calculate the probability of the relationship between the original trajectory points of the floating car and the candidate road sections in, Represents the i-th original trajectory point p i The jth candidate point of Represents the point-line relationship function value between the i-th original trajectory point and the j-th candidate road segment. The point-line relationship function is defined as follows: The coordinates of the original trajectory point are (x, y), and the line segment is A(x 1 ,y 1 ) as the starting point and B(x 2 ,y 2 ) is the end point. If the original trajectory point can be vertically projected onto the line segment, the range of the point-line relationship function value is [0,1], and the current probability score of the trajectory is not penalized. Otherwise, the current probability score of the trajectory will be reduced to a certain extent. Step 2.4, calculate the probability of the shortest path between the candidate points of the floating car in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of the shortest path between Represents the candidate point and The shortest path distance between the original trajectory point p i There are multiple candidate points, c i Represents p i All candidate points of min(c i-1 ,c i ) and max(c i-1 ,c i ) represent the i and c i-1 The minimum and maximum values ​​of the shortest path distances between all candidate point pairs formed by all candidate points in . The above formula normalizes the shortest path distance to between [0.5, 1]; Step 2.5, calculate the probability of the speed between the candidate points of the floating car in, Represents the i-th original trajectory point p i The tth candidate point of Represented by candidate points To the candidate point The probability of traveling at speeds between Represents the candidate point To the candidate point The average speed is calculated by dividing the shortest path value between two candidate points by the travel time between two original trajectory points. u represents the maximum speed limit of the current road u, and k represents the candidate point and The number of road segments that the shortest path passes through.

2. The method for restoring the trajectory of floating vehicle data based on a hidden Markov model according to claim 1, It is characterized in that The original format of the floating vehicle data in step 1 includes vehicle identification, spatial position, driving direction angle, and recorded collection time; The spatial position is composed of longitude and latitude; In step 1, the floating vehicle data is preprocessed as follows: The plurality of groups of floating vehicle data are grouped into different floating vehicle data sets according to the vehicle identifications of the floating vehicles, and the floating vehicle data with the same vehicle identifications are grouped into the same floating vehicle data set; In each floating vehicle data set, the trajectory record information of each floating vehicle is sorted in chronological order according to the corresponding recording time to obtain the sorted floating vehicle data set. The data set is composed of p i =(id i ,x i ,y i ,a i ,t i ), where i represents the order of the trajectory records in the data set; In each floating car data set after sorting, the Euclidean distance between two adjacent moments is calculated based on the position information of each floating car at two adjacent moments; In each floating car data set after sorting, the time interval is calculated according to the time recorded at two adjacent moments, and the speed of the floating car at two adjacent moments is calculated by combining the Euclidean distance between the two adjacent moments; Taking the city's maximum speed limit of 120km / h as the threshold, we preliminarily screened outliers and interrupted the trajectory at the locations where the outliers existed. After interruption, we obtained multiple sets of floating vehicle data that met the maximum speed limit conditions. Finally, the obtained multiple floating vehicle data sets that meet the maximum speed limit conditions are traversed, and only the data sets with more than 5 trajectory records in the data sets are retained; In step 1, the urban road data is preprocessed, specifically: According to the topological relationship of urban road data, road nodes in urban road data are extracted, and roads are broken according to their breaking points, and nodes are extracted and separated from them (N = [n 1 …n p ]), shape point (SP = [sp 1 …sp q ]), road section (S = [s 1 …s m ]) and the road (R = [r 1 …r n ]) elements; where a node is the intersection of three or more line segments, and an endpoint that is not associated with other line segments. The node is used to construct a directed graph in the shortest path algorithm; A path is a polyline or line segment between two nodes, connected end to end with other paths and not interrupted by other paths; The endpoints of the polyline other than the nodes in the road represent the shape of the road and are also used for calculating candidate points and filling in the passing points during trajectory restoration; A line segment formed by one or two shape points; R* tree is used to perform spatial indexing on road segment information, so that the road segment information contained or intersected within the range can be obtained according to the spatial range; red-black tree is used to perform attribute indexing on road and node information, so that detailed information of the feature can be queried according to the feature ID or associated ID, so as to facilitate the call of data in the trajectory restoration method during the solution; Using the topological relationship between nodes and paths, the weighted directed graph required in the shortest path algorithm is constructed, with nodes as nodes of the weighted directed graph, paths as edges of the weighted directed graph, and weights as the length of the paths. The preprocessing results of the urban road data can be reused in all floating vehicle trajectory records under the current city, so it only needs to be executed once before the trajectory restoration method starts.

3. The method for restoring the trajectory of floating vehicle data based on a hidden Markov model according to claim 2, It is characterized in that The step 3 is specifically as follows: Step 3.1 The observation probability is used to describe the probability of a certain state type of an implicit node generating a certain observation value. In the trajectory restoration problem, the observation probability represents the probability of the floating car generating the current trajectory point record when driving on the current road section. Therefore, it is necessary to consider the relationship between the current original trajectory point and the candidate road section, including the position, angle, and point-line relationship function value: in, Represents the i-th original trajectory point p i The jth candidate point of is the probability of the spatial position of the original trajectory point of the floating car described in step 2.1; is the probability of the driving direction of the original trajectory point of the floating vehicle described in step 2.2; is the probability of the relationship between the original trajectory point of the floating vehicle and the candidate road section described in step 2.3; Step 3.2: Transition probability. Transition probability is used to describe the probability of transitioning from one implicit state to another implicit state. In the trajectory restoration problem, the transition probability represents the probability of transitioning from one candidate road segment to another candidate road segment. Therefore, it is necessary to consider not only the shortest path between two candidate road segments, but also the relationship between the driving time between adjacent original trajectory points of the floating vehicle, the instantaneous speed and the speed limit of urban roads: in, Represents the i-th original trajectory point p i The tth candidate point of Represents a candidate point To the candidate point The transition probability between is the probability of the shortest path between the candidate points of the floating car described in step 2.4; is the probability of the traveling speed between the candidate points of the floating vehicle described in step 2.5; Step 3.3, the overall probability of the trajectory of the hidden Markov model. In order to weaken the impact of some outliers on the probability of the entire state trajectory, the probability accumulation method is used to calculate the final probability value of the state sequence, and it is assumed that the probability calculation process of each current original trajectory point is independent; therefore, the observation probability and transition probability can be renamed as observation score and transition score. According to the logic of the hidden Markov model, the overall probability of the trajectory of the hidden Markov model is calculated: in, Represents the jth state type of the i-th state node. In the map matching problem, it represents the jth candidate segment selected by the i-th original trajectory point. j, s, t represent the sequence numbers of the candidate segments selected at different original trajectory points.

4. The method for restoring the trajectory of floating vehicle data based on a hidden Markov model according to claim 3, It is characterized in that The step 4 is specifically as follows: Step 4.1, candidate road segment acquisition, traverse all original trajectory points in turn; in each round of calculation, take the currently traversed original trajectory point as the center of the circle, search for road segments within a certain threshold range, and after screening according to the driving direction and road direction; determine the candidate points of the current candidate road segment according to the point selection relationship function between the original trajectory point and the candidate road segment; Step 4.2, grouping candidate road segments, adding candidate points to the candidate set and alternative set respectively according to the point-line relationship function and the distance between the original trajectory point and the candidate point; the candidate set retains road segments with point-line relationship function between [0,1], or line relationship function value between [-0.1,0)∪(1,1.1], or the distance between the original trajectory point and the candidate point is less than a certain threshold. In the candidate set, ensure that only one candidate point with the best matching position is retained for each road, and other candidate road segments will be temporarily added to the alternative set. When the candidate set is empty or all candidate points in the candidate set are not connected to the previous original trajectory point, they will be further considered; Step 4.3, candidate road segment screening. After the candidate road segments are grouped, if there is no candidate road segment in the candidate set, the candidate road segments in the alternative set are added to the candidate set to cope with the complex scenarios caused by the abnormal position of the floating vehicle trajectory points. Then, a comprehensive evaluation is performed on each candidate segment based on the position and angle information of the current original trajectory point and the candidate segment. The first few candidate points are retained according to the evaluation score and further solved in the hidden Markov model. The other candidate points are put into the candidate set. Step 4.4, observation probability calculation, using the Viterbi algorithm with dynamic programming idea to solve the prediction problem of the hidden Markov model; Traverse all candidate points of the current original trajectory point in turn, calculate the observation probability of the current candidate point, if there is no previous candidate point, mark the item with the highest observation probability score among the current candidate points, and execute step 4.4 for the next original trajectory point; Otherwise, go to step 4.5; Step 4.5, shortest path solution, solve the shortest path between all candidate points of the current original trajectory point and all previous candidate points. The travel time is introduced into the shortest path algorithm to control the solution range of the algorithm. While solving the shortest path, the maximum and minimum values ​​of the shortest path length of all candidate points are recorded. If the path is found successfully, the section information of the route is returned at the same time. Step 4.6, shortest path judgment, consider the straight-line distance between the original trajectory points outside the hidden Markov model. If the shortest path solution fails, or the ratio of the shortest path length to the straight-line distance of the original trajectory points exceeds a certain threshold, it is considered that the current candidate point pair is not connected; if there is no shortest path between all the previous candidate points and all the candidate points of the current original trajectory point, go to step 4.9 to record the currently solved path, and regard the current original trajectory point as the first original trajectory point of the new path and start the calculation from step 4.3; Step 4.7, transfer probability calculation, after the current original trajectory point traversal is completed, determine the maximum and minimum values ​​of the shortest path length recorded in step 4.

6. If the difference between the maximum and minimum values ​​is less than a certain threshold, in order to avoid the influence of errors on the results, the shortest path scores of all current candidate points will no longer be calculated and compared, and the shortest path scores of all candidate points will be set to the same score; otherwise, for each set of candidate point pairs, the shortest path score is calculated according to step 2.4; with the route section information returned in step 4.5, the driving speed score is calculated according to step 2.5, and finally the transfer probability score is calculated according to step 3.2; Step 4.8, calculation of trajectory overall probability and retention of previous candidate points: According to the observation probability score and transition probability score obtained in steps 4.4 and 4.7, the score of each candidate point of the current original trajectory point is calculated according to step 3.

3. For each candidate point, only the previous candidate point with the highest overall probability score and the current highest score are recorded; among all candidate points, mark the one with the highest score, go to step 4.3, and solve the next original trajectory point; if the current one is the last original trajectory point, go to step 4.9; Step 4.9, recursive solution: starting from the candidate point with the highest score in the last original trajectory point, continuously recursively solve its predecessor candidate points to obtain the map matching results of each original trajectory point in turn. While obtaining the map matching results, according to the information of the passing roads recorded in the candidate points and the driving direction of the floating vehicle on the current road, splice them in a certain order to obtain the restored trajectory.