Dynamic regulation and control method, device and equipment for lane, medium and product
By processing and predicting multi-source traffic perception data, lane control instructions are determined, solving the real-time and accuracy problems of lane dynamic control in existing technologies and achieving efficient management of complex traffic scenarios.
Patent Information
- Application Number
- CN202511980043.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-03
AI Technical Summary
Existing lane dynamic control methods are unable to respond to traffic changes in real time, lack quantitative characterization of lane occupancy uncertainty, and cannot effectively handle multi-source heterogeneous sensing data and safety risk assessment, resulting in a lack of dynamic adjustment capability and accuracy in control strategies.
By acquiring multi-source traffic perception data, a target trajectory set is obtained, and combined with lane geometry data, a time-specific lane confidence envelope is determined. The current feature matrix is then obtained and input into a pre-trained traffic flow prediction model to generate predicted traffic flow. Finally, lane control instructions are determined based on the time-specific lane confidence envelope and road rule constraints.
It improves the accuracy and efficiency of lane dynamic control, enabling it to better cope with complex tidal flow scenarios and emergencies, and enhances the real-time performance and controllability of lane configuration.
Smart Images

Figure CN121789453A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a lane dynamic control method, device, equipment, medium and product. Background Technology
[0002] As urban traffic management gradually shifts from static to dynamic control, traffic managers have increasingly higher demands for real-time performance, accuracy, and controllability. Simply relying on fixed lane configurations can no longer meet the needs of complex tidal flow scenarios.
[0003] Traditional variable lane systems, while capable of direction switching, suffer from limitations in real-time response to traffic flow changes due to their fixed rules. They also lack a quantitative representation of lane occupancy uncertainty and struggle to handle multi-source heterogeneous sensing data, dynamic flow field identification, or safety risk assessment. Existing variable lane control methods mainly fall into the following categories:
[0004] 1. Rule-based fixed threshold control: By setting traffic flow thresholds, occupancy thresholds, or time-based rules to trigger lane direction switching, basic control can be quickly achieved without complex modeling. Its advantages include low implementation cost, simple logic, and suitability for highly predictable scenarios. However, its disadvantages include reliance on manual experience to set thresholds, making it difficult to guarantee adaptability and generalization across different road sections and time periods. Once the threshold is fixed, it lacks dynamic adjustment capabilities and cannot cope with sudden events or unconventional traffic patterns.
[0005] 2. Detector-based real-time response control: Combining coil detectors, geomagnetic sensors, or video detection data with control logic can provide the system with real-time traffic data, reducing the frequency of manual intervention. Its advantages include scalability to multiple road segments and support for online updates; disadvantages include difficulty in dynamically controlling the accuracy and latency of detection data, susceptibility of single sensors to environmental interference (such as severe weather or obstruction), lack of multi-source fusion mechanisms, and a tendency to misjudgment or control oscillations.
[0006] 3. Periodic scheduling based on historical statistics: This method pre-determines lane configuration schemes by analyzing historical traffic flow patterns and identifying tidal characteristics or peak-hour patterns, thus preserving key control strategies within a limited decision-making space. The advantages are a significant reduction in real-time computational burden and improved control stability; the disadvantages are that scheduling strategies are often based on historical averages or fixed time periods, making it impossible to distinguish between "must-switch" and "can-delay" situations based on specific real-time traffic characteristics, potentially leading to missed critical response opportunities.
[0007] 4. Forward-looking control based on short-term forecasts: Using ARIMA, Kalman filtering, or machine learning models to predict traffic flow 5-15 minutes in advance, lane configuration adjustments are triggered to maintain control consistency and foresight. The advantage is that the combination of long-term and short-term forecasts often improves response timeliness; the disadvantage is that forecast accuracy depends on the quality of historical data and the model's generalization ability, lacks quantitative representation of forecast uncertainty, and is prone to overreaction or underreaction. Summary of the Invention
[0008] This invention provides a lane dynamic control method, device, equipment, medium, and product to solve at least one of the above-mentioned problems.
[0009] According to one aspect of the present invention, a lane dynamic control method is provided, comprising:
[0010] Acquire multi-source traffic sensing data;
[0011] The multi-source traffic sensing data is processed to obtain the target trajectory set;
[0012] Based on the target trajectory set and lane geometry data, determine the time-phased lane confidence envelope;
[0013] Obtain the current feature matrix, wherein the current feature matrix includes at least one of: lag features, envelope features, event features, weather features, and time features;
[0014] Input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow;
[0015] Based on the time-based lane confidence envelope, predicted traffic flow, and road rule constraints, lane control instructions are determined and executed.
[0016] According to another aspect of the present invention, a lane dynamic control device is provided, the lane dynamic control device comprising:
[0017] The multi-source traffic sensing data acquisition module is used to acquire multi-source traffic sensing data;
[0018] The target trajectory set generation module is used to process multi-source traffic sensing data to obtain the target trajectory set;
[0019] A time-based lane confidence envelope determination module is used to determine the time-based lane confidence envelope based on the target trajectory set and lane geometry data;
[0020] The current feature matrix acquisition module is used to acquire the current feature matrix, wherein the current feature matrix includes at least one of the following: lag features, envelope features, event features, weather features, and time features;
[0021] The traffic flow prediction module is used to input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow.
[0022] The lane control instruction determination module is used to determine lane control instructions based on time-based lane confidence envelopes, predicted traffic flow, and road rule constraints, and then execute the lane control instructions.
[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0024] At least one processor; and
[0025] A memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the lane dynamic control method according to any embodiment of the present invention.
[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the lane dynamic control method according to any embodiment of the present invention.
[0028] According to another aspect of the present invention, a computer program product is provided, which, when executed by a processor, implements the lane dynamic control method as described in any of the embodiments of the present invention.
[0029] This invention improves the accuracy and efficiency of dynamic lane control by acquiring multi-source traffic perception data; processing the multi-source traffic perception data to obtain a target trajectory set; determining a time-specific lane confidence envelope based on the target trajectory set and lane geometry data; obtaining a current feature matrix, wherein the current feature matrix includes at least one of lag features, envelope features, event features, weather features, and time features; inputting the current feature matrix into a pre-trained traffic flow prediction model to obtain predicted traffic flow; and determining and executing lane control instructions based on the time-specific lane confidence envelope, predicted traffic flow, and road rule constraints.
[0030] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a flowchart of a lane dynamic control method according to an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of the structure of a lane dynamic control device according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0035] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0037] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0038] Example 1
[0039] Figure 1This is a flowchart illustrating a lane dynamic control method provided in an embodiment of the present invention. This embodiment is applicable to lane dynamic control situations. The method can be executed by the lane dynamic control device in this embodiment, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:
[0040] S110, acquire multi-source traffic perception data.
[0041] In this embodiment, the multi-source traffic perception data includes at least one of the following: camera video stream, roadside radar data, detection data, vehicle location information, signal phase and timing (SPaT) data, and historical trajectory database. The detection data can be traffic flow / speed detection data. The signal phase data includes the real-time status and timing information of traffic lights. S120, the multi-source traffic perception data is processed to obtain a target trajectory set.
[0042] Optionally, the multi-source traffic sensing data is processed to obtain a target trajectory set, including:
[0043] Based on multi-source traffic perception data, a time-series vehicle record set is determined.
[0044] In this embodiment, the time-series vehicle record set includes at least one of the following: vehicle identifier, timestamp, local plane coordinates, lane longitudinal offset s_lane, lane lateral offset y_lateral, heading angle heading_deg, driving speed speed_mps, data source type src_type, and source confidence weight src_conf. The timestamp is the timestamp corresponding to the GPS / OBU location record. Lane longitudinal offset s_lane refers to the longitudinal distance (in meters) of the vehicle relative to the starting point of the lane within the current road segment (link), used to determine the vehicle's front and rear position within the lane. Lane lateral offset y_lateral refers to the lateral distance (in meters) of the vehicle relative to the lane centerline, with positive / negative values distinguishing left and right offsets, and can be used to determine whether the vehicle has crossed the line, deviated from the lane, or engaged in other violations or dangerous behaviors.
[0045] In this embodiment, real-time processing of multi-source traffic perception data is achieved through projection, multi-resolution rasterization, and other processing methods, eliminating differences in dimensions, coordinates, and time, thus providing a foundation for subsequent rasterization and confidence modeling. The multi-source traffic perception data includes: camera video streams (Video_stream), roadside radar data (Radar_data, millimeter-wave radar point cloud), flow / speed detection data (Detector_data, coil or geomagnetic sensor data), vehicle GPS / OBU location information (GPS_data), signal phase data (SPaT_data), and historical trajectory database (Trajectory_db), etc. Its detailed implementation is as follows:
[0046] First, the multi-source sensing data is preprocessed. The specific processing steps, depending on the data type, are as follows:
[0047] 1. Video Stream Object Detection: The processing object is the video stream. A YOLOv8-like object detection algorithm is used to detect vehicles in the video frames, outputting vehicle bounding boxes and categories (car / truck / bus, etc.). Subsequently, a Deep SORT-like multi-object tracking algorithm is used to perform cross-frame association based on the vehicle bounding boxes and categories, generating vehicle trajectory IDs and outputting pixel coordinates (u,v), confidence score conf_video∈[0,1], and timestamp t_video (in milliseconds). The video stream detection result is denoted as Video_detections={(veh_id_video, t_video video frame acquisition timestamp, u,v,conf_video confidence score,veh_class)}. veh_id_video is the video vehicle identifier, a unique number assigned by the video detection algorithm to each vehicle identified in the frame. It is used to continuously track the position and state of the same vehicle in the video frame sequence, realizing the continuous association of vehicle trajectories. (u,v) is the horizontal / vertical pixel position of the vehicle target in the video image coordinate system. veh_class is the vehicle type, which is the category classification of the detected vehicles by the video algorithm. Common classifications include small cars (sedans, SUVs), medium-sized cars (vans), and large cars (trucks, buses), etc.
[0048] 2. Radar Filtering Target Detection: The processing object is roadside radar data (Radar_data). First, the Region of Interest (ROI) of the millimeter-wave radar point cloud is cropped (e.g., only points within a distance ≤150m and an azimuth ±60° are retained). Then, a filter similar to α-β-γ (where α represents the position smoothing coefficient, β represents the velocity smoothing coefficient, and γ represents the acceleration smoothing coefficient) is used to remove point cloud jitter and estimate the vehicle's instantaneous velocity v_radar and vehicle acceleration a_radar. Further, a clustering algorithm similar to DBSCAN is used to cluster the point cloud into target clusters, and the centroid coordinates (x_radar, y_radar)r and the average RCS (radar cross section) of each cluster are calculated as auxiliary parameters for confidence. The radar filtering result is denoted as Radar_targets={(target_id_radar, t_radar, x_radar, y_radar, vehicle instantaneous velocity v_radar, vehicle acceleration a_radar, radar cross section RCS)}. `target_id_radar` is the radar target identifier, a unique number assigned by the radar to each detected target (such as a vehicle, pedestrian, or obstacle). It is used to track the motion state of the same target in consecutive frames of data, avoiding target confusion. `t_radar` is the time point at which the radar target state was observed or estimated. `(x_radar, y_radar)` are the centroid coordinates.
[0049] 3. Detector Sensor Data Processing: The processing object is the Detector_data traffic / speed detection data. Outliers are removed from the traffic count, occupancy, and average speed (avg_speed) uploaded by coil detectors or geomagnetic sensors (using the 3σ criterion, i.e., data points |value-μ|>3σ are marked as outliers and discarded). Timestamps are synchronized using Network Time Protocol (NTP) (accuracy ≤50ms) to ensure consistency with other data sources' time bases. Missing data is completed using linear interpolation (missing duration ≤5min), generating standardized detector records. The detector cleaning result is denoted as Detector_records={(detector_id, t_detector, data upload traffic count, occupancy, average upload speed avg_speed)}. detector_id is the unique identifier for the detector, used to distinguish different coil detectors, geomagnetic sensors, or other fixed traffic detection equipment. t_detector is the timestamp corresponding to the detector data record. Occupancy is the proportion of time a detector is actually occupied by a vehicle (e.g., the total time a vehicle continuously presses against the coil) within a certain statistical time window, relative to the total duration of that time window.
[0050] 4. GPS / OBU Location Data Processing: The processed object is GPS_data. First, the timestamp format is unified to ISO8601 (including milliseconds) through NTP time synchronization (accuracy ≤50ms). Then, 3σ anomaly removal is performed on the original GPS coordinates (lat, lon) (e.g., based on the spatial continuity of historical trajectory points, if the distance between adjacent points is >500m or the speed is >150km / h, it is judged as an anomaly). Subsequently, a map matching algorithm similar to Hidden Markov Model (HMM) is used to match GPS points to the road network, generating the matched road segment ID and linear reference coordinates (link_id, offset) along the road segment. The GPS cleaning result is denoted as GPS_clean={(veh_id_gps, t_gps, lat latitude, lon longitude, link_id road segment identifier / link number, offset, which usually refers to the longitudinal distance offset of the vehicle on the current road segment (link) (such as the distance from the start of the road segment), or the lateral offset relative to the road centerline, vehicle speed_gpsGPS, heading angle heading_gpsGPS)}. `veh_id_gps` is the GPS vehicle identifier / vehicle GPS number, a unique identifier assigned to each vehicle equipped with a GPS positioning device. It is used to distinguish the positioning and trajectory information of different vehicles within the data system, ensuring that trajectory data can be accurately linked to specific vehicles. `t_gps` is the timestamp corresponding to the GPS / OBU location record.
[0051] Then, coordinate unification is performed: the processing objects are three types of preprocessing results: Video_detections, Radar_targets, and GPS_clean. The Gauss-Kruger projection is used to convert the WGS84 geographic coordinates (lat,lon) into the local plane coordinate system (x,y).
[0052] 1. For video pixel coordinates (u,v)_pixel, the pixel coordinates are inversely projected to ground plane coordinates (x_video,y_video) using the camera calibration parameter matrix K and the extrinsic parameter matrix [R|t].
[0053] 2. For radar target coordinates (x_radar, y_radar), transform them to a unified coordinate system using the radar installation position offset matrix T_radar (which includes translation and rotation);
[0054] 3. For GPS matching coordinates (link_id, offset), query the corresponding UTM coordinates (x_gps, y_gps) through the road centerline Shapefile.
[0055] Furthermore, all coordinates are mapped to the lane centerline reference system (lane_map, this reference system is constructed using existing technology and will not be elaborated upon), that is, the main lane centerline is used as the ordinate s (arc length parameter) and the perpendicular to the centerline is used as the abscissa y_lateral. The mapping is completed through nearest neighbor search, and a standardized time-series vehicle record set V_rec={(veh_id vehicle unique identifier, t_ms timestamp, x_utm, y_utm, lane longitudinal offset s_lane, lane lateral offset y_lateral, heading angle (degree system) heading_deg, driving speed (m / s) speed_mps, data source type src_type, data source confidence src_conf)} is output, where veh_id is the vehicle identifier, t_ms is the millisecond-level timestamp, src_type∈{video,radar,gps,detector} indicates the data source type, and src_conf∈[0,1] is the source confidence weight. (x_utm, y_utm) are the local plane coordinates. `heading_deg` represents the angle between the vehicle's direction of travel and true north (in degrees, increasing clockwise), fusing GPS heading and radar / video motion direction data, resulting in higher accuracy than single-sensor data. `speed_mps` represents the fused vehicle's actual speed (in meters per second, convertible to km / h), integrating GPS speed, radar speed measurement, and video frame-by-frame speed measurement results, offering greater stability and accuracy. `src_type` identifies the primary contributing sensor for this fused data.
[0056] Finally, the multi-source association and ID fusion sub-steps are performed: the processing objects are records in V_rec carrying different src_types, and the observations of the same vehicle in different sensor data are associated with a unified ID by a spatiotemporal matching algorithm (such as the Hungarian algorithm). The specific rules are as follows: within the time window Δt_match=500ms and the spatial window Δd_match=5m, the Mahalanobis distance D_mahalanobis=sqrt((Δx,Δy)^T×Σ^(-1)×(Δx,Δy)) of any two observation records is calculated, where Σ is the covariance matrix (the diagonal elements are the sensor error variance). If D_mahalanobis<threshold (the threshold is set to χ²(2,0.05)=5.99 according to the 95% confidence interval of the chi-square distribution), then it is determined to be the same vehicle; for one-to-many or many-to-many matching conflicts, a greedy strategy is adopted to prioritize the matching pair with the largest confidence product; after successful association, a globally unique veh_id is generated, and unassociated observations retain their original IDs and are marked as "single source". The merged V_rec is updated to a unified set containing global IDs.
[0057] In this embodiment, the standardized time-series vehicle record set V_rec={(veh_id, timestamp t_ms, local plane coordinates (x_utm, y_utm), lane longitudinal offset s_lane, lane lateral offset y_lateral, heading angle heading_deg, driving speed speed_mps, data source type src_type, source confidence weight src_conf)} can be directly used for trajectory completion and confidence weighting.
[0058] The trajectory interruption points in the time-series vehicle record set are processed to obtain the target trajectory set.
[0059] In this embodiment, trajectory breakpoints in the time-series vehicle record set V_rec are completed and assigned dynamic weights to form a unified, smooth trajectory set with uncertainty representation, providing high-quality input for subsequent rasterization.
[0060] In this embodiment, the target trajectory set V_weighted={(veh_id, t_ms, x_utm, y_utm, s_lane, y_lateral, heading_deg, speed_mps, w_traj, is_estimated)}, where w_traj∈[0,1] is the trajectory-level confidence, and is_estimated marks whether the point is an interpolation completion and can be directly input into the spatial rasterization process.
[0061] Optionally, the trajectory interruption points in the time-series vehicle record set are processed to obtain the target trajectory set, including:
[0062] Obtain the discrete point sequence of the same vehicle identifier in the time-series vehicle record set.
[0063] In this embodiment, firstly, confidence modeling is performed: the processing object is the src_conf field in V_rec, and the confidence of V_rec is adjusted by weighting factors such as field occlusion rate, time delay, recognition confidence, and sensor quality. The specific calculations are as follows: For video detection, w_video = conf_video × (1 - occlusion_rate), where occlusion_rate is calculated based on the overlap between the target bounding box and the edge of the field of view; for radar, w_radar = sigmoid((RCS - RCS_min) / (RCS_max - RCS_min)) × (1 - t_delay / 120ms), where the RCS threshold is set according to the vehicle type (car RCS_min = 5dBsm, RCS_max = 15dBsm); for GPS, w_gps = 1 / (1 + HDOP / 2) × (n_satellites / 12), where HDOP is the horizontal precision factor and n_satellites is the number of satellites; for detectors, w_detector = 0.8 × (1 - t_delay / 2000ms). The weights of all observations are normalized to the [0,1] interval to generate src_conf_normalized. The confidence modeling result is that the src_conf field in V_rec is updated to src_conf_normalized.
[0064] In this embodiment, the discrete point sequence is a discrete point sequence V_traj_raw={(t_1,x_1,y_1),(t_2,x_2,y_2),...} where the processing object is the same veh_id.
[0065] Based on the time interval between adjacent points, determine the trajectory interruption point in the discrete point sequence.
[0066] The trajectory is split based on the interruption point to obtain multiple trajectory segments.
[0067] A set of candidate trajectory segments is generated based on the predicted location corresponding to each trajectory segment.
[0068] In this embodiment, the processing object is a discrete point sequence V_traj_raw with the same veh_id. After sorting by time, trajectory interruption points are identified (defined as the time interval Δt between adjacent points > 2s or the spatial distance Δd > 20m). The complete trajectory is then divided into multiple trajectory segments segment_k = {points_k}. For each trajectory segment, the position at the next moment is predicted using a uniform motion method: (x_pred, y_pred) = (x_last + v_x × Δt, y_last + v_y × Δt), where v_x and v_y are the average velocities. The predicted position is matched with the actual observation using a Hungarian matching algorithm (the gate distance can be set to d_gate = 3.5m). If the match is successful, the trajectory segment is considered to be related; otherwise, the trajectory is considered to be interrupted. A candidate trajectory segment set Segments_candidate = {segment_1, segment_2, ...} is generated, where each segment contains metadata such as start and end times, number of points, and average velocity.
[0069] Obtain target trajectory segment pairs from the candidate trajectory segment set whose interruption duration is less than a duration threshold, wherein the target trajectory segment pairs include: a first trajectory segment and a second trajectory segment.
[0070] The average curvature of the target trajectory segment pair is determined based on the trajectory points in the first trajectory segment of the target trajectory segment pair.
[0071] Based on the average curvature of the target trajectory segment pair, determine the motion model corresponding to the target trajectory segment pair.
[0072] In this embodiment, the processing object is the trajectory segment pair (segment_i, segment_j) with interruption duration Δt_gap ≤ first time. The motion model is dynamically selected according to the road type and trajectory characteristics. The first time can be 30s.
[0073] The target trajectory segment pairs are processed based on the motion model corresponding to the target trajectory segment pairs to obtain the initial trajectory set.
[0074] In this embodiment, based on the selected motion model, the interrupted trajectory pairs are subjected to Extended Kalman Filter (EKF) (for the CTRV nonlinear model) or Standard Kalman Filter (KF) (for the CV / CA linear model). Forward filtering: Initialize the state X_0 from the end point of segment_i (position is taken from the coordinates of the end point, velocity is taken from the average velocity of the end segment, acceleration / rotation is initialized to 0), predict to the starting point of segment_j, and update the state estimate X^_k and covariance P_k at each step; Backward smoothing: Smooth from the starting point of segment_j to the end point of segment_i, and fuse the forward and backward estimates: X^_k_smoothed=w_fwd·X^_k_forward+w_bwd·X^_k_backward (weight w=1 / trace(P), the smaller the covariance, the larger the weight); the interpolation interval Δt_interp can be set to 100ms to generate the completed trajectory point sequence, which is the initial trajectory set.
[0075] The target trajectory set is determined based on the initial trajectory set and the fusion confidence of each trajectory point in the initial trajectory set.
[0076] In this embodiment, the processing object is the trajectory point of multiple repeated observations within the same spatiotemporal window (e.g., time window Δt_fusion=200ms, spatial window Δd_fusion=2.0m) (such as the same vehicle being detected by both video and radar). A unique trajectory point is generated by variance-weighted averaging and the comprehensive confidence w_traj is updated. Specifically, the calculation is as follows: Assuming that there are N observations of the same vehicle around time t {(x_i, y_i, src_conf_i, σ_i²)}_{i=1..N}, where σ_i² is the observation variance (estimated based on sensor accuracy and confidence), the fusion position is (x_fused, y_fused)=Σi(x_i, y_i)×(1 / σ_i²) / Σi(1 / σ_i²), and the fusion confidence is w_traj=1 / sqrt(1 / Σ_i(1 / σ_i²)) (normalized to [0,1]). For trajectory points observed from a single source (without duplication), w_traj directly inherits from src_conf_normalized. The fused trajectory points also inherit the heading_deg and speed_mps fields (using a weighted average).
[0077] Optionally, based on the average curvature of the target trajectory segment pair, determine the corresponding motion model, including:
[0078] If the average curvature of the target trajectory segment is less than the first value, then the constant velocity model is used as the motion model for the target trajectory segment.
[0079] If the average curvature of the target trajectory segment is greater than or equal to the first value and less than the second value, and / or the road type is an intersection type, then the constant acceleration model will be used as the motion model for the target trajectory segment.
[0080] If the average curvature of the target trajectory segment is greater than or equal to the second value, then the constant speed and constant rotation rate model will be used as the motion model for the target trajectory segment.
[0081] In this embodiment, the first value is less than the second value. For example, the first value can be 0.01 and the second value can be 0.05.
[0082] In this embodiment, the road type (road_type) and geometric features (curvature κ_road, number of lanes, speed limit) of the trajectory segment are obtained by querying Road_geometry (geometric data of roads or lanes in intelligent transportation systems, commonly used to store spatial information such as road centerlines, lane boundaries, and traffic facilities; this is existing technology and will not be elaborated upon). The curvature features of the trajectory segment are calculated: the average curvature K_traj = mean(|dθ / ds|) is estimated from the three points at the end of segment_i. If K_traj < 0.01m^(-1) (corresponding to a curvature radius > 100m, approximately a straight line), the CV model (Constant Velocity) is selected; if 0.01 ≤ K_traj < 0.05m^(-1) (gentle curve), the CA model (Constant Acceleration) is selected; if K_traj ≥ 0.05m^(-1) (sharp curve, roundabout, ramp), the CTRV model (Constant Turn Rate and...) is selected. Velocity (constant speed and constant rev rate model); Special handling for intersections: If road_type=intersection, the CA model is forcibly selected (vehicles in the intersection frequently accelerate and decelerate, and the rev rate changes irregularly, so the CTRV assumption does not hold).
[0083] S130, determine the time-segmented lane confidence envelope based on the target trajectory set and lane geometry data.
[0084] In this embodiment, lane geometry data includes attribute information such as lane centerline coordinate sequence, lane width, and number of lanes. The time-varying lane confidence envelope P(q,t)={feature_1,feature_2,...} (each feature corresponds to a polygon with confidence level q), in GeoJSONFeature format, can be directly used for short-term prediction and lane scheduling.
[0085] In this embodiment, the method for determining the time-specific lane confidence envelope based on the target trajectory set and lane geometry data can be as follows: Process the target trajectory set and lane geometry data to obtain a spatiotemporal network counting matrix; determine a binary mask matrix based on the spatiotemporal network counting matrix; determine the pruned trunk channel skeleton curve and the branch type of each branch based on the binary mask matrix; determine a station-level lateral offset sample set based on the target trajectory set, the pruned trunk channel skeleton curve, and the branch type of each branch; calculate the weighted quantiles of the station-level lateral offset sample set to obtain a width curve; perform sampling point smoothing fitting on the pruned trunk channel skeleton curve to generate a principal axis geometry curve; and determine the time-specific lane confidence envelope based on the principal axis geometry curve and the width curve.
[0086] Optionally, based on the target trajectory set and lane geometry data, a time-phased lane confidence envelope is determined, including:
[0087] The target trajectory set and lane geometry data are processed to obtain a space-time network counting matrix.
[0088] In this embodiment, the spatiotemporal grid counting matrix G(t_window) = {Grid_cell(i,j): {count, avg_speed, occupancy}} can be directly used for density field smoothing and mask generation. Grid_cell(i,j) is the grid cell (i,j), and count(i,j) = the weighted number of vehicle occurrences within the grid cell (i,j), i.e., the number of reliable vehicles. Occupancy(i,j) is the occupancy rate of the grid cell (i,j), occupancy(i,j) = count(i,j) × avg_vehicle_length / (Δs × n_lanes) (occupancy rate, assuming avg_vehicle_length = 5m as the average vehicle length and n_lanes as the number of lanes covered by the grid). avg_speed(i,j) is the average speed of the grid cell (i,j).
[0089] In this embodiment, the method for processing the target trajectory set and lane geometry data to obtain the spatiotemporal grid counting matrix can be as follows: Generate a grid index matrix based on the lane geometry data; obtain the period of the relevant traffic lights for the road segment; take the starting point of the period of the relevant traffic light for the road segment closest to the trajectory point as the window start time; determine the window end time based on the window start time and the target window width; determine a first time period based on the window start time and the window end time; generate time-segmented data blocks based on the trajectory points in the target trajectory set that are within the first time period; and generate the spatiotemporal grid counting matrix based on the grid index matrix and the time-segmented data blocks.
[0090] Determine the binary mask matrix based on the space-time network counting matrix.
[0091] In this embodiment, the method for determining the binary mask matrix based on the spatiotemporal grid counting matrix can be as follows: A first matrix is generated based on the first field of the spatiotemporal grid counting matrix; the first matrix is smoothed to obtain a second matrix; the neighborhood average density of each grid cell in the second matrix is obtained; a threshold for each grid cell is determined based on the neighborhood average density of each grid cell in the second matrix; if the first field of the grid cell in the second matrix is greater than or equal to the threshold of the grid cell, the grid cell is masked with a first value; if the first field of the grid cell in the second matrix is less than the threshold of the grid cell, the grid cell is masked with a second value; and the binary mask matrix is determined based on the mask of the grid cells in the second matrix.
[0092] Based on the binary mask matrix, the pruned trunk channel skeleton curve and the branch type of each branch are determined.
[0093] In this embodiment, the branch types include: road segment branches and intersection branches.
[0094] In this embodiment, the method for determining the pruned main channel skeleton curve and the branch type of each branch based on the binary mask matrix can be as follows: the binary mask matrix is converted into a skeleton curve based on a fast skeletonization algorithm; the branch points and endpoints of the skeleton curve are identified by depth-first search; DFS is performed from each endpoint to the nearest branch point or another endpoint to form a branch; the geometric properties of each branch are determined; based on the geometric properties of each branch, the skeleton curve is pruned to obtain the pruned main channel skeleton curve; branch points with a distance less than a second distance are aggregated to obtain the intersection area; and the branch type of each branch is determined based on the intersection area.
[0095] Based on the target trajectory set, the pruned backbone curve, and the branch type of each branch, determine the station-level lateral offset sample set.
[0096] In this embodiment, the global trajectory set is projected onto the principal axis local coordinate system and aggregated into station-level samples according to the longitudinal position, providing structured input for subsequent quantile analysis.
[0097] In this embodiment, the method for determining the station-level lateral offset sample set based on the target trajectory set, the pruned backbone curve, and the branch type of each branch can be as follows: establish a Frenet reference system based on the pruned backbone curve; project the trajectory points in the target trajectory set based on the Frenet reference system and the branch type of each branch to obtain a projected trajectory point set; and aggregate the projected trajectory point set to obtain the station-level lateral offset sample set.
[0098] The width curve is obtained by calculating the weighted quantiles of the site-level lateral offset sample set.
[0099] In this embodiment, the weighted quantiles of the station-level lateral offset sample set Y(s_n,t_window) are calculated to obtain the lane occupancy width at different confidence levels, providing a statistical basis for variable lane decision-making.
[0100] In this embodiment, firstly, the continuous probability characterization of vehicle lateral distribution is performed. From scattered observation points (observation points are the projections of trajectory points in the lateral y-direction, used to statistically analyze lane occupancy distribution), the overall pattern of "continuous occupancy" of traffic flow in the lateral space is reconstructed. The traditional method is to divide the lateral space into several intervals (e.g., one grid every 0.5 meters) using statistical histograms and count the number of vehicles in each interval. This method is subjective, the results are unstable, and it cannot smoothly reflect the continuous characteristics of traffic flow, making it difficult to accurately extract boundary positions later. This invention uses a kernel density estimation method to output a smooth and continuous curve, which can capture the "multiple peaks" (each peak corresponds to one lane) when multiple lanes are parallel, and suppress the "spurs" caused by random observation errors. The detailed technical implementation is to select the Epanechnikov kernel function: K(u)=(3 / 4)×(1-u²) when |u|≤1, otherwise K(u)=0. Meanwhile, the kernel function bandwidth h is dynamically selected using an adaptive rule: h = 1.06 × σy × Nn − 1 / 5, where σ_y is the standard deviation of the station samples (reflecting the lateral dispersion of traffic flow), and N_n is the sample size. This provides a larger smoothing radius when the traffic flow is more dispersed (larger σ_y), and a finer resolution when there are more samples (larger N_n). An observation grid is established in the lateral range y ∈ [-20m, +20m] (covering a typical urban road with 4 lanes + emergency lane), with an interval Δy = 0.1 meters (approximately 1 / 20 of the vehicle width). At each grid point y_grid_j, the weighted density value f(y_grid_j) is calculated using the kernel function, and the output is a discrete density distribution {(y_grid_j, f_j)}, j = 1..M_grid. The density curve f(y) can be regarded as a "heatmap of traffic flow occupancy in lateral space".
[0101] Then, the actual traffic flow demand boundaries are defined to determine how much space the lanes need to leave when a certain number of vehicles can pass safely. Real traffic scenarios are often asymmetrical: large trucks tend to drive to the right due to the blind spot on the right, passenger cars tend to overtake from the left lane, the outer side of curves occupies more space due to centrifugal force, and vehicles are forced to compress to the opposite side after construction occupies the lane. This embodiment adopts an asymmetric quantile strategy to allow independent adjustment of the left and right boundaries, ensuring coverage of a specified proportion of traffic flow (e.g., 80%) while minimizing unnecessary space waste. The processing object is the continuous density function f(y) and its discrete representation {(y_grid_j,f_j)} generated in the previous step. The density function integral is transformed into a cumulative probability distribution, and then the left and right boundary positions corresponding to different confidence levels are marked on the cumulative curve (the cumulative curve refers to the cumulative distribution function constructed based on the horizontal density function f(y) of the trajectory points, i.e., the cumulative vehicle proportion curve corresponding to the horizontal position y). The detailed implementation is as follows: First, the cumulative distribution function ( The expression represents the proportion of vehicles with a lateral position ≤ y in the total traffic flow. Three confidence levels q ∈ {0.60, 0.80, 0.95} are defined, corresponding to different management objectives:
[0102] q=0.60 (Daily Traffic Envelope): Covers mainstream vehicles (60%), suitable for lane configuration during normal traffic flow periods. This boundary has the highest space utilization, but allows temporary crossings in a few special cases (such as oversized vehicles or emergency avoidance), requiring dynamic monitoring.
[0103] q=0.80 (standard design envelope): Covers the vast majority of vehicles (80%), corresponding to the lane width required by road design specifications. This boundary balances traffic efficiency and safety margin, and is suitable for medium- to long-term lane configuration schemes;
[0104] q=0.95 (safety redundancy envelope): Covers almost all vehicles (95%), used for emergency lane planning, extreme weather contingency plans, and accident risk assessment. This boundary provides ample safety space, but may sacrifice some space utilization.
[0105] For each confidence level q, solve for the asymmetric width pair (w_L, w_R) (input: cumulative distribution function F(y): the cumulative vehicle percentage corresponding to the lateral position y (obtained by integrating the kernel density function f(y), lane centerline: defined as y=0). The solution algorithm can use a combination of binary search and Newton iteration for joint optimization. The output results are: the width pairs w_L(q,n,t) and w_R(q,n,t) (unit: meters) for each station n, each confidence level q, and each time window t. w_L represents "the minimum width required to be reserved to the left from the lane centerline", and w_R represents "the minimum width required to be reserved to the right". The sum of the two, w_L + w_R, is the actual required width of the lane at that station and confidence level. A station is a fixed sampling point or cross-sectional position on the road along the main axis direction. It is used to statistically analyze the lateral distribution of vehicles and calculate the asymmetric lane width; multiple stations are connected to form the lane width curve for the entire road.
[0106] Finally, width curve smoothing is performed to ensure smooth transitions between lane lines across different road sections, rather than abrupt changes. This embodiment employs Savitzky-Golay filtering (SG filtering) for spatial smoothing. The processing targets are width sequences {w_L(q,n,t)} and {w_R(q,n,t)} arranged along the main axis, each sequence containing width values from N_sample+1 stations. The processing procedure is as follows: a fixed-length neighborhood window (e.g., two stations before and after each station) is selected around each station. A low-order polynomial (cubic curve) is used to fit the width points within the window, and the value of the fitted curve at that station is used as the smoothed width. The window is slid along the main axis point by point to generate a smooth width curve throughout. The relevant calculations are existing methods and will not be elaborated upon. The width sequence is a series of width queues representing the asymmetrical left and right reserved widths for each sampling station along the main axis of the road.
[0107] It's important to note that standard SG filtering typically requires two stations before and after the filter, but a complete window cannot be formed near the start and end points of a road segment. Solution:
[0108] Constant Padding: Sets the width of the virtual station outside the boundary to the value of the nearest actual station (e.g., w(-1) = w(0)). Applicable scenarios: Traffic flow at the start and end points of a road segment has reached a steady state, and the width is basically constant (e.g., the middle section of a highway mainline).
[0109] Linear extrapolation: Extrapolates virtual point values based on the changing trends of two points inside the boundary (e.g., w(-1)=w(0)-[w(1)-w(0)]). Applicable scenarios: There is a clear trend of width change near the road segment boundary (e.g., widening of entrance ramps and narrowing of exit ramps), and the trend needs to be naturally continued to avoid truncation and abrupt changes.
[0110] In this embodiment, the road type can be adaptively selected: constant extrapolation is used for the main road segment (link), and linear extrapolation is used for the ramp / auxiliary road (ramp / auxiliary).
[0111] The output is a smoothed width curve:
[0112] W_q(n,t)={w_L_smooth(q,n,t),w_R_smooth(q,n,t)};
[0113] The smoothed width curve includes the left and right width values (in meters) of all stations n∈[0,N_sample], all confidence levels q∈{0.60,0.80,0.95}, and the current time window t. It describes the continuously changing lane demand space along the longitudinal direction of the road. At station s_n on a certain road segment, w_L_smooth meters need to be reserved to the left of the centerline and w_R_smooth meters to the right to accommodate the traffic flow at confidence level q. The longitudinal gradient of the curve reflects the rate of change of lane width (a large gradient indicates a sharp widening or narrowing, which requires close attention), and the left and right differences of the curve reflect the lateral offset tendency of the traffic flow (a large difference indicates significant asymmetry, and asymmetrical lane design can be considered).
[0114] The main trunk channel skeleton curve after pruning is sampled and smoothed to generate the main axis geometric curve.
[0115] In this embodiment, the principal axis geometry curve A(t) is the centerline geometry of the entire lane or road segment, used to generate the left and right boundaries along the road and construct the lane polygon. The principal axis geometry curve is generated by smoothing and fitting the pruned main channel skeleton curve using sampling points. This is done by skeletonizing and pruning the binary mask 𝑀 to obtain the pruned main channel skeleton curve Skeleton_pruned(i,j), representing the centerline of the main traffic flow channel. A continuous curve is generated through smoothing and fitting using sampling points, and the output is A(t).
[0116] The time-specific lane confidence envelope is determined based on the principal axis geometry curve and the width curve.
[0117] In this embodiment, the width curve is geometrically coupled with the main axis to construct a closed polygon and attach direction and confidence metadata to provide standard vector input for the GIS platform and controller.
[0118] In this embodiment, firstly, boundary point constructors are constructed: the principal axis geometric curve is sampled, and for each sampled point (s_n, x_n, y_n) and its corresponding width pair (w_L_smooth, w_R_smooth), the left and right boundary point coordinates of the sampled point are calculated along the normal vector direction n_n. The left boundary point coordinates (x_L, y_L)_n = (x_n, y_n) - w_L_smooth × n_n (offset by w_L_smooth distance along the reverse direction of the normal vector); the right boundary point coordinates (x_R, y_R)_n = (x_n, y_n) + w_R_smooth × n_n (offset by w_R_smooth distance along the positive direction of the normal vector). Traverse all sampling points n=0..N_sample on the main axis of the road to generate the left boundary point sequence Left_boundary={(x_L,y_L)_0,(x_L,y_L)_1,...,(x_L,y_L)_N}; and the right boundary point sequence Right_boundary={(x_R,y_R)_0,...,(x_R,y_R)_N}.
[0119] Then, polygon closure is performed: the object is the sequence of left and right boundary points, and a closed polygon is constructed according to the GeoJSONPolygon specification. The order of the polygon vertices is: traverse the right boundary point Right_boundary along the main axis in the forward direction (from the start point to the end point), then traverse the left boundary point Left_boundary in the reverse direction along the main axis (from the end point to the start point), and finally return to the start point of the right boundary to form a closed loop. Vertices sequence Vertices=[Right_boundary forward, Left_boundary reverse, Right_boundary[0]] (closed at the beginning and end), the total number of vertices is 2×(N_sample+1)+1. Generate a GeoJSON format Polygon object: polygon_geojson={"type":"Polygon","coordinates":[[Vertices]]} (outer ring coordinate array, inner ring is empty to indicate no holes).
[0120] Next, a coordinate inverse projection is performed: the vertex coordinates (currently in UTM coordinate system) of the polygon_geojson object are processed, and all vertices are transformed from local planar coordinates (x_utm, y_utm) back to WGS84 geographic coordinates (lon, lat) through the Gauss-Kruger inverse transformation. The planar coordinates of the lane polygon are converted to a globally universal geographic coordinate system (latitude and longitude) for accurate positioning and visualization in GIS platforms or map applications.
[0121] The specific calculation is as follows: For each vertex (x_i, y_i)_UTM, call the projection library (such as pyproj) to perform back projection transformer.transform(x_i, y_i, direction='INVERSE'), and output (lon_i, lat_i)_WGS84; the GeoJSON coordinate order follows the RFC7946 specification as [longitude, latitude], i.e. [lon, lat]; update the polygon vertex sequence Vertices_WGS84=[(lon_0, lat_0), (lon_1, lat_1),...,(lon_N, lat_N)]; at the same time, perform the same back projection processing on the sampling points {(x_n, y_n)} of the principal axis centerline to generate Centerline_WGS84 for GIS visualization.
[0122] Finally, metadata injection is performed: the processed object is polygon properties (metadata manually added when generating GeoJSONFeature, used to describe the direction, confidence level, data source, and geometric information of the lane polygon), and the following metadata fields are written to form a complete GeoJSON Feature object, including: direction preference (which can come from the branch type of each branch) ∈ {forward, backward, bidirectional} (determined according to the main axis direction label and traffic rules; if the main axis corresponds to the uphill lane, then direction="forward"; if it corresponds to the downhill lane, then direction="backward"; if it includes a tidal lane, then direction="bidirectional"); coordinate reference system label (manually assigned or specified by default) crs="EPSG:4326" (explicitly declares the use of the WGS84 coordinate system, conforming to the GeoJSON default specification); projection information (from the original plane coordinate system used when generating the road main axis or skeleton) source_crs="EPSG:32649" (records the original UTM projection zone for easy traceability and accuracy evaluation). Confidence level (calculated based on asymmetric quantiles) confidence_level=q (e.g., 0.6 represents a 60% confidence level, meaning 60% of vehicles fall within this polygon); Data source summary (from the fusion results of multi-source traffic perception data) data_source_summary={sensor_types:[video,radar,gps],total_samples:N_total,avg_confidence:w_avg} (records the sensor types used to construct this polygon, the total number of samples, and the average confidence level); Generation timestamp (polygon generation time) timestamp `amp=ISO8601 format` (e.g., "2025-10-21T14:30:00.000Z"); `ty_period=[t_start,t_end]` (corresponding time window range); `geometry_quality={area:Area(q,t),perimeter:Perimeter,smoothness:K_max}` (area is the area, perimeter is the perimeter, and smoothness is the maximum curvature K_max, used to reflect the degree of geometric smoothness). Assemble into a complete `GeoJSONFeature`:
[0123] The feature is defined as follows: `feature={"type":"Feature","geometry":polygon_geojson,"properties":{direction,confidence_level,data_source_summary,timestamp,validity_period,geometry_quality}}`. The fixed value "Feature" indicates that this is a GeoJSON feature object. The geometry part stores polygon coordinate data in a `polygon_geojson` data structure, used to describe the boundaries of road lanes or flow fields.
[0124] In this embodiment, the time-based lane confidence envelope P(q,t)={feature_1,feature_2,...} (each feature corresponds to a polygon with confidence level q), in GeoJSONFeature format, can be directly used for short-term prediction and lane scheduling.
[0125] Optionally, based on the target trajectory set, the pruned backbone curve, and the branch type of each branch, a station-level lateral offset sample set is determined, including:
[0126] A Frenet reference system is established based on the pruned trunk channel skeleton curve.
[0127] In this embodiment, the trajectory projection data is first preprocessed, mainly including principal axis parameterization and tubular region definition. The processing object is Skeleton_pruned(i,j), extracting the discrete point sequence of the centerline along the skeleton and establishing a Frenet reference frame. The detailed processing is as follows: pixel chain tracing is performed on the skeleton Skeleton_pruned, extracting the skeleton pixel sequence {(i_k,j_k)}{k=1..L} (L is the total number of skeleton pixels) according to 8-connectivity; the pixel coordinates are converted into the actual physical coordinate sequence {(x_k,y_k)}{k=1..L} (through grid coordinate mapping); the arc length is accumulated along the skeleton. Generate parameterized sampling points Axis_samples={(s_n,x_n,y_n)}, {n=0..N}, with a sampling interval Δs_sample=5m (N=⌈s_L / Δs_sample⌉ is the total number of sampling points); calculate the local coordinate system and tangent vector at each sampling point. (Central difference, normalization), normal vector (Rotate 90° counterclockwise); Define tubular region parameters: tube length L_n = Δs_sample (coverage sampling interval), tube width W_n is dynamically determined according to region type: for road segment region (road_type=link), W_n = 0.5 × total_lane_width (query the total lane width from Road_geometry, typical value 10-15m); for intersection region (road_type=intersection), W_n = 1.5 × total_lane_width (large lateral vehicle movement within the intersection, increasing tube width); Construct spatial index: Store Axis_samples in KD-Tree (kd-tree) data structure KDTree_axis, supporting nearest neighbor queries with O(logN) complexity, accelerating subsequent large-scale trajectory point projection.
[0128] Based on the Frenet reference frame and the branch types of each branch, the trajectory points in the target trajectory set are projected to obtain the projected trajectory point set.
[0129] In this embodiment, trajectory projection processing is performed, and the processing object is V_weighted (target trajectory set). The projection method is selected according to the type of the region where the trajectory points are located.
[0130] In this embodiment, the method for projecting trajectory points in the target trajectory set based on the Frenet reference frame and the branch type of each branch to obtain the projected trajectory point set can be as follows: Based on the Frenet reference frame, project trajectory points of the road segment type to obtain the first projection set; take the branch of the intersection type and the branch direction of the approach direction as the center line of the approach lane; calculate the perpendicular distance from the trajectory points in the intersection area to the center line of each approach lane; determine the second projection set based on the trajectory points whose perpendicular distance to the center line of the approach lane is greater than the first distance; determine the third projection set based on the trajectory points whose perpendicular distance to the center line of the approach lane is less than or equal to the first distance; determine the projected trajectory point set based on the first projection set, the second projection set, and the third projection set.
[0131] The set of projected trajectory points is aggregated to obtain a set of station-level lateral offset samples.
[0132] In this embodiment, the processing object is the set of projected trajectory points V_projected (only projected points with road_type='link' or 'intersection' are processed, excluding 'intersection_core'), and spatial binning is performed according to the longitudinal coordinate s to aggregate them into station-level samples. Define a station index function: c(s) = ⌊s / Δs_sample⌋ (rounded down to the nearest principal axis sampling point index n), which aggregates all trajectory points with longitudinal coordinates s ∈ [n × Δs_sample, (n+1) × Δs_sample) to station n; for road segment projection points (s_traj, y_traj, w_traj, axis_id), calculate station index n = c(s_traj), and add the lateral offset y_traj and weight w_traj to the station sample set Y(s_n, t_window, axis_id); for intersection projection points (s_k, y_k, w_traj, approach_id), calculate station index n = c(s_k), and add the lateral offset y_k and weight w_traj to the approach sample set Y(s_n, t_window, approach_id).
[0133] In this embodiment, the station-level lateral offset sample set Y(s_n,t_window)={(y_i,w_i)},{i=1..N_n}, where N_n is the total number of samples aggregated at station n. Each station contains several weighted lateral offset samples, which can be directly used for subsequent quantile confidence envelope estimation and lane occupancy analysis.
[0134] Optionally, the trajectory points in the target trajectory set are projected based on the Frenet reference frame and the branch type of each branch to obtain a projected trajectory point set, including:
[0135] Based on the Frenet reference frame, trajectory points with branch type of road segment are projected to obtain the first projection set.
[0136] In this embodiment, the road segment area projection (road_type=link) uses Frenet coordinate projection. For each trajectory point (veh_id, t_ms, x_traj, y_traj, w_traj, ...) in V_weighted, the nearest principal axis sampling point is queried through KDTree_axis, denoted as The query complexity is O(logN); the local coordinate system parameters corresponding to the sampling point are obtained: the tangent vector. Normal vector tubular region parameters ; Calculate the projection vector Vertical coordinate projection: (Dot product calculates the projected length along the tangent), representing the arc length position of the trajectory point along the principal axis; Lateral offset projection: (Dot product calculates the offset distance along the normal; a positive value indicates the right side of the axis, and a negative value indicates the left side); Projection residual calculation: (Calculate the perpendicular distance error from the point to the principal axis). Tubular region constraint verification: If (Longitudinal length exceeds the pipe length range) or If the point exceeds the tube width range laterally or dist_proj>3m (the projection residual is too large, indicating that the point is far from the main axis), then the point is determined to be outside the effective tubular area, marked as out_of_tube=True and removed from subsequent statistics (to avoid introducing interference from external or irrelevant traffic flows); otherwise, the point is retained, and the projection information is recorded as: (veh_id,t_ms,s_traj,y_traj,w_traj,axis_id,road_type='link',out_of_tube=False), resulting in the first projection set V_projected_link={(veh_id,t_ms,s_traj,y_traj,w_traj,axis_id, road_type='link')}.
[0137] Branches that are of the intersection type and whose branch direction is the inbound direction are designated as the centerline of the inbound lane.
[0138] Calculate the vertical distance from the trajectory points within the intersection area to the centerline of each approach lane.
[0139] The second projection set is determined based on the trajectory points whose perpendicular distance to the centerline of the entrance road is greater than the first distance.
[0140] In this embodiment, the first distance is greater than the second distance, and the first distance can be 20 meters.
[0141] The third projection set is determined based on the trajectory points whose perpendicular distance to the centerline of the entrance road is less than or equal to the first distance.
[0142] In this embodiment, for the intersection area projection (road_type = intersection), topological coordinate projection is adopted. For the trajectory points (x_traj, y_traj) located within the intersection Intersection_zone (judged by the distance from the point to the intersection center < R_influence), the following processing is performed: Identify all the approach centerlines {Approach_k}_{k = 1..K} connecting this intersection (extract the branches with road_type = 'intersection' and in the approach direction from the branch type annotation of Skeleton_pruned); Calculate the perpendicular distance dist_k from the trajectory point to each approach centerline: dist_k = min_{point∈Approach_k}||point - (x_traj, y_traj)|| (traverse the sampling points of the approach to calculate the minimum distance); Select the approach with the minimum distance: k_min = argmin_k(dist_k), min_dist = dist_{k_min}; Judgment of approach attribution: If min_dist > 20m, it is considered that the point is located in the core conflict area of the intersection (multi-lane weaving area, unable to clearly belong to a certain approach), marked as intersection_core, not projected to any local coordinate system, and directly record the original coordinates (veh_id, t_ms, x_traj, y_traj, w_traj, road_type = 'intersection_core') for special analysis of the intersection; If min_dist ≤ 20m, project the point to the local coordinate system of approach Approach_{k_min}: Calculate the longitudinal distance s_{k_min} by the nearest point method: s_{k_min} = arc length accumulation from the intersection center to the projection point along the approach centerline (positive value indicates before the stop line, negative value indicates inside the intersection); Calculate the lateral offset y_{k_min}: y_{k_min} = the directed distance from the trajectory point to the approach centerline (using the dot product of the normal vector, positive value indicates right deviation, negative value indicates left deviation); Record the projection information (veh_id, t_ms, approach_id = k_min, s_{k_min}, y_{k_min}, w_traj, road_type = 'intersection').
[0143] Generate the projected trajectory point set as:
[0144] V_projected_link = {(veh_id, t_ms, s_traj, y_traj, w_traj, axis_id, road_type = 'link')} (the projection result of the link, that is, the first projection set).
[0145] V_projected_intersection={(veh_id,t_ms,approach_id,s_k,y_k,w_traj,road_type='intersection')} (The projection result of the intersection approach road, which is the second projection set).
[0146] V_projected_core={(veh_id,t_ms,x_traj,y_traj,w_traj,road_type='intersection_core')} (Unprojected results of the intersection core area, i.e., the third projection set).
[0147] The set of projection trajectory points is determined based on the first projection set, the second projection set, and the third projection set.
[0148] In this embodiment, the first projection set, the second projection set, and the third projection set are merged into a unified projection set V_projected = V_projected_link ∪ V_projected_intersection ∪ V_projected_core.
[0149] Optionally, based on the binary mask matrix, the pruned main channel skeleton curve and the branch type of each branch are determined, including:
[0150] The binary mask matrix is transformed into a skeleton curve based on a fast skeletonization algorithm.
[0151] The branch points and endpoints of the skeleton curve are identified by depth-first search.
[0152] In this embodiment, a branch point is an intersection, a three-way intersection, or a point where multiple roads converge; a branch is a continuous set of skeleton pixels between endpoints, or between endpoints, and is an independent road segment or channel segment in the skeleton; one branch corresponds to one segment.
[0153] Starting from each endpoint, perform a depth-first search (DFS) to trace to the nearest branch point or another endpoint, forming a branch.
[0154] Determine the geometric properties of each branch.
[0155] Based on the geometric properties of each branch, the skeleton curve is pruned to obtain the pruned main channel skeleton curve.
[0156] In this embodiment, the pruning rules are as follows: For road segment branches: if the length is <30m or the deviation from the connected main trunk direction is >30°, the branch is deleted; For branches within intersections: the pruning conditions are relaxed, only extremely short branches <10m in length are deleted (to prevent accidental deletion of entrance or exit lanes), and all branches ≥10m in length are retained as valid entrance / exit lanes; For the identification of ramps, auxiliary lanes, and bus lanes: if the branch length is ≥50m and parallel to the main trunk (directional deviation <15°) but the lateral spacing is >8m, it is marked as parallel_lane and retained without pruning. The pruned main trunk skeleton curve is denoted as Skeleton_pruned(i,j).
[0157] Aggregate the branch points whose distance is less than the second distance to obtain the intersection area.
[0158] In this embodiment, the second distance can be 15 meters.
[0159] Determine the branch type of each branch based on the intersection area.
[0160] In this embodiment, branch types include: main road framework, intersection area, road type, etc.
[0161] In this embodiment, all skeleton branches are first determined by endpoints and branch points; spatial clustering is performed on the branch points to obtain the intersection area; each branch is traversed: if the endpoints / branch points contained in the branch are in the intersection area, it becomes a branch within the intersection; otherwise, it becomes a road segment branch.
[0162] In this embodiment, firstly, a fast skeletonization algorithm similar to Zhang-Suen is used to refine the binary mask matrix M(t_window) into skeleton curves with a single-pixel width, preserving topological connectivity. The output is denoted as the skeleton curve Skeleton_raw(i,j)∈{0,1}. Then, branch pruning is performed: depth-first search is used to identify the branch points and endpoints of the skeleton curve Skeleton_raw(i,j). Branch points are defined as skeleton points with ≥3 foreground pixels in their 8-neighborhood (i.e., three-way intersections or higher-order intersections), and endpoints are skeleton points with only one foreground neighbor. Starting from each endpoint, DFS is performed to trace to the nearest branch point or another endpoint, forming a branch segment. The geometric properties of each branch are calculated: length... This is the cumulative Euclidean distance along the branch pixels; the average direction avg_direction_branch = arctan2(Σsin(θ_i), Σcos(θ_i)), where θ_i is the direction angle of each branch segment. All branch points are clustered (DBSCAN, eps=15m), and branch points with a distance <15m are aggregated into an intersection zone (Intersection_zone). The center coordinates (x_center, y_center) and influence radius R_influence = max(distance(branch point, center)) are recorded. The skeleton is divided into "intersection branches" and "road segment branches," labeled road_type = {intersection, link}. An intersection branch extends from a road segment to the intersection, with its endpoint inside the intersection. A link branch exists only on a straight section of the main road, with no endpoint at the intersection.
[0163] In this embodiment, the centerline and main driving lanes are extracted, and interference from branch roads is removed to provide a geometric basis for establishing local coordinates.
[0164] Optionally, based on the space-time network counting matrix, a binary mask matrix is determined, including:
[0165] Generate the first matrix based on the first field of the space-time network counting matrix.
[0166] In this embodiment, the first field can be a count field.
[0167] In this embodiment, a binary mask is generated. The count field of G(t_window) is extracted to form an M×N matrix Density_raw(i,j) (which is the first matrix).
[0168] The first matrix is smoothed to obtain the second matrix.
[0169] In this embodiment, the first matrix is smoothed, for example by using a two-dimensional Gaussian kernel for convolution smoothing. The smoothed result is denoted as Density_smooth(i,j), which is the second matrix. This preserves the spatial distribution characteristics of the main traffic aggregation area while suppressing isolated anomalies and sensor noise.
[0170] Obtain the neighborhood average density of each grid cell in the second matrix.
[0171] The threshold for each grid cell is determined based on the average neighborhood density of each grid cell in the second matrix.
[0172] If the first field of a grid cell in the second matrix is greater than or equal to the threshold of the grid cell, then the grid cell is masked with the first value; if the first field of a grid cell in the second matrix is less than the threshold of the grid cell, then the grid cell is masked with the second value.
[0173] In this embodiment, the first value and the second value are different; the first value can be 1, and the second value can be 0.
[0174] Determine the binary mask matrix based on the mask of the grid cells in the second matrix.
[0175] In this embodiment, 1) Local mean filtering: A k×k mean filter U_k (k=21, i.e., covering 21×21=441 cells, corresponding to a physical region of approximately 105m×63m) is applied to the density field Density_smooth, and the neighborhood average density U_k of each cell (i,j) is calculated. (i,j)=(1 / k²)×ΣΣDensity_smooth(i+m,j+n)(m,n∈[-(k-1) / 2,(k-1) / 2]). This filter captures the local density benchmark, reflecting the typical flow level of the region; 2) Adaptive threshold calculation: θ_adaptive(i,j)=α×U_k( )(i,j)+β, α=0.5 (proportional coefficient, indicating that the threshold is 50% of the local mean), β=2veh (absolute offset, filtering extremely low density noise). 3) Binary mask generation: Mask_init(i,j)=1 if Density_smooth(i,j)≥θ_adaptive(i,j)else0.
[0176] Morphological post-processing is performed: The processing object is a binary mask Mask_init(i,j). The "open-then-close" method in morphology is used to remove noise islands and fill internal holes. The detailed processing is as follows: 1) The size of the structuring element is dynamically calculated according to the grid resolution (Δs,Δn). For example, the physical area of a single grid cell is cell_area=Δs×Δn=5m×3m=15m²; to effectively remove patches with an area <200m², the number of cells that the structuring element needs to cover is: Therefore, the structuring element is defined as SE_4x4 (4×4 square kernel, covering a physical area of approximately 60m×48m≈240m²); for hole filling with an area threshold of 100m², SE_3x3 (3×3 square kernel, covering approximately 45m×36m≈135m²) is used; 2) Multi-scale morphological operations: coarse-grained denoising (removing large patches): first, use SE_4x4 to perform the opening operation Mask_coarse=(Mask_init⊖SE_4x4)⊕SE_4x4 to remove isolated large-area noise (such as roadside parking lots, sidewalks). (Misidentified as a driving area); Fine-grained denoising (removing small patches): Apply SE_3x3 to Mask_coarse again, Mask_opened=(Mask_coarse⊖SE_3x3)⊕SE_3x3, to remove residual small noise; Connected component area filtering: Perform connected component marking (8-connected) on Mask_opened, calculate the actual physical area of each component area_component=component_pixel_count×cell_area, and delete a Components with rea_component < 200m² (double insurance, ensuring that anomalous patches not removed by morphological operations are filtered out); Void filling: Perform a closing operation using SE_3x3, Mask_closed = (Mask_opened ⊕ SE_3x3) ⊖ SE_3x3, to fill small voids inside the main channel (corresponding to physical areas < 135m²); For larger voids (such as those misjudged as voids in the central median), determine based on void shape characteristics: if the void aspect ratio > 5 (elongated type), then preserve... Leave unfilled; otherwise, fill. Finally, perform mask annotation: the processing object is the target mask Mask_closed(i,j), and a lane direction label direction(i,j) is recorded for each valid unit (i,j) (judged by the consistency between the tangent vector τ and the lane centerline direction; if the angle between τ and the positive road direction is <90°, then direction="forward"; otherwise, direction="backward"). The tangent vector τ is a vector of local traffic flow direction, used to indicate the lane driving direction of each mask unit. In each valid mask unit, a local linear trend is fitted based on the set of trajectories passed, and the tangent direction is τ. Calculate the global statistics of the mask: total number of valid units N_valid=ΣM(i,j), total area of valid region Area_valid=N_valid×Δs×Δn, average density Avg_density=ΣDensity_smooth(i,j)×M(i,j) / N_valid.Generate a density heatmap (t_window): Map Density_smooth(i,j)×M(i,j) to RGB color encoding (low density → blue, medium density → green, high density → red, using Jetcolormap), outputting in GeoTIFF or PNG format for visualization. M(i,j) is the mask. Jetcolormap is typically defined as: minimum value → blue, middle value → green, maximum value → red. The original density Density_smooth can be mapped to the [0,1] interval. After normalization, 0 corresponds to blue in Jetcolormap, 1 corresponds to red, and the middle value corresponds to green. For the window t_window, based on the final mask value, its corresponding binary matrix is denoted as M(t_window)∈{0,1} (1 represents the effective flow field region, 0 represents the background).
[0177] In this embodiment, the binary mask M(t_window)∈{0,1}, the direction label direction(i,j), and the density heatmap can be directly used for skeletonization and main axis extraction.
[0178] In this embodiment, the effective driving area is extracted, highlighting the main channel, to provide a binary template for skeleton extraction.
[0179] Optionally, the target trajectory set and lane geometry data are processed to obtain a space-time network counting matrix, including:
[0180] A grid index matrix is generated based on the lane geometry data.
[0181] In this embodiment, the processing object is the lane centerline in the lane geometry data Road_geometry: Centerline={(s_0,x_0,y_0),(s_1,x_1,y_1),...,(s_n,x_n,y_n)}, where s is the arc length coordinate (cumulative distance) along the centerline. The centerline is resampled into equidistant sampling points through cubic spline interpolation. At each sampling point, the tangent vector τ and the normal vector n are calculated. The lane_width_left and lane_width_right are expanded to the left and right of the normal vector n respectively (obtained according to the lane width attribute in Road_geometry; the typical value needs to cover multiple lanes + emergency lanes), generating rectangular grid cells Grid_cell(i,j), where i is the vertical index (along the s direction) and j is the horizontal index (along the n direction). The cell size is Δs×Δn (Δn = horizontal resolution, typical value 3m), and the cell area is ≤100m² to ensure a balance between computational efficiency and spatial resolution. Each grid cell stores the coordinates of four vertices (x_corner, y_corner) and the coordinates of its center point (x_center, y_center), while also recording its lane ID and direction label (lane_id, direction). This generates a grid index matrix G_idx(i,j) with dimensions M×N (M being the number of vertical grid cells and N being the number of horizontal grid cells). The grid geometry is stored as GeoJSON format Polygon objects for easy spatial querying and visualization. The cycle of the relevant traffic lights for the road segment is also retrieved.
[0182] The starting point of the cycle of the traffic light associated with the road segment closest to the trajectory point is used as the starting time of the window.
[0183] The window end time is determined based on the window start time and the target window width.
[0184] In this embodiment, the basic window width is obtained in advance; if it is a high-traffic period, the basic window width is shortened by a first width to obtain the target window width; if it is a low-traffic period, the basic window width is extended by a second width to obtain the target window width. The window end time is determined based on the window start time and the target window width.
[0185] The first time period is determined based on the window start time and window end time.
[0186] In this embodiment, the first time period is [t_start, t_end].
[0187] Based on the trajectory points in the target trajectory set that are within the first time period, a time-based data block is generated.
[0188] Adjust the window start time t_start forward to the nearest signal cycle start time (the green light turning on), t_start_aligned = t_start - (t_start - t_signal_epoch) mod C_signal, where t_signal_epoch is the initial time (epochtime) of the signal system; the end time t_end = t_start_aligned + Δt_window, ensuring that [t_start_aligned, t_end] contains an integer number of signal cycles; for each window [t_start, t_end], filter the trajectory points in V_weighted that satisfy t_ms ∈ [t_start, t_end], and generate a time-phased data block V_windowed(t_window).
[0189] A time-space grid counting matrix is generated based on the grid index matrix and the time-segmented data blocks.
[0190] In this embodiment, a mapping count is performed: the processing objects are the trajectory point V_windowed(t_window) and the grid G_idx, and the number of times a vehicle appears in each grid cell is counted by a point-in-polygon fast judgment algorithm (such as the ray method).
[0191] In this embodiment, the detailed processing is as follows: traverse each trajectory point in V_windowed(t_window). If the point falls within a grid cell Grid_cell(i,j), update the statistical variables of that grid cell: count(i,j)+=w_traj (weighted count, considering confidence level), sum_speed(i,j)+=speed_mps×w_traj (weighted sum of speeds), sum_weight(i,j)+=w_traj (cumulative sum of weights). After traversal, calculate the aggregate index of each grid cell: count(i,j) is the weighted number of vehicles, avg_speed(i,j)=sum_speed(i,j) / sum_weight(i,j) (average speed, in m / s), occupancy(i,j)=count(i,j)×avg_vehicle_length / (Δs×n_lanes) (occupancy rate, assuming avg_vehicle_length=5m is the average vehicle length and n_lanes is the number of lanes covered by the grid). The output is a space network counting matrix G(t_window)[i,j], where the matrix elements are structures {count,avg_speed,occupancy,sum_weight}, and all fields of cells not covered by trajectory points are initialized to 0.
[0192] In this embodiment, road network rasterization and signal cycle alignment are performed. A longitudinal-lateral reference grid is constructed under lane-level geometric constraints, and trajectories are aggregated using a sliding time window to provide a spatiotemporally aligned data foundation for density field calculation.
[0193] In this embodiment, the space-time grid counting matrix G(t_window)={Grid_cell(i,j):{count, avg_speed,occupancy}} can be directly used for density field smoothing and mask generation.
[0194] Optionally, before determining the window end time based on the window start time and the target window width, the method further includes:
[0195] Get the base window width;
[0196] If it is a high-traffic period, the base window width is shortened by the first width to obtain the target window width;
[0197] If it is a low-traffic period, the base window width is extended by a second width to obtain the target window width.
[0198] In this embodiment, signal cycle alignment is performed: the processing object is V_weighted, and an adaptive sliding time window is used to achieve spatiotemporal alignment in combination with the signal cycle. The cycle C_signal (in seconds) of the relevant traffic lights on the road segment is obtained from real-time SPaT data (SPaT provides real-time status and time information about traffic lights, which is an existing system and will not be described in detail). If there are multiple traffic lights, the average cycle C_avg is taken. The base window width Δt_window_base=max(5min,3×C_avg) (containing at least 3 complete signal cycles to capture the complete "red-green-red" traffic pattern). For high-traffic periods (historical average traffic >1500veh / h), it is shortened to Δt_window=2×C_avg (to speed up the response) to obtain the target window width. For low-traffic periods (<500veh / h), it is extended to Δt_window=10min (to accumulate sufficient samples) to obtain the target window width. The sliding step size Δt_step=C_avg (a new window is generated for each signal cycle to ensure that the window boundary is aligned with the signal phase).
[0199] In this embodiment, the preprocessed trajectory data is transformed into a spatial distribution model of lane occupancy, identifying the main driving areas and confidence ranges at different times, and finally dynamically generating the optimal lane configuration and signal timing scheme.
[0200] S140, obtain the current feature matrix.
[0201] The current feature matrix includes at least one of the following: lag features, envelope features, event features, weather features, and time features.
[0202] S150: Input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow.
[0203] Optionally, the training process for the traffic flow prediction model includes:
[0204] The input feature samples are obtained by extracting lag features, envelope features, event features, weather features, and time features from historical vehicle density sequences.
[0205] The traffic flow prediction model is obtained by training the model based on the input feature samples.
[0206] In this embodiment, based on the historical sequence and confidence envelope time series of the spatiotemporal network counting matrix, combined with external event characteristics, the lane-level occupancy distribution and uncertainty within the future Δt are output, providing demand-side input for signal adjustment. The model inputs are the historical sequence {G(t-kΔt)}k=0..K_history of the spatiotemporal network counting matrix, where K_history = the number of historical backtracking windows, with a typical value of 12 corresponding to the past hour's data; the historical confidence envelope sequence {P(q,t-kΔt)}k=0..K_history; external events (including accident, construction, event, etc., each event containing location, start time t_start, duration, severity ∈ {1,2,3}); and weather information (including weather type ∈ {clear,rain,snow,fog}, visibility _m, and pavement condition ∈ {dry,wet,icy}). Its detailed implementation is as follows:
[0207] First, a traffic flow prediction model is trained by constructing a multi-dimensional feature vector X(t). The multi-dimensional feature vector X(t) is then extracted and used as input to the prediction model.
[0208] Time lag characteristics: Extract grid densities G(t-Δt).count, G(t-2Δt).count, and G(t-3Δt).count from historical density sequences with lags of 1, 2, and 3 time windows, and aggregate them into vectors [count_{s_n}(t-Δt),count_{s_n}(t-2Δt),count_{s_n}(t-3Δt)] by station;
[0209] Confidence envelope area ratio feature: Calculate R(q,t)=Area(q,t) / Area_max (Area_max is the historical maximum area, used as the normalization benchmark), and generate the area ratio time series [R(0.6,t),R(0.8,t),R(0.95,t),R(0.6,t-Δt),R(0.8,t-Δt),R(0.95,t-Δt)], which reflects the expansion / contraction trend of lane occupancy;
[0210] Event indicator variable: For each external event Event_external, calculate the event impact function: E(t)=severity×exp(-distance² / (2σ_spatial²))×(1-|t-t_event| / duration) (distance is the distance between the event location and the predicted road segment, t_event is the time of the event occurrence, and σ_spatial is the spatial attenuation parameter, such as 500m). If E(t)>0.1, then E(t) remains unchanged; otherwise, it is set to 0. Generate the event impact vector [E_accident(t),E_construction(t),E_event(t)];
[0211] Weather rating: Map the weather type to a numerical code W(t)∈{1,2,3} (1=clear, sunny; 2=rain / fog; 3=snow / ice), and encode the visibility normalized value visibility_norm=visibility_m / 10000 (saturated to [0,1]) and the road surface condition one-hot vector;
[0212] Time periodic features: Extract hour_of_day∈[0,23], day of week_of_week∈[0,6], and whether it is a holiday_holiday∈{0,1}. Use sine / cosine encoding hour_sin=sin(2π×hour_of_day / 24) and hour_cos=cos(2π×hour_of_day / 24) to avoid periodic boundary breaks.
[0213] All features are concatenated to form a feature matrix X(t) = [lag features, envelope features, event features, weather features, time features], with a dimension of approximately D_feature = 30-50. The traffic flow prediction model can be trained using an LSTM neural network, with training data consisting of one month of historical time-series data. The input is X(t) → LSTM layer → Dense (output_size = 2 × N_sample) → output [μ, σ]. The loss function is: NLL = -Σlog(N(y_true|μ, σ²)), where μ is the predicted mean and σ is the predicted standard deviation. Model training is a current method and will not be elaborated further.
[0214] In this embodiment, the current feature matrix is input into the pre-trained traffic flow prediction model, which outputs the predicted traffic flow and its uncertainty at future times, and outputs the prediction interval [μ,σ]. At the same time, the prediction confidence index confidence_pred=1 / (1+σ / μ) (the inverse of the coefficient of variation, the larger the value, the more reliable the prediction) is calculated.
[0215] The output of the traffic flow prediction model is Pred(t+Δt)={μ,σ,confidence_pred} (the mean, standard deviation, and confidence level of the predicted density for each station at each confidence level), which can be directly used for lane scheme benefit calculation. For example, Pred(t+Δt)={150,20,1 / (1+20 / 150)≈0.88}, so the downstream "lane scheme benefit calculation" can know: expected traffic flow of 150 vehicles, uncertainty ±20 vehicles (approximately ±13%), and prediction reliability of 88%.
[0216] S160 determines and executes lane control instructions based on time-based lane confidence envelopes, predicted traffic flow, and road rule constraints.
[0217] In this embodiment, the road rule constraints include: minimum lane change interval min_switch_interval=30s to prevent frequent switching, emergency lane width requirement emergency_lane_width≥3.5m, candidate set of variable lanes candidate_lanes={lane_id_1,lane_id_2,...}, maximum capacity per lane capacity_per_lane=1800veh / h), and signal phase constraints (including minimum green light interval min_green_interval≥5s, phase transition time phase_transition_time=3s, and phase groups that coordinate with variable lanes).
[0218] Optionally, lane control instructions are determined based on time-varying lane confidence envelopes, predicted traffic flow, and road rule constraints, including:
[0219] Generate a set of current lane configuration vectors based on the time-based lane confidence envelope.
[0220] In this embodiment, the current driving direction of each lane is determined by the static lane topology of the road and the real-time lane controller status. The configuration vector is then assembled according to the lane order to form the initial lane configuration by querying the traffic signal or lane control equipment.
[0221] In this embodiment, the time-based lane confidence envelope is used to determine the feasibility of adjusting the available width and direction of each lane, thereby generating a set of candidate configuration vectors.
[0222] In this embodiment, the current lane configuration vector is a preliminary candidate scheme, not the final scheme.
[0223] In this embodiment, the current lane configuration L_current=[direction_1, direction_2,...,direction_N] (direction_i represents the current direction of the i-th lane) is predetermined. A set of candidate schemes is generated by enumerating the direction reversals and number increases / decreases of variable lanes. The enumeration rules are as follows: for each variable lane lane_id_k∈candidate_lanes, a direction scheme is generated; for adjacent variable lanes, a linkage scheme is generated; for each direction, a lane number increase / decrease scheme of ±1 is generated; the total number of schemes is limited to K≤8 to avoid search space explosion, and schemes with high matching degree with the predicted demand are prioritized (e.g., through heuristic rules). Each scheme is encoded as a lane configuration vector L_config_k=[direction_1, direction_2,...,direction_N], and the change ΔL_k=L_config_k- L_current (used to calculate the switching cost) is recorded. A set of current lane configuration vectors is generated based on the configuration vector L_config_k obtained from each scheme encoding.
[0224] Based on road rule constraints and time-based lane confidence envelopes, the current lane configuration vectors in the current lane configuration vector set are filtered to obtain the target lane configuration vector set.
[0225] In this embodiment, during the safety verification phase, candidate solutions are mainly screened based on road rule constraints (such as minimum switching time, emergency lane, intersection conflict, signal phase compatibility), and P(q,t) only indirectly affects width feasibility. In this embodiment, when generating the current lane configuration vector set, information such as the available width of each lane and lane direction safety needs to be considered. P(q,t) provides the available width and occupancy information of each lane at different confidence levels, which is used to determine which direction adjustments are feasible.
[0226] In this embodiment, the processing object is each lane configuration vector L_config_k in the current lane configuration vector set. The following safety constraints are checked in sequence and unqualified solutions are eliminated. Minimum switching time constraint: Query the historical lane switching log Switch_history, calculate the time interval since the last switch Δt_since_last_switch = t_current - t_last_switch. If Δt_since_last_switch < min_switch_interval, mark it as "too frequent switching" and eliminate it; Emergency lane retention constraint: Count the number of disabled lanes and the total width in the solution, and verify whether at least 1 emergency lane is retained and the width ≥ 3.5m. If not satisfied, mark it as "insufficient emergency lane" and eliminate it; Intersection conflict point check: For variable lanes involving intersections, calculate the number of conflict points (defined as the intersection points, confluence points, and divergence points of vehicle flows in different directions) through the intersection topology map, and use the traffic conflict technology TCT (this is an existing technology) to evaluate the severity of conflicts. If there are serious conflicts, mark it as "conflict exists" and eliminate it; Signal phase compatibility check: Verify whether the corresponding phase group phase_group of the solution is in the signal machine support list, and the phase switch will not cause conflicting flows to be released simultaneously (such as left turn and oncoming straight). If it is not compatible, eliminate it. The solutions that pass the safety verification are recorded as the target lane configuration vector set Safe_configs = {L_config_i|i ∈ passing index set}.
[0227] Determine the expected delay, queue length change amount, and switching cost of each target lane configuration vector in the target lane configuration vector set according to the predicted traffic flow.
[0228] In this embodiment, the processing objects are the target lane configuration vector set Safe_configs and the predicted flow Pred(t+Δt). A comprehensive benefit score is calculated for each lane configuration vector to quantify the control effect. Specifically, the expected delay is calculated as follows: For each candidate scheme L_config_i, the capacity in each direction is first calculated based on the number of lanes allocated. The capacity c represents the maximum traffic flow that a lane can handle per unit time, calculated as c = number of lanes × capacity_per_lane, where capacity_per_lane is the saturation flow rate of a single lane (typically 1800-2000 veh / h). The greater the capacity, the stronger the intersection's traffic handling capacity. Then, the BPR (Bureau of Public Roads) delay function is used to characterize the flow-delay relationship. The BPR function is a widely used empirical model in traffic engineering, its form being delay(v,c) = delay_free × [ The function is defined as follows: where v is the actual traffic flow and delay_free is the free-flow delay (the baseline time for vehicles to pass through the intersection in a congested environment). This function reflects the nonlinear characteristics of traffic congestion. When the traffic flow approaches the capacity (v / c→1), the delay increases dramatically to the fourth power, reflecting the performance degradation of the intersection as it transitions from free flow to saturation. Due to the uncertainty in traffic flow prediction, the actual traffic flow may fluctuate within the range of μ±σ. Therefore, it is necessary to calculate the expected delay considering this uncertainty. The predicted traffic flow is modeled as a normal distribution v~N(μ,σ²), and the expected delay is calculated by integration: D_est=∫delay(μ+σ×z,c)×φ(z)dz, where z is a standard normal variable and φ is a standard normal density function. This integral represents the weighted average of the delay over all possible traffic flow values, with the weights determined by the probability of the traffic flow occurring. In actual calculations, numerical integration methods such as Gauss-Hermite Quadrature are used for efficient solution, avoiding the computational overhead of Monte Carlo sampling. The expected single-veh delay D_est for each lane configuration vector is obtained, in units of s / veh (seconds / veh), reflecting the average waiting cost of vehicles passing through the intersection under this scheme. Queue length fluctuation calculation: The essence of queue fluctuation stems from the interaction between random arrival and service processes. The M / D / 1 model (Poisson arrival, deterministic service, single service station) from queuing theory is used to characterize intersection queuing behavior. This model assumes that vehicle arrivals follow a Poisson process (arrival intervals follow an exponential distribution) and that the service time is fixed (determined by capacity), enabling analytical calculation of the statistical characteristics of queue length. The formula for calculating the expected queue length is E[Q]=(v²×σ_arrival²) / (2×(cv)), where v is the average arrival rate, c is the service rate (capacity), and σ_arrival² is the variance of the arrival rate. By comparing the expected queue length before and after the scheme implementation, the change in queue length ΔQ=E[Q_after]-E[Q_before] is calculated, in units of veh (number of vehicles). A negative ΔQ indicates that the proposed solution can alleviate congestion and shorten queues, while a positive value indicates that it may worsen queue conditions. This indicator captures the impact of the proposed solution on traffic flow stability. The queue length change ΔQ for each lane configuration vector, expressed in veh, reflects the impact of the proposed solution on intersection queue stability. Switching cost calculation: Switching cost is directly related to the magnitude of lane changes. The proposed solution change ΔL = |L_config_i - L_current| is defined as the difference in lane configuration between the new and current solutions (e.g., if the number of left-turn lanes changes from 2 to 3, then ΔL_left = 1). The switching cost is calculated as C_switch = β × |ΔL|, where β is the unit switching cost parameter, comprehensively considering factors such as equipment action time, transitional traffic disturbance, and driver adaptation costs. A typical calibration value is β = 10s / lane (i.e., adjusting one lane is equivalent to adding 10 seconds of equivalent delay to the system).This embodies the "principle of minimum intervention": when benefits are similar, prioritize the option that is closest to the current configuration to avoid unnecessary frequent adjustments. This conservative strategy can improve system stability and reduce user confusion in practical applications. The switching cost C_switch for each lane configuration vector is obtained, in seconds per lane, quantifying the operational cost of configuration changes. The overall benefit is a weighted sum: Score = -(D_est + λ × ΔQ + γ × C_switch) (the negative sign indicates minimization, weights λ = 0.4 emphasize queue stability, and γ = 0.2 penalize frequent switching). The option with the highest Score is selected as the optimal option: L_optimal = argmaxScore.
[0229] Based on the expected delay, queue length change, and switching cost of each target lane configuration vector, candidate lane configuration vectors are obtained by filtering each target lane configuration vector in the target lane configuration vector set.
[0230] Lane control instructions are generated based on candidate lane configuration vectors.
[0231] In this embodiment, the processing object is the candidate lane configuration vector L_optimal, generating lane control instructions. The specific implementation process is as follows: The execution timestamp t_exec = t_current + t_prepare is determined, where t_prepare is the preparation time (typically 60s), reserving a buffer period for instruction issuance and equipment response. Signal timing is adjusted according to L_optimal, and the green light duration for each phase is calculated using the Webster optimal timing formula. The Webster formula, based on the principle of delay minimization, calculates the optimal green light duration for the i-th phase: g_i = (C × y_i) / Σy_i, where C is the signal period and y_i is the traffic flow ratio (the ratio of actual traffic flow to saturated traffic flow) for that phase. This formula can dynamically allocate green light time according to traffic demand in each direction, minimizing overall intersection delay. The adjustment amount Δg = g_optimal - g_current is calculated, with a constraint |Δg| ≤ 10s to avoid significant disturbances. Define a rollback condition (rollback_condition) to immediately restore the current configuration (L_current) when any of the following abnormal conditions are triggered: (1) Flow deviation exceeds the limit: The actual observed flow deviates from the predicted flow by more than 20% (|Actual-Pred| / Pred>0.2), indicating that the prediction is inaccurate, and continued execution may lead to a serious mismatch between the configuration and the requirements; (2) Safety event trigger: Safety threat events such as traffic accidents, vehicle conflicts, and pedestrian intrusions are detected (safety_event_count>0), and adjustments must be stopped immediately to ensure safety; (3) Equipment failure: Communication interruption or functional abnormality occurs in key equipment such as traffic signals, variable lane signs, and detectors (device_failure=true), and the correct execution of control commands cannot be guaranteed. Then, the lane control command is obtained, denoted as Plan_exec={t_exec,L_optimal,signal adjustmentΔg,rollback condition}, which can be directly sent to the traffic signal for execution.
[0232] This embodiment sends Plan_exec to devices such as traffic signals, VMS, and roadside units via standard protocols, and monitors implementation deviations in real time to ensure that control actions are implemented safely as planned or to quickly revert in case of anomalies. The input is Plan_exec. Based on a multi-protocol concurrent distribution mechanism, Plan_exec is distributed to heterogeneous traffic devices, such as traffic signal control: updating timing parameters and confirming responses via NMS / NTCIP protocol interfaces; VMS devices: pushing dynamic information and verifying return status via HTTPREST interfaces; V2X devices: publishing MAP / SPAT / TIM messages using MQTT-TLS to ensure at least one delivery. Within the implementation window [t_exec, t_exec+t_monitor] (typically 15 minutes), the system continuously collects multi-source data: traffic response monitoring, aggregating real-time detection data to form the actual grid density G_windowed_actual, and calculating density and speed deviation indices ΔG_density and ΔG_speed; event detection: accessing the traffic event database (CIDNE format) and counting serious events safety_event_count.
[0233] The system automatically determines rollback conditions based on monitoring metrics and safety events: if ΔG_density > 20%, ΔG_speed > 20%, and safety_event_count > 0, a rollback operation is triggered: a Plan_rollback is generated and issued to restore the original signal and lane configuration; an Anomaly_report is generated and automatically pushed for manual review. This results in Exec_log = {sent: issuance record, received: confirmation receipt, actual_metrics: {G_windowed_actual, ΔG_density, ΔG_speed, safety event_count}, rollback_flag: whether to rollback} and the real-time metric sequence Real_time_metrics, which can be directly used for online evaluation.
[0234] In this embodiment, predefined interpretable indicators are calculated from the data before and after implementation, transforming macroscopic deviations into microscopic root causes, automatically generating targeted improvement measures, and forming an "evaluation-optimization-re-evaluation" closed loop. This avoids blind parameter tuning, ensures continuous strategy evolution and model self-learning, and achieves online iteration and performance improvement of the traffic control system. The steps are as follows:
[0235] Lane control evaluation system construction. Based on pre- and post-implementation data, predefined interpretable indicators are calculated to generate objective and verifiable quantitative results of the control effect. Inputs are Exec_log and baseline indicators Baseline_metrics (historical average values for the same period, retrieved from the database under the same time period, weekday, and weather conditions, taking the mean and standard deviation). Its detailed implementation is as follows:
[0236] First, the evaluation metrics are set: the data processed is the implementation window [t_exec-Δt_before, t_exec+Δt_after] (Δt_before=5min is the baseline period before implementation, Δt_after=15min is the observation period after implementation), and the following interpretable metrics are calculated:
[0237] Average speed of road segment avg_speed_segment(t): Extract the avg_speed field of all grid cells from G_windowed_actual, and calculate the weighted average avg_speed_segment=Σ(avg_speed(i,j)×count(i,j)) / Σcount(i,j), in km / h;
[0238] Queue length (t): Identifies continuous cells in the grid with speed < 5 km / h and occupancy > 0.6, and accumulates their longitudinal length to obtain the queue length. Queue length = ΣΔs × 1 {speed(i,j) < 5 AND occupancy(i,j) > 0.6}, in meters.
[0239] Average vehicle delay delay_avg(t): Calculated using the travel time method, delay_avg=(travel_time_actual-travel_time_free) / vehicle_count, where travel_time_actual is the actual travel time calculated from the trajectory data V_weighted, and travel_time_free is the free-flow travel time (segment length / free-flow speed), in seconds / veh.
[0240] Lane utilization rate (lane_util_rate(q,t): The coverage test is used to calculate the proportion of the confidence envelope P(q,t) that covers the actual trajectory points. lane_util_rate(q,t)=Σ1{(x_traj,y_traj)∈P(q,t)} / total_traj_points×100%. At the same time, the coverage deviation |lane_util_rate(q,t)-q|<0.02 (2% tolerance) is used to judge the accuracy of the envelope estimation.
[0241] Safety event count (t): Counts safety events (including rear-end collisions, emergency braking, lane departures, etc.) caused by lane switching during the implementation period from the event log, and sums them by severity: safety_event_count = Σevent_i × severity_weight_i.
[0242] This can be summarized as the time series of indicators: Metrics_all={avg_speed:[speed(t_1), speed(t_2),...],queue:[queue(t_1),queue(t_2),...],delay:[delay(t_1),delay(t_2),...],util:[util(q,t_1),util(q,t_2),...],safety:[safety(t_1),safety(t_2),...]}.
[0243] Secondly, a baseline comparison is performed, comparing Metrics_all and Baseline_metrics in depth. The improvement rate ΔX = (X_baseline - X_post) / X_baseline × 100%, where X represents the value of each metric (such as delay, queue, etc.), with positive values indicating improvement and negative values indicating deterioration. The judgment criteria are: if Δdelay ≥ +10% (delay reduction ≥ 10%) and Δsafety = 0 (no new safety events), and the coverage test passes, it is marked as "effective improvement"; if Δdelay < -5% (delay increase > 5%) or Δsafety > 0, it is marked as "poor performance, requiring further analysis"; other cases are marked as "moderate performance". This yields the time series of metrics Metrics_all, the improvement rate vector ΔMetrics = {Δdelay, Δqueue, Δspeed, Δutil, Δsafety}, and the comprehensive evaluation label Evaluation_label ∈ {effective improvement, moderate performance, poor performance}, which can be directly used for anomaly detection.
[0244] This transforms macroscopic indicator deviations into microscopic root causes, avoiding blind parameter tuning. Inputs include Metrics_all, ΔMetrics, Evaluation_label, Exec_log (containing issued commands, device responses, and sensor status), Pred(t) (predicted value), and V_weighted (actual trajectory data). Its detailed implementation is as follows:
[0245] First, threshold judgment is performed: the processing objects are ΔMetrics and Evaluation_label, and anomaly triggering rules are set. If Δdelay < -5% (delay worsening > 5%), Δsafety > 0 (a safety event exists), or Evaluation_label = "poor performance", then the anomaly flag Flag_anomaly = True is triggered; otherwise, Flag_anomaly = False, "System is running normally" is output directly, and root cause analysis is skipped. For cases where Flag_anomaly = True, the root cause classification process begins.
[0246] Secondly, root cause classification is performed: the objects of processing are Flag_anomaly and multi-source diagnostic evidence, and the root cause type is automatically classified using decision tree rules. The rule set is defined as follows: IF|Pred.μ-G_actual.count| / Pred.μ>15% (prediction bias>15%) THENroot_type="predict prediction error"; IFExec_log.sensor_health.online_rate<0.9 ORExec_log.sensor _health.data_quality_score<70 (low sensor online rate or poor data quality) THENroot_type="sensor data missing"; IF|signal_adjustments_actual-signal_adjustments_planned|>3s (actual signal timing deviation >3 seconds) ORlane_config_actual≠lane_config_planned (lane configuration not executed as planned) THENroot_type="control decision error"; IFEvent_external.severity≥2ANDdistance(Event_external.location,current_segment)<500m (external event of high severity exists at close range) THENroot_type="external interference"; IF None of the above conditions are met THENroot_type="unknown unknown cause". Multiple root causes are allowed to coexist (such as "prediction error" and "data missing" at the same time). The output root cause type set Root_type={predict,sensor, control,external,unknown} and its confidence_root (calculated based on the strength of evidence, with a value of 0-1) are output.
[0247] Finally, impact localization is performed: the processing objects are Root_type and detailed log data, to accurately pinpoint the affected spatiotemporal range. The detailed processing sub-steps are as follows:
[0248] 1) Endpoint effect inflation: For time series boundaries (the start of implementation t_exec and the end of implementation t_exec+Δt_after), the abnormal weight of indicators within Δt_boundary=2min near the boundary is amplified by 1.2 times (inflation coefficient) to compensate for the problem of incomplete data at the boundary or the underestimation of disturbances during the transition period;
[0249] 2) Boundary-aware smoothing: Apply Savitzky-Golay filtering (window length = 5 time points, polynomial order = 2) to the index time series, and use an asymmetric window at the boundary (the boundary point window only extends inward) to avoid extrapolation error.
[0250] 3) Tracing the scope of impact: Extract device response time and sensor quality time series from Exec_log to locate the time period of data quality degradation [t_quality_drop_start, t_quality_drop_end]; extract abnormal trajectories (speed abrupt change > 20km / h, lateral offset abrupt change > 2m, acceleration > ±3m / s²) from V_weighted, and identify high-incidence road segments segment_id_anomaly through spatial clustering; extract the scope of event impact from Event_external, and calculate the spatiotemporal overlap ratio overlap_ratio = |Δt_event∩Δt_implement| / Δt_implement×|Δx_event∩segment| / segment_length.
[0251] 4) Generate a root cause report: Root_cause_report = {root_type: set of root cause types, affected_scope: {time_range: [t_start, t_end], segment_ids: [segment_1, segment_2, ...], device_ids: [device_1, ...]}, evidence_refs: {pred_error: prediction error value, sensor_drop: sensor quality degradation period, control_deviation: control deviation, external_overlap: external event overlap}, impact_score: impact severity score 0-100}. The impact_score is calculated as a weighted sum: impact_score = 0.3 × Δdelay weight + 0.3 × Δqueue weight + 0.2 × safety_event_count weight + 0.2 × affected_scope (spatiotemporal range weight). This results in the root cause report, Root_cause_report, which can be directly used to generate optimization measures.
[0252] Based on root cause reports, actionable improvements are automatically generated, forming a closed loop of "evaluation-optimization-re-evaluation". Its detailed implementation is as follows:
[0253] First, measure template matching is performed, processing the root cause type (Root_type). A measure library (Measure_lib) is maintained, which can be built manually or automatically. The measure data structure is Measure_structured={ID, root_type, target_param, action_desc, expected_effect, complexity, auto_executable}, where measure_id is a globally unique string, root_type is the root cause category, target_param is the list of parameters to be adjusted, action_desc is the executable engineering instruction, expected_effect is the internal KPI improvement margin, execution_complexity is the execution difficulty enumeration, and auto_executable indicates whether the system can execute directly without human intervention. A simple example of a measure is as follows:
[0254] {"measure_id":"M_PE_02","root_type":"predict prediction error","target_param":["E(t) input dimension"],"action_desc":"Introducing real-time traffic event features E(t) as an additional input dimension for LSTM","expected_effect":{" ":0.08," ":0},"execution_complexity ":"medium","auto_ executable":true};
[0255] {"measure_id":"M_CD_01","root_type":"control decision error","target_param":["min_switch_interval"],"action_desc":"Extend lane switching interval min_switch_interval from 30s to 45s to reduce frequent switching","expected_effect":{"Δdelay_expected":0.06,"Δsafety_expected":0.01},"execution_complexity ":"low","auto_executable":true}.
[0256] Then, closed-loop iterative optimization is performed. For measures involving parameter adjustment, a parameter sensitivity analysis mechanism is established: the partial derivative of the target index with respect to the parameter ∂(target) / ∂(parameter) is calculated, and the parameter with the highest sensitivity is selected for optimization first. In multi-parameter scenarios, grid search or Bayesian optimization is used to find the best option within the constraints. If the measure is automatically executable (auto_executable=true), the system automatically updates the configuration parameters (config_updated), triggering the recalculation and scheduling of the second to third phases of the process, forming an iteration trigger request Iteration_trigger={iteration_count,config_changes,restart_from_stage,status}, where iteration_count is the current iteration count, config_changes is the set of updated parameters, restart_from_stage indicates the process stage identifier for restarting execution, and status is the description of the current iteration status. If the measure requires manual execution (auto_executable=false), a human task object Human_task={task_type, measure_desc, expected_effect, approval_required} is generated, where task_type represents the task category (such as manual intervention, equipment maintenance, etc.), measure_desc is the text description of the measure to be executed, expected_effect is the expected improvement effect, and approval_required indicates whether manual approval is required.
[0257] After the measures are implemented, the performance metrics are recalculated to obtain the improvement rate ΔMetrics_v2. If the improvement reaches the preset threshold and there are no new anomalies, the optimization is considered "successful"; otherwise, the next round of analysis begins.
[0258] Finally, an evaluation report object is generated: Evaluation_report={iteration_id, measures_applied, metrics_before, metrics_after, improvement_rate, conclusion}, where iteration_id is the iteration number, measures_applied is the set of applied measures, metrics_before and metrics_after are the system performance indicators before and after optimization, improvement_rate is the improvement rate of key indicators, and conclusion is the evaluation conclusion identifier (such as "optimization successful" or "manual intervention required").
[0259] This embodiment transforms multi-source traffic perception data into interpretable and optimizable lane management strategies, achieving an intelligent upgrade from passive response to proactive prediction. It utilizes multi-dimensional monitoring indicators and root cause diagnosis methods. In practical applications, depending on actual needs, there will be more evaluation and optimization functional dimensions, such as: modal alignment evaluation and optimization for multi-modal fusion (e.g., video-radar spatiotemporal registration error monitoring and adaptive correction); drift detection and online model updates for long-term prediction (e.g., triggering incremental learning after detecting distribution offset); phase conflict resolution and dynamic green wave optimization for signal coordination (e.g., real-time adjustment of phase difference offset to achieve green wave coordination); message latency monitoring and congestion control for V2X communication (e.g., reducing broadcast frequency when DSRC channel is congested), etc., which cannot be listed exhaustively. Without departing from the essence of this embodiment, those skilled in the art can make various corresponding customized developments and modifications based on this embodiment, all of which fall within the protection scope of this embodiment.
[0260] Furthermore, this embodiment proposes an optimization method for the alternative measure template library. This method pre-installs corresponding prompt templates for root cause diagnosis and measure generation in a diagnosis-optimization routing table. These templates include fields such as ID, root cause type, applicable scenario, diagnostic criteria, diagnostic prompt, and optimization prompt. When root cause analysis or optimization of the system is required, the corresponding prompt is retrieved and executed by the larger model. It can be executed independently or, depending on the task requirements, merged into a single prompt based on scenario or category for overall execution.
[0261] The diagnostic-optimized routing table is shown in Table 1:
[0262] Table 1
[0263]
[0264] Here is a simple example of diagnosing and optimizing a prompt:
[0265] Prediction Error (Traffic Flow Forecast): Predict_diagnosis_prompt={"You are a traffic forecasting expert. Please diagnose the sources of error in the following short-term traffic flow forecasts. Input: Predicted value Pred(μ,σ), actual observed value G_actual, feature vector X(t), model type (LSTM / Holt-Winters). Output: 1. Statistical characteristics of the prediction bias (mean bias, standard deviation bias, MAPE); 2. Whether there is a systematic bias (such as consistently overestimating or underestimating traffic flow in a certain direction); 3. Feature missing analysis (whether key external event features E(t) or weather features W(t) are missing); 4. Model applicability judgment (whether the complexity of the current scenario exceeds the model's capabilities); 5. Tags: {Prediction accurate, systematic bias, feature missing, model inapplicable}; 6. Evidence: Indicate the typical time periods and road sections where the prediction is inaccurate."}Predict_optim_prom pt={"You are a traffic prediction optimization expert. Please optimize the prediction model based on the diagnostic results. Input: Diagnostic conclusion, historical prediction error sequence, current model parameters. Optimization tasks: 1. If there is a systematic bias, adjust the model output post-processing (e.g., add a bias correction term); 2. If features are missing, supplement missing features from external data sources (e.g., real-time event API, weather API); 3. If the model is not suitable, switch to a more complex model (e.g., LSTM → Transformer) or introduce ensemble learning; 4. Adjust hyperparameters (e.g., LSTM dropout from 0.2 → 0.15, hidden layers from 64 → 128); 5. Increase the training sample (from 1 month → 2 months of historical data). Output: Optimized model configuration {model_type, hyperparameters, training_data_range} and expected MAPE improvement."}
[0266] Data Missing (Sensor Failure): Sensor_diagnosis_prompt={"Please diagnose the following sensor data quality issues: Input: Sensor health status sensor_health{online_rate,data_quality_score}, trajectory completion rate, confidence distribution. Output: 1. Spatiotemporal distribution of missing data (which road segments and time periods have severe data loss); 2. Classification of missing data causes (equipment failure / communication interruption / view obstruction / severe weather); 3. Impact on downstream tasks (raster density field distortion, abnormal confidence envelope width); 4. Tags: {data complete, minor missing, severe missing - requires re-collection, sensor failure - requires maintenance}; 5. Evidence: cite sensor_health The time-series changes and affected_scope. "}Sensor_optim_prompt={"Please optimize sensor data quality: Input: diagnostic conclusion, sensor deployment plan, backup data source. Optimization tasks: 1. If there is slight missing data, fill it using interpolation from adjacent sensor data or historical patterns; 2. If there is severe missing data, supplement from backup data sources (e.g., call nearby road radar, enable backup cameras); 3. If a sensor fails, generate a maintenance work order and temporarily reduce the sensor's weight to 0.3; 4. Re-estimate the confidence weight src_conf, and increase the weight of healthy sensors; 5. Optimize the fusion strategy (use robust estimation such as RANSAC to remove abnormal observations). Output: optimized sensor configuration, confidence weight adjustment plan, supplementary data source."}
[0267] Decision-making error (lane configuration deviation): Control_diagnosis_prompt={"Please diagnose the following variable lane control decision-making problem: Input: planned configuration lane_config_planned, actual configuration lane_config_actual, signal timing deviation, execution log Exec_log. Output: 1. Specific manifestations of the configuration execution deviation (which lanes did not switch as planned, signal timing deviation amount); 2. Causes of the deviation (device response delay / communication failure / safety constraint triggering / manual intervention); 3. Impact on traffic flow (increase in delay, queue length fluctuation, user confusion); 4. Tags: {Accurate execution, minor deviation, severe deviation - requires rollback, constraint conflict}; 5. Evidence: Referencing device_response_time and rollback_flag in Exec_log."}Control_optim_prompt={"Please optimize the variable lane control strategy: Input: diagnostic conclusion, current constraint parameters Road_rules, benefit weights {λ, γ}. Optimization tasks: 1. If there is a delay in execution, extend the preparation time t_prepare from 60s to 90s to ensure the device responds; 2. If there are frequent switches, extend the minimum switch interval min_switch_interval from 30s to 45s; 3. If there are constraint conflicts, adjust the benefit evaluation weights (increase λ from 0.4 to 0.5 to enhance queue stability, decrease γ from 0.2 to 0.15 to reduce switch penalties); 4. If there is user confusion, enhance VMS warnings (display 2 minutes in advance, increase font size, add animation); 5. Introduce redundant verification (wait for secondary confirmation from the device after issuing the command before it takes effect). Output: optimized control parameters, constraint adjustment scheme, expected improvement in execution accuracy."}
[0268] Example of a diagnostic and optimization Prompt template based on scenario merging:
[0269] Based on the diagnostic and optimization prompt template for the variable lane scenario: {You are a traffic control system expert and variable lane optimization consultant. Please conduct a comprehensive optimization of the variable lane dynamic control system based on the following integrated diagnostic results.} Input: [Predict_diagnosis Prediction Error Diagnosis][Sensor_diagnosis Data Quality Diagnosis][Control_diagnosis Decision Execution Diagnosis][Envelope_diagnosis Envelope Estimation Diagnosis][External_diagnosis External Event Impact Diagnosis] Task Context Characteristics: [Road Type: Urban Expressway / Highway / Intersection][Flow Pattern: Tidal Flow / Equilibrium Flow / Random Fluctuation][Control Objective: Minimize Delay / Safety Priority / Energy Optimization] Task Requirements: 1. Optimize short-term prediction model parameters and feature engineering to address prediction errors; 2. Supplement sensor data and reassess confidence weights to address missing data; 3. Adjust lane switching constraints and benefit assessment weights to address decision bias; 4. Correct quantile estimation methods to address envelope inaccuracies (e.g., adjust asymmetric proportions q_L / q_R); 5. Establish cross-module collaborative optimization (e.g., prediction uncertainty σ triggers conservative decision-making, sensor failure triggers prediction mode switching); 6. Ensure the optimized system meets safety constraints (switching interval ≥ 30s, emergency lane retention ≥ 3.5m, conflict point = 0). Output: The optimized system configuration (including complete definitions of the prediction model, sensor weights, control parameters, and envelope estimation parameters) and the expected overall improvement rate {Δdelay, Δqueue, Δsafety}.
[0270] Furthermore, to further improve the applicability, robustness, and scalability of this embodiment, the following improvements can be made based on existing technological innovations:
[0271] 1. Multi-timescale prediction and control collaborative mechanism: Based on the single prediction step size of the basic scheme of this invention, it can be extended into a multi-timescale collaborative prediction and control framework. Specifically: ultra-short-term prediction (1-2 minutes) is used for real-time anomaly detection and emergency rollback decision-making, using a lightweight ARIMA or exponential smoothing model to ensure computational latency <10s; short-term prediction (5-15 minutes) is used for routine lane configuration adjustment and signal coordination, using the current LSTM+Holt-Winters hybrid model; medium-term prediction (30-60 minutes) is used for forward-looking resource scheduling and multi-segment coordination, using a graph neural network (GNN) to model road network topology dependencies. The prediction results of the three time scales are weighted and integrated through Bayesian fusion, with the weights dynamically adjusted according to the historical accuracy of each scale, forming a hierarchical decision-making system of "ultra-short-term rapid response + short-term precise control + medium-term strategic planning", improving the system's response speed to sudden traffic fluctuations and its ability to anticipate long-term trends.
[0272] 2. Lane-level trajectory prediction and microscopic simulation verification: Based on the macroscopic density field prediction of the basic scheme of this invention, it can be extended to lane-level microscopic trajectory prediction and digital twin simulation verification. Specifically, for key vehicles (such as large vehicles and vehicles with abnormal driving behavior), the trajectory of the next 3-5 seconds is predicted based on the CTRV motion model + interactive multiple model (IMM), taking into account the lane change intention (judged by turn signals, lateral speed, and distance from lane lines); the predicted trajectory is input into a microscopic traffic simulation engine (such as SUMO, VISSIMAPI) for digital twin verification of the lane configuration scheme, simulating the traffic flow evolution after lane switching in a virtual environment (including driver reaction, lane changing behavior, and queue dissipation), and calculating the simulation delay and collision risk TTC (Time to Collision) distribution; the actual control command is issued only when the simulation verification is passed (delay improvement ≥10% and TTC_min>2s), otherwise the scheme is recalculated or downgraded to a conservative strategy (such as only adjusting signal timing without switching lanes). Microscopic simulation verification can significantly reduce the implementation risk of control schemes and avoid microscopic conflicts or safety hazards caused by macroscopic prediction errors.
[0273] 3. Enhanced root cause diagnosis based on causal inference: Based on the rule tree root cause classification in the basic scheme of this invention, it can be extended to a root cause localization method driven by causal inference. Specifically, the process involves: constructing a causal graph for the traffic control system, where nodes represent observable variables (such as sensor data quality, prediction error, lane configuration, and delay metrics) and latent variables (such as driver behavior patterns and external interference intensity), and edges represent causal relationships (such as "sensor failure → missing data → prediction error → decision-making error → increased delay"). A structural causal model (SCM) and counterfactual reasoning are used to answer the question, "If the sensor had not failed, would the delay have decreased?". The intervention effect is calculated using do-calculus, quantitatively assessing the causal contribution of each root cause to the target metric (such as "sensor failure increases delay by 12%, prediction error increases delay by 5%"). Root causes with high causal contributions are prioritized based on their causal contribution. Causal discovery algorithms (such as PC algorithm and GES algorithm) are introduced to automatically learn the causal graph structure from historical data, reducing the subjectivity of manually defining causal relationships. Causal inference methods can more accurately identify the true root cause (distinguishing between correlation and causation), avoid misjudging related phenomena (such as "delay and weather deterioration at the same time") as causal relationships, and improve the scientific nature of root cause diagnosis and the pertinence of measures.
[0274] 4. User behavior feedback and acceptance modeling: Based on the assumption that the driver fully complies with lane signs, the basic solution of this invention can be extended to driver behavior response modeling and adaptive adjustment of control strategy. Specifically, the process involves: collecting driver responses to lane adjustments via V2X communication (e.g., lane change completion time, compliance rate, and complaint feedback); establishing a behavioral response model (e.g., using a Logit model to predict the probability P_comply of drivers complying with variable lane signs, with influencing factors including VMS warning duration, sign clarity, and historical adjustment frequency); introducing user acceptance constraints during lane plan generation (requiring P_comply ≥ 90%); extending preparation time or enhancing VMS prompts if the predicted acceptance is insufficient (e.g., adding voice announcements and dynamic arrow animations); using Cumulative Prospect Theory (CPT) to model drivers' negative perception of frequent lane changes (loss aversion); adding a user satisfaction item, penalty_dissatisfaction = β × lane change frequency × negative perception weight, to the benefit evaluation; and establishing a user feedback loop by collecting driver satisfaction ratings (1-5 stars) via a mobile app or in-vehicle terminal, marking low-scoring sections as "poor user experience" and triggering strategy review (analyzing whether lane changes are too frequent, signs are unclear, or timing is unreasonable). User behavior modeling can make control strategies more closely resemble real driving scenarios, avoid compromised implementation effects due to idealized assumptions, and improve the social acceptance and long-term sustainability of variable lane systems.
[0275] This embodiment upgrades traditional single-source static detection to a multi-source heterogeneous dynamic fusion system. Through "streaming rasterization—confidence weighting—adaptive trajectory reconstruction," it achieves unified standardization, spatiotemporal alignment, and uncertainty quantification of sensing data. Each data source (video, radar, detector, GPS, etc.) is fused with confidence normalization and dynamic weights to generate a traceable and quantifiable unified trajectory set.
[0276] This embodiment proposes a lane adaptive modeling method based on confidence envelope. Through density raster → mask extraction → skeletonization → asymmetric quantile confidence analysis, it automatically identifies the boundaries of mainstream lanes, achieving dynamic expansion and contraction of lane space and confidence quantification. Unlike static rule or fixed threshold methods, this system adaptively adjusts across spatiotemporal scales, ensuring robustness and interpretability of lane recognition in complex tidal scenarios.
[0277] This embodiment uses confidence prediction to drive lane configuration and signal timing linkage, forming an adaptive control closed loop covering traffic flow prediction, risk assessment, execution monitoring, and root cause analysis. After deviation detection, the system automatically triggers rollback and policy relearning, achieving a paradigm shift from passive response to proactive evolution.
[0278] The urban lane dynamic control method proposed in this embodiment is generally divided into four stages: Stage 1, multi-source traffic perception data preprocessing, transforming heterogeneous perception data into a unified time-series trajectory set with uncertainty representation, reducing deviations caused by "data silos, spatiotemporal misalignment, and lack of confidence". Stage 2, lane modeling based on confidence envelope, transforming the preprocessed trajectory data into a spatial distribution model of lane occupancy, and identifying the main driving areas and confidence ranges at different time periods through statistical analysis. Stage 3, urban lane dynamic scheduling and signal linkage, dynamically generating optimal lane configuration and signal timing schemes based on short-term forecast needs. Stage 4, online evaluation, root cause analysis, and closed-loop optimization, transforming macro-level deviations into micro-level root causes based on predefined interpretable indicators, automatically generating targeted improvement measures, ensuring continuous strategy evolution and model self-learning. This invention, through a complete four-stage closed loop, transforms multi-source traffic perception data into interpretable and optimizable lane management strategies, achieving an intelligent upgrade from passive response to proactive prediction.
[0279] The method proposed in this embodiment differs from existing variable lane control methods in that:
[0280] 1. A multi-source sensing fusion method is proposed to solve the problems of "data heterogeneity and lack of confidence".
[0281] The "streaming rasterization-confidence weighting-adaptive trajectory reconstruction" processing method provided in this embodiment addresses structural problems in traditional methods such as spatiotemporal misalignment, confidence ambiguity, and trajectory fragmentation. Through techniques such as dynamic generation of multi-factor normalized weights, adaptive selection of confidence models and motion models, it makes input data traceable and uncertainty quantifiable, providing a high-quality, low-latency fusion foundation for subsequent flow field identification. Differentiated innovative technologies include: dynamic generation of multi-factor normalized weights, adaptive selection of motion models, and weighted trajectory reconstruction.
[0282] 2. A lane envelope adaptive processing flow is proposed to achieve accurate measurement of lane uncertainty occupancy.
[0283] Unlike rule-based or simple statistical methods, this embodiment employs a hierarchical processing flow: first, effective traffic flow data is dynamically extracted using a local adaptive method; then, the main traffic axis is extracted using an adaptive pruning method; and finally, lane occupancy boundaries are located based on asymmetric processing. This achieves automatic contraction and expansion of lane envelope detection based on traffic flow changes, adapting to dynamic tidal scenarios without manual intervention. Differentiated innovative technologies include: a local adaptive threshold method, asymmetric quantile confidence envelope, and boundary-aware smoothing processing.
[0284] 3. Signal periodic alignment and dynamic tubular region projection enable multi-scale spatiotemporal coordination.
[0285] Unlike traditional methods that use fixed time windows and uniform projection, this embodiment innovatively proposes a signal cycle adaptive alignment mechanism and a dynamic tubular region projection method, addressing the periodic characteristics of urban road signal control and the geometric differences between road segments and intersections. Through signal phase alignment in the time dimension and region type adaptive projection in the spatial dimension, it achieves precise capture of the spatiotemporal characteristics of traffic flow, overcoming the technical bottlenecks of fixed windows failing to adapt to signal cycle changes and uniform projection failing to accommodate complex geometries. The differentiated innovative technologies include: adaptive sliding time window, dynamic tubular region definition, and differentiation between road segment and intersection projection.
[0286] 4. Achieve a dynamic closed loop throughout the entire process of "prediction-decision-execution-monitoring-evaluation".
[0287] This embodiment constructs a complete optimization closed loop through deep collaboration: the prediction stage uses a confidence prediction mechanism to output flow predictions with uncertainty; the decision-making layer dynamically adjusts based on the prediction uncertainty; the execution layer automatically triggers rollback by monitoring deviations in real time; and the evaluation layer introduces a confidence quality assessment method and automatically generates optimization measures through root cause analysis. This invention's self-learning response chain realizes a paradigm shift from "passive response" to "active learning," significantly improving system robustness, security, and continuous evolution capabilities. Differentiated innovative technologies include: confidence prediction mechanism and uncertainty quantification; dynamic decision optimization considering uncertainty; real-time monitoring and automatic rollback mechanism; evaluation system and root cause analysis; and automatic optimization measure generation and iteration.
[0288] In this embodiment, a current lane configuration vector set, i.e., a preliminary candidate lane configuration vector set, is generated based on the time-based lane confidence envelope P(q,t) and road rule constraints. A safety check is performed on the current lane configuration vector set to eliminate schemes that violate road rules, resulting in the target lane configuration vector set (P(q,t) has limited effect at this stage). The expected delay D_est, queue length change ΔQ, and switching cost C_switch for each scheme are calculated based on the traffic prediction Pred(t+Δt). A comprehensive benefit evaluation of the schemes is performed to select the optimal candidate scheme. Finally, the lane control instruction is generated.
[0289] In this embodiment, using time-based lane confidence envelopes and predicted traffic flow as inputs, the optimal lane configuration is searched under road rule constraints to generate lane control instructions. These instructions are then sent to the traffic signal controller via the GeoJSON compatible protocol. Simultaneously, implementation deviations are monitored in real time to ensure that control actions are implemented safely as planned or to quickly revert to normal operation in case of anomalies, achieving a closed-loop control system of "prediction-decision-execution-monitoring".
[0290] The technical solution of this embodiment acquires multi-source traffic perception data; processes the multi-source traffic perception data to obtain a target trajectory set; determines a time-specific lane confidence envelope based on the target trajectory set and lane geometry data; obtains a current feature matrix, wherein the current feature matrix includes at least one of: lag features, envelope features, event features, weather features, and time features; inputs the current feature matrix into a pre-trained traffic flow prediction model to obtain predicted traffic flow; and determines and executes lane control instructions based on the time-specific lane confidence envelope, predicted traffic flow, and road rule constraints, thereby improving the accuracy and efficiency of dynamic lane control.
[0291] Example 2
[0292] Figure 2 This is a schematic diagram of a lane dynamic control device provided in an embodiment of the present invention. This embodiment is applicable to lane dynamic control applications. The device can be implemented using software and / or hardware methods and can be integrated into any device that provides lane dynamic control functionality, such as… Figure 2 As shown, the lane dynamic control device specifically includes: a multi-source traffic perception data acquisition module 210, a target trajectory set generation module 220, a time-based lane confidence envelope determination module 230, a current feature matrix acquisition module 240, a predicted traffic flow determination module 250, and a lane control command determination module 260.
[0293] Among them, the multi-source traffic perception data acquisition module is used to acquire multi-source traffic perception data;
[0294] The target trajectory set generation module is used to process multi-source traffic sensing data to obtain the target trajectory set;
[0295] A time-based lane confidence envelope determination module is used to determine the time-based lane confidence envelope based on the target trajectory set and lane geometry data;
[0296] The current feature matrix acquisition module is used to acquire the current feature matrix, wherein the current feature matrix includes at least one of the following: lag features, envelope features, event features, weather features, and time features;
[0297] The traffic flow prediction module is used to input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow.
[0298] The lane control instruction determination module is used to determine lane control instructions based on time-based lane confidence envelopes, predicted traffic flow, and road rule constraints, and then execute the lane control instructions.
[0299] The above-described products can perform the methods provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for performing the methods.
[0300] Example 3
[0301] Figure 3 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0302] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0303] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0304] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as lane dynamic control methods.
[0305] In some embodiments, the lane dynamic control method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the lane dynamic control method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the lane dynamic control method by any other suitable means (e.g., by means of firmware).
[0306] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0307] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0308] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0309] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0310] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0311] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0312] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0313] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the lane dynamic control method according to any embodiment of the invention.
[0314] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0315] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A lane dynamic control method, characterized in that, include: Acquire multi-source traffic sensing data; The multi-source traffic sensing data is processed to obtain the target trajectory set; Based on the target trajectory set and lane geometry data, determine the time-phased lane confidence envelope; Obtain the current feature matrix, wherein the current feature matrix includes at least one of: lag features, envelope features, event features, weather features, and time features; Input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow; Based on the time-based lane confidence envelope, predicted traffic flow, and road rule constraints, lane control instructions are determined and executed.
2. The method according to claim 1, characterized in that, The multi-source traffic sensing data is processed to obtain a target trajectory set, including: Based on multi-source traffic perception data, determine the time-series vehicle record set; The trajectory interruption points in the time-series vehicle record set are processed to obtain the target trajectory set.
3. The method according to claim 2, characterized in that, The trajectory interruption points in the time-series vehicle record set are processed to obtain the target trajectory set, including: Obtain the discrete point sequence of the same vehicle identifier in the time-series vehicle record set; Based on the time interval between adjacent points, determine the trajectory interruption points in the discrete point sequence; The trajectory is split based on the interruption points to obtain multiple trajectory segments; Based on the predicted location corresponding to each trajectory segment, a set of candidate trajectory segments is generated; Obtain target trajectory segment pairs from the candidate trajectory segment set whose interruption duration is less than a duration threshold, wherein the target trajectory segment pairs include: a first trajectory segment and a second trajectory segment; Determine the average curvature of the target trajectory segment pair based on the trajectory points in the first trajectory segment of the target trajectory segment pair; Based on the average curvature of the target trajectory segment pair, determine the corresponding motion model of the target trajectory segment pair; The target trajectory segment pairs are processed based on the motion model corresponding to the target trajectory segment pairs to obtain the initial trajectory set; The target trajectory set is determined based on the initial trajectory set and the fusion confidence of each trajectory point in the initial trajectory set.
4. The method according to claim 3, characterized in that, Based on the average curvature of the target trajectory segment pair, determine the motion model corresponding to the target trajectory segment pair, including: If the average curvature of the target trajectory segment is less than the first value, then the constant velocity model is used as the motion model for the target trajectory segment. If the average curvature of the target trajectory segment is greater than or equal to the first value and less than the second value, and / or the road type is an intersection type, then the constant acceleration model will be used as the motion model for the target trajectory segment. If the average curvature of the target trajectory segment is greater than or equal to the second value, then the constant speed and constant rotation rate model will be used as the motion model for the target trajectory segment.
5. The method according to claim 1, characterized in that, Based on the target trajectory set and lane geometry data, determine the time-varying lane confidence envelope, including: The target trajectory set and lane geometry data are processed to obtain a space-time grid counting matrix; Determine the binary mask matrix based on the space-time network counting matrix; Based on the binary mask matrix, determine the skeleton curve of the pruned main channel and the branch type of each branch; Based on the target trajectory set, the pruned backbone curve, and the branch type of each branch, determine the station-level lateral offset sample set. Weighted quantiles are calculated on the site-level lateral offset sample set to obtain the width curve; The sampling points of the pruned main channel skeleton curve are smoothly fitted to generate the main axis geometric curve. The time-specific lane confidence envelope is determined based on the principal axis geometry curve and the width curve.
6. The method according to claim 5, characterized in that, Based on the target trajectory set, the pruned backbone curve, and the branch types of each branch, a station-level lateral offset sample set is determined, including: Based on the pruned trunk channel skeleton curve, a Frenet reference system is established. Based on the Frenet reference frame and the branch types of each branch, the trajectory points in the target trajectory set are projected to obtain the projected trajectory point set. The set of projected trajectory points is aggregated to obtain a set of station-level lateral offset samples.
7. The method according to claim 6, characterized in that, Based on the Frenet reference frame and the branch types of each branch, the trajectory points in the target trajectory set are projected to obtain the projected trajectory point set, including: Based on the Frenet reference frame, trajectory points with branch type of road segment are projected to obtain the first projection set; Branches that are of the intersection type and whose branch direction is the inbound direction are designated as the center line of the inbound lane. Calculate the perpendicular distance from the trajectory points within the intersection area to the centerline of each approach lane; The second projection set is determined based on the trajectory points whose perpendicular distance to the centerline of the entrance lane is greater than the first distance; The third projection set is determined based on the trajectory points whose perpendicular distance to the centerline of the entrance road is less than or equal to the first distance; The set of projection trajectory points is determined based on the first projection set, the second projection set, and the third projection set.
8. The method according to claim 5, characterized in that, Based on the binary mask matrix, the pruned main channel skeleton curve and the branch types of each branch are determined, including: The binary mask matrix is transformed into a skeleton curve based on a fast skeletonization algorithm; Identify the branch points and endpoints of the skeleton curve using depth-first search; Starting from each endpoint, perform a depth-first search (DFS) to trace to the nearest branch point or another endpoint, forming a branch; Determine the geometric properties of each branch; Based on the geometric properties of each branch, the skeleton curve is reduced to obtain the pruned trunk channel skeleton curve. Aggregate the branch points whose distance is less than the second distance to obtain the intersection area; Determine the branch type of each branch based on the intersection area.
9. The method according to claim 5, characterized in that, Based on the space-time network counting matrix, determine the binary mask matrix, including: Generate the first matrix based on the first field of the space-time network counting matrix; The first matrix is smoothed to obtain the second matrix; Obtain the neighborhood average density of each grid cell in the second matrix; The threshold for each grid cell is determined based on the average neighborhood density of each grid cell in the second matrix. If the first field of a grid cell in the second matrix is greater than or equal to the threshold of the grid cell, then the grid cell is masked with the first value; if the first field of a grid cell in the second matrix is less than the threshold of the grid cell, then the grid cell is masked with the second value. Determine the binary mask matrix based on the mask of the grid cells in the second matrix.
10. The method according to claim 5, characterized in that, The target trajectory set and lane geometry data are processed to obtain a space-time network counting matrix, including: Generate a grid index matrix based on the lane geometry data; Obtain the cycle of relevant traffic lights for the road section; The starting point of the cycle of the traffic light associated with the road segment closest to the trajectory point is used as the starting time of the window; The window end time is determined based on the window start time and the target window width; The first time period is determined based on the window start time and window end time; Based on the trajectory points in the target trajectory set that are within the first time period, generate time-based data blocks; A time-space grid counting matrix is generated based on the grid index matrix and the time-segmented data blocks.
11. The method according to claim 10, characterized in that, Before determining the window end time based on the window start time and the target window width, the process also includes: Get the base window width; If it is a high-traffic period, the base window width is shortened by the first width to obtain the target window width; If it is a low-traffic period, the base window width is extended by a second width to obtain the target window width.
12. The method according to claim 1, characterized in that, Based on time-based lane confidence envelopes, predicted traffic flow, and road rule constraints, lane control instructions are determined, including: Generate a set of current lane configuration vectors based on the time-based lane confidence envelope; Based on road rule constraints and time-based lane confidence envelopes, the current lane configuration vectors in the current lane configuration vector set are filtered to obtain the target lane configuration vector set; The expected delay, queue length change, and switching cost for each target lane configuration vector in the target lane configuration vector set are determined based on the predicted traffic flow. Based on the expected delay, queue length change, and switching cost of each target lane configuration vector, candidate lane configuration vectors are obtained by filtering each target lane configuration vector in the target lane configuration vector set. Lane control instructions are generated based on candidate lane configuration vectors.
13. A lane dynamic control device, characterized in that, include: The multi-source traffic sensing data acquisition module is used to acquire multi-source traffic sensing data; The target trajectory set generation module is used to process multi-source traffic sensing data to obtain the target trajectory set; A time-based lane confidence envelope determination module is used to determine the time-based lane confidence envelope based on the target trajectory set and lane geometry data; The current feature matrix acquisition module is used to acquire the current feature matrix, wherein the current feature matrix includes at least one of the following: lag features, envelope features, event features, weather features, and time features; The traffic flow prediction module is used to input the current feature matrix into the pre-trained traffic flow prediction model to obtain the predicted traffic flow. The lane control instruction determination module is used to determine lane control instructions based on time-based lane confidence envelopes, predicted traffic flow, and road rule constraints, and then execute the lane control instructions.
14. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the lane dynamic control method according to any one of claims 1-12.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the lane dynamic control method according to any one of claims 1-12.
16. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the lane dynamic control method according to any one of claims 1-12.