Alternating traffic detection method and device in automatic driving scene based on trajectory continuity

By generating vehicle trajectory sequences and combining dynamic clustering analysis and adaptive threshold adjustment, the problem of misjudgment in alternating traffic detection in autonomous driving is solved, achieving higher accuracy and robustness, and adapting to complex traffic environments.

CN122199618APending Publication Date: 2026-06-12SHENZHEN URBAN TRANSPORT PLANNING CENT CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN URBAN TRANSPORT PLANNING CENT CO LTD
Filing Date
2026-05-15
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Existing autonomous driving technologies have a high misjudgment rate when dealing with vehicle trajectory deviations and abnormal situations, and cannot adapt to complex traffic flow changes, resulting in inaccurate detection of alternating traffic.

Method used

Vehicle trajectory sequences are generated using target detection and multi-target tracking algorithms. Combined with dynamic clustering analysis and trajectory continuity judgment, the merging points and lane divisions are dynamically updated. The frame index of the trajectory midpoint is used for temporal sorting, and the trajectory continuity time threshold is adaptively adjusted.

🎯Benefits of technology

It effectively reduces the false alarm rate, improves the accuracy and robustness of alternating traffic detection, adapts to different road structures and traffic conditions, and enhances the reliability of autonomous driving decisions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122199618A_ABST
    Figure CN122199618A_ABST
Patent Text Reader

Abstract

The application discloses an alternating passing detection method and device based on trajectory continuity in an automatic driving scene, and relates to the technical field of automatic driving.The method is used for solving the problems of the prior art, such as the deficiency in processing trajectory deviation and abnormal conditions, and the problem of not considering time factors, and comprises the following steps: taking a video stream of a convergence area as input, and obtaining a vehicle motion trajectory; dynamically analyzing a convergence environment and distributing vehicle lane attribution; sorting a passing time sequence according to a frame index of a midpoint of the vehicle trajectory passing through the convergence point; and comparing adjacent vehicle lane attribution and a trajectory continuity time threshold value, determining an alternating passing violation, and outputting a result.The application has good application effects in the fields of automatic driving environment perception and decision control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous driving technology, and specifically to a method and apparatus for detecting alternating traffic in autonomous driving scenarios based on trajectory continuity. Background Technology

[0002] In autonomous driving and intelligent traffic management systems, compliance with alternating traffic rules at road merging points directly impacts traffic efficiency and driving safety. Existing alternating traffic detection mainly employs two schemes: one is rule-based detection based on the lane attributes of adjacent vehicles, which only determines the vehicle's origin; the other is detection based on time intervals, which adds a fixed time interval constraint to the former. Existing technologies have three major drawbacks: they cannot handle normal trajectory deviations caused by vehicles avoiding obstacles or uneven road surfaces, which can easily lead to misjudgments; they cannot cope with abnormal situations such as vehicles briefly stopping or making small detours near merging points, resulting in a high misjudgment rate; and the fixed time interval threshold cannot adapt to complex traffic flow changes, and even compliant passage during peak hours may be misjudged. Summary of the Invention

[0003] To address the shortcomings of existing technologies in handling trajectory deviations and abnormal situations, as well as their inadequate consideration of time factors, this invention provides an alternating passage detection method for autonomous driving scenarios based on trajectory continuity, comprising:

[0004] S1 Vehicle Motion Trajectory Acquisition: Taking the real-time video stream of the autonomous driving confluence area as input, the system generates and stores a sequence of vehicle motion trajectories containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms.

[0005] S2 Convergence Environment Dynamic Analysis: Taking the vehicle motion trajectory sequence as input, through dynamic cluster analysis, the precise coordinates of the convergence point, the effective coverage of the convergence area, the division results of the convergence lanes, and the cluster centers corresponding to each convergence lane are determined and dynamically updated, and output.

[0006] S3 Vehicle trajectory and merging lane association allocation: Using the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, extract the trajectory segment coordinate features before the vehicle enters the merging area, calculate its distance to each merging lane cluster center, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle.

[0007] S4 Vehicle Passage Time Sequence Precise Sorting: Taking the vehicle motion trajectory sequence and the precise coordinates of the merging point as input, and using the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point, all vehicles are sorted in time sequence, and the vehicle passage time sequence is output.

[0008] S5 Alternating traffic violation detection and result output based on trajectory continuity: Taking the lane assignment result and the time sequence as input, it iterates through adjacent vehicles in the time sequence, first determining whether two adjacent vehicles come from the same merging lane; if two adjacent vehicles come from different merging lanes, it is determined to be compliant; if two adjacent vehicles come from the same merging lane, it calculates the time difference between the two vehicles passing through the merging point, compares the time difference with a preset trajectory continuity time threshold, if the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation, if the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant, and finally outputs the alternating traffic violation detection result.

[0009] Furthermore, in S1, through target detection and multi-target tracking algorithms, a vehicle motion trajectory sequence containing continuous spatiotemporal coordinates is generated for each detected vehicle. Specifically, the YOLO real-time target detection model is used to perform frame-by-frame vehicle target detection on the input real-time video stream, and a multi-target tracking algorithm is used to assign a unique ID to each vehicle, generating a vehicle motion trajectory sequence containing a set of spatiotemporal coordinate points corresponding to a single vehicle.

[0010] Furthermore, in S2, the step of determining and dynamically updating the precise coordinates of the merging point through dynamic clustering analysis specifically involves: based on the spatial distribution characteristics of the vehicle motion trajectory sequence, dynamically identifying the boundary range of the merging area, the precise location of the merging point, and the geometric boundary of the two merging lanes.

[0011] Furthermore, in S3, the extraction of the trajectory segment coordinate features before the vehicle enters the merging area specifically involves: extracting the complete driving trajectory segment of the vehicle before entering the merging area, and calculating representative features for lane matching based on the coordinate information of the trajectory segment.

[0012] Furthermore, in S4, the step of using the video frame index corresponding to the passing of the geometric center point of the vehicle trajectory to determine the precise time of the vehicle passing through the confluence point specifically involves: calculating the coordinates of the geometric center point of the vehicle's trajectory, determining the video frame index corresponding to the point where the geometric center point coincides with the coordinates of the confluence point, and using this index as the precise time of the vehicle passing through the confluence point.

[0013] Furthermore, in S5, calculating the time difference between the two vehicles passing through the merging point specifically involves calculating the difference between the video frame indices corresponding to the two vehicles passing through the merging point; the trajectory continuity time threshold is a preset minimum interval frame number threshold.

[0014] Furthermore, the minimum interval frame number threshold is determined through the following steps:

[0015] S51 Historical Data Acquisition and Preprocessing: Historical traffic video data of the target merging area and similar urban road merging areas were collected. Traffic density was divided into three levels based on hourly traffic volume: low peak, off-peak, and high peak. The low peak level corresponds to an hourly traffic volume of less than 200 vehicles, the off-peak level corresponds to an hourly traffic volume of 200 to 600 vehicles, and the high peak level corresponds to an hourly traffic volume of more than 600 vehicles. The frame index time interval between adjacent vehicles passing through the merging point in the same merging lane under each density level was calculated. Abnormal interval data caused by stopping to yield, vehicle malfunctions, or pedestrian crossings were excluded to obtain the effective time interval sample set corresponding to each density level.

[0016] S52 baseline threshold calculation: Calculate the 75th percentile of the effective time interval sample set for each traffic flow density level, and use it as the baseline threshold for the corresponding density level;

[0017] S53 Real-time Adaptive Adjustment: Real-time detection of traffic density and average vehicle speed in the current merging area. The traffic density is calculated by the number of vehicles entering the merging area per unit time (1 minute), and the average vehicle speed is calculated by the trajectory displacement and time difference of vehicles within the first 5 seconds before entering the merging area. A corresponding baseline threshold is matched based on the current traffic density level. When the average vehicle speed is below 20 km / h, the matched baseline threshold is increased by 10%; when the average vehicle speed is above 40 km / h, the matched baseline threshold is decreased by 10% to adapt to the requirement of tighter following distances for high-speed, smooth traffic flow. During off-peak hours and when the average vehicle speed is between 20 km / h and 40 km / h, the baseline threshold remains unchanged, ultimately obtaining the minimum interval frame threshold that takes effect in real time.

[0018] It also provides an alternating passage detection device for autonomous driving scenarios based on trajectory continuity, including:

[0019] The vehicle motion trajectory acquisition module is used to take the real-time video stream of the autonomous driving confluence area as input, and generate and store the vehicle motion trajectory sequence containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms.

[0020] The dynamic analysis module for the merging environment takes the vehicle trajectory sequence as input, and through dynamic cluster analysis, determines and dynamically updates the precise coordinates of the merging point, the effective coverage of the merging area, the division results of the merging lanes, and the cluster centers corresponding to each merging lane, and outputs them.

[0021] The vehicle trajectory and merging lane association and allocation module is used to extract the coordinate features of the trajectory segment before the vehicle enters the merging area, with the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, calculate the distance between the vehicle and the cluster center of each merging lane, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle.

[0022] The vehicle passage time sequence precise sorting module is used to sort all vehicles in time sequence and output the vehicle passage time sequence by taking the vehicle movement trajectory sequence and the precise coordinates of the merging point as inputs, and taking the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point as the precise time.

[0023] The alternating traffic violation detection and result output module based on trajectory continuity is used to take the lane attribution result and the time sequence as input, traverse adjacent vehicles in the time sequence, first determine whether two adjacent vehicles come from the same merging lane; if two adjacent vehicles come from different merging lanes, it is determined to be compliant; if two adjacent vehicles come from the same merging lane, it calculates the time difference between the two vehicles passing the merging point, compares the time difference with a preset trajectory continuity time threshold, if the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation, if the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant, and finally outputs the alternating traffic violation detection result.

[0024] The beneficial effects of this invention are:

[0025] (1) High robustness and effective handling of trajectory deviation: By introducing the "minimum interval frame number threshold" for trajectory continuity judgment, the present invention can effectively tolerate trajectory fluctuations caused by small-scale vehicle avoidance, brief lane deviation or sensor noise, avoid a large number of misjudgments, and reduce the misjudgment rate by more than 62% (illustrative data, based on test results on a real traffic video dataset containing 1000 alternating traffic events, compared with the detection scheme based on adjacent vehicle rules).

[0026] (2) Accurately reflects the passage order: The frame index of the midpoint of the trajectory is used for time-series sorting, which can better reflect the actual passage order of vehicles in a congested environment than the traditional fixed detection line method.

[0027] (3) Full-scene adaptation: Due to its reliance on dynamic confluence environment analysis, this method can adapt to different road structures and traffic conditions, and has strong versatility.

[0028] (4) Improve the quality of autonomous driving decision-making: Provide autonomous vehicles with more reliable basis for judging the behavior of surrounding vehicles, enabling them to more accurately predict the intentions of other vehicles and avoid taking unnecessary emergency braking or evasive actions due to misjudgment. Attached Figure Description

[0029] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0030] The technical solution of the present invention will be further described below with reference to embodiments, but it is not limited thereto. Any modifications or equivalent substitutions to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention should be covered within the protection scope of the present invention. In the following embodiments, process equipment or devices not specifically specified are all conventional equipment or devices in the art. Unless specifically specified, the technical means used in the embodiments of the present invention are all conventional means well known to those skilled in the art.

[0031] Example 1, combined with Figure 1 This embodiment illustrates that the present invention provides an alternating passage detection method for autonomous driving scenarios based on trajectory continuity, comprising:

[0032] S1 Vehicle Motion Trajectory Acquisition: Taking the real-time video stream of the autonomous driving confluence area as input, the system generates and stores a sequence of vehicle motion trajectories containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms.

[0033] S2 Convergence Environment Dynamic Analysis: Taking the vehicle motion trajectory sequence as input, through dynamic cluster analysis, the precise coordinates of the convergence point, the effective coverage of the convergence area, the division results of the convergence lanes, and the cluster centers corresponding to each convergence lane are determined and dynamically updated, and output.

[0034] S3 Vehicle trajectory and merging lane association allocation: Using the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, extract the trajectory segment coordinate features before the vehicle enters the merging area, calculate its distance to each merging lane cluster center, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle.

[0035] S4 Vehicle Passage Time Sequence Precise Sorting: Taking the vehicle motion trajectory sequence and the precise coordinates of the merging point as input, and using the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point, all vehicles are sorted in time sequence, and the vehicle passage time sequence is output.

[0036] S5 Alternating traffic violation detection and result output based on trajectory continuity: Taking the lane assignment result and the time sequence as input, it iterates through adjacent vehicles in the time sequence, first determining whether two adjacent vehicles come from the same merging lane; if two adjacent vehicles come from different merging lanes, it is determined to be compliant; if two adjacent vehicles come from the same merging lane, it calculates the time difference between the two vehicles passing through the merging point, compares the time difference with a preset trajectory continuity time threshold, if the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation, if the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant, and finally outputs the alternating traffic violation detection result.

[0037] In S1, a vehicle motion trajectory sequence containing continuous spatiotemporal coordinates is generated for each detected vehicle through target detection and multi-target tracking algorithms. Specifically, the YOLO real-time target detection model is used to perform frame-by-frame vehicle target detection on the input real-time video stream, and a multi-target tracking algorithm is used to assign a unique ID to each vehicle, generating a vehicle motion trajectory sequence containing a set of spatiotemporal coordinate points corresponding to a single vehicle.

[0038] In S2, determining and dynamically updating the precise coordinates of the merging point through dynamic clustering analysis specifically involves: dynamically identifying the boundary range of the merging area, the precise location of the merging point, and the geometric boundary of the two merging lanes based on the spatial distribution characteristics of the vehicle trajectory sequence.

[0039] In S3, the extraction of the trajectory segment coordinate features before the vehicle enters the merging area specifically involves: extracting the complete driving trajectory segment of the vehicle before entering the merging area, and calculating representative features for lane matching based on the coordinate information of the trajectory segment.

[0040] Specifically, vehicles in the merging zone are prone to trajectory fluctuations due to avoidance and lane changes. The driving path before entering the merging zone can more accurately reflect the vehicle's original lane affiliation. The purpose is to accurately complete the association and allocation between the vehicle and the merging lane, avoid lane affiliation errors caused by trajectory interference in the merging zone, and provide a reliable lane determination basis for subsequent alternating traffic violation detection.

[0041] In S4, the step of using the video frame index corresponding to the passing of the geometric midpoint of the vehicle trajectory through the merging point as the precise time of the vehicle passing through the merging point specifically involves: calculating the coordinates of the geometric center point of the vehicle's trajectory, determining the video frame index corresponding to the point where the geometric center point coincides with the coordinates of the merging point, and using this index as the precise time of the vehicle passing through the merging point.

[0042] Specifically, this step uses the video frame index corresponding to the point where the geometric midpoint of the vehicle trajectory coincides with the coordinates of the merging point to define the precise time when the vehicle passes through the merging point, replacing the traditional fixed detection line timing method. The purpose is to more accurately reflect the actual passage order of vehicles in space, avoid timing errors caused by differences in vehicle speed, and provide a reliable timing benchmark for subsequent alternating passage violation detection.

[0043] In S5, calculating the time difference between the two vehicles passing through the merging point specifically involves calculating the difference between the video frame indices corresponding to the two vehicles passing through the merging point; the trajectory continuity time threshold is a preset minimum interval frame number threshold.

[0044] The minimum interval frame number threshold is determined through the following steps:

[0045] S51 Historical Data Acquisition and Preprocessing: Historical traffic video data of the target merging area and similar urban road merging areas were collected. Traffic density was divided into three levels based on hourly traffic volume: low peak, off-peak, and high peak. The low peak level corresponds to an hourly traffic volume of less than 200 vehicles, the off-peak level corresponds to an hourly traffic volume of 200 to 600 vehicles, and the high peak level corresponds to an hourly traffic volume of more than 600 vehicles. The frame index time interval between adjacent vehicles passing through the merging point in the same merging lane under each density level was calculated. Abnormal interval data caused by stopping to yield, vehicle malfunctions, or pedestrian crossings were excluded to obtain the effective time interval sample set corresponding to each density level.

[0046] S52 baseline threshold calculation: Calculate the 75th percentile of the effective time interval sample set for each traffic flow density level, and use it as the baseline threshold for the corresponding density level;

[0047] S53 Real-time Adaptive Adjustment: Real-time detection of traffic density and average vehicle speed in the current merging area. The traffic density is calculated by the number of vehicles entering the merging area per unit time (1 minute), and the average vehicle speed is calculated by the trajectory displacement and time difference of vehicles within the first 5 seconds before entering the merging area. A corresponding baseline threshold is matched based on the current traffic density level. When the average vehicle speed is below 20 km / h, the matched baseline threshold is increased by 10%; when the average vehicle speed is above 40 km / h, the matched baseline threshold is decreased by 10% to adapt to the requirement of tighter following distances for high-speed, smooth traffic flow. During off-peak hours and when the average vehicle speed is between 20 km / h and 40 km / h, the baseline threshold remains unchanged, ultimately obtaining the minimum interval frame threshold that takes effect in real time.

[0048] It also provides an alternating passage detection device for autonomous driving scenarios based on trajectory continuity, including:

[0049] The vehicle motion trajectory acquisition module is used to take the real-time video stream of the autonomous driving confluence area as input, and generate and store the vehicle motion trajectory sequence containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms.

[0050] The dynamic analysis module for the merging environment takes the vehicle trajectory sequence as input, and through dynamic cluster analysis, determines and dynamically updates the precise coordinates of the merging point, the effective coverage of the merging area, the division results of the merging lanes, and the cluster centers corresponding to each merging lane, and outputs them.

[0051] The vehicle trajectory and merging lane association and allocation module is used to extract the coordinate features of the trajectory segment before the vehicle enters the merging area, with the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, calculate the distance between the vehicle and the cluster center of each merging lane, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle.

[0052] The vehicle passage time sequence precise sorting module is used to sort all vehicles in time sequence and output the vehicle passage time sequence by taking the vehicle movement trajectory sequence and the precise coordinates of the merging point as inputs, and taking the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point as the precise time.

[0053] The alternating traffic violation detection and result output module based on trajectory continuity is used to take the lane attribution result and the time sequence as input, traverse adjacent vehicles in the time sequence, first determine whether two adjacent vehicles come from the same merging lane; if two adjacent vehicles come from different merging lanes, it is determined to be compliant; if two adjacent vehicles come from the same merging lane, it calculates the time difference between the two vehicles passing the merging point, compares the time difference with a preset trajectory continuity time threshold, if the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation, if the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant, and finally outputs the alternating traffic violation detection result.

[0054] Example 2: This example uses a city expressway ramp merging as an example. This expressway ramp merging point is a typical alternating traffic control scenario where two lanes merge into one lane. The video acquisition equipment uses a high-definition industrial camera with a frame rate of 30fps. The system performs alternating traffic detection according to the following steps:

[0055] S1 uses the YOLO model to detect targets in the real-time video stream, assigns a unique ID to each trajectory, and accurately detects and tracks vehicles on both merging lanes, generating their respective motion trajectory sequences.

[0056] S2 uses dynamic clustering analysis to determine the precise pixel coordinates of the merging point as (1280, 720) and the boundary of the merging region, identifies the geometric boundary of the two merging lanes and determines the corresponding cluster center;

[0057] S3 extracts the trajectory segment of the vehicle before entering the merging area and performs lane matching, and completes accurate lane assignment based on the nearest cluster center;

[0058] S4 calculates the time when the geometric center point of the vehicle trajectory coincides with the confluence point. Vehicle A corresponds to frame index 1050, vehicle B to frame 1110, and vehicle C to frame 1065. The passage time sequence is established according to the frame index: A (frame 1050) → C (frame 1065) → B (frame 1110). Before conducting violation detection, the minimum frame interval threshold for real-time effectiveness is determined: historical traffic video data for 7 consecutive days is collected from the merging area and three similar expressway ramp merging areas in the surrounding area. Traffic density is divided into three levels according to hourly traffic flow: low peak (<200 vehicles / hour), off-peak (200-600 vehicles / hour), and high peak (>600 vehicles / hour). The frame index time interval between adjacent vehicles passing the merging point in the same merging lane under each level is counted. Abnormal data such as stopping to yield and vehicle malfunctions are excluded to obtain an effective time interval sample set. The 75th percentile of the sample set for each level is calculated as the corresponding baseline threshold. In this scenario, 24 frames are for low peak, 30 frames for off-peak, and 33 frames for high peak. The current traffic density and average vehicle speed in the merging area are detected in real time. The traffic density is calculated by the number of vehicles entering the merging area per unit time of 1 minute, and the average vehicle speed is calculated by the trajectory displacement and time difference of vehicles in the 5 seconds before entering the merging area.

[0059] In this embodiment, the detection period is the morning rush hour, with a real-time traffic density of 20 vehicles / minute (1200 vehicles / hour). The peak threshold is matched to 33 frames. Simultaneously, the average vehicle speed is detected at 18 km / h, below 20 km / h. Therefore, the threshold is increased by 10%, rounded to obtain a real-time threshold of 36 frames. After determining the threshold, S5 violation detection is executed: The time sequence is traversed to check adjacent vehicles. Vehicles A and C both originate from the left lane, with a time difference of 15 frames (less than 36 frames), indicating normal continuous following and compliance. Vehicles C and B originate from different lanes and are also considered compliant. Vehicle B alone is considered compliant. If another time sequence is detected: Vehicle D (1200 frames, left lane) → Vehicle E (1242 frames, left lane) → Vehicle F (1278 frames, right lane), the time difference between vehicles D and E is 42 frames (greater than 36 frames), indicating a broken trajectory between the two vehicles, constituting a violation. Vehicles E and F originate from different lanes and are also considered compliant. The system outputs that one violation exists and records the information of the violating vehicle and evidence fragments.

Claims

1. A method for detecting alternating traffic in autonomous driving scenarios based on trajectory continuity, characterized in that, include: S1 Vehicle Motion Trajectory Acquisition: Taking the real-time video stream of the autonomous driving confluence area as input, the system generates and stores a sequence of vehicle motion trajectories containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms. S2 Convergence Environment Dynamic Analysis: Taking the vehicle motion trajectory sequence as input, through dynamic cluster analysis, the precise coordinates of the convergence point, the effective coverage of the convergence area, the division results of the convergence lanes, and the cluster centers corresponding to each convergence lane are determined and dynamically updated, and output. S3 Vehicle trajectory and merging lane association allocation: Using the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, extract the trajectory segment coordinate features before the vehicle enters the merging area, calculate its distance to each merging lane cluster center, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle. S4 Vehicle Passage Time Sequence Precise Sorting: Taking the vehicle motion trajectory sequence and the precise coordinates of the merging point as input, and using the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point, all vehicles are sorted in time sequence, and the vehicle passage time sequence is output. S5 based on trajectory continuity for alternating traffic violation detection and result output: taking the lane attribution result and the time sequence as input, it iterates through adjacent vehicles in the time sequence, first determining whether two adjacent vehicles come from the same merging lane; if two adjacent vehicles come from different merging lanes, it is determined to be compliant; If two adjacent vehicles come from the same merging lane, the time difference between the two vehicles passing through the merging point is calculated. The time difference is compared with a preset trajectory continuity time threshold. If the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation. If the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant. Finally, the alternating traffic violation detection result is output.

2. The alternating passage detection method for autonomous driving scenarios based on trajectory continuity according to claim 1, characterized in that, In S1, a vehicle motion trajectory sequence containing continuous spatiotemporal coordinates is generated for each detected vehicle through target detection and multi-target tracking algorithms. Specifically, the YOLO real-time target detection model is used to perform frame-by-frame vehicle target detection on the input real-time video stream, and a multi-target tracking algorithm is used to assign a unique ID to each vehicle, generating a vehicle motion trajectory sequence containing a set of spatiotemporal coordinate points corresponding to a single vehicle.

3. The alternating passage detection method for autonomous driving scenarios based on trajectory continuity according to claim 1, characterized in that, In S2, determining and dynamically updating the precise coordinates of the merging point through dynamic clustering analysis specifically involves: dynamically identifying the boundary range of the merging area, the precise location of the merging point, and the geometric boundary of the two merging lanes based on the spatial distribution characteristics of the vehicle trajectory sequence.

4. The alternating passage detection method in an autonomous driving scenario based on trajectory continuity according to claim 1, characterized in that, In S3, the extraction of the trajectory segment coordinate features before the vehicle enters the merging area specifically involves: extracting the complete driving trajectory segment of the vehicle before entering the merging area, and calculating representative features for lane matching based on the coordinate information of the trajectory segment.

5. The alternating passage detection method for autonomous driving scenarios based on trajectory continuity according to claim 1, characterized in that, In S4, the step of using the video frame index corresponding to the passing of the geometric midpoint of the vehicle trajectory through the merging point as the precise time of the vehicle passing through the merging point specifically involves: calculating the coordinates of the geometric center point of the vehicle's trajectory, determining the video frame index corresponding to the point where the geometric center point coincides with the coordinates of the merging point, and using this index as the precise time of the vehicle passing through the merging point.

6. The alternating passage detection method for autonomous driving scenarios based on trajectory continuity according to claim 1, characterized in that, In S5, calculating the time difference between the two vehicles passing through the merging point specifically involves calculating the difference between the video frame indices corresponding to the two vehicles passing through the merging point; the trajectory continuity time threshold is a dynamically determined minimum interval frame number threshold.

7. The alternating passage detection method for autonomous driving scenarios based on trajectory continuity according to claim 6, characterized in that, The minimum interval frame number threshold is determined through the following steps: S51 Historical Data Acquisition and Preprocessing: Historical traffic video data of the target merging area and similar urban road merging areas were collected. Traffic density was divided into three levels based on hourly traffic volume: low peak, off-peak, and high peak. The low peak level corresponds to an hourly traffic volume of less than 200 vehicles, the off-peak level corresponds to an hourly traffic volume of 200 to 600 vehicles, and the high peak level corresponds to an hourly traffic volume of more than 600 vehicles. The frame index time interval between adjacent vehicles passing through the merging point in the same merging lane under each density level was calculated. Abnormal interval data caused by stopping to yield, vehicle malfunctions, or pedestrian crossings were excluded to obtain the effective time interval sample set corresponding to each density level. S52 baseline threshold calculation: Calculate the 75th percentile of the effective time interval sample set for each traffic flow density level, and use it as the baseline threshold for the corresponding density level; S53 Real-time Adaptive Adjustment: Real-time detection of traffic density and average vehicle speed in the current merging area. The traffic density is calculated by the number of vehicles entering the merging area per unit time (1 minute), and the average vehicle speed is calculated by the trajectory displacement and time difference of vehicles within the first 5 seconds before entering the merging area. A corresponding baseline threshold is matched based on the current traffic density level. When the average vehicle speed is below 20 km / h, the matched baseline threshold is increased by 10%; when the average vehicle speed is above 40 km / h, the matched baseline threshold is decreased by 10%; during off-peak hours and when the average vehicle speed is between 20 km / h and 40 km / h, the baseline threshold remains unchanged, ultimately obtaining the minimum interval frame threshold that takes effect in real time.

8. An alternating passage detection device for autonomous driving scenarios based on trajectory continuity, characterized in that, include: The vehicle motion trajectory acquisition module is used to take the real-time video stream of the autonomous driving confluence area as input, and generate and store the vehicle motion trajectory sequence containing continuous spatiotemporal coordinates for each detected vehicle through target detection and multi-target tracking algorithms. The dynamic analysis module for the merging environment takes the vehicle trajectory sequence as input, and through dynamic cluster analysis, determines and dynamically updates the precise coordinates of the merging point, the effective coverage of the merging area, the division results of the merging lanes, and the cluster centers corresponding to each merging lane, and outputs them. The vehicle trajectory and merging lane association and allocation module is used to extract the coordinate features of the trajectory segment before the vehicle enters the merging area, with the cluster center corresponding to each merging lane as the matching benchmark and the vehicle motion trajectory sequence as input, calculate the distance between the vehicle and the cluster center of each merging lane, assign the vehicle to the merging lane corresponding to the nearest cluster center, and output the lane assignment result for each vehicle. The vehicle passage time sequence precise sorting module is used to sort all vehicles in time sequence and output the vehicle passage time sequence by taking the vehicle movement trajectory sequence and the precise coordinates of the merging point as inputs, and taking the video frame index corresponding to the geometric midpoint of the vehicle trajectory passing through the merging point as the precise time of the vehicle passing through the merging point as the precise time. The alternating traffic violation detection and result output module based on trajectory continuity is used to take the lane attribution result and the time sequence as input, traverse the adjacent vehicles in the time sequence, first determine whether the two adjacent vehicles come from the same merging lane; if the two adjacent vehicles come from different merging lanes, it is determined to be compliant; If two adjacent vehicles come from the same merging lane, the time difference between the two vehicles passing through the merging point is calculated. The time difference is compared with a preset trajectory continuity time threshold. If the time difference is greater than the trajectory continuity time threshold, it is determined to be an alternating traffic violation. If the time difference is less than or equal to the trajectory continuity time threshold, it is determined to be compliant. Finally, the alternating traffic violation detection result is output.