A vehicle trajectory data cleaning and calibration method
By deduplication, fill in missing points and correcting outliers on vehicle trajectory data, the problem of abnormal data during vehicle trajectory data acquisition is solved, data quality and accuracy are improved, and reliable data support is provided for vehicle safety detection.
Patent Information
- Application Number
- CN202111190719.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-13
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2041-10-13
AI Technical Summary
During the acquisition of vehicle trajectory data, missing points, duplicate points and outlier abnormal data caused by factors such as terrain obstacles and signal instability affect the data quality. The existing technology has a great impact on vehicle safety detection when eliminating outliers. , unable to provide effective data analysis support.
By creating a vehicle trajectory data sample containing feature fields, deduplication and missing points are checked and filled, outliers are identified using the real distance detection method, and corrected to ensure that the data complies with the rules of particle kinematics.
Improve the quality of vehicle trajectory data, ensure that the data truly reflects the vehicle's driving status, reduces the deviation of data analysis, and provides accurate data support for vehicle safety operations.
Smart Images

Figure CN114116687B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle data processing, and in particular to a vehicle track data cleaning and calibration method. Background Art
[0002] During the driving process of the vehicle, the vehicle collector needs to collect a large amount of data, which can provide effective value for vehicle applications, such as abnormal monitoring of vehicle driving process, vehicle driving efficiency evaluation, route adjustment and planning, etc. However, in the process of collecting data, the quality of vehicle driving data may be affected by many unavoidable factors such as terrain obstruction, unstable signal, channel congestion, etc., such as missing points, duplicate points, outliers and other abnormal data. Therefore, before analyzing the vehicle driving data, data cleaning is the key.
[0003] In the process of data cleaning, the most important link is outlier detection and processing. For trajectory data, the commonly used methods are mean filtering, density clustering, etc. Different trajectory data should be processed by appropriate methods. For example, the invention patent named "ADS-B track cleaning and calibration method based on local traversal density clustering" (publication number CN110362559A) uses a local traversal density clustering algorithm to clean and calibrate the speed, longitude, latitude, pressure altitude and other fields of the navigation trajectory data, so that the track points in the navigation trajectory data meet the kinematic laws of the particle point, but the vehicle driving data is different from the track data, and most of it will not be affected by pressure, airflow, etc. For example, the invention patent named "A GPS track cleaning method based on road network data" (publication number CN112748452A) uses urban road network spatial data to optimize GPS cleaning data, so that the removal of outliers and the replanting between jump points are more in line with the actual situation. Although this method can clean the speed in combination with longitude and latitude, directly removing outliers will have a great impact on the performance detection of vehicle safety and cannot provide effective data for subsequent detection of vehicle driving abnormalities. Summary of the invention
[0004] The object of the present invention is to provide a vehicle trajectory data cleaning and calibration method for cleaning hidden danger data existing in vehicle trajectory data and providing a supporting basis for subsequent data analysis of vehicle performance.
[0005] The object of the present invention is achieved in that:
[0006] A vehicle trajectory data cleaning and calibration method is characterized by: the specific steps are as follows:
[0007] (1) establishing a vehicle trajectory data sample including a feature field, wherein the feature field is composed of an initial field and an extended field, the initial field is obtained by a vehicle travel collector, and the extended field is calculated from the initial field;
[0008] (2) De-duplication of vehicle trajectory data samples;
[0009] (3) Select the feature fields to be detected;
[0010] (4) Check for missing points in the feature fields to be detected;
[0011] (5) Fill in the data of the feature fields of the missing points of the vehicle trajectory;
[0012] (6) Identifying vehicle trajectory outliers for vehicle trajectory data samples based on the true distance detection method;
[0013] (7) Correct the vehicle trajectory outliers based on the initial data in the vehicle trajectory data sample.
[0014] In the above step (1), a vehicle trajectory data sample containing feature fields is established. The specific operation process is as follows:
[0015] (1.1) A vehicle trajectory data sample containing a feature field is established. The vehicle trajectory data sample consists of N vehicle trajectory points. The vehicle trajectory data sample is represented as Loc = {P1, P2, ..., P N}, i = 1, 2, ..., N, where P i represents the i-th vehicle trajectory point, N is the number of vehicle trajectory points in the vehicle trajectory data; vehicle trajectory point P i The specific initial fields include: license plate number ID i , timestamp T i , speed V i , direction θ i , longitude Lon i , Latitude i And the affiliated unit Cor i , vehicle trajectory point P i The specific extended fields include: current vehicle acceleration a i ;
[0016] (1.2) The current vehicle acceleration a in the extended field i Calculated from the initial field. Specifically calculate the current vehicle acceleration a i The formula is as follows:
[0017]
[0018] In the above step (2), the vehicle trajectory data samples are deduplicated. The specific operation process is as follows:
[0019] (2.1) According to the timestamp T i The order of the vehicle trajectory point P in the vehicle trajectory data sample i Sort by
[0020] (2.2) With timestamp T i As a reference, find the i All vehicle trajectory points that are equal are removed from Loc and added to the vehicle trajectory time repeating dataset Loc'; if the vehicle trajectory point P in Loc' i is the starting point of the timestamp, then the vehicle trajectory point to the vehicle trajectory point P at the next timestamp is calculated x Euclidean distance; if the vehicle trajectory point P in Loc' i is the end point of the timestamp, then calculate the vehicle trajectory point P from the vehicle trajectory point to the previous timestamp y The specific Euclidean distance formula is as follows:
[0021]
[0022] Where m and n are the subscripts of the two vehicle trajectory points whose Euclidean distance needs to be calculated. Similarly, the Euclidean distances of all vehicle trajectory points in Loc' are calculated, and the vehicle trajectory point with the smallest Euclidean distance in Loc' is taken as the vehicle trajectory point at the timestamp.
[0023] (2.3) The vehicle trajectory points in Loc' are merged with the extracted Loc, and renumbered according to the order of timestamps to obtain the deduplicated vehicle trajectory data sample Loc d = {P1,P2,...,P M}, where M is the number of vehicle trajectory points in the vehicle trajectory data after deduplication.
[0024] In the above step (3), the feature fields to be detected are selected. The specific operation process is as follows:
[0025] (3.1) According to the collected data sample, which is the vehicle trajectory data of a vehicle in a certain period of time, the feature fields to be detected are selected including: timestamp T, speed V, direction θ, longitude Lon, latitude Lat and current vehicle acceleration a.
[0026] In the above step (4), the missing points of the feature fields to be detected are checked. The specific operation process is as follows:
[0027] (4.1) According to the collection time interval t set by the collector, the vehicle trajectory data sample Locd = {P1,P2,…,P M Any vehicle trajectory point P in i Test, if P i If there are missing feature fields in P i Mark it as the missing point of vehicle trajectory, and i Add the missing vehicle trajectory domain S; if P i If there is no missing feature field in P i Add to the non-missing vehicle trajectory domain A;
[0028] (4.2) For the next vehicle trajectory point P i+1 Repeat (4.1) until the last vehicle trajectory point P N The test is finished;
[0029] (4.3) All missing points of vehicle trajectories in the missing vehicle trajectory domain S are merged to obtain the missing point set Where a≠b; merge all vehicle trajectory points in the missing vehicle trajectory domain A to obtain the missing point set
[0030] In the above step (5), the feature fields of the missing points of the vehicle trajectory are filled with data. The specific operation process is as follows:
[0031] (5.1) Taking the missing point set Loc s The vehicle trajectory within the missing point P i To fill the object, in the non-missing point set Loc A In the example, i is used as the center point subscript, and m vehicle trajectory points are obtained before and after. This group of data is recorded as
[0032] (5.2) are calculated respectively The vehicle trajectory within the missing point P k Feature fields to be filled in: timestamp T k , speed V k , direction θ k , longitude Lon k , Latitude k , where k = im,…,i-1,i+1,…,i+m. Specific calculation of a single feature field The formula is as follows:
[0033]
[0034] (5.3) Calculate P using the formula in step (1.2) k The current vehicle acceleration a to be filled in k ;
[0035] (5.4) For the next vehicle trajectory missing point P k+1 Repeat (5.1) to (5.3) until the missing point set Loc s The missing point of the last vehicle trajectory is filled in;
[0036] (5.5) The missing point set Loc is filled s and the set of non-missing points Loc A Merge and renumber in the order of timestamps to get a complete vehicle trajectory dataset Where P i * is the filled vehicle trajectory point, and U is the number of vehicle trajectory points in the complete vehicle trajectory dataset.
[0037] The actual distance detection method mentioned in step (6) above is specifically implemented as follows:
[0038] (6.1) With the complete vehicle trajectory data set Loc * The vehicle trajectory point P i * As a benchmark, find P i * The previous vehicle trajectory point and the next vehicle trajectory point Calculate P i * arrive The real distance and P i * arrive The real distance Assuming the Earth is a perfect sphere, R e is the radius of the earth. The specific real distance formula is as follows:
[0039]
[0040]
[0041] Among them, j = i-1, i+1, the actual distance The arc between two points Calculated;
[0042] (6.2) According to the previous vehicle trajectory point The current vehicle acceleration in Calculate To P i * The relative distance The specific calculation formula for the relative distance is as follows:
[0043]
[0044] in, is the previous vehicle trajectory point The speed of is the previous vehicle trajectory point The timestamp in T i * is the vehicle trajectory point P i * The timestamp in P can be calculated similarly. i * arrive The relative distance
[0045] (6.3) When sum and The sum is greater than the maximum difference Dis between the true distance and the relative distance thr , then P i * Mark it as a vehicle trajectory outlier, and i * Add to the vehicle trajectory outlier domain O; otherwise, P i * Add to the normal domain C of the vehicle trajectory. The specific formula for determining the difference is as follows:
[0046]
[0047] (6.4) All vehicle trajectory outliers in the vehicle trajectory outlier domain O are merged to obtain the outlier set Where x≠y; merge all vehicle trajectory points in the normal domain C of the vehicle trajectory to obtain the normal point set
[0048] In the above step (7), the outliers in the vehicle trajectory data are corrected according to the initial data in the vehicle trajectory data sample, so that the entire trajectory conforms to the kinematic law of the particle, that is, the speed, time, mileage and current location can match each other. The specific implementation steps are as follows:
[0049] (7.1) Taking the outlier set Loc o The vehicle trajectory within the missing point P i * For the correction object, P i * The characteristic fields that need to be corrected include speed V i * ,direction longitude latitude and the current vehicle acceleration At the normal point collection Loc c Find P i * The previous vehicle trajectory point and the next vehicle trajectory point
[0050] (7.2) When the direction When you find a path through and perpendicular to the latitude The straight line L of latitude; when the direction or When you find a and perpendicular to longitude The meridian line L; when the direction If it is neither of the above two situations, then follow this direction Find a straight line L. The specific definition formula of straight line L is as follows:
[0051]
[0052] (7.3) Calculate P i * arrive The relative distance by Longitude and latitude is the center point of the circle, the relative distance With radius r, make a circle R. The standard equation of circle R is as follows:
[0053]
[0054] (7.4) Based on the straight line L and circle R obtained above, calculate the center of the circle The distance d to the straight line L. The specific calculation formula of the distance d is as follows:
[0055]
[0056] (7.5) Correction P i * Longitude and latitude The process is divided into three cases:
[0057] a) When the center of the circle When the distance d to the straight line L is less than the radius r of the circle R, find the two vehicle trajectory prediction points P where the straight line L intersects the circle R a '(Lon' a ,Lat' a ) and Pb '(Lon' b ,Lat' b ), and calculate P according to the Euclidean distance formula. a ' and P b 'arrive Distance (a,i-1) , l (b,i-1) . Find l (a,i-1) , l (b,i-1) The vehicle trajectory point P corresponding to the minimum value i '(Lon i ',Lat i '), where Lon i ', Lat i ' is P i * Corrected longitude and latitude;
[0058] b) When the center of the circle The distance d to the straight line L is equal to the radius r of the circle R. Find a vehicle trajectory prediction point P where the straight line L is tangent to the circle R. i '(Lon i ',Lat i '), where Lon i ', Lat i ' is P i * Corrected longitude and latitude;
[0059] c) When the center of the circle If the distance d to the straight line L is greater than the radius r of the circle R, then calculate the line passing through the center of the circle. And perpendicular to the normal line L' of the line L. The specific formula of the normal line equation L' is as follows:
[0060]
[0061] like Then the normal equation is L': like Then the normal equation is L′: Find the two vehicle trajectory prediction points Pc'(Lon'c, Lat'c) and Pc' where the normal line L' intersects the circle R d '(Lon' d ,Lat' d ), calculate P c ' and P d 'arrive The distance l (c,i-1) , l (d,i-1) , find l (c,i-1) , l (d,i-1) The vehicle trajectory point P corresponding to the minimum value i'(Lon i ',Lat i '), where Lon i ', Lat i ' is P i * Corrected longitude and latitude;
[0062] (7.6) According to P i * Corrected longitude Lon i ', Latitude i 'With the next vehicle trajectory point Calculate P i * and The arc between Calculate P using the radian angle formula i * The corrected direction θ i '. The specific radian angle formula is as follows:
[0063]
[0064] Similarly, according to P i * Corrected longitude Lon i ', Latitude i ' and the previous point Calculate Corrected direction θ i ';
[0065] (7.7) Based on the previous vehicle trajectory point The speed V i+1 and the current acceleration Calculate P i * The corrected speed V i '. The specific formula is as follows:
[0066]
[0067] (7.8) According to the previous vehicle trajectory point Timestamp in speed P i * Corrected speed V i ' and the original timestamp T i * , calculate P i * The corrected current vehicle acceleration a i ';
[0068] (7.9) Loc after correction o With the normal point set Loc c The merged set is used as the final cleaned complete vehicle trajectory data.
[0069] Compared with the prior art, the advantages of the present invention are:
[0070] The present invention uses a vehicle trajectory data cleaning and calibration method to clean vehicle trajectory data. The method corrects the influence of outlier trajectories on vehicle trajectory data. The quality of the cleaned data can more realistically reflect the driving status of the vehicle, more accurately count various attributes of the vehicle, and reduce the deviation of subsequent data analysis, thereby providing accurate data for the subsequent formulation of corresponding vehicle safety operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 is a method flow chart of an embodiment of the present invention;
[0072] Figure 2 It is a schematic diagram of correcting longitude and latitude when the center of a circle intersects a straight line;
[0073] Figure 3 It is a schematic diagram of correcting longitude and latitude when the center of a circle is tangent to a straight line;
[0074] Figure 4 It is a schematic diagram for correcting longitude and latitude when there is no intersection between the center of the circle and the straight line. DETAILED DESCRIPTION
[0075] The specific implementation of the present invention will be further described in detail below in conjunction with the accompanying drawings in the embodiments of the present invention. It should be noted that the specific embodiment of the vehicle trajectory data cleaning and calibration method according to the present invention is only used as an example and is not intended to limit the present invention.
[0076] This embodiment discloses a vehicle trajectory data cleaning and calibration method, such as Figure 1 As shown in the method flow chart, the present invention uses the following steps to clean the vehicle trajectory data:
[0077] (1) establishing a vehicle trajectory data sample including a feature field, wherein the feature field is composed of an initial field and an extended field, the initial field is obtained by a vehicle travel collector, and the extended field is calculated from the initial field;
[0078] (2) De-duplication of vehicle trajectory data samples;
[0079] (3) Select the feature fields to be detected;
[0080] (4) Check for missing points in the feature fields to be detected;
[0081] (5) Fill in the data of the feature fields of the missing points of the vehicle trajectory;
[0082] (6) Identifying vehicle trajectory outliers for vehicle trajectory data samples based on the true distance detection method;
[0083] (7) Correct the vehicle trajectory outliers based on the initial data in the vehicle trajectory data sample.
[0084] In the above step (1), a vehicle trajectory data sample containing feature fields is established. The specific operation process is as follows:
[0085] (1.1) A vehicle trajectory data sample containing a feature field is established. The vehicle trajectory data sample consists of N vehicle trajectory points. The vehicle trajectory data sample is represented as Loc = {P1, P2, ..., P N}, i = 1, 2, ..., N, where P i represents the i-th vehicle trajectory point, N is the number of vehicle trajectory points in the vehicle trajectory data; vehicle trajectory point P i The specific initial fields include: license plate number ID i , timestamp T i , speed V i , direction θ i , longitude Lon i , Latitude i And the affiliated unit Cor i , vehicle trajectory point P i The specific extended fields include: current vehicle acceleration a i ;
[0086] (1.2) The current vehicle acceleration a in the extended field i Calculated from the initial field. Specifically calculate the current vehicle acceleration a i The formula is as follows:
[0087]
[0088] In the above step (2), the vehicle trajectory data samples are deduplicated. The specific operation process is as follows:
[0089] (2.1) According to the timestamp T i The order of the vehicle trajectory point P in the vehicle trajectory data sample i Sort by
[0090] (2.2) With timestamp T i As a reference, find the iAll vehicle trajectory points that are equal are removed from Loc and added to the vehicle trajectory time repeating dataset Loc'; if the vehicle trajectory point P in Loc' i is the starting point of the timestamp, then the vehicle trajectory point to the vehicle trajectory point P at the next timestamp is calculated x Euclidean distance; if the vehicle trajectory point P in Loc' i is the end point of the timestamp, then calculate the vehicle trajectory point P from the vehicle trajectory point to the previous timestamp y The specific Euclidean distance formula is as follows:
[0091]
[0092] Where m and n are the subscripts of the two vehicle trajectory points whose Euclidean distance needs to be calculated. Similarly, the Euclidean distances of all vehicle trajectory points in Loc' are calculated, and the vehicle trajectory point with the smallest Euclidean distance in Loc' is taken as the vehicle trajectory point at the timestamp.
[0093] (2.3) The vehicle trajectory points in Loc' are merged with the extracted Loc, and renumbered according to the order of timestamps to obtain the deduplicated vehicle trajectory data sample Loc d = {P1,P2,...,P M}, where M is the number of vehicle trajectory points in the vehicle trajectory data after deduplication.
[0094] In the above step (3), the feature fields to be detected are selected. The specific operation process is as follows:
[0095] (3.1) According to the collected data sample, which is the vehicle trajectory data of a vehicle in a certain period of time, the feature fields to be detected are selected including: timestamp T, speed V, direction θ, longitude Lon, latitude Lat and current vehicle acceleration a.
[0096] In the above step (4), the missing points of the feature fields to be detected are checked. The specific operation process is as follows:
[0097] (4.1) According to the collection time interval t = 15 seconds set by the collector, the vehicle trajectory data sample Loc d = {P1,P2,...,P M Any vehicle trajectory point P in i Test, if P i If there are missing feature fields in P i Mark it as the missing point of vehicle trajectory, and i Add the missing vehicle trajectory domain S; if P i If there is no missing feature field in Pi Add to the non-missing vehicle trajectory domain A;
[0098] (4.2) For the next vehicle trajectory point P i+1 Repeat (4.1) until the last vehicle trajectory point P N The test is finished;
[0099] (4.3) All missing points of vehicle trajectories in the missing vehicle trajectory domain S are merged to obtain the missing point set Where a≠b; merge all vehicle trajectory points in the non-missing vehicle trajectory domain A to obtain a non-missing point set
[0100] In the above step (5), the feature fields of the missing points of the vehicle trajectory are filled with data. The specific operation process is as follows:
[0101] (5.1) Taking the missing point set Loc s The vehicle trajectory within the missing point P i To fill the object, in the non-missing point set Loc A With i as the center point subscript, m = 20 vehicle trajectory points are obtained before and after, and this group of data is recorded as
[0102] (5.2) are calculated respectively The vehicle trajectory within the missing point P k Feature fields to be filled in: timestamp T k , speed V k , direction θ k , longitude Lon k , Latitude k , where k = im,...,i-1,i+1,…,i+m. Specific calculation of a single feature field The formula is as follows:
[0103]
[0104] (5.3) Calculate P using the formula in step (1.2) k The current vehicle acceleration a to be filled in k ;
[0105] (5.4) For the next vehicle trajectory missing point P k+1 Repeat (5.1) to (5.3) until the missing point set Loc s The missing point of the last vehicle trajectory is filled in;
[0106] (5.5) The missing point set Loc is filled s and the set of non-missing points Loc AMerge and renumber in the order of timestamps to get a complete vehicle trajectory dataset Where P i * is the filled vehicle trajectory point, and U is the number of vehicle trajectory points in the complete vehicle trajectory dataset.
[0107] The actual distance detection method mentioned in step (6) above is specifically implemented as follows:
[0108] (6.1) With the complete vehicle trajectory data set Loc * The vehicle trajectory point P i * As a benchmark, find P i * The previous vehicle trajectory point and the next vehicle trajectory point Calculate P i * arrive The real distance and P i * arrive The real distance Assuming the Earth is a perfect sphere, R e =6371 (unit: km) is the radius of the earth. The specific real distance formula is as follows:
[0109]
[0110]
[0111] Among them, j = i-1, i+1, the actual distance The arc between two points Calculated;
[0112] (6.2) According to the previous vehicle trajectory point The current vehicle acceleration in Calculate To P i * The relative distance The specific calculation formula for the relative distance is as follows:
[0113]
[0114] in, is the previous vehicle trajectory point The speed of is the previous vehicle trajectory point The timestamp in T i * is the vehicle trajectory point Pi * The timestamp in P can be calculated similarly. i * arrive The relative distance
[0115] (6.3) When sum and The sum is greater than the maximum difference Dis between the true distance and the relative distance thr =1.98 (unit: km), then P i * Mark it as a vehicle trajectory outlier, and i * Add to the vehicle trajectory outlier domain O; otherwise, P i * Add to the normal domain C of the vehicle trajectory. The specific formula for determining the difference is as follows:
[0116]
[0117] (6.4) All vehicle trajectory outliers in the vehicle trajectory outlier domain O are merged to obtain the outlier set Where x≠y; merge all vehicle trajectory points in the normal domain C of the vehicle trajectory to obtain the normal point set
[0118] In the above step (7), the outliers in the vehicle trajectory data are corrected according to the initial data in the vehicle trajectory data sample, so that the entire trajectory conforms to the kinematic law of the particle, that is, the speed, time, mileage and current location can match each other. The specific implementation steps are as follows:
[0119] (7.1) Taking the outlier set Loc o The vehicle trajectory within the missing point P i * For the correction object, P i * The characteristic fields that need to be corrected include speed V i * ,direction longitude latitude and the current vehicle acceleration At the normal point collection Loc c Find P i * The previous vehicle trajectory point and the next vehicle trajectory point
[0120] (7.2) When the direction When you find a path through and perpendicular to the latitude The straight line L of latitude; when the direction or When you find a and perpendicular to longitude The meridian line L; when the direction If it is neither of the above two cases, then follow this direction Find a straight line L. The specific definition formula of straight line L is as follows:
[0121]
[0122] (7.3) Calculate P i * arrive The relative distance by Longitude and latitude is the center point of the circle, the relative distance With radius r, make a circle R. The standard equation of circle R is as follows:
[0123]
[0124] (7.4) Based on the straight line L and circle R obtained above, calculate the center of the circle The distance d to the straight line L. The specific calculation formula of the distance d is as follows:
[0125]
[0126] (7.5) Correction P i * Longitude and latitude The process is divided into three cases:
[0127] a) When the center of the circle When the distance d to the straight line L is less than the radius r of the circle R, find the two vehicle trajectory prediction points P where the straight line L intersects the circle R a '(Lon' a ,Lat' a ) and P b '(Lon' b ,Lat' b ), and calculate P according to the Euclidean distance formula. a ' and P b 'arrive Distance (a,i-1) , l (b,i-1) . Find l (a,i-1) , l(b,i-1) The vehicle trajectory point P corresponding to the minimum value i '(Lon i ',Lat i '), where Loni' and Lati' are the longitude and latitude corrected by Pi*;
[0128] b) When the center of the circle The distance d to the straight line L is equal to the radius r of the circle R. Find a vehicle trajectory prediction point P where the straight line L is tangent to the circle R. i '(Lon i ',Lat i '), where Lon i ', Lat i ' is P i * Corrected longitude and latitude;
[0129] c) When the center of the circle If the distance d to the straight line L is greater than the radius r of the circle R, then calculate the line passing through the center of the circle. And perpendicular to the normal line L' of the line L. The specific formula of the normal line equation L' is as follows:
[0130]
[0131] like Then the normal equation is L': like Then the normal equation is L': Find the two vehicle trajectory prediction points Pc'(Lon'c, Lat'c) and Pc' where the normal line L' intersects the circle R d '(Lon' d ,Lat' d ), calculate P c ' and P d 'arrive The distance l (c,i-1) , l (d,i-1) , find l (c,i-1) , l (d,i-1) The vehicle trajectory point P corresponding to the minimum value i '(Lon i ',Lat i '), where Loni' and Lati' are the longitude and latitude corrected by Pi*;
[0132] (7.6) According to P i * Corrected longitude Lon i ', Latitude i 'With the next vehicle trajectory point Calculate Pi * and The arc between Calculate P using the radian angle formula i * The corrected direction θ i '. The specific radian angle formula is as follows:
[0133]
[0134] Similarly, according to P i * Corrected longitude Lon i ', Latitude i ' and the previous point Calculate Corrected direction θ i ';
[0135] (7.7) Based on the previous vehicle trajectory point The speed V i+1 and the current acceleration Calculate P i * The corrected speed V i '. The specific formula is as follows:
[0136]
[0137] (7.8) According to the previous vehicle trajectory point Timestamp in speed P i * Corrected speed V i ' and the original timestamp T i * , calculate P i * The corrected current vehicle acceleration a i ';
[0138] (7.9) Loc after correction o With the normal point set Loc c The merged set is used as the final cleaned complete vehicle trajectory data.
[0139] The above is a preferred embodiment of the present invention, but the present invention should not be limited to the contents disclosed in the embodiment and the drawings. Therefore, any equivalent or modification completed without departing from the spirit disclosed in the present invention shall fall within the scope of protection of the present invention.
Claims
1. A vehicle trajectory data cleaning and calibration method, characterized in that: The specific steps are as follows: (1) Establish a vehicle trajectory data sample containing feature fields, The characteristic field is composed of an initial field and an extended field, the initial field is obtained by the vehicle trip collector, and the extended field is calculated from the initial field; (2) De-duplication of vehicle trajectory data samples; (3) Select the feature fields to be detected; (4) Check for missing points in the feature fields to be detected; (5) Fill in the data of the feature fields of the missing points of the vehicle trajectory; (6) Identifying vehicle trajectory outliers for vehicle trajectory data samples based on the true distance detection method; (7) correcting vehicle trajectory outliers based on initial data in the vehicle trajectory data sample; Wherein: the actual distance detection method mentioned in step (6) is specifically implemented as follows: The first step is to use the complete vehicle trajectory data set Loc * The vehicle trajectory point P i * As a benchmark, find P i * The previous vehicle trajectory point and the next vehicle trajectory point Calculate P i * arrive The real distance and P i * arrive The real distance Assuming the Earth is a perfect sphere, R e is the radius of the earth, the specific real distance formula is as follows: Among them, j = i-1, i+1, the actual distance The radian between two points Rad Calculated; The second step is to use the previous vehicle trajectory point The current vehicle acceleration in Calculate To P i * The relative distance The specific calculation formula for the relative distance is as follows: in, is the previous vehicle trajectory point The speed of is the previous vehicle trajectory point The timestamp in T i * is the vehicle trajectory point P i * The timestamp in P can be calculated similarly. i * arrive The relative distance The third step is when sum and The sum is greater than the maximum difference Dis between the true distance and the relative distance thr , then P i * Mark it as a vehicle trajectory outlier, and i * Add to the vehicle trajectory outlier domain O; otherwise, P i * Added to the normal domain C of the vehicle trajectory, the specific formula for determining the difference is as follows: The fourth step is to merge all the vehicle trajectory outliers in the vehicle trajectory outlier domain O to obtain the outlier set Where x≠y; merge all vehicle trajectory points in the normal domain C of the vehicle trajectory to obtain the normal point set 2. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (1), a vehicle trajectory data sample containing feature fields is established. The specific operation process is as follows: The first step is to establish a vehicle trajectory data sample containing feature fields. The vehicle trajectory data sample consists of N vehicle trajectory points. The vehicle trajectory data sample is represented as Loc = {P1, P2, ..., P N }, i = 1, 2, ..., N, where P i represents the i-th vehicle trajectory point, N is the number of vehicle trajectory points in the vehicle trajectory data; vehicle trajectory point P i The specific initial fields include: license plate number ID i , timestamp T i , speed V i , direction θ i , longitude Lon i , Latitude i And the affiliated unit Cor i , vehicle trajectory point P i The specific extended fields include: current vehicle acceleration a i ; The second step is to expand the current vehicle acceleration a in the field i Calculated from the initial field, specifically calculate the current vehicle acceleration a i The formula is as follows:
3. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (2), the vehicle trajectory data samples are deduplicated. The specific operation process is as follows: The first step is to use the timestamp T i The order of the vehicle trajectory point P in the vehicle trajectory data sample i Sort by The second step is to use the timestamp T i As a reference, find the i All vehicle trajectory points that are equal are removed from Loc and added to the vehicle trajectory time repetition dataset Loc'; If the vehicle trajectory point P in Loc' i is the starting point of the timestamp, then the vehicle trajectory point to the vehicle trajectory point P at the next timestamp is calculated x The Euclidean distance of If the vehicle trajectory point P in Loc' i is the end point of the timestamp, then calculate the vehicle trajectory point P from the vehicle trajectory point to the previous timestamp y The specific Euclidean distance formula is as follows: Where m and n are the subscripts of the two vehicle trajectory points whose Euclidean distance needs to be calculated. Similarly, the Euclidean distances of all vehicle trajectory points in Loc' are calculated, and the vehicle trajectory point with the smallest Euclidean distance in Loc' is taken as the vehicle trajectory point at the timestamp. The third step is to merge the vehicle trajectory points in Loc' with the extracted Loc, renumber them according to the order of timestamps, and obtain the deduplicated vehicle trajectory data sample Loc d = {P1,P2,...,P M }, where M is the number of vehicle trajectory points in the vehicle trajectory data after deduplication.
4. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (3), the feature fields to be detected are selected. The specific operation process is as follows: In the first step, based on the collected data samples, which are vehicle trajectory data of a vehicle in a certain period of time, the feature fields required for detection are selected, including: timestamp T, speed V, direction θ, longitude Lon, latitude Lat and current vehicle acceleration a.
5. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (4), the missing points of the feature fields to be detected are checked. The specific operation process is as follows: In the first step, according to the collection time interval t = 15 seconds set by the collector, the vehicle trajectory data samples Locd = {P1, P2, ..., P M Any vehicle trajectory point P in i Test, if P i If there are missing feature fields in P i Mark it as the missing point of vehicle trajectory, and i Add the missing vehicle trajectory domain S; if P i If there is no missing feature field in P i Add to the non-missing vehicle trajectory domain A; The second step is to calculate the next vehicle trajectory point P. i+1 Repeat the first step until the last vehicle trajectory point P N The test is finished; The third step is to merge all the missing points of the vehicle trajectories in the missing vehicle trajectory domain S to obtain the missing point set. Where a≠b; merge all vehicle trajectory points in the missing vehicle trajectory domain A to obtain the missing point set 6. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (5), the feature fields of the missing points of the vehicle trajectory are filled with data. The specific operation process is as follows: The first step is to use the missing point set Loc s The vehicle trajectory within the missing point P i To fill the object, in the non-missing point set Loc A In the example, i is used as the center point subscript, and m vehicle trajectory points are obtained before and after. This group of data is recorded as The second step is to calculate The vehicle trajectory within the missing point P k Feature fields to be filled in: timestamp T k , speed V k , direction θ k , longitude Lon k , Latitude k , where k = im,...,i-1,i+1,...,i+m, specifically calculate a single feature field The formula is as follows: The third step is to calculate P using the formula in the second step of step (1). k The current vehicle acceleration a to be filled in k ; Step 4: Find the missing point P of the next vehicle trajectory k+1 Repeat steps 1 to 3 until the missing point set Loc s The missing point of the last vehicle trajectory is filled in; Step 5: Fill in the missing point set Loc s and the set of non-missing points Loc A Merge and renumber in the order of timestamps to get a complete vehicle trajectory dataset Where P i * is the filled vehicle trajectory point, and U is the number of vehicle trajectory points in the complete vehicle trajectory dataset.
7. The vehicle trajectory data cleaning and calibration method according to claim 1, characterized in that: In the above step (7), the outliers in the vehicle trajectory data are corrected according to the initial data in the vehicle trajectory data sample, so that the entire trajectory conforms to the kinematic law of the particle, that is, the speed, time, mileage and current location can match each other. The specific implementation steps are as follows: The first step is to use the outlier set Loc o The vehicle trajectory within the missing point P i * For the correction object, P i * The characteristic fields that need to be corrected include speed V i * ,direction longitude latitude and the current vehicle acceleration At the normal point collection Loc c Find P i * The previous vehicle trajectory point and the next vehicle trajectory point The second step is when the direction When you find a path through and perpendicular to the latitude The straight line L of latitude; when the direction or When you find a and perpendicular to longitude The meridian line L; when the direction If it is neither of the above two cases, then follow this direction Find a straight line L. The specific definition formula of straight line L is as follows: The third step is to calculate P i * arrive The relative distance by Longitude and latitude is the center point of the circle, the relative distance For radius r, make a circle R. The standard equation of circle R is as follows: Step 4: Calculate the center of the circle based on the straight line L and circle R obtained above. The distance d to the straight line L, the specific calculation formula of the distance d is as follows: Step 5: Correct P i * Longitude and latitude The process is divided into three cases: a) When the center of the circle When the distance d to the straight line L is less than the radius r of the circle R, find the two vehicle trajectory prediction points P′ where the straight line L intersects the circle R a (Lon' a ,Lat' a ) and P′ b (Lon' b ,Lat' b ), and P′ is calculated according to the Euclidean distance formula. a and P′ b arrive Distance (a,i-1) , l (b,i-1) , find l (a,i-1) , l (b,i-1) The vehicle trajectory point P′ corresponding to the minimum value i (Lon′ i ,Lat′ i ), where Lon′ i , Lat′ i That is P i * Corrected longitude and latitude; b) When the center of the circle The distance d to the straight line L is equal to the radius r of the circle R. Find a vehicle trajectory prediction point P′ where the straight line L is tangent to the circle R i (Lon′ i ,Lat′ i ), where Lon′ i , Lat′ i That is Corrected longitude and latitude; c) When the center of the circle If the distance d to the straight line L is greater than the radius r of the circle R, then calculate the line passing through the center of the circle. And perpendicular to the normal line L' of the straight line L, the specific formula of the normal line equation L' is as follows: like Then the normal equation is like Then the normal equation is Find the two vehicle trajectory prediction points P′ where the normal line L' intersects the circle R c (Lon' c ,Lat' c ) and P′ d (Lon' d ,Lat' d ), calculate P′ respectively c and P′ d arrive The distance l (c,i-1) , l (d,i-1) , find l (c,i-1) , l (d,i-1) The vehicle trajectory point P corresponding to the minimum value i '(Lon′ i ,Lat′ i ), where Lon′ i , Lat′ i That is P i * Corrected longitude and latitude; Step 6: Based on P i * Corrected longitude Lon′ i , Latitude Lat′ i The vehicle trajectory point Calculate P i * and The arc between Calculate P using the radian angle formula i * The corrected direction θ′ i , the specific radian angle formula is as follows: Similarly, according to P i * Corrected longitude Lon′ i , Latitude Lat′ i and the previous point Calculate The corrected direction θ′ i ; Step 7: Based on the previous vehicle trajectory point The speed V i+1 and the current acceleration Calculate P i * The corrected speed V' i , the specific formula is as follows: Step 8: Based on the previous vehicle trajectory point Timestamp in speed P i * Corrected speed V' i and the original timestamp T i * , calculate P i * The corrected current vehicle acceleration a′ i ; Step 9: Loc after correction o With the normal point set Loc c The merged set is used as the final cleaned complete vehicle trajectory data.
Citation Information
Patent Citations
GPS track cleaning method based on road network data
CN112748452A
Method and device for determining movement trajectory, mobile robot and storage medium
CN107742304A
ADS-B track cleaning and calibration method based on local traversal density clustering
CN110362559A
