A vehicle trajectory splicing method of cross-correlation time synchronization and two-stage matching

By employing a cross-correlation time synchronization and two-stage matching method, this approach solves the problems of high computational complexity and trajectory jumps caused by reliance on specific hardware and video in existing technologies. It achieves efficient and accurate vehicle trajectory stitching, is suitable for data processing from multiple heterogeneous sensing sources, and provides high-quality long-distance trajectory data support.

CN122335536APending Publication Date: 2026-07-03HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HEFEI UNIV OF TECH
Filing Date
2026-04-02
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies rely on specific hardware or original video for long-distance vehicle trajectory stitching, resulting in high computational complexity, poor robustness, and failure to effectively compensate for system time synchronization errors. This leads to abrupt changes at the trajectory stitching points, making it difficult to meet the needs of high-precision microscopic traffic analysis.

Method used

A cross-correlation time synchronization and two-stage matching method is adopted. The system time difference is compensated by a time synchronization method based on traffic flow cross-correlation, and the trajectory data is processed by dynamic time warping and progressive relaxation matching. Finally, the Kalman filter algorithm is used for smoothing to ensure the continuity and accuracy of the trajectory.

Benefits of technology

It achieves efficient and accurate trajectory stitching, reduces system deployment costs, enhances environmental adaptability and flexibility, improves the accuracy and computational efficiency of trajectory matching, and the output trajectory conforms to the vehicle motion law, making it suitable for data processing from various heterogeneous sensing sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335536A_ABST
    Figure CN122335536A_ABST
Patent Text Reader

Abstract

This invention discloses a vehicle trajectory stitching method based on cross-correlation time synchronization and two-stage matching, comprising: 1. cleaning and fragment reconstruction of multi-source structured trajectory data; 2. achieving high-precision time synchronization by setting virtual detection lines in overlapping areas and analyzing the cross-correlation of traffic signals; 3. matching trajectories with time overlap using a dynamic time warping algorithm, and matching non-overlapping trajectories using a progressive relaxation method; 4. dynamically weighting and fusing the matched trajectories based on a smoothing weight function to ensure a smooth transition at the stitching point; and 5. applying Kalman filtering for overall trajectory smoothing and denoising. This invention achieves efficient and accurate trajectory stitching without relying on the original video, solving the technical problems of difficult spatiotemporal alignment of multi-source asynchronous trajectory data and easy jumps at the stitching point, providing high-quality long-distance trajectory data support for microscopic traffic behavior analysis, traffic conflict identification, and traffic safety assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of intelligent transportation technology, data fusion and information processing, and specifically to a method for vehicle trajectory stitching based on structured trajectory data collected by multiple UAVs. It is particularly suitable for application scenarios that do not rely on the original video and can directly use the extracted trajectory data to reconstruct long-distance, continuous and smooth vehicle trajectories. Background Technology

[0002] With the rapid development of intelligent transportation systems and vehicle-road cooperative technologies, acquiring continuous and smooth vehicle trajectories over long distances has become a core data foundation for accurate traffic condition perception, in-depth analysis of driving behavior, intelligent identification of traffic incidents, and emergency management decision-making. Especially in scenarios such as urban expressways, highways, and arterial roads, continuous vehicle trajectories can directly support key applications such as travel time estimation, congestion source tracing, detection of abnormal driving behaviors such as emergency lane changes and illegal parking, and full-process reconstruction of traffic accidents.

[0003] Currently, long-distance vehicle trajectories are mainly reconstructed by fusing local trajectory segments collected by multiple adjacent sensing devices. However, existing methods face significant challenges in practical applications: First, many methods heavily rely on raw video data, using vehicle re-identification for cross-camera association. This approach is computationally complex and susceptible to interference from changes in lighting, weather, and viewing angle, resulting in insufficient robustness. Second, some methods that do not rely on video and directly process structured trajectory data often use simple spatiotemporal thresholds for matching. These methods are extremely sensitive to system time synchronization errors and coordinate calibration errors between sensing devices, leading to trajectory jumps at stitching points, disrupting motion continuity, and failing to meet the stringent trajectory quality requirements of microscopic traffic analysis. Furthermore, some solutions employ complex deep learning models to improve accuracy, resulting in heavy computational burdens, poor real-time performance, or reliance on specific sensor-specific features, leading to weak generalization ability and difficulty in adapting to various heterogeneous sensing sources such as drones and cameras.

[0004] Therefore, the problems with existing technical solutions include: (1) Most existing technical solutions rely on specific hardware or raw data, resulting in high costs, poor flexibility, and weak environmental adaptability. Some solutions rely on the deployment of fixed roadside dedicated sensors, such as radar and grating arrays, which are costly to deploy and difficult to cover temporary or non-standard road sections. Other solutions rely on raw video stream data, and their trajectory association is based on vehicle visual features. This not only requires high computing power for matching video images but is also inefficient. None of these methods can flexibly and cost-effectively process trajectory data from mobile platforms such as drones.

[0005] (2) Existing technical solutions lack an effective compensation mechanism for time synchronization errors in multi-source systems, resulting in low matching accuracy. Some solutions rely solely on device timestamps or set fixed time error thresholds when performing data alignment or trajectory matching, without specifically estimating and calibrating the inherent system clock deviations between sensing devices. When there are uncompensated time synchronization errors, the mismatch rate of direct spatiotemporal matching is high, which directly affects the splicing accuracy.

[0006] (3) Existing technical solutions neglect the smoothness of trajectory kinematics, resulting in abrupt changes in the splicing results. Most solutions also do not specifically address the issue of splicing smoothness, which can lead to discontinuities or abrupt changes in position and velocity at the splicing points of the generated continuous trajectory, violating the actual motion laws of vehicles and making it difficult to directly use the output trajectory for microscopic traffic behavior analysis and simulation that requires high precision.

[0007] Therefore, how to efficiently overcome multi-source system errors without relying on raw video and output kinematically smooth and accurate long-distance trajectories has become a technical bottleneck that urgently needs to be overcome in the field of intelligent transportation perception. Summary of the Invention

[0008] This invention addresses the shortcomings of existing technologies by proposing a vehicle trajectory stitching method based on cross-correlation time synchronization and two-stage matching. This method aims to achieve efficient and accurate trajectory stitching, thereby solving the technical problems of spatiotemporal alignment difficulties in multi-source asynchronous trajectory data and the tendency for jumps to occur at stitching points. It provides high-quality long-distance trajectory data support for microscopic traffic behavior analysis, traffic conflict identification, and traffic safety assessment.

[0009] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: The vehicle trajectory stitching method of this invention, which combines cross-correlation time synchronization and two-stage matching, is characterized by the following steps: Step 1: Utilize R drones {A1, A2, ..., A r ,…,A R Simultaneously capture video of traffic flow in overlapping areas upstream and downstream of R+1 road segments in the research road, where the r-th drone A... r and the (r+1)th drone A r+1 The traffic flow videos of the r-th road segment in the study section are captured respectively, and the corresponding traffic flow video S of the r-th segment is obtained. r And the (r+1)th traffic video S r+1 R is the number of drones; A two-dimensional coordinate system is established with the starting point of the study section as the origin, the direction of vehicle travel as the X-axis, and the direction perpendicular to the X-axis as the Y-axis. Extract the r-th traffic video S rThe trajectory points of each vehicle are collected and used as the trajectory data for each vehicle, thus obtaining the trajectory data of the r-th UAV A. r Vehicle trajectory dataset D r ; Step 2: Preprocess the vehicle trajectory dataset for each drone to obtain the complete vehicle trajectory dataset for each drone. Step 3: Perform time synchronization on the complete vehicle trajectory dataset of each drone based on traffic cross-correlation to obtain the time-synchronized complete vehicle trajectory dataset of each drone. Step 4: Synchronize the time-synchronized complete vehicle trajectory dataset E r With E r+1 The trajectory segments belonging to the same vehicle within the overlapping area are matched to obtain the matching result dataset F. r ; Step 5: Use the dynamic weighted fusion method to process the matching result dataset F. r Each pair of trajectories in the dataset is spliced ​​together to obtain a continuous long-distance vehicle trajectory set G for the entire study road segment; Step 6: Use the Kalman filter algorithm to smooth and denoise G to obtain a smoothed and denoised long-distance vehicle trajectory dataset.

[0010] The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching described in this invention is characterized in that step two is performed as follows: Step 2.1, for D r If the trajectory data of any vehicle (car) satisfies equation (1), then the trajectory data of the vehicle (car) is a false ghost trajectory, and the trajectory data of the vehicle (car) is removed; otherwise, proceed to step 2.2. (1) In equation (1), This represents the starting coordinates of the vehicle's trajectory data. This represents the endpoint coordinates of the vehicle's trajectory data. It is the duration of the vehicle's trajectory data; Step 2.2: If the position coordinates of vehicle car at time g in the trajectory data... and D r The position coordinates of another vehicle's trajectory data at time g. They are not the same, and the position coordinates at time g+1 are different. The position coordinates at time g+1 in the trajectory data of vehicle 'car' If they are the same, it means that the complete trajectory of vehicle car and the trajectory data of vehicle car' overlap from time g. when Keep the trajectory data of vehicle car starting from time g, and delete the trajectory data of vehicle car' starting from time g. when If the trajectory data of vehicle car' starting from time g is retained, the trajectory data of vehicle car starting from time g is deleted; otherwise, proceed to step 2.3. Step 2.3, if Located before the starting line of the r-th road segment, and If the vehicle's trajectory data is located after the end line of the r-th road segment, it is determined that the trajectory data of the vehicle is a complete trajectory and is retained, and step 2.7 is executed; otherwise, it is indicated that the trajectory data of the vehicle is a broken trajectory. Step 2.4, if D r If there exists another fracture trajectory b that satisfies equation (2), then step 2.5 is executed; otherwise, it indicates that the reconstruction of the fracture trajectory a of vehicle car is complete. (2) In equation (2), The X-axis coordinate represents the last point on the fracture trajectory a. This represents the X-axis coordinate of the first trajectory point of the fracture trajectory b; This represents the time difference between the last trajectory point of fracture trajectory a and the first trajectory point of fracture trajectory b. t max Maximum search time window; D for and The difference between them D To show the Y-axis coordinate of the last trajectory point of fracture trajectory a Y-axis coordinate of the first trajectory point of the fracture trajectory b The difference between them; V max It is the maximum speed along the X-axis in a single road segment; w h The threshold representing the difference in Y-axis coordinates; Step 2.5: Use equation (3) to splice the fracture trajectory a with its matching fracture trajectory b into a reconstructed trajectory; (3) In equation (3), , These are the X-axis and Y-axis coordinates of the p-th trajectory point in the reconstructed trajectory; It is a cubic polynomial fitting function; Indicates the sampling interval; Step 2.6: Determine whether the reconstructed trajectory is complete according to the process in Step 2.3. If it is, proceed to Step 2.7; otherwise, return to Step 2.4 and execute sequentially. Step 2.7: Follow the steps in step 2.1 to process D. r The trajectory data of other vehicles are processed to obtain the trajectory data of the r-th UAV A. r Complete vehicle trajectory dataset B r .

[0011] Furthermore, step three is carried out as follows: Step 3.1: Initialize r=1; Step 3.2: Select the r-th UAV A r and the (r+1)th drone A r+1 The line perpendicular to the r-th road segment at half the location of the overlapping area of ​​the r-th road segment is used as the virtual detection line L; S r The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r Traffic time series | ;in, For time intervals; S r+1 The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r+1 The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r+1 Traffic time series | ; Step 3.3, will With S r+1 The tth a time window {t ,(t+1) Number of vehicles crossing the virtual detection line L The time interval containing valid data is used as the first... Calculation window Therefore, according to equation (4), the calculation is performed. and cross-correlation coefficient , search for Reaching the global maximum time difference ; (4) In equation (4), For a given time shift, and They are and In the Calculation window The mean within; Step 3.4: Move the (r+1)th drone A r+1 Complete vehicle trajectory dataset B r+1 Timestamps are uniformly added Thus, the rth drone A was completed. r Complete vehicle trajectory dataset B r Time synchronization, obtain the (r+1)th drone A r+1 Time-synchronized complete vehicle trajectory dataset E r+1 ; Step 3.5: After assigning r+1 to r, return to step 3.2 until r=R, thus obtaining the complete vehicle trajectory dataset after time synchronization for each drone.

[0012] Furthermore, step four is carried out as follows: Step 4.1: Record the time-intersecting intervals of two trajectories as trajectory pairs with temporal overlap, and calculate the trajectory similarity of trajectory pairs with temporal overlap using the dynamic time warping method. If the trajectory similarity is less than a set threshold... If , it means that there are trajectory pairs with overlapping time belonging to the same vehicle's trajectory segments; Step 4.2: Use the progressive relaxation matching method to match trajectory pairs that do not overlap in time to obtain trajectory matching pairs belonging to the same vehicle.

[0013] Furthermore, step 4.1 is performed as follows: Step 4.1.1, let E r The i-th trajectory and E r+1 The trajectory segments of the j-th trajectory within the overlapping region are Q and Q', respectively. i and C j Q is calculated using equation (5). i With C j Minimum cumulative distance matrix between , and as Q i With C j Trajectory similarity; (5) In equation (5), and Q i The a-th trajectory point and C j The b-th trajectory point, For Q i The first a trajectory points and C j The minimum cumulative distance between the first b trajectory points; Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b trajectory points. Q represents i The first a trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points. Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points; Step 4.1.2, if Less than the set threshold Then determine Q i With C j The trajectory segments belong to the same vehicle. Furthermore, step 4.2 is performed as follows: Step 4.2.1, E r Unmatched trajectories are placed into sets U and E. r+1 Unmatched trajectories are placed into set V; Define and initialize the current matching round k = 0; Define and initialize the time threshold for the k-th round. Space threshold of round k ; Define and initialize two relaxation coefficients. ; Step 4.2.2: For any i'-th trajectory u in U i’ Search for all that satisfy V and The candidate trajectories are determined, and the comprehensive distance D is calculated according to equation (6). c Thus, the candidate trajectory v with the smallest comprehensive distance is selected. j’ As u i’ The k-th round of matching objects, and the successfully matched trajectories are removed from U and V; (6) In equation (6), Δt is u i’ The time difference Δs between the last trajectory point and the first trajectory point of any candidate trajectory is u. i’ The spatial distance between the last trajectory point and the first trajectory point of the corresponding candidate trajectory. and These are the normalization factors for time and space, respectively. It is a time-weighted factor; Step 4.2.3: Determine if U is empty. If it is empty, it means E... r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r F r Includes information on all successfully matched trajectory pairs; otherwise, proceed to step 4.2.4. Step 4.2.4: If the end time of all remaining trajectories in U is later than the latest start time of all trajectories in V, or... or If the system's preset maximum security threshold is exceeded, it indicates that E has been obtained. r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r Otherwise, calculate the time threshold for the (k+1)th round. =β× Spatial threshold in round k+1 =γ× Then, assign k+1 to k and return to step 4.2.2 for sequential execution.

[0014] Furthermore, step five is performed as follows: Step 5.1, record F r Any group in the middle comes from E r The trajectory is , originating from E r+1 The trajectory is ; Step 5.2, if The start time is later than The end time indicates that there is a time gap between the trajectory pairs, and the process is carried out according to steps 2.4 to 2.5. and After trajectory reconstruction, the segments are stitched together to form a single trajectory segment. like and For trajectory pairs that overlap in time, calculate the normalized position of any time t within the overlapping time interval relative to the entire overlapping time interval. Therefore, according to formula (7) and Perform smooth fusion to obtain the trajectory position at any time t after fusion. Used for and By splicing the data at time t, we obtain the spliced ​​trajectory segment over the entire overlapping time interval, where t... start t end These are the start and end times of the overlapping time intervals, respectively. (7) In equation (7); and They are respectively and At the interpolation position of time t, Let represent the weighting function for time t, and .

[0015] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor in performing the method described therein, and the processor is configured to execute the program stored in the memory.

[0016] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program is executed by a processor to perform the steps of the method described thereon.

[0017] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) Data dependency and system cost: Existing technologies such as grating arrays, dedicated radar, or video re-identification all rely on dedicated hardware or raw video streams. The technical solution of this invention starts with extracted "structured trajectory data" and designs a complete set of algorithms for cross-correlation time synchronization and DTW matching, effectively handling standardized trajectory data acquired by various types of sensors. This effectively overcomes the dependence of existing technologies on dedicated sensor deployment environments, resulting in greater flexibility in application scenarios.

[0018] (2) Regarding time synchronization accuracy: Existing simple threshold methods do not compensate for system time differences, directly using timestamps within a fixed error range as matching conditions, making them sensitive to uncalibrated errors. This invention employs a time synchronization method based on traffic flow cross-correlation, estimating and compensating for system time differences by analyzing the statistical correlation of traffic fluctuations in overlapping areas. This is a software calibration method based on the inherent statistical properties of data. Due to the short-term stability of traffic flow fluctuations, this method can effectively estimate the true relative delay between devices, thus significantly reducing matching uncertainty caused by time asynchrony at the algorithm level, providing a reliable time benchmark for subsequent accurate matching.

[0019] (3) Regarding trajectory matching efficiency: Existing technologies either employ simple multi-rule thresholding methods or introduce complex prediction models. This invention adopts a hybrid matching method to handle different types of trajectories: for overlapping trajectories, the DTW algorithm is used to improve matching speed; for non-overlapping trajectories, a progressive relaxation matching method is used, searching for matches through multiple iterations and dynamically relaxing the threshold, avoiding missed matches due to an overly strict single fixed threshold or incorrect matches due to an overly lenient threshold. The combination of these two methods enables the matching process to efficiently handle a large number of overlapping trajectories. Attached Figure Description

[0020] Figure 1 This is an overall flowchart of the vehicle trajectory stitching method provided in the embodiments of the present invention. Detailed Implementation

[0021] In this embodiment, a general and high-precision vehicle trajectory stitching method based on cross-correlation time synchronization and two-stage matching is applicable to trajectory data collected by multiple drones deployed sequentially along a road segment. This method directly utilizes multi-source structured trajectory data and provides reliable, high-quality trajectory data support for subsequent traffic analysis and management applications through innovative synchronization, matching, and fusion algorithms.

[0022] First, this invention does not rely on raw video streams or dedicated roadside sensors. Instead, it directly processes structured trajectory data extracted from various mobile or fixed platforms, such as multiple drones. This eliminates dependence on specific hardware and raw data, significantly reducing system deployment costs and enhancing flexibility and environmental adaptability in various road and temporary monitoring scenarios. Simultaneously, to overcome the sensitivity of existing technologies to system time errors, this invention first constructs a software-level time synchronization method based on traffic flow fluctuation cross-correlation analysis. By calculating and compensating for the inherent system time difference between different data sources, it lays a reliable foundation for subsequent accurate trajectory matching and effectively reduces the false matching rate. Then, a two-stage hybrid matching strategy is proposed. For overlapping trajectories, a dynamic time warping algorithm is used to significantly improve computational efficiency while ensuring shape similarity matching accuracy. For non-overlapping or broken trajectories, a progressive relaxation matching method is used to achieve robust matching by dynamically adjusting spatiotemporal thresholds, thus achieving a balance between high matching accuracy and high processing speed. Finally, to address the issue of trajectory jumps at the splicing points, a dynamic weighted fusion algorithm based on the Smoothstep function is used in the overlapping areas. Kalman polynomial interpolation, conforming to kinematics, is employed at trajectory breaks. Finally, the entire trajectory is smoothed using Kalman filtering to ensure that the output long-distance trajectory is continuous and smooth in both position and velocity, conforming to the physical laws of vehicle motion. Specifically, for example... Figure 1 As shown, the method is performed according to the following steps: Step 1: Utilize R drones {A1, A2, ..., A r ,…,A RSimultaneously capture video of traffic flow in overlapping areas upstream and downstream of R+1 road segments in the research road, where the r-th drone A... r and the (r+1)th drone A r+1 The traffic flow videos of the r-th road segment in the study section are captured respectively, and the corresponding traffic flow video S of the r-th segment is obtained. r And the (r+1)th traffic video S r+1 R is the number of drones; A two-dimensional coordinate system is established with the starting point of the study section as the origin, the direction of vehicle travel as the X-axis, and the direction perpendicular to the X-axis as the Y-axis. Extract the r-th traffic video S r The trajectory points of each vehicle are collected and used as the trajectory data for each vehicle, thus obtaining the trajectory data of the r-th UAV A. r Vehicle trajectory dataset D r .

[0023] Step 2: Preprocess the vehicle trajectory dataset for each drone to obtain the complete vehicle trajectory dataset for each drone. Step 2.1, for D r If the trajectory data of any vehicle (car) satisfies equation (1), then the trajectory data of the vehicle (car) is a false ghost trajectory, and the trajectory data of the vehicle (car) is removed; otherwise, proceed to step 2.2. (1) In equation (1), This represents the starting coordinates of the vehicle's trajectory data. This represents the endpoint coordinates of the vehicle's trajectory data. It is the duration of the vehicle's trajectory data.

[0024] Step 2.2: If the position coordinates of vehicle car at time g in the trajectory data... and D r The position coordinates of another vehicle's trajectory data at time g. They are not the same, and the position coordinates at time g+1 are different. The position coordinates at time g+1 in the trajectory data of vehicle 'car' If they are the same, it means that the complete trajectory of vehicle car and the trajectory data of vehicle car' overlap from time g.

[0025] when Keep the trajectory data of vehicle car starting from time g, and delete the trajectory data of vehicle car' starting from time g. when If the trajectory data of vehicle car' starting from time g is retained, the trajectory data of vehicle car starting from time g is deleted; otherwise, proceed to step 2.3.

[0026] Step 2.3, if Located before the starting line of the r-th road segment, and If the vehicle's trajectory data is located after the end line of the r-th road segment, it is determined that the trajectory data of the vehicle is a complete trajectory and is retained, and step 2.7 is executed; otherwise, it is indicated that the trajectory data of the vehicle is a broken trajectory.

[0027] Step 2.4, if D r If there exists another fracture trajectory b that satisfies equation (2), then step 2.5 is executed; otherwise, it indicates that the reconstruction of the fracture trajectory a of vehicle car is complete. (2) In equation (2), The X-axis coordinate represents the last point on the fracture trajectory a. This represents the X-axis coordinate of the first trajectory point of the fracture trajectory b; This represents the time difference between the last trajectory point of fracture trajectory a and the first trajectory point of fracture trajectory b. t max Maximum search time window; D for and The difference between them D To show the Y-axis coordinate of the last trajectory point of fracture trajectory a Y-axis coordinate of the first trajectory point of the fracture trajectory b The difference between them; V max It is the maximum speed along the X-axis in a single road segment; w h The threshold representing the difference in Y-axis coordinates.

[0028] Step 2.5: Use equation (3) to splice the fracture trajectory a with its matching fracture trajectory b into a reconstructed trajectory; (3) In equation (3), , These are the X-axis and Y-axis coordinates of the p-th trajectory point in the reconstructed trajectory; It is a cubic polynomial fitting function; Indicates the sampling interval.

[0029] Step 2.6: Determine whether the reconstructed trajectory is complete according to the process in Step 2.3. If it is, proceed to Step 2.7; otherwise, return to Step 2.4 and execute sequentially.

[0030] Step 2.7: Follow the steps in step 2.1 to process D. r The trajectory data of other vehicles are processed to obtain the trajectory data of the r-th UAV A. r Complete vehicle trajectory dataset B r .

[0031] Step 3: Perform time synchronization on the complete vehicle trajectory dataset of each drone based on traffic cross-correlation to obtain the time-synchronized complete vehicle trajectory dataset of each drone. Step 3.1: Initialize r=1; Step 3.2: Select the r-th UAV A r and the (r+1)th drone A r+1 The line perpendicular to the r-th road segment at half the location of the overlapping area of ​​the r-th road segment is used as the virtual detection line L; S r The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r Traffic time series | ;in, For time intervals; S r+1 The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r+1 The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r+1 Traffic time series | .

[0032] Step 3.3, will With S r+1 The tth a time window {t ,(t+1) Number of vehicles crossing the virtual detection line L The time interval containing valid data is used as the first... Calculation window Therefore, according to equation (4), the calculation is performed. and cross-correlation coefficient , search for Reaching the global maximum time difference ; (4) In equation (4), For a given time shift, and They are and In the Calculation window The mean within.

[0033] Step 3.4: Move the (r+1)th drone A r+1 Complete vehicle trajectory dataset B r+1 Timestamps are uniformly added Thus, the rth drone A was completed. r Complete vehicle trajectory dataset B r Time synchronization, obtain the (r+1)th drone A r+1 Time-synchronized complete vehicle trajectory dataset E r+1 .

[0034] Step 3.5: After assigning r+1 to r, return to step 3.2 until r=R, thus obtaining the complete vehicle trajectory dataset after time synchronization for each drone.

[0035] Step 4: Synchronize the time-synchronized complete vehicle trajectory dataset E r With E r+1 The trajectory segments belonging to the same vehicle within the overlapping area are matched to obtain the matching result dataset F. r ; Step 4.1: Record the time-intersecting intervals of two trajectories as trajectory pairs with temporal overlap, and use Dynamic Time Warping (DTW) to calculate the trajectory similarity of trajectory pairs with temporal overlap. If the trajectory similarity is less than a set threshold... If , it means that there are trajectory pairs with overlapping time belonging to the same vehicle's trajectory segments.

[0036] Step 4.1.1, let E r The i-th trajectory and E r+1 The trajectory segments of the j-th trajectory within the overlapping region are Q and Q', respectively. i and C j Q is calculated using equation (5). i With C j Minimum cumulative distance matrix between , and as Q i With C j Trajectory similarity; (5) In equation (5), and Q i The a-th trajectory point and C j The b-th trajectory point, For Q i The first a trajectory points and C j The minimum cumulative distance between the first b trajectory points; Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b trajectory points. Q represents i The first a trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points. Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points.

[0037] Step 4.1.2, if Less than the set threshold Then determine Q i With C j The trajectory segments belong to the same vehicle.

[0038] Step 4.2: Use the progressive relaxation matching method to match trajectory pairs that do not overlap in time to obtain trajectory matching pairs belonging to the same vehicle.

[0039] Step 4.2.1, E r Unmatched trajectories are placed into sets U and E. r+1 Unmatched trajectories are placed into set V; Define and initialize the current matching round k = 0; Define and initialize the time threshold for the k-th round. Space threshold of round k ; Define and initialize two relaxation coefficients. .

[0040] Step 4.2.2: For any i'-th trajectory u in U i’ Search for all that satisfy V and The candidate trajectories are determined, and the comprehensive distance D is calculated according to equation (6). c Thus, the candidate trajectory v with the smallest comprehensive distance is selected.j’ As u i’ The k-th round of matching objects, and the successfully matched trajectories are removed from U and V; (6) In equation (6), Δt is u i’ The time difference Δs between the last trajectory point and the first trajectory point of any candidate trajectory is u. i’ The spatial distance between the last trajectory point and the first trajectory point of the corresponding candidate trajectory. and These are the normalization factors for time and space, respectively. It is a time weighting factor.

[0041] Step 4.2.3: Determine if U is empty. If it is empty, it means E... r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r F r Include information on all successfully matched trajectory pairs; otherwise, proceed to step 4.2.4.

[0042] Step 4.2.4: If the end time of all remaining trajectories in U is later than the latest start time of all trajectories in V, or... or If the system's preset maximum security threshold is exceeded, it indicates that E has been obtained. r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r Otherwise, calculate the time threshold for the (k+1)th round. =β× Spatial threshold in round k+1 =γ× Then, assign k+1 to k and return to step 4.2.2 for sequential execution.

[0043] Step 5: Use the dynamic weighted fusion method to process the matching result dataset F. r Each pair of trajectories in the dataset is spliced ​​together to obtain a continuous long-distance vehicle trajectory set G for the entire study road segment; Step 5.1, record F r Any group in the middle comes from E r The trajectory is , originating from E r+1 The trajectory is ; Step 5.1.1, if The start time is later than The end time indicates that there is a time gap between the trajectory pairs, and the process is carried out according to steps 2.4 to 2.5. and After trajectory reconstruction, the segments are stitched together to form a single trajectory segment.

[0044] Step 5.1.2, if and For trajectory pairs that overlap in time, calculate the normalized position of any time t within the overlapping time interval relative to the entire overlapping time interval. Therefore, according to formula (7) and Perform smooth fusion to obtain the trajectory position at any time t after fusion. Used for and By splicing the data at time t, we obtain the spliced ​​trajectory segment over the entire overlapping time interval, where t... start t end These are the start and end times of the overlapping time intervals, respectively. (7) In equation (7); and They are respectively and At the interpolation position of time t, the Smoothstep function Let represent the weighting function for time t, and .

[0045] Step 6: Use the Kalman filter algorithm to smooth and denoise G to obtain a smoothed and denoised long-distance vehicle trajectory dataset.

[0046] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0047] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

Claims

1. A method for vehicle trajectory stitching with cross-correlation time synchronization and two-stage matching, characterized in that, The procedure is as follows: Step 1: Utilize R drones {A1, A2, ..., A r ,…,A R Simultaneously capture video of traffic flow in overlapping areas upstream and downstream of R+1 road segments in the research road, where the r-th drone A... r and the (r+1)th drone A r+1 The traffic flow videos of the r-th road segment in the study section are captured respectively, and the corresponding traffic flow video S of the r-th segment is obtained. r And the (r+1)th traffic video S r+1 R is the number of drones; A two-dimensional coordinate system is established with the starting point of the study section as the origin, the direction of vehicle travel as the X-axis, and the direction perpendicular to the X-axis as the Y-axis. Extract the r-th traffic video S r The trajectory points of each vehicle are collected and used as the trajectory data for each vehicle, thus obtaining the trajectory data of the r-th UAV A. r Vehicle trajectory dataset D r ; Step 2: Preprocess the vehicle trajectory dataset for each drone to obtain the complete vehicle trajectory dataset for each drone. Step 3: Perform time synchronization on the complete vehicle trajectory dataset of each drone based on traffic cross-correlation to obtain the time-synchronized complete vehicle trajectory dataset of each drone. Step 4: Synchronize the time-synchronized complete vehicle trajectory dataset E r With E r+1 The trajectory segments belonging to the same vehicle within the overlapping area are matched to obtain the matching result dataset F. r ; Step 5: Use the dynamic weighted fusion method to process the matching result dataset F. r Each pair of trajectories in the dataset is spliced ​​together to obtain a continuous long-distance vehicle trajectory set G for the entire study road segment; Step 6: Use the Kalman filter algorithm to smooth and denoise G to obtain a smoothed and denoised long-distance vehicle trajectory dataset.

2. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 1, characterized in that, Step two is to proceed as follows: Step 2.1, for D r If the trajectory data of any vehicle (car) satisfies equation (1), then the trajectory data of the vehicle (car) is a false ghost trajectory, and the trajectory data of the vehicle (car) is removed; otherwise, proceed to step 2.

2. (1) In equation (1), This represents the starting coordinates of the vehicle's trajectory data. This represents the endpoint coordinates of the vehicle's trajectory data. It is the duration of the vehicle's trajectory data; Step 2.2: If the position coordinates of vehicle car at time g in the trajectory data... and D r The position coordinates of another vehicle's trajectory data at time g. They are not the same, and the position coordinates at time g+1 are different. The position coordinates at time g+1 in the trajectory data of vehicle 'car' If they are the same, it means that the complete trajectory of vehicle car and the trajectory data of vehicle car' overlap from time g. when Keep the trajectory data of vehicle car starting from time g, and delete the trajectory data of vehicle car' starting from time g. when Retain the trajectory data of vehicle car' starting from time g, and delete the trajectory data of vehicle car starting from time g. Otherwise, proceed to step 2.3; Step 2.3, if Located before the starting line of the r-th road segment, and If the vehicle's trajectory data is located after the end line of the r-th road segment, it is determined that the trajectory data of the vehicle is a complete trajectory and is retained, and step 2.7 is executed; otherwise, it is indicated that the trajectory data of the vehicle is a broken trajectory. Step 2.4, if D r If there exists another fracture trajectory b that satisfies equation (2), then step 2.5 is executed; otherwise, it indicates that the reconstruction of the fracture trajectory a of vehicle car is complete. (2) In equation (2), The X-axis coordinate represents the last point on the fracture trajectory a. This represents the X-axis coordinate of the first trajectory point of the fracture trajectory b; This represents the time difference between the last trajectory point of fracture trajectory a and the first trajectory point of fracture trajectory b. t max Maximum search time window; Δ for and The difference between them Δ To show the Y-axis coordinate of the last trajectory point of fracture trajectory a Y-axis coordinate of the first trajectory point of the fracture trajectory b The difference between them; V max It is the maximum speed along the X-axis in a single road segment; w h The threshold representing the difference in Y-axis coordinates; Step 2.5: Use equation (3) to splice the fracture trajectory a with its matching fracture trajectory b into a reconstructed trajectory; (3) In equation (3), , These are the X-axis and Y-axis coordinates of the p-th trajectory point in the reconstructed trajectory; It is a cubic polynomial fitting function; Indicates the sampling interval; Step 2.6: Determine whether the reconstructed trajectory is complete according to the process in Step 2.

3. If it is, proceed to Step 2.7; otherwise, return to Step 2.4 and execute sequentially. Step 2.7: Follow the steps in step 2.1 to process D. r The trajectory data of other vehicles are processed to obtain the trajectory data of the r-th UAV A. r Complete vehicle trajectory dataset B r .

3. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 2, characterized in that, Step three is to proceed as follows: Step 3.1: Initialize r=1; Step 3.2: Select the r-th UAV A r and the (r+1)th drone A r+1 The line perpendicular to the r-th road segment at half the location of the overlapping area of ​​the r-th road segment is used as the virtual detection line L; S r The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r Traffic time series | ;in, For time intervals; S r+1 The shooting time is divided into K consecutive time windows, and S is statistically analyzed. r+1 The t-th time window {t ,(t+1) The number of vehicles that cross the virtual detection line L within the area is denoted as . Thus, S is obtained. r+1 Traffic time series | ; Step 3.3, will With S r+1 The tth a time window {t ,(t+1) Number of vehicles crossing the virtual detection line L The time interval containing valid data is used as the first... Calculation window Therefore, according to equation (4), the calculation is performed. and cross-correlation coefficient , search for Reaching the global maximum time difference ; (4) In equation (4), For a given time shift, and They are and In the Calculation window The mean within; Step 3.4: Move the (r+1)th drone A r+1 Complete vehicle trajectory dataset B r+1 Timestamps are uniformly added Thus, the rth drone A was completed. r Complete vehicle trajectory dataset B r Time synchronization, obtain the (r+1)th drone A r+1 Time-synchronized complete vehicle trajectory dataset E r+1 ; Step 3.5: After assigning r+1 to r, return to step 3.2 until r=R, thus obtaining the complete vehicle trajectory dataset after time synchronization for each drone.

4. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 3, characterized in that, Step four is to proceed as follows: Step 4.1: Record the time-intersecting intervals of two trajectories as trajectory pairs with temporal overlap, and calculate the trajectory similarity of trajectory pairs with temporal overlap using the dynamic time warping method. If the trajectory similarity is less than a set threshold... If , it means that there are trajectory pairs with overlapping time belonging to the same vehicle's trajectory segments; Step 4.2: Use the progressive relaxation matching method to match trajectory pairs that do not overlap in time to obtain trajectory matching pairs belonging to the same vehicle.

5. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 4, characterized in that, Step 4.1 is performed as follows: Step 4.1.1, let E r The i-th trajectory and E r+1 The trajectory segments of the j-th trajectory within the overlapping region are Q and Q', respectively. i and C j Q is calculated using equation (5). i With C j Minimum cumulative distance matrix between , and as Q i With C j Trajectory similarity; (5) In equation (5), and Q i The a-th trajectory point and C j The b-th trajectory point, For Q i The first a trajectory points and C j The minimum cumulative distance between the first b trajectory points; Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b trajectory points. Q represents i The first a trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points. Q represents i The first a-1 trajectory points and C j The minimum cumulative distance between the first b-1 trajectory points; Step 4.1.2, if Less than the set threshold Then determine Q i With C j The trajectory segments belong to the same vehicle.

6. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 5, characterized in that, Step 4.2 is performed as follows: Step 4.2.1, E r Unmatched trajectories are placed into sets U and E. r+1 Unmatched trajectories are placed into set V; Define and initialize the current matching round k = 0; Define and initialize the time threshold for the k-th round. Space threshold of round k ; Define and initialize two relaxation coefficients. ; Step 4.2.2: For any i'-th trajectory u in U i’ Search for all that satisfy V and The candidate trajectories are determined, and the comprehensive distance D is calculated according to equation (6). c Thus, the candidate trajectory v with the smallest comprehensive distance is selected. j’ As u i’ The k-th round of matching objects, and the successfully matched trajectories are removed from U and V; (6) In equation (6), Δt is u i’ The time difference Δs between the last trajectory point and the first trajectory point of any candidate trajectory is u. i’ The spatial distance between the last trajectory point and the first trajectory point of the corresponding candidate trajectory. and These are the normalization factors for time and space, respectively. It is a time-weighted factor; Step 4.2.3: Determine if U is empty. If it is empty, it means E... r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r , where F r Includes information on all successfully matched trajectory pairs; otherwise, proceed to step 4.2.

4. Step 4.2.4: If the end time of all remaining trajectories in U is later than the latest start time of all trajectories in V, or... or If the system's preset maximum security threshold is exceeded, it indicates that E has been obtained. r With E r+1 Trajectory matching pairs belonging to the same vehicle are denoted as the matching result dataset F. r Otherwise, calculate the time threshold for the (k+1)th round. =β× Spatial threshold in round k+1 =γ× Then, assign k+1 to k and return to step 4.2.2 for sequential execution.

7. The vehicle trajectory stitching method for cross-correlation time synchronization and two-stage matching according to claim 6, characterized in that, Step five is to proceed as follows: Step 5.1, record F r Any group in the middle comes from E r The trajectory is , originating from E r+1 The trajectory is ; Step 5.2, if The start time is later than The end time indicates that there is a time gap between the trajectory pairs, and the process is carried out according to steps 2.4 to 2.

5. and After trajectory reconstruction, the segments are stitched together to form a single trajectory segment. like and For trajectory pairs that overlap in time, calculate the normalized position of any time t within the overlapping time interval relative to the entire overlapping time interval. Therefore, according to formula (7) and Perform smooth fusion to obtain the trajectory position at any time t after fusion. Used for and By splicing the data at time t, we obtain the spliced ​​trajectory segment over the entire overlapping time interval, where t... start t end These are the start and end times of the overlapping time intervals, respectively. (7) In equation (7); and They are respectively and At the interpolation position of time t, Let represent the weighting function for time t, and .

8. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing the method of any one of claims 1-7, the processor being configured to execute the program stored in the memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by the processor to perform the steps of the method according to any one of claims 1-7.