Vehicle trajectory cleaning and trip segmentation method based on space-time grid and kinematics

CN122547780APending Publication Date: 2026-08-11HIGHWAY MONITORING & RESPONSE CENT MINIST OF TRANSPORT OF THE P R C
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-08
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

现有系统无法获取车辆全程连续门架通行信息,无法完整还原车辆高速行驶路径、中途停留、区间往返等真实行驶行为,节假日车辆通行轨迹大面积缺失、碎片化严重,无法实现全时段、全路径轨迹追溯

Benefits of technology

(1)适配节假日免通场景:针对节假日小客车无ETC扣费记录、无高速出入口计费台账的空白场景,仅依托全量ETC门架车牌识别数据,即可完整还原车辆单日行驶轨迹与分段行程序列,填补了免费通行时段无交易数据下轨迹无法还原的技术空白。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122547780A_ABST
    Figure CN122547780A_ABST
Patent Text Reader

Abstract

This invention discloses a vehicle trajectory cleaning and trip segmentation method based on spatiotemporal grids and kinematics, belonging to the field of intelligent transportation big data analysis technology. The method includes: acquiring discrete vehicle passing records, mapping latitude and longitude coordinates to a planar grid system, and removing spatiotemporal jump anomalies based on neighborhood topology; calculating the time interval, spatial interval, and angle between adjacent valid points, quantifying vehicle steering behavior by constructing a vector dot product model, with a special logical judgment designed specifically for U-turn scenarios; and segmenting the trajectory using a triple threshold joint decision mechanism of distance + time + angle, and aggregating to generate a structured trip chain including the trip start and end points, mileage, and time consumption. This invention solves the trajectory distortion problem caused by data noise and equipment drift, significantly improving the accuracy and robustness of trip recognition compared to traditional single threshold segmentation methods, and is suitable for highway network monitoring and vehicle travel characteristic analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation big data analysis technology. More specifically, this invention relates to a method for vehicle trajectory cleaning and trip segmentation based on spatiotemporal grids and kinematics. Background Technology

[0002] Currently, toll highways generally rely on entry / exit and gantry transaction data, combined with road network GIS coordinates and gantry location information, to reconstruct vehicle travel paths and perform tasks such as vehicle trajectory fitting, trip segmentation, stop determination, and traffic behavior analysis. However, during holidays when passenger vehicles with 7 seats or less are exempt from tolls, there are numerous inherent technical defects and algorithmic shortcomings that prevent them from accurately analyzing the actual traffic characteristics of toll-free vehicles during holidays. Specific deficiencies are as follows: (1) During holidays, passenger cars that pass through free of charge are missing billing transactions, and the regular trajectory data source is invalid; During holidays, passenger cars are exempt from highway tolls. However, these vehicles lack ETC (Electronic Toll Collection) transaction records, toll ledgers at entrances and exits, and reconciliation data from toll-charging gantries. Traditional algorithms that rely on toll transaction logs to construct vehicle trajectories, define travel segments, and determine highway entry and exit points are completely ineffective. Existing systems cannot obtain continuous gantry passage information for the entire journey, nor can they fully reconstruct the vehicle's actual highway travel path, stops, and inter-section travel behavior. During holidays, vehicle trajectories are largely missing and fragmented, making full-time, full-path trajectory tracking impossible.

[0003] (2) Relying solely on the original license plate recognition data, the trajectory is highly susceptible to distortion due to misidentification and re-identification of license plates; Existing ETC gantry license plate recognition raw data suffers from numerous issues, including license plate capture errors, misaligned license plate characters, confusion of similar license plates, duplicate captures, and cross-traffic license plate number mixing. Directly using the raw gantry point time-series data to construct vehicle trajectories results in trajectory jumps, disordered paths, abnormal cross-city points, and accumulation of invalid and redundant points. Traditional algorithms do not perform spatiotemporal joint cleaning and filtering of abnormal license plate recognition points; abnormal and dirty data is directly involved in trajectory sorting, distance calculation, and duration statistics, leading to severe distortion in vehicle travel intervals, travel durations, and city traversal determinations, making it impossible to distinguish between genuine travel trajectories and erroneous pseudo-trajectories.

[0004] (3) The gantry equipment has clock drift and timing disorder, and the travel segment logic is chaotic with huge errors; The varying deployment years of ETC gantry devices along highways, asynchronous time synchronization, clock drift, and cross-segment timestamp discrepancies cause the capture time sequence of adjacent gantries for the same vehicle to be reversed, and the time intervals to be abnormally large or small. Existing trajectory algorithms simply fit the path according to the linear order of capture time, without correcting for the timing anomalies caused by clock drift. They directly calculate the travel time, travel distance, and turning angle of adjacent gantries, resulting in false long-distance skips, false long-term delays, unreasonable sharp turns and U-turns, disordered travel segmentation, and a very high misjudgment rate for stop identification, making it impossible to accurately divide the effective continuous travel range of a vehicle.

[0005] (4) Unable to accurately distinguish between genuine detours, intermediate stops and false abnormal trajectories; entry and exit identification fails. Existing algorithms cannot combine factors such as the distance between adjacent gantries, travel time, steering angle, and road network topology to jointly determine the reasonable travel routes and abnormal trajectories of vehicles. When faced with vehicles exempt from tolls and without billing records, they cannot identify reasonable entry and exit points, interval turns, intermediate stops, or detours, nor can they distinguish genuine and valid highway entry and exit information. This results in numerous misjudgments of false entry and exit points and invalid travel segments, leaving unreliable technical support for tracing vehicle traffic sources, verifying travel routes, and monitoring traffic behavior during holidays.

[0006] (5) The ability to aggregate segments of continuous trips during holidays is weak, making it impossible to reconstruct complete travel routes in batches. Traditional ETC trajectory segmentation algorithms are only suitable for vehicles with short tolling intervals and continuous normal transactions. They cannot automatically aggregate continuous driving segments, split independent trips, and statistically analyze segmented driving mileage, driving time, origin and destination cities, and spatial coordinate information for passenger cars during holidays that lack tolling records, have scattered time sequences, sparse locations, and are subject to spatiotemporal anomalies. Furthermore, they cannot provide standardized batch outputs of vehicle daily trip sequences, daily driving sequence numbers, number of gantries passed, maximum interval, and origin and destination latitude and longitude coordinates, and lack the capability for large-scale big data analysis of holiday traffic trajectories.

[0007] Therefore, there is an urgent need for an intelligent algorithm that can combine geospatial grids and kinematic features to reconstruct the real vehicle travel chain from massive amounts of messy ETC gantry license plate recognition data. Summary of the Invention

[0008] One object of the present invention is to solve at least the above-mentioned problems and to provide at least the advantages that will be described later.

[0009] To achieve these objectives and other advantages of the present invention, a vehicle trajectory cleaning and stroke segmentation method based on spatiotemporal grids and kinematics is provided, comprising the following steps: The system acquires raw vehicle passage data generated by the ETC gantries on highways for license plate recognition. Each data entry includes the vehicle identifier, gantry number, capture time, and gantry latitude and longitude coordinates. The raw data is cleaned and deduplicated. The latitude and longitude coordinates of each cleaned data entry are projected onto a plane coordinate system. The system then reduces the dimensionality to generate fine-grained grid coordinates and coarse-grained grid codes for each data entry, resulting in a sequence of trajectory points with spatial grid attributes. A sliding window is constructed based on the trajectory point sequence. The topological neighborhood relationship between the current trajectory point and the coarse-grained grid codes of the adjacent trajectory points is used to determine whether the current trajectory point is an outlier. After removing outliers, a valid point sequence is obtained. The time difference, spatial distance, and cosine value of the steering angle between valid points are calculated sequentially based on the valid point sequence. Based on the preset joint judgment rule including distance threshold, time threshold, and angle threshold, the valid points in the valid point sequence are determined. Valid points that meet the joint judgment rule are marked as segment cutting points of the journey. All segment cutting points constitute the segment cutting point sequence. The effective point sequence is divided into multiple travel segments based on the segmented cutting point sequence. Each travel segment is assigned a unique travel identifier. The total travel mileage, total time, and number of gantries passed through each segment are aggregated and calculated according to the travel identifier. The start and end records of each travel segment are extracted, and a structured vehicle travel sequence is output.

[0010] Preferably, cleaning and deduplication of the original vehicle passage data includes: filtering vehicle passage data whose vehicle identification does not conform to the national standard license plate rules; and deduplicating duplicate capture records of the same vehicle identification within the same gantry number and the same time window, retaining only one record.

[0011] Preferably, projecting latitude and longitude coordinates to a plane coordinate system includes: using the Earth's radius to convert latitude and longitude into plane rectangular coordinates; The generation of fine-grained grid coordinates and coarse-grained grid codes for each vehicle passage data includes: rounding the Cartesian coordinates to obtain fine-grained grid coordinates, and dividing the fine-grained grid coordinates by a preset coarseness value, rounding them, and then concatenating them to obtain coarse-grained grid codes.

[0012] Preferably, a sliding window is constructed based on the trajectory point sequence, and the current trajectory point is determined as an outlier based on the topological neighborhood relationship between the current trajectory point and its preceding and following adjacent trajectory points using coarse-grained grid encoding. This includes: If the coarse-grained grid code of the current trajectory point is different from the coarse-grained grid codes of the previous and next trajectory points, and the current trajectory point does not belong to the start or end point of the trajectory point sequence, then the current trajectory point is determined to be an isolated jump anomaly point. If the current trajectory point is the starting point of the trajectory point sequence, and the absolute value of the difference between the coarse-grained grid code of the current trajectory point and the next trajectory point in the x-direction or y-direction exceeds the preset grid threshold, then the current trajectory point is determined to be a boundary sparse anomaly point. If the current trajectory point is the end point of the trajectory point sequence, and the absolute value of the difference between the coarse-grained grid code of the current trajectory point and the previous trajectory point in the x-direction or y-direction exceeds the preset grid threshold, then the current trajectory point is determined to be a boundary sparse anomaly point.

[0013] Preferably, the cosine value of the steering angle is calculated as follows: for three adjacent points in the effective point sequence, construct a vector a pointing from the previous point to the current point and a vector b pointing from the current point to the next point, and use the dot product formula cosθ=a•b / (|a|×|b|) to calculate the cosine value of the steering angle θ.

[0014] Preferably, when vector a and vector b are detected to be in opposite directions and have non-zero magnitudes, it is determined that the vehicle has made a U-turn, and a segmentation point is forcibly generated at the current point.

[0015] Preferably, the joint determination rule is as follows: If the spatial distance between adjacent valid points is greater than a preset distance threshold, the next valid point is marked as a segmentation point; or if the time difference between adjacent valid points is greater than a preset time threshold, the next valid point is marked as a segmentation point; or if the turning angle corresponding to the cosine value of the turning angle of three consecutive valid points is greater than a preset angle threshold, the middle valid point is marked as a segmentation point.

[0016] Preferably, the distance threshold is 200km, the time threshold is 2h, and the angle threshold is 120°.

[0017] Preferably, the step of aggregating and calculating the total mileage, total time, and number of gantries passed for each segment based on the trip identifier, and extracting the start and end records for each segment, specifically includes: The total travel time for the segment is obtained by summing the time differences between all adjacent valid points within the same travel marker. The total mileage of the travel segment is obtained by summing the spatial distances between all adjacent valid points within the same travel marker. Count the number of valid points within the same travel marker to obtain the number of gantries passed through in that travel segment; The window function is used to extract the earliest captured vehicle data within the same travel identifier as the starting point record and the latest captured vehicle data as the ending point record.

[0018] Preferably, the output structured vehicle trip sequence includes the following fields: vehicle identifier, statistical date, trip number, number of gantries passed, travel time, travel mileage, maximum gantry interval, city of origin, city of destination, origin time, destination time, X coordinate of origin, Y coordinate of origin, X coordinate of destination, and Y coordinate of destination.

[0019] This invention addresses the scenario of small vehicles lacking ETC toll transactions and complete highway entrance / exit records during statutory toll-free holidays on highways. It utilizes the raw data from the full range of ETC gantry license plate time-series recognition on the road network to construct a spatiotemporal gridded trajectory cleaning algorithm model. This model combines time-series anomaly correction, multi-dimensional stop segmentation determination, and trajectory link aggregation and reconstruction. The aim is to solve the problem of trip statistics distortion caused by abnormal points in massive trajectory data, providing an automated and high-precision method for trajectory cleaning and trip segmentation. The beneficial effects of this invention are: (1) Adapting to the free passage scenario during holidays: For the blank scenario where passenger cars have no ETC deduction records and no highway entrance and exit billing ledgers during holidays, the vehicle's daily driving trajectory and segmented travel sequence can be completely restored by relying solely on the full amount of ETC gantry license plate recognition data, filling the technical gap that the trajectory cannot be restored when there is no transaction data during the free passage period.

[0020] (2) Effectively eliminate trajectory interference errors: Through grid space topology verification and sequential correlation identification of front and rear points, accurately filter out license plate recognition errors, repeated captures, and flying points, jumps, and redundant abnormal points caused by wrong license plate serial numbers; at the same time, avoid time reversal and interval distortion caused by gantry clock drift and timing disorder, and the purity and authenticity of the trajectory are greatly improved.

[0021] (3) Intelligent and accurate breakdown of driving trip: It integrates multi-dimensional threshold rules such as gantry spacing, driving time and steering angle to automatically divide the vehicle into independent driving segments, generate trip sequence numbers, and accurately count core indicators such as the number of gantry passed, segment driving time, driving mileage, and maximum gantry spacing. The trip breakdown logic is rigorous and closely matches real driving behavior.

[0022] (4) Accurately identify reasonable highway entrances and exits: Based on the starting and ending cities of the trajectory segment, latitude and longitude coordinates and road network spatial correlation, the system automatically identifies the actual highway entry and exit points and the cities to which the vehicle belongs, eliminates false entrances and exits and invalid trip segments, and solves the problems of misjudgment of entrances and exits and inaccurate tracing in the traditional way.

[0023] (5) Standardized and structured output data: It can generate standardized results in batches, including license plate number, date, route number, number of gantry passes, driving time / mileage, start and end time, start and end cities and latitude and longitude coordinates. It is compatible with business applications such as big data storage, statistical analysis, traffic traceability, and traffic flow supervision, and can be directly implemented in road network operation and maintenance and holiday traffic analysis scenarios.

[0024] (6) Robust and widely applicable: This method runs on a distributed computing cluster (Hadoop / Spark environment), does not rely on billing transaction and entry / exit registration data, and can be computed based on existing ETC gantry license plate recognition data. It is compatible with the actual field environment with varying highway gantry layouts, equipment time deviations, and license plate recognition quality across the entire network, and has strong engineering feasibility.

[0025] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description

[0026] Figure 1 This is a flowchart of the vehicle trajectory cleaning and stroke segmentation method based on spatiotemporal grids and kinematics described in this invention. Detailed Implementation

[0027] The technical solution of the present invention will be clearly and completely described below with reference to specific embodiments and accompanying drawings. The described embodiments are only some embodiments of the present invention, and not all embodiments; based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0028] like Figure 1 As shown, this invention provides a vehicle trajectory cleaning and stroke segmentation method based on spatiotemporal grids and kinematics, comprising the following steps: Step 1: Obtain the raw vehicle passage data generated by the ETC gantry on the highway for license plate recognition. Each vehicle passage data includes the vehicle identifier, gantry number, capture time, and gantry latitude and longitude coordinates. Clean and deduplicate the raw vehicle passage data. Project the latitude and longitude coordinates of each cleaned vehicle passage data into a plane coordinate system. Then, reduce the dimensionality to generate fine-grained grid coordinates and coarse-grained grid codes for each vehicle passage data to obtain a trajectory point sequence with spatial grid attributes. This embodiment uses ETC gantry license plate recognition data from a highway network toll collection system on a legally mandated free-passage holiday as the processing object. The raw vehicle passage data comes from ETC gantry devices deployed along the highway. These devices include gantry cameras, RSUs (Roadside Units), and license plate recognition systems. They remain operational during free-passage holidays, continuously capturing vehicle images and reading information, only suspending real-time toll deduction. Each gantry captures the license plate and records the capture time as a vehicle passes. Each raw vehicle passage data entry includes the vehicle identifier (i.e., license plate number), gantry number, capture time, and gantry latitude and longitude coordinates.

[0029] First, perform data cleaning.

[0030] Filter the records whose license plate numbers do not conform to the national standard license plate rules. For example, if the license plate number of a certain record is "Jing A1234561", with a length of 8 digits and the first digit being the province abbreviation "Jing", it passes the verification; if the license plate number is "12345" or contains special characters, it is filtered out; Eliminate the trailer records whose license plate numbers contain the word "gua", such as "Jing A1234gua"; Deduplicate the repeated capture records of the same vehicle within the same gantry number and the same time window. For example, if a vehicle is continuously captured 3 times at gantry "G001" at 2024-10-01 08:05:23, only the earliest record is retained.

[0031] Each vehicle passing record after cleaning contains: vehicle identification, passing date, gantry number, capture time, gantry name, city where the gantry is located, gantry longitude, and gantry latitude.

[0032] Secondly, project the longitude and latitude coordinates of each vehicle passing data after cleaning onto a plane coordinate system.

[0033] Since the original gantry longitude and latitude coordinates are spherical coordinates, direct calculation of the distance requires a large number of spherical trigonometric operations, which is not conducive to large-scale data processing. In this embodiment, a simplified plane projection method is adopted: Define the earth radius parameter R = 6371 km. For the longitude and latitude coordinates (lon, lat) of any vehicle passing data, convert them into plane rectangular coordinates (x, y). The specific conversion formula is: In the formula, (lon0, lat0) is the reference origin. In this embodiment, lon0 = 70° and lat0 = 0°. The above formula ensures that the units of x and y are both kilometers, and the Euclidean distance between two points in the plane is approximately equal to the actual spherical distance.

[0034] For example: The longitude and latitude of a certain gantry A are (116.4°, 39.9°). After calculation, the plane rectangular coordinates (x A , y A ) = (325.6, 442.8) km; the longitude and latitude of another gantry B are (116.5°, 40.0°), and (x B , y B ) = (336.2, 453.1) km. The Euclidean distance between the two points is approximately km.

[0035] Next, generate fine-grained grid coordinates and coarse-grained grid codes by reducing the dimension of the plane rectangular coordinates of each vehicle passing data.

[0036] In order to perform spatial neighborhood analysis on trajectory points, it is necessary to discretize continuous plane rectangular coordinates into grid codes.

[0037] For fine-grained grid coordinates, the Cartesian coordinates (x, y) are rounded down to obtain the fine-grained grid coordinates (g). x ,g y ).Right now: Each fine-grained grid corresponds to a spatial range of 1 km × 1 km. Taking the gantry A above as an example, x = 325.6, rounded to obtain g. x =325; y=442.8, rounding up gives g y =442, meaning it is located within the grid (325,442).

[0038] For coarse-grained grid coding, divide the fine-grained grid coordinates by 100 and round down, then concatenate the two coordinate values ​​with "-" to obtain the coarse-grained grid code.

[0039] Each coarse-grained grid corresponds to a spatial range of 100 km × 100 km, used for quickly identifying regional transitions. For example, the coarse-grained grid code for gantry A above is: and That is, "3-4".

[0040] Through the above processing, each original vehicle passage record is converted into a trajectory point with spatial grid attributes. All trajectory points are sorted by vehicle identification and capture time to form a trajectory point sequence.

[0041] Step 2: Construct a sliding window based on the trajectory point sequence. Determine whether the current trajectory point is an outlier based on the topological neighborhood relationship between the current trajectory point and the coarse-grained grid codes of the adjacent trajectory points. After removing outliers, obtain the valid point sequence. For the trajectory point sequence of each vehicle P ={ p 1, p 2,…, p n A sliding window is constructed, and the topological relationship between the current trajectory point and its preceding and following adjacent points in the coarse-grained grid is used to determine whether it is an outlier. In specific implementation, this embodiment utilizes standard SQL analysis functions, such as LAG and LEAD, to extract the spatial attributes of the records preceding and following the current record, thereby implementing the logical judgment of the sliding window. The following example illustrates this: (1) Detection of isolated jump anomalies: If the current point p i coarse-grained grid encoding and the previous trajectory point p i-1 and the next trajectory point p i+1 The coarse-grained grid codes are all different, and pi If it is neither the starting point nor the ending point of the trajectory, then it is determined that... p i This is an abrupt change anomaly.

[0042] For example: The trajectory sequence of a certain vehicle is: p Grid 1 "3-4" → p 2 grids "5-6" → p 3 grids "3-4". p The grid of 2 is different from both the front and back, and it is not an endpoint, so it is judged as an anomaly and removed.

[0043] (2) Detection of sparse boundary anomalies: If the current point is the starting point of the trajectory p 1, and with the second point p If the absolute value of the difference between the coarse-grained grid codes in the x or y direction exceeds a preset grid threshold (e.g., the absolute value of the coarse-grained grid coordinate difference is greater than 1), then... p 1 indicates a boundary anomaly; if the current point is the trajectory endpoint... p n And the previous point p n-1 If the absolute value of the difference between the coarse-grained grid codes in the x or y direction exceeds a preset grid threshold, then it is determined that... p n These are boundary anomalies.

[0044] For example: trajectory starting point p The fine-grained grid of 1 is (325, 442), and its coarse-grained grid is encoded as (3-4), the latter point p The fine-grained grid of grid 2 is (430, 500), and its coarse-grained grid is (4-5). The difference between the two in the x-direction is 1, and the difference in the y-direction is also 1, neither of which exceeds the threshold of 1, therefore it is not considered a boundary anomaly. If p If the coarse-grained grid encoding of 2 is (5-6), then the difference in the x-direction is 2, which exceeds 1, and a decision is made. p 1 indicates a boundary anomaly and is therefore removed.

[0045] (3) Marking and Removal: Generate anomaly flags, marking abnormal points as 1 and normal points as 0. Only retain trajectory points marked as 0 to participate in subsequent calculations to obtain a valid point sequence.

[0046] Step 3: Calculate the time difference, spatial distance, and cosine value of the steering angle between valid points according to the valid point sequence; based on the preset joint judgment rule including distance threshold, time threshold, and angle threshold, determine the valid points in the valid point sequence, and mark the valid points that meet the joint judgment rule as the segment cutting points of the journey. All segment cutting points constitute the segment cutting point sequence. For valid point sequences Q ={q 1, q 2,…, q m The motion feature vectors between adjacent points are calculated sequentially. The following is a specific numerical example: Suppose the valid point sequence of a certain vehicle is as follows: Calculate the time difference Δt between adjacent points and convert it to hours: Δt1(q1→q2) = (08:20-08:00) / 60 = 0.333 hours; Δt2(q2→q3) = (08:45-08:20) / 60 = 0.417 hours; Δt3(q3→q4) = (12:10-08:45) / 60 = 3.417 hours; Calculate the Euclidean distance Δs based on planar coordinates: kilometer; kilometer; kilometer; For three consecutive trajectory points q i-1 , q i , q i+1 Define vector ,vector Calculate the cosine of the included angle using the dot product formula: Taking the midpoint q2 as an example: cosθ2=-300.5 / (14.5×19.2)=-300.5 / 278.4≈-1.08. Since the cosine value cannot be less than -1, it is actually taken as -1, which corresponds to a turning angle of 180°, i.e., a U-turn.

[0047] Next, a joint judgment rule incorporating three thresholds—distance, time, and angle—is used to generate segmentation points when any of the following conditions are met. In this embodiment, the distance threshold is set to 200 kilometers, the time threshold to 2 hours, and the angle threshold to 120°: Long-distance jump: if Δ s i >200 kilometers, then q i+1 Marked as segmentation points. In the example above, Δ s 1. Δ s 2. Δ sNone of the three exceeded 200 kilometers, so they were not triggered.

[0048] Long-term interruption: if Δ t i >2 hours, then q i+1 Marked as segmentation points. In the example above, Δ t 3 = 3.417 hours > 2 hours, therefore... q 4 marks the segmentation point, indicating that the vehicle is at... q After 3, if there has been a long stay or departure from the highway, it should be divided into sections.

[0049] Large-angle turn: for the midpoint q i If the steering angle i i >120°, i.e., cos i i If <-0.5, then q i Marked as segmentation cut points. In the example above, q cos at 2 locations i 2 = -1, corresponding to a steering angle of 180°, which is greater than 120°, therefore... q Mark 2 as the segmentation point, indicating that the vehicle made a U-turn at gantry B. This point also triggers the forced segmentation logic for the U-turn.

[0050] Specifically, when a vehicle is detected returning along its original route, i.e., a vector... and If the direction is opposite and the magnitude is non-zero, it is directly judged as a U-turn, and segmentation is forcibly performed at the current intermediate trajectory point. For example, the above q Point 2 represents the return journey along the original route, a forced cut, making... q 2 serves as both the end point of the preceding segment and the starting point of the following segment. Additionally, if Δ s i-1 or Δ s i If the value is 0, it means that the coordinates of adjacent gantry are exactly the same but may be in the up or down direction. In this case, the cosine of the steering angle cannot be calculated normally, and a U-turn determination is made.

[0051] Ultimately, all the positions marked as segmentation points form a sequence of segmentation points. In this example, the segmentation points are... q 2 and q 4.

[0052] Step 4: Divide the effective point sequence into multiple travel segments based on the segmented cutting point sequence, assign a unique travel identifier to each travel segment, aggregate and calculate the total travel mileage, total time, and number of gantries passed through each segment according to the travel identifier, and extract the start and end records of each travel segment to output a structured vehicle travel sequence.

[0053] The segmented cutting point sequence is applied to the valid point sequence to achieve journey segmentation. The following continues with the above example: The first point is initially q 1. When encountering a cutting point q At 2 o'clock, the travel section will be q 1→ q 2. Assign a unique itinerary identifier: stay id =0: point q There are 3 uncut areas; when a cutting point is encountered... q At 4 o'clock, the travel section will be... q 2→ q 4. Assign a unique itinerary identifier: stay id =1; The final segmentation includes: journey 0, q 1→ q 2; Itinerary 1, q 2→ q 4.

[0054] Based on the above segmented aggregation statistics of the total mileage, total time, and number of gantries passed through each segment, and using window functions to extract the start and end records of each segment, this embodiment uses standard SQL analysis functions, such as FIRST_VALUE and LAST_VALUE, to extract the first record of each group as the start point and the last record as the end point within the window grouped by vehicle and segment number, sorted by capture time, thereby achieving automatic extraction of the start and end point information of the segment. Trip 0: Total mileage = Δ s 1 = 14.5 km, total time = Δt1 = 0.333 hours, number of gantries passed = 2, starting point is q 1, i.e., gantry A, with the endpoint being q 2, namely gantry B; Trip 1: Total mileage = Δ s 2+Δ s 3 = 125.7 km, total time = Δt2 + Δt3 = 3.834 hours, number of gantries passed = 3, starting point is q 2, i.e., gantry B, with the endpoint being q 4, namely gantry D.

[0055] Finally, a structured vehicle trip sequence is output, containing the following fields: vehicle_id, stat_date, trip number stay_id, number of gantries passed record_num, travel time stay_time, travel distance stay_distance, maximum gantry interval stay_maxinterval_km, city of origin start_city, city of destination end_city, start time start_time, end time end_time, X coordinate of origin start_x, Y coordinate of origin start_y, X coordinate of destination end_x, and Y coordinate of destination end_y.

[0056] For example: The results can be directly stored in a distributed data warehouse, facilitating subsequent batch analysis, traffic flow tracing, and travel pattern mining applications.

[0057] Using the methods described above, trip identification and vehicle profiling were performed on passenger cars on the national expressway network during the 2026 Spring Festival holiday, identifying a total of 130 million vehicles. Among them, 47.35 million passenger cars traveled within a single city (accounting for 36%), 28.05 million passenger cars traveled across cities, with the longest and second longest trips showing round-trip characteristics (accounting for 22%), and the remaining 54.58 million passenger cars traveling across cities did not exhibit the above significant round-trip characteristics during the Spring Festival holiday (accounting for 42%).

[0058] During the Spring Festival holiday, the most popular cities for intra-city travel by passenger car were provincial capitals and other major cities within the province. Cities with a high number of vehicles traveling included Chongqing, Beijing, Chengdu, Shanghai, and Tianjin. The longest inter-city trips during the Spring Festival holiday, characterized by round-trip travel, were mainly between the Beijing-Tianjin-Hebei region, the Yangtze River Delta, and the Chengdu-Chongqing urban agglomeration, as well as between provincial capitals and surrounding cities within the province. Inter-city round-trip passenger car trips were characterized by concentrated departure points and dispersed destinations, with Chengdu, Zhengzhou, Shanghai, Beijing, Xi'an, and Guangzhou having significantly higher departure numbers than other cities.

[0059] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and illustrations shown and described herein.

Claims

1. A method for vehicle trajectory cleaning and trip segmentation based on spatiotemporal grid and kinematics, characterized in that, Includes the following steps: The system acquires raw vehicle passage data generated by the ETC gantries on highways for license plate recognition. Each data entry includes the vehicle identifier, gantry number, capture time, and gantry latitude and longitude coordinates. The raw data is cleaned and deduplicated. The latitude and longitude coordinates of each cleaned data entry are projected onto a plane coordinate system. The system then reduces the dimensionality to generate fine-grained grid coordinates and coarse-grained grid codes for each data entry, resulting in a sequence of trajectory points with spatial grid attributes. A sliding window is constructed based on the trajectory point sequence. The topological neighborhood relationship between the current trajectory point and the coarse-grained grid codes of the adjacent trajectory points is used to determine whether the current trajectory point is an outlier. After removing outliers, a valid point sequence is obtained. The time difference, spatial distance, and cosine value of the steering angle between valid points are calculated sequentially based on the valid point sequence. Based on the preset joint judgment rule including distance threshold, time threshold, and angle threshold, the valid points in the valid point sequence are determined. Valid points that meet the joint judgment rule are marked as segment cutting points of the journey. All segment cutting points constitute the segment cutting point sequence. The effective point sequence is divided into multiple travel segments based on the segmented cutting point sequence. Each travel segment is assigned a unique travel identifier. The total travel mileage, total time, and number of gantries passed through each segment are aggregated and calculated according to the travel identifier. The start and end records of each travel segment are extracted, and a structured vehicle travel sequence is output.

2. The spatio-temporal grid and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, Cleaning and deduplication of the original vehicle data includes: filtering out vehicle data whose vehicle identification does not conform to the national standard license plate rules; and deduplicating duplicate capture records of the same vehicle identification within the same gantry number and the same time window, retaining only one record.

3. The spatio-temporal grid and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, Projecting latitude and longitude coordinates to a plane coordinate system includes: using the Earth's radius to convert latitude and longitude into Cartesian coordinates; The generation of fine-grained grid coordinates and coarse-grained grid codes for each vehicle passage data includes: rounding the Cartesian coordinates to obtain fine-grained grid coordinates, and dividing the fine-grained grid coordinates by a preset coarseness value, rounding them, and then concatenating them to obtain coarse-grained grid codes.

4. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, A sliding window is constructed based on the trajectory point sequence. The current trajectory point is determined as an outlier based on the topological neighborhood relationship between its current position and the coarse-grained grid codes of its preceding and following adjacent trajectory points. This includes: If the coarse-grained grid code of the current trajectory point is different from the coarse-grained grid codes of the previous and next trajectory points, and the current trajectory point does not belong to the start or end point of the trajectory point sequence, then the current trajectory point is determined to be an isolated jump anomaly point. If the current trajectory point is the starting point of the trajectory point sequence, and the absolute value of the difference between the coarse-grained grid code of the current trajectory point and the next trajectory point in the x-direction or y-direction exceeds the preset grid threshold, then the current trajectory point is determined to be a boundary sparse anomaly point. If the current trajectory point is the end point of the trajectory point sequence, and the absolute value of the difference between the coarse-grained grid code of the current trajectory point and the previous trajectory point in the x-direction or y-direction exceeds the preset grid threshold, then the current trajectory point is determined to be a boundary sparse anomaly point.

5. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, The cosine value of the steering angle is calculated as follows: For three adjacent points in the effective point sequence, construct a vector a pointing from the previous point to the current point, and a vector b pointing from the current point to the next point. Use the dot product formula cosθ=a•b / (|a|×|b|) to calculate the cosine value of the steering angle θ.

6. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method of claim 5, wherein, When it is detected that vector a and vector b have opposite directions and non-zero magnitude, it is determined that the vehicle has made a U-turn, and a segmentation point is forcibly generated at the current point.

7. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, The joint determination rule is as follows: If the spatial distance between adjacent valid points is greater than a preset distance threshold, the next valid point is marked as a segmentation point; or if the time difference between adjacent valid points is greater than a preset time threshold, the next valid point is marked as a segmentation point; or if the turning angle corresponding to the cosine value of the turning angle of three consecutive valid points is greater than a preset angle threshold, the middle valid point is marked as a segmentation point.

8. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, The distance threshold is 200km, the time threshold is 2h, and the angle threshold is 120°.

9. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, The process involves aggregating and calculating the total mileage, total time, and number of gantries passed for each segment based on the trip identifier, and extracting the start and end records for each segment. Specifically, this includes: The total travel time for the segment is obtained by summing the time differences between all adjacent valid points within the same travel marker. The total mileage of the travel segment is obtained by summing the spatial distances between all adjacent valid points within the same travel marker. Count the number of valid points within the same travel marker to obtain the number of gantries passed through in that travel segment; The window function is used to extract the earliest captured vehicle data within the same travel identifier as the starting point record and the latest captured vehicle data as the ending point record.

10. The spatio-temporal mesh and kinematic based vehicle trajectory cleaning and trip segmentation method as claimed in claim 1 wherein, The output structured vehicle trip sequence includes the following fields: vehicle identifier, statistical date, trip number, number of gantries passed, travel time, travel mileage, maximum gantry interval, city of origin, city of destination, origin time, destination time, X coordinate of origin, Y coordinate of origin, X coordinate of destination, and Y coordinate of destination.