A traffic signal adaptive timing method, system and medium

By using cameras and edge computing devices in the traffic signal system to identify and calculate vehicle types and optimize green light time allocation, the problem of existing systems being unable to respond to traffic flow changes in real time is solved, and the relevance and robustness of the traffic signal system are improved.

CN122493674APending Publication Date: 2026-07-31SUZHOU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU UNIV OF SCI & TECH
Filing Date
2026-05-07
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing traffic signal control systems cannot respond to changes in traffic flow in real time or distinguish vehicle types, leading to wasted traffic resources and traffic congestion.

Method used

Using standard road surveillance cameras and edge computing devices, the YOLO target detection model is used to identify vehicle categories. Combined with multi-target tracking algorithms, the phase control load is calculated to perform linear allocation of green light time, environmental correction, and constraint pruning, thereby achieving signal cycle redistribution and smooth execution.

Benefits of technology

It enables detailed counting of different vehicle types, ensures smooth passage in bottleneck directions, avoids excessive compression of critical phases, and improves the targeting and robustness of the traffic signal system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122493674A_ABST
    Figure CN122493674A_ABST
Patent Text Reader

Abstract

This invention provides a traffic signal adaptive timing method, system, and medium. The method includes: calculating the phase control load; linearly allocating the phase control load within a preset phase green light time interval based on the proportional distribution of the phase control load to obtain a first green light time; correcting the first green light time based on environmental factors to obtain a second green light time; trimming the second green light time within a joint constraint interval to obtain a third green light time; calculating the signal period C; if C is within [C_min, C_max], generating a timing scheme; otherwise, calculating the available adjustment time flex(p); allocating the adjustment difference to different phases based on flex(p) to obtain a fourth green light time; controlling the change in the green light time of the same phase within adjacent signal periods to not exceed the maximum allowable change to obtain a fifth green light time; and generating a traffic signal timing scheme based on the obtained green light time of each phase.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of traffic control, and in particular to a method, system and medium for adaptive timing of traffic signals. Background Technology

[0002] Existing traffic signal control systems typically employ one of the following methods: 1) Fixed timing scheme: Phases are switched cyclically according to a preset schedule, which cannot respond to real-time traffic flow changes. During peak hours, some directions are excessively congested while other directions have green lights, resulting in wasted traffic resources; 2) Geomagnetic coil induction control: Geomagnetic coils buried in the road surface detect the presence of vehicles, but can only obtain binary information of vehicle presence / absence, and cannot distinguish vehicle types. However, buses and heavy trucks occupy far more traffic capacity than cars (actually occupying 2.5 to 3 times the traffic capacity of cars), but the coils cannot detect this difference; 3) Adaptive control scheme based on traffic demand intensity: This type of scheme can calculate the standard vehicle number and traffic demand intensity based on different vehicle types, and can also readjust the green light duration of each phase when the cycle exceeds the limit. Some schemes also incorporate weather conditions as a timing reference factor into the control process. This type of scheme has made significant progress compared to fixed timing, but it usually remains at the level of "demand intensity assessment" and "cycle threshold judgment", and has not yet formed a complete and executable timing chain suitable for direct deployment on visual edge control devices.

[0003] It should be noted that the above introduction to the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions of this application and facilitating understanding by those skilled in the art. It should not be assumed that these technical solutions are known to those skilled in the art simply because they have been described in the background section of this application. Summary of the Invention

[0004] The purpose of this invention is to provide a traffic signal adaptive timing method, system, and medium that can be implemented with only standard road monitoring cameras and edge computing devices, and to construct a complete timing chain from visual perception, load refinement, phase control load formation, period boundary redistribution to smooth execution.

[0005] To address the aforementioned issues, firstly, an adaptive traffic signal timing method is provided, comprising the following steps: S1. Calculate the phase control load L_phase(p) for each phase based on the acquired road video data, where the phase control load L_phase(p) is the maximum value of the passenger vehicle load in each approach direction contained in the phase; S2. Based on the proportional distribution of the phase control load L_phase(p) for each phase, linearly allocate it within the preset phase green light time interval [G_min_phase(p), G_max_phase(p)] to obtain the first green light time G_1(p) for each phase; S3. Based on environmental factors, the first green light time G_1(p) of each phase is corrected to obtain the corresponding second green light time G_2(p); S4. Set a joint constraint interval [lower(p), upper(p)], and perform a clipping process on the second green light time G_2(p) based on the joint constraint interval [lower(p), upper(p)] to obtain the third green light time G_3(p), where the third green light time G_3(p) = clamp(G_2(p), lower(p), upper(p)), and clamp() is the clipping function; S5. Calculate the signal period C and compare it with the preset period constraint interval [C_min, C_max]. If the signal period C is within the period constraint interval [C_min, C_max], proceed to step S7; otherwise, calculate the available adjustment time flex(p) for each phase using the following formula: δ_total=current_green_total-target_green_total; target_green_total=C_target-Σ_p(T_yellow(p)+T_allred(p)); current_green_total=C-Σ_p(T_yellow(p)+T_allred(p)); S6. Based on the available adjustment time flex(p) of each phase, allocate the adjustment difference δ_total to the third green light time G_3(p) of different phases, and perform boundary freezing when the third green light time G_3(p) of any phase touches the boundary of the joint constraint interval [lower(p), upper(p)], so that the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], and obtain the fourth green light time G_4(p); S7. Controlling the change in green light time of the same phase within adjacent signal cycles to not exceed the maximum allowable change δ_max, the fifth green light time G_5(p) is obtained. The calculation formula for the fifth green light time G_5(p) is as follows: δ_max = α × G_prev(p) Where α is a preset ratio and G_prev(p) is the actual green light time of the same phase in the previous signal cycle. S8. Generate a traffic signal timing plan based on the obtained green light time of each phase.

[0006] In step S1, the process of calculating the phase control load L_phase(p) of each phase includes: using the YOLO object detection model to identify the category of each vehicle in the road video data; assigning a unique tracking identification number to each vehicle through a multi-object tracking algorithm, and confirming the import direction to which the vehicle belongs by crossing the virtual detection line with the vehicle trajectory; taking the sum of the equivalent coefficients of the vehicles corresponding to each tracking identification number in the same import direction as the passenger car load in the corresponding import direction, and each tracking identification number is only accumulated once in the same import direction; taking the maximum value of the passenger car loads in each import direction included in each phase as the phase control load L_phase(p) of the corresponding phase.

[0007] The categories of the vehicles include cars, buses, light trucks, heavy trucks, special vehicles, bicycles and pedestrians; the identification process of the light trucks and the heavy trucks includes: using the YOLO object detection model to identify the trucks in the road video data; judging whether the ratio of the detection frame area of the truck to the area of the video frame where it is located is greater than a preset threshold, if so, it is identified as a heavy truck, if not, it is identified as a light truck.

[0008] It also includes: detecting the joint constraint interval [lower(p), upper(p)], if upper(p) < lower(p), then retreat to the phase green light time interval [G_min_phase(p), G_max_phase(p)], and continue to generate a timing plan based on the retreated phase green light time interval [G_min_phase(p), G_max_phase(p)].

[0009] In step S2, the calculation formula of the first green light time G_1(p) is: G_1(p) = G_min_phase(p) + [L_phase(p) / L_max] × [G_max_phase(p) - G_min_phase(p)]; where G_min_phase(p) is the preset minimum green light time of each phase, G_max_phase(p) is the preset maximum green light time of each phase, L_phase(p) is the phase control load of each phase, and L_max is the maximum value of all phase control loads.

[0010] In step S3, the second green light time G_2(p) = G_1(p) × F_env, where F_env is a preset environmental correction factor. Step S3 also includes: detecting whether each phase contains a pedestrian sub-phase and detecting whether the pedestrian sub-phase has a pedestrian waiting request. When the pedestrian sub-phase exists and a pedestrian waiting request exists, the calculation formula for the second green light time G_2(p) is as follows: T_ped_min = T_ped_green + T_ped_flash; where T_ped_min is the minimum crossing time for pedestrians, T_ped_green is the green light time for pedestrians, and T_ped_flash is the flashing green light time.

[0011] In step S4, the joint constraint interval [lower(p), upper(p)] is: lower(p)=max(G_min_phase(p),G_min)+T_green_ext; upper(p) = min(G_max_phase(p), G_max); where G_min is the global minimum green light time, G_max is the global maximum green light time, and T_green_ext is the minimum green light extension time.

[0012] In step S6, the process of obtaining the fourth green light time G_4(p) includes: S61, calculating the adjustment value share(p) for each phase sequentially, wherein the adjustment value share(p) = δ_residual × flex(p) / Σflex(p), where δ_residual is the remaining difference to be allocated in the current iteration round, and the initial value of δ_residual is equal to the difference to be adjusted δ_total; S62, allocating the adjustment value share(p) to the third green light time G_3(p) of each phase accordingly, thereby obtaining the adjusted green light time; S63, if the adjusted green light time is located within the joint constraint interval [lower(p), upper(p)], the adjusted green light time is used as the fourth green light time G_4(p) for the corresponding phase; otherwise, proceed to step S64; S64 S65. The boundary value in the joint constraint interval [lower(p), upper(p)] that has a smaller difference from the adjusted green light time is taken as the fourth green light time of the corresponding phase, and the adjustment value share(p) of the remaining phase is recalculated; S66. The recalculated adjustment value share(p) is assigned to the third green light time G_3(p) of the remaining phase to obtain the adjusted green light time; S67. If the adjusted green light time is located within the joint constraint interval [lower(p), upper(p)], the adjusted green light time is taken as the fourth green light time G_4(p) of the corresponding phase; otherwise, step S68 is executed; S69. Steps S64 to S66 are repeated iteratively until |δ_residual|≤ε or the number of iterations reaches N+2 rounds, where ε is the convergence threshold and N is the number of phases.

[0013] Secondly, this application also provides a traffic signal adaptive timing system, comprising: The camera module is used to acquire road video data; An edge computing module is used to execute a traffic signal adaptive timing method as described in any one of the first aspects.

[0014] Thirdly, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a traffic signal adaptive timing method according to any one of the first aspects.

[0015] Compared with the prior art, the beneficial effects of the present invention mainly include the following: 1) By automatically subdividing the light and heavy loads of trucks and deduplicating the trajectory count, the differences in traffic capacity within truck categories can be further quantified, and load distortion caused by repeated counting of the same target can be avoided; 2) By taking the load of the maximum release direction within the phase as the control load, the bottleneck direction in the same release phase is guaranteed to receive sufficient green light protection, and the timing is improved; 3) By redistributing the available adjustment space ratio and using the boundary freezing method under joint constraints, a scheme that still meets the boundary conditions can be output when the cycle exceeds the limit, and the critical phase can be avoided from being over-compressed; 4) By setting up cross-cycle smooth execution and automatic rollback process for constraint infeasibility, the calculated target value can be stably converted into an executable scheme on site, suppressing sudden changes and improving the robustness of continuous operation. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the specific embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 The timing flowchart provided by this invention.

[0018] Figure 2 This is a schematic diagram illustrating the automatic classification of light and heavy trucks provided by the present invention.

[0019] Figure 3 The flowchart for the periodic constraint adaptive scaling provided by the present invention.

[0020] Figure 4 This is a schematic diagram of a smooth transition across cycles provided by the present invention.

[0021] Figure 5 The flowchart for runtime constraint feasibility normalization provided by this invention.

[0022] Figure 6 The system architecture diagram provided by this invention. Detailed Implementation

[0023] The foregoing and other technical contents, features, and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the accompanying drawings. The directional terms mentioned in the following embodiments, such as up, down, left, right, front, or back, are merely for reference to the accompanying drawings. Therefore, the directional terms used are for illustrative purposes and not for limiting the present invention.

[0024] The embodiments of this application will now be described in detail with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the embodiments of this application to facilitate a better understanding of the application. However, the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments.

[0025] Example 1 This invention provides a method, system, and medium for adaptive traffic signal timing. Please refer to the following references. Figures 1 to 6 As shown. Figure 1 The diagram shows a flowchart of a traffic signal adaptive timing method according to this embodiment. In Embodiment 1, a traffic signal adaptive timing method is first provided, including the following steps: calculating the phase control load L_phase(p) for each phase based on acquired road video data; linearly allocating the phase control load L_phase(p) within a preset phase green light time interval [G_min_phase(p), G_max_phase(p)] based on the proportional distribution of each phase's phase control load L_phase(p) to obtain the first green light time G_1(p) for each phase; correcting the first green light time G_1(p) for each phase based on environmental factors to obtain the corresponding second green light time G_2(p); setting a joint constraint interval [lower(p), upper(p)], and cropping the second green light time G_2(p) based on the joint constraint interval [lower(p), upper(p)] to obtain the third green light time. G_3(p); Calculate the signal period C and compare it with the preset period constraint interval [C_min, C_max]: If the signal period C is within the period constraint interval [C_min, C_max], directly generate the traffic signal timing scheme; otherwise, calculate the available adjustment time flex(p) for each phase; Based on the available adjustment time flex(p) for each phase, allocate the adjustment difference δ_total to the third green light time G_3(p) for different phases, and make the adjusted green light time within the joint constraint interval [lower(p), upper(p)] to obtain the fourth green light time G_4(p); Control the change in the green light time of the same phase within adjacent signal periods to not exceed the maximum allowable change δ_max to obtain the fifth green light time G_5(p); Based on the obtained green light time for each phase, generate the traffic signal timing scheme.

[0026] The adaptive traffic signal timing method in this embodiment does not directly map a detection quantity to a green light time. Instead, it converges layer by layer around "load formation, bottleneck extraction, boundary-based solution, cycle redistribution, and execution smoothing." Before the end of each signal cycle, the system performs a complete solution for the next cycle's scheme. (Reference) Figure 1 As shown, the specific process is as follows: Step 1: Calculate the phase control load L_phase(p) for each phase based on the acquired road video data; First, directional load statistics and deduplication are performed. In this invention, "entry direction" refers to an independent traffic flow direction on a specific entry lane of an intersection (e.g., "east entry straight" or "south entry left turn"). It can be understood that a standard four-phase intersection typically includes eight entry directions (i.e., straight and left turns in each of the four cardinal directions). Right-turning vehicles that are normally parked (i.e., not controlled by signals) are not included in the directional load; however, if right turns are also controlled by signals, they can be counted as an independent direction.

[0027] Specifically, in this embodiment, the YOLO object detection model is first used to identify the category of each vehicle in the road video data; a multi-object tracking algorithm (such as DeepSORT) is used to assign a unique tracking identifier (also known as a tracking ID) to each vehicle, and the intersection of the virtual detection line and the tracking trajectory is used to determine the approach direction of the vehicle; finally, the sum of the equivalent coefficients of different categories of vehicles in the same approach direction is used as the passenger vehicle load in the corresponding approach direction. Each tracking ID is counted only once in the same approach direction to prevent duplicate counting caused by vehicles lingering near the detection line.

[0028] It should be noted that this invention uses passenger vehicle load to perform weighted statistics on different vehicle types, transforming heterogeneous traffic flow into a unified load index. As mentioned above, vehicle type identification can be achieved using existing YOLO deep learning object detection models (such as YOLOv5 or YOLOv8). These models are pre-trained on public datasets such as COCO and can simultaneously identify six major categories of traffic participants: cars (car, ID=0), buses (bus, ID=1), trucks (truck, ID=2), special vehicles (such as fire trucks, ID=3), bicycles (bicycle, ID=4), and pedestrians (person, ID=5). The object detection capability of the YOLO model is a mature existing technology. The innovation of this invention lies not in the detection model itself, but in mapping the detection results to a unified load quantification index through the following equivalent coefficient (also known as the PCU coefficient), and further automatically subdividing trucks into light and heavy load categories, as detailed below: Cars: YOLO category ID is 0; PCU coefficient is 1.0; Bus: YOLO category ID is 1; PCU coefficient is 2.5; Light trucks: YOLO category ID is 2; PCU coefficient is 2.0; Heavy-duty trucks: YOLO category ID is 2; PCU coefficient is 3.0; Special vehicles: YOLO category ID is 3; PCU coefficient is 1.0; Bicycle: YOLO category ID is 4; PCU coefficient is 0.2; Pedestrian: YOLO category ID is 5; PCU coefficient is 0.1; like Figure 2 As shown, in this embodiment, the light and heavy types of trucks are further automatically subdivided. Specifically, the basic principle is to distinguish between light and heavy trucks by comparing the proportion of the detection box area to the entire frame with a preset threshold (e.g., 0.15), and assign different standard vehicle equivalent coefficients (e.g., 2.0 or 3.0) accordingly. This method utilizes the principle of perspective projection: under the same camera viewpoint, heavy trucks, due to their larger size, have a significantly higher proportion of their detection boxes in the image than light trucks. Therefore, trucks with a proportion greater than the preset threshold can be identified as heavy trucks, and trucks with a proportion less than or equal to the preset threshold can be identified as light trucks. In this embodiment, the threshold of 0.15 is based on the typical road monitoring camera installation angle (elevation angle 15°-30°, height 5-8 meters). The corresponding pseudocode implementation flow is given below: Input: bounding box bbox = (x1, y1, x2, y2), frame size (H, W) box_area = (x2 - x1) × (y2 - y1) frame_area = H × W area_ratio = box_area / frame_area Judgment rules: If area_ratio > 0.15 → Heavy trucks, PCU = 3.0 If area_ratio ≤ 0.15 → light truck, PCU = 2.0 In this embodiment, the direction of vehicle entry is determined by the intersection of the virtual detection line and the tracking trajectory. The passenger vehicle load L(d) in the current signal cycle is obtained by accumulating the PCU coefficients of each vehicle. Specifically, L(d) = M_time × Σ_i PCU(vehicle_type_i) (i ∈ vehicles crossing the detection line in direction d); where: L(d) is the passenger vehicle load in the current signal cycle in direction d; PCU(vehicle_type_i) is the PCU coefficient corresponding to the i-th vehicle crossing the virtual detection line in direction d (e.g., 1.0 for cars, 2.5 for buses, etc.); Σ_i represents the summation of all vehicles that have crossed the detection line in this direction; M_time is the load multiplier for the current time period (1.2 for morning / evening peak hours, 1.0 for off-peak hours, and 0.8 for nighttime).

[0029] In this embodiment, the time period dimension indirectly affects timing allocation through the load multiplier M_time. The load multiplier is used in the directional load statistics in this step to amplify the load difference between directions during peak hours, allowing high-load directions to receive a more favorable green light allocation; and to reduce the load difference at night, shortening the overall cycle. The load multipliers corresponding to each time period are as follows: 1. Morning rush hour: Time range is 07:00-09:00; Load multiplier is 1.2; Its function is to amplify the load difference between directions and increase the green light tilt. 2. Evening Peak Hour: Time range is 17:00-19:00; Load multiplier is 1.2; Amplify load differences between directions, increase green light tilt; 3. Off-peak period: Time range is 09:00-17:00; Load multiplier is 1.0; Function is normal load distribution; 4. Nighttime: Time range is 22:00-06:00; Load multiplier is 0.8; Function is to shorten the overall cycle and reduce waiting time.

[0030] In this embodiment, the determination of the vehicle's crossing direction is achieved through "virtual detection lines." Virtual detection lines are a set of line segments pre-configured in the camera's view, each corresponding to an entrance direction (e.g., "East entrance straight-through detection line," "South entrance left-turn detection line"). The position and orientation of the line segments are determined based on the actual lane layout of the intersection. When YOLO detects a vehicle, a multi-target tracking algorithm (such as DeepSORT) assigns it a unique tracking ID and records the vehicle's center point position in consecutive frames to form a motion trajectory. In each frame, the system takes the trajectory points p1 and p2 from the two most recent frames of the vehicle to form a trajectory segment p1→p2, and then determines whether this trajectory segment intersects with a virtual detection line c→d. The intersection determination uses the two-dimensional vector cross product method, with the following steps: For the trajectory segment p1→p2 and the detection line c→d, calculate four cross product values ​​respectively: d1 = cross(cd, cp1) = (dx-cx)×(p1.yc.y) - (dy-cy)×(p1.xc.x); d2 = cross(cd, cp2), calculated in the same way as above, replacing p1 with p2; d3 = cross(p1p2, p1c), performing the cross product of p2 and c with p1 as the origin; d4 = cross(p1p2, p1d), performing the cross product of p2 and d with p1 as the origin. The intersection condition is: sign(d1)≠sign(d2) and sign(d3)≠sign(d4), that is, the two endpoints of the trajectory segment are on opposite sides of the detection line, and the two endpoints of the detection line are also on opposite sides of the trajectory segment. If this condition is met, it is determined that the vehicle has crossed the detection line in that direction. The cross product method is a standard algorithm in computational geometry for determining whether two line segments intersect. It has a computational complexity of O(1), does not rely on floating-point division, and has good numerical stability. The calculation process is represented by the following pseudocode: For trajectory segment p1→p2 and detection line c→d: d1 = cross(c, d, p1) d2 = cross(c, d, p2) d3 = cross(p1, p2, c) d4 = cross(p1, p2, d) Intersection condition: sign(d1) ≠ sign(d2) and sign(d3) ≠ sign(d4) In this embodiment, each tracking ID is counted only once in the same import direction to prevent duplicate counting.

[0031] After completing the passenger vehicle load calculation for each import direction, phase bottleneck load extraction is required to obtain the phase control load L_phase(p) for each phase. It should be understood that a release phase typically includes two or more import directions that can be released simultaneously (e.g., "Phase 1" simultaneously releases "East Import Straight Through" and "West Import Straight Through," i.e., includes two import directions). Therefore, this step involves merging the passenger vehicle loads L(d) obtained above for each import direction according to their respective release phases. The merging method is as follows: the maximum value of the passenger vehicle loads in all import directions within the same phase is taken as the phase control load L_phase(p) for that phase, i.e., L_phase(p) = max{L(d) | d ∈ phase p}.

[0032] In this embodiment, a simple summation or averaging method is not used. This design aims to ensure that the bottleneck direction (i.e., the direction with the highest traffic pressure) within a phase receives sufficient green light protection, preventing high-load directions from being diluted by low-load directions within the same phase. This is because green light time is uniformly controlled by the phase, and all directions within a phase share the same green light time. Therefore, green light allocation must be based on the direction with the highest load (i.e., the bottleneck direction) to ensure that this direction receives sufficient passage time. If an average is taken, the bottleneck direction will not receive sufficient green light protection due to the "dilution" by low-load directions. For example, in phase 1, if the straight-through load at the east entrance is 20 PCU and the straight-through load at the west entrance is 8 PCU, then the control load for phase 1 should be 20 PCU to ensure that the straight-through traffic at the east entrance receives sufficient green light protection.

[0033] Step 2: Based on the proportional distribution of the phase control load L_phase(p) for each phase, linearly allocate it within the preset phase green light time interval [G_min_phase(p), G_max_phase(p)] to obtain the first green light time G_1(p) for each phase; Specifically, within the range of the preset minimum green light time G_min_phase(p) and the preset maximum green light time G_max_phase(p) for each phase, linear interpolation is performed based on the ratio of the phase control load L_phase(p) to generate the first green light time G_1(p). The specific calculation formula for the first green light time G_1(p) is as follows: G_1(p) = G_min_phase(p) + [L_phase(p) / L_max] × [G_max_phase(p) - G_min_phase(p)]; where G_1(p) is the first green light time (seconds); G_min_phase(p) is the minimum green light time for phase p (preset by the signal scheme, e.g., 15 seconds); G_max_phase(p) is the maximum green light time for phase p (preset by the signal scheme, e.g., 90 seconds); L_phase(p) is the phase control load of phase p; L_max is the maximum value among all phase control loads, i.e., L_max = max{L_phase(p) | p ∈ all phases}. This ensures that the phase with the largest phase control load receives the maximum green light time, while the phase with zero phase control load still receives the minimum green light guarantee, and the remaining phases are linearly distributed between the minimum and maximum according to the proportion of their phase control loads.

[0034] Step 3: Correct the first green light time G_1(p) for each phase based on environmental factors to obtain the corresponding second green light time G_2(p); In this embodiment, environmental factors are incorporated into the adaptive timing of traffic signals. Specifically, the first green light time G_1(p) of each phase can be amplified using a preset environmental correction factor F_env, i.e., G_2(p) = G_1(p) × F_env, to obtain the corresponding second green light time G_2(p).

[0035] In this embodiment, the environmental correction factor F_env is calculated only based on the weather dimension. Specifically, F_env = 1.0 + (T_yellow_ext + T_allred_ext) / 10.0; where F_env is the environmental correction factor (dimensionless), which is 1.0 for sunny days and greater than 1.0 for inclement weather; the yellow light extension time T_yellow_ext is the additional time (in seconds) required for the yellow light to extend under the current weather conditions; the all-red light extension time T_allred_ext is the additional time (in seconds) required for the all-red light to extend under the current weather conditions; and the denominator 10.0 is a normalization constant. The environmental correction factor F_env is preset and can be obtained by looking up a table during the calculation process. A specific setting example is shown below: 1. Sunny day: T_yellow_ext is 0; T_allred_ext(s) is 0; T_green_ext is 0; F_env is 1.0; 2. Light rain: T_yellow_ext is 1; T_allred_ext is 1; T_green_ext is 0; F_env is 1.2; 3. Heavy rain: T_yellow_ext is 2; T_allred_ext is 2; T_green_ext is 5; F_env is 1.4; 4. Foggy weather: T_yellow_ext is 2; T_allred_ext is 3; T_green_ext is 8; F_env is 1.5; 5. Snowfall: T_yellow_ext is 2; T_allred_ext is 3; T_green_ext is 5; F_env is 1.5; 6. Freezing: T_yellow_ext is 3; T_allred_ext is 4; T_green_ext is 10; F_env is 1.7.

[0036] In this embodiment, weather conditions not only affect the environmental correction factor but also adjust the safety parameters of the traffic lights, specifically as follows: 1. Yellow light extension time T_yellow_ext: Increases driver reaction and braking time; 2. All-red light extension time T_allred_ext: Increases intersection clearance margin; 3. Minimum green light extension time T_green_ext: Ensures the shortest passage time under adverse conditions. These safety parameter adjustments can be independent of the green light time allocation process in the timing calculation. Specifically, when the system receives a change in weather conditions, it looks up the corresponding T_yellow_ext, T_allred_ext, and T_green_ext values ​​and then directly writes these extensions into the timing register of the traffic light state machine. For example, in heavy rain, the yellow light phase executed by the state machine at each phase transition is extended from the baseline 3 seconds to 3+2=5 seconds, and the all-red phase is extended from the baseline 2 seconds to 2+2=4 seconds. This adjustment does not require re-triggering the timing calculation but takes effect independently at the state machine level.

[0037] In summary, in this embodiment, environmental factors are not used in isolation as separate empirical correction items, but rather work together through the following three paths: (1) F_env is used to amplify the green light time of each phase to compensate for the decrease in vehicle speed; (2) T_green_ext is used to increase the minimum green light constraint of each phase to ensure safe passage time (see below for details); (3) the yellow light and all-red light time is directly extended through the state machine to increase the clearance margin of the intersection.

[0038] In addition, this section may also include pedestrian protection procedures. First, it checks whether each phase contains a pedestrian sub-phase and whether there is a pedestrian waiting request within that sub-phase. If a phase contains a pedestrian sub-phase and the system detects a pedestrian waiting request, it checks whether the green light time for that phase is not less than the minimum pedestrian crossing time T_ped_min (determined by the sum of the pedestrian green light time T_ped_green and the green flash time T_ped_flash, i.e., T_ped_min = T_ped_green + T_ped_flash). If it is insufficient, the green light time is increased to T_ped_min. The formula for calculating the second green light time G_2(p) at this point is as follows: T_ped_min=T_ped_green+T_ped_flash; Where T_ped_min is the minimum crossing time for pedestrians, T_ped_green is the green light time for pedestrians, and T_ped_flash is the flashing green light time.

[0039] It is understandable that this pedestrian protection process is conditionally executed: it is triggered only when the phase contains a pedestrian sub-phase and there is a pedestrian request signal; if there is no pedestrian demand, the process is skipped.

[0040] Step 4: Set the joint constraint interval [lower(p), upper(p)], and prune the second green light time G_2(p) based on the joint constraint interval [lower(p), upper(p)] to obtain the third green light time G_3(p); In this embodiment, the joint constraint interval [lower(p), upper(p)] is the intersection of two types of constraints. The first type is "phase-inherent constraints," which are the minimum green light time G_min_phase(p) and maximum green light time G_max_phase(p) preset for each phase during signal scheme design (for example, the inherent constraint for phase 1 can be [15s, 90s]), and these values ​​remain unchanged during operation. The second type is "runtime constraints," which are the global minimum green light time G_min and global maximum green light time G_max that can be dynamically adjusted by administrators during system operation (for example, they can be set to [15s, 90s]) to adapt to needs such as temporary traffic control. Thus, the joint constraint interval [lower(p), upper(p)] is specifically as follows: lower(p)=max(G_min_phase(p),G_min)+T_green_ext; upper(p)=min(G_max_phase(p), G_max).

[0041] Next, the second green light time G_2(p) is clipped based on the joint constraint interval [lower(p), upper(p)] to obtain the third green light time G_3(p). The clipping process is: G_3(p) = clamp(G_2(p), lower(p), upper(p)), where clamp() is the clipping function. The clamp() function is an existing function whose operation is to output the value of G_2(p) when the input G_2(p) is within the joint constraint interval [lower(p), upper(p)]; when the input G_2(p) is greater than upper(p), the output value is equal to upper(p); and when the input G_2(p) is less than lower(p), the output value is equal to lower(p).

[0042] To ensure that the shortest green light time for each phase is sufficient for vehicles to safely start and pass through the intersection under severe weather conditions, the minimum green light time for each phase can be adjusted according to the weather conditions. This is achieved by adding the minimum green light extension time T_green_ext to the minimum green light constraint of each phase. The adjusted minimum green light time for each phase is then G_min_effective(p) = G_min_phase(p) + T_green_ext.

[0043] Step 5: Calculate the signal period C and the available adjustment time flex(p); First, calculate the signal period C. The signal period can be understood as the total time it takes for each phase to complete one full cycle in a predetermined order, including the sum of the green light time, yellow light time, and all-red light time for all phases. That is, the signal period C = Σ_p[G_3(p) + T_yellow(p) + T_allred(p)], where T_yellow(p) and T_allred(p) are the yellow light time and all-red light time for phase p, respectively.

[0044] Afterwards, refer to Figure 3 As shown, the signal period C at this time is compared with the preset period constraint interval [C_min, C_max] (for example, it can be set to [60s, 180s]). If the signal period C is within the period constraint interval [C_min, C_max], the timing scheme is directly generated and output. If the signal period C exceeds the system's preset period constraint interval [C_min, C_max], it is necessary to calculate the available adjustment time flex(p) for each phase and then scale the green light for each phase to provide a quantitative basis for subsequent readjustment of the timing scheme.

[0045] Specifically, the calculation process of the available adjustment time flex(p) includes: First, calculate the total target green light duration target_green_total and the total current green light duration current_green_total; where, target_green_total = C_target - Σ_p(T_yellow(p) + T_allred(p)), and the target cycle boundary C_target is C_min (when C < C_min) or C_max (when C > C_max); current_green_total = C - Σ_p(T_yellow(p) + T_allred(p)). Then calculate the adjustment difference to be made δ_total, δ_total = current_green_total - target_green_total. Subsequently, calculate the available adjustment space flex(p) for each phase within the joint constraint interval [lower(p), upper(p)]: If reduction is required (δ_total > 0), flex(p) = G_3(p) - lower(p), that is, the margin of the current green light value from the lower bound; if increase is required (δ_total < 0), flex(p) = upper(p) - G_3(p), that is, the margin of the current green light value from the upper bound.

[0046] Step 6: Allocate the adjustment difference to be made δ_total to different phases based on the available adjustment time flex(p) for each phase, and make the adjusted green light time fall within the joint constraint interval [lower(p), upper(p)] to obtain the fourth green light time G_4(p); When the signal period C exceeds the constraint [C_min, C_max], this invention does not employ simple proportional compression, nor does it merely remain at the abstract level of "readjusting according to the principle of equal saturation." Instead, it adopts a proportional redistribution method based on available adjustment space and boundary freezing. The adjustment difference δ_total is distributed according to the proportion of the available adjustment space flex(p) calculated in step 5 for each phase. The distribution formula is: share(p) = δ_residual × flex(p) / Σflex, where δ_residual is the remaining difference to be distributed in the current iteration round, and its initial value is equal to the adjustment difference δ_total. If the green light value of a phase after distribution touches the boundary (lower(p), upper(p)) of its joint constraint interval [lower(p), upper(p)], then that phase is fixed at the boundary value, and the remaining difference that has not been distributed is carried over to the next round, continuing iterative distribution only among the remaining unfixed phases. The iteration terminates when |δ_residual| ≤ ε (convergence threshold, default 0.1 seconds) or when the number of iterations reaches N+2 (N is the number of phases).

[0047] Specifically, the process of obtaining the fourth green light time G_4(p) includes: Step 61: Calculate the adjustment value share(p) for each phase sequentially; Step 62: Assign the adjustment value share(p) to the third green light time G_3(p) of each phase to obtain the adjusted green light time; Step 63: If the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], use the adjusted green light time as the fourth green light time G_4(p) for the corresponding phase; otherwise, proceed to step 64. Step 64: Take the boundary value in the joint constraint interval [lower(p), upper(p)] that has a smaller difference from the adjusted green light time as the fourth green light time of the corresponding phase, and recalculate the adjustment value share(p) of the remaining phases. Step 65: Allocate the recalculated adjustment value share(p) to the third green light time G_3(p) of the remaining phase to obtain the adjusted green light time. Step 66: If the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], use the adjusted green light time as the fourth green light time G_4(p) for the corresponding phase; otherwise, proceed to step 67. Step 67: Repeat steps 64 to 66 iteratively until |δ_residual|≤ε or the number of iterations reaches N+2, where ε is the convergence threshold and N is the number of phases.

[0048] The following numerical examples illustrate the above iterative process. Assume a 4-phase intersection, with current green light durations for each phase being G = [50, 40, 35, 30] seconds, yellow light durations for each phase being 3 seconds, and all-red light durations being 2 seconds. The current signal cycle is C = (50 + 40 + 35 + 30) + 4 × (3 + 2) = 175 seconds. If C_max = 160 seconds, the target total green light duration is 160 - 20 = 140 seconds, requiring a reduction of δ_total = 155 - 140 = 15 seconds. Assuming the lower bound of each phase constraint is lower = [15, 15, 15, 15] seconds, the reduction space for each phase is flex = [50 - 15, 40 - 15, 35 - 15, 30 - 15] = [35, 25, 20, 15] seconds, Σflex = 95 seconds. In the first round, the load is proportionally allocated: Phase 1 receives 15 × 35 / 95 = 5.5 seconds, Phase 2 receives 15 × 25 / 95 = 3.9 seconds, Phase 3 receives 15 × 20 / 95 = 3.2 seconds, and Phase 4 receives 15 × 15 / 95 = 2.4 seconds. After adjustment, G = [44.5, 36.1, 31.8, 27.6] seconds, none of which reach the lower bound, and convergence occurs in one round. If the original value of Phase 4 is 18 seconds (close to the lower bound), its flex is only 3 seconds. After allocation, it will reach the 15-second boundary. In this case, Phase 4 is fixed at 15 seconds, and the remaining difference continues to be proportionally allocated between Phases 1 and 3. This method has the following advantages compared to simple proportional scaling: 1) Phases that are close to the constraint boundary will not be over-compressed; 2) When there is a boundary saturation phase, the remaining adjustment amount can continue to be borne by the other adjustable phases; 3) It maintains the load response ratio between each phase; 4) It ensures that the scaling result is always within the constraint range of each phase.

[0049] The corresponding pseudocode implementation process is given below: 1. Calculate the target total green light: target_green_total = C_target - Σ(T_yellow + T_allred) δ_total = current_green_total - target_green_total 2. Calculate the joint feasible boundary for each phase: lower(p) = max(G_min_phase(p), G_min_runtime) upper(p) = min(G_max_phase(p), G_max_runtime) 3. Calculate the available adjustment space for each phase: If it needs to be reduced: flex(p) = G3(p) - lower(p) If it needs to be increased: flex(p) = upper(p) - G3(p) 4. Distribute the current remaining difference according to the adjustment space ratio: share(p) = δ_residual × flex(p) / Σflex 5. If a phase touches its joint boundary after distribution, then fix that phase at the boundary value, and carry over the undistributed residual difference to the next round, continuing to distribute it only among the remaining unfixed phases. 6. Iterate until convergence (|δ_residual| ≤ ε or ≤ N+2 rounds, where N is the number of phases) Step 7: Control the change in green light time of the same phase within adjacent signal cycles to not exceed the maximum allowable change δ_max, and obtain the fifth green light time G_5(p); In this embodiment, it is also proposed to control the variation amplitude of the green light time in the same phase within adjacent signal cycles to reduce signal abrupt changes and maintain a smooth transition. Specifically, the calculation formula for the fifth green light time G_5(p) is as follows: Where G_prev(p) is the actual green light time of the same phase in the previous signal cycle.

[0050] refer to Figure 4 As shown, in this embodiment, the maximum allowable change δ_max is set to 15% of G_prev(p). In other embodiments, the maximum allowable change δ_max can be adaptively modified based on the actual situation. Specifically, the target value G_4(p) output in step 6 of this cycle can be compared with the actual execution value G_prev(p) of this phase in the previous cycle to calculate whether it exceeds the maximum allowable change δ_max = G_prev(p) × 0.15.

[0051] If |G_4(p) - G_prev(p)| < δ_max, then directly use the value of G_4(p) as the fifth green light time G_5(p); if G_4(p) - G_prev(p) > δ_max, then set the fifth green light time G_5(p) to G_prev(p) + δ_max; if G_prev(p) - G_4(p) > δ_max, then set the fifth green light time G_5(p) to G_prev(p) - δ_max.

[0052] After smoothing, it still needs to satisfy the joint constraint interval [lower(p), upper(p)]: G_6(p) = clamp(G_5(p), lower(p), upper(p)). If the constraint is infeasible (i.e., upper(p) < lower(p)), then automatically fallback to the phase inherent constraint range. For the first calculation (when there is no previous cycle data), smoothing may not be performed, and the calculated value can be directly used. After the above steps, the system output is no longer an abstract demand intensity evaluation value, but a set of next cycle phase green light durations and cycle parameters that have been boundary checked, cycle reallocated, and smoothed, which can be directly handed over to the local state machine for implementation.

[0053] The following gives the corresponding pseudo - code implementation process: Input: Calculated value G_4(p) of this cycle, actual value G_prev(p) of the previous cycle Parameters: Maximum change ratio α = 0.15 (15%) For each phase p: δ_max = G_prev(p) × α δ_actual = G_4(p) - G_prev(p) If |δ_actual| > δ_max: G_5(p) = G_prev(p) + sign(δ_actual) × δ_max Else: G_5(p) = G_4(p) # After smoothing, it still needs to satisfy the green light constraint G_6(p) = clamp(G_5(p), lower(p), upper(p)) By setting smooth transition processing in adjacent cycles, amplitude limiting can be achieved for each phase separately: the change amplitude of the green light time of the same phase (i.e., the corresponding phase) in two adjacent cycles does not exceed 15% of the actual execution value of the previous cycle of this phase. For example, if the execution value of phase 1 in the previous cycle is 40 seconds, then the green light target value of phase 1 in this cycle is restricted within the range of [34s, 46s]. Each phase performs this amplitude limiting independently without affecting each other; it makes the driver have predictability about signal changes and reduces sudden braking caused by signal mutations; when the traffic flow changes suddenly, the timing is gradually adjusted through multiple cycles to maintain a smooth transition.

[0054] Step 8: Generate a traffic signal timing plan based on the obtained green light time for each phase.

[0055] In addition, the timing constraint parameters of the present invention support runtime dynamic adjustment to achieve "constraint feasibility automatic normalization". The specific definitions of each parameter in the constraint parameter set are as follows: C_min is the minimum signal cycle (default 60 seconds), that is, a complete signal cycle shall not be shorter than this value to avoid extremely low traffic efficiency caused by too short green light time for each phase; C_max is the maximum signal cycle (default 180 seconds), that is, a complete signal cycle shall not exceed this value to avoid too long waiting time in some directions; G_min is the lower limit of the global green light time (default 15 seconds), that is, the green light time of any phase shall not be lower than this value to ensure the most basic vehicle traffic demand; G_max is the upper limit of the global green light time (default 90 seconds), that is, the green light time of any phase shall not exceed this value to prevent a single phase from occupying too many cycles; α is the smoothing amplitude ratio (default 0.15, i.e., 15%), which is used to limit the change amplitude of the green light of the same phase in adjacent cycles during the cross-cycle smoothing execution in Step 8. These parameters can be modified in real time by the management personnel through the configuration interface during the system operation without restarting the system. When a conflict occurs between the runtime constraints and the phase inherent constraints, the system automatically performs the following feasibility checks and processing: Constraint parameter set: {C_min, C_max, G_min, G_max, α} Feasibility check: For each phase p, calculate the green light constraint intersection: lower(p) = max(G_min, G_min_phase(p)) upper(p) = min(G_max, G_max_phase(p)) If upper(p) < lower(p) → The constraint is infeasible Infeasible processing strategy: - Automatically fallback to the inherent constraint range of the phase plan - Record a warning log - The system continues to run safely without interruption of control Embodiment 2 This Embodiment 2 provides a traffic signal adaptive timing system, including: a camera module for obtaining road video data; an edge computing module for implementing a traffic signal adaptive timing method described in Embodiment 1.

[0056] Specifically, refer to Figure 6As shown, the camera module, i.e., the intersection monitoring camera, captures road video data and inputs the video stream to the edge computing module for processing. The edge computing module includes a visual perception module for vehicle category detection and multi-target tracking; a load calculation module for calculating phase control load; an adaptive timing engine for generating timing schemes; and a signal control module for generating corresponding control commands based on the timing schemes to control traffic lights. It can be understood that these modules are deployed in the intersection edge device and can independently complete timing calculations and control outputs without relying on a central server.

[0057] The performance test data for this system is as follows: Under a standard 4-phase intersection scheme (including pedestrian phase), 100-500 rounds of stress testing were conducted using simulated traffic flow data. The test environment was Windows 11 / Python 3.11 / a standard x86 platform (non-GPU). The results are as follows: 1. Single-round timing calculation latency: The test scale was 100 rounds; the measured results were an average of 0.11ms, a P95 latency of 0.16ms, and a maximum of 0.18ms; the design target was ≤ 10ms. 2. Total latency including timing and environmental correction: The test scale was 50 rounds; the measured results were an average of 0.15ms and a P95 latency of 0.31ms; the design target was ≤ 10ms. 3. Complete control cycle (perception + decision-making + execution): The test scale was 100 rounds; the measured results were an average of 0.0029ms, a P95 of 0.0061ms, and a maximum of 0.0146ms; the design target was ≤ 10ms. 4. Intersection controller initialization: Test scale: 1 time; Actual test result: 0.20ms; Design target: ≤ 1000ms Conclusion: The timing calculation P95 delay is <0.16ms, which is far better than the 10ms target and fully meets the requirements of 1Hz real-time control frequency.

[0058] The functional verification data for this system is as follows: The following functional features were verified using 139 automated test cases (all of which passed): 1. Load distribution ratio: The test method is as follows: east-west load = 20, north-south load = 5; the verification result is that the east-west phase green light is greater than the north-south phase green light. 2. Equal load symmetry: The test method is that the load in all four directions is 10; the verification result is that the green light time is equal in straight-ahead phase 1 and phase 3. 3. Zero-load minimum guarantee: The test method is that the load in all four directions is 0; the verification result is that the green light in each phase is ≥ G_min (15s). 4. Green light constraint pruning: The test method is extreme load difference (100 vs 0.1); the verification result is 15s ≤ green light duration for each phase ≤ 90s. 5. Signal period constraint: The test method is extremely high / extreme low load; the verification result is 60s ≤ period ≤ 180s. 6. Environmental Factor Correction: The testing method was factor=1.3 (heavy rain) vs factor=1.0 (sunny day); the verification result was that the green light time for severe weather was ≥ the green light time for sunny day. 7. Smooth Transition Limitation: The test method involves two consecutive extreme changes (uniform → tilt); the verification result is that the change between adjacent periods is ≤15%. 8. Minimum pedestrian guarantee: The test method is low load in the pedestrian waiting direction; the verification result is that the green light duration including pedestrian phase is ≥27s (22s+5s). 9. Runtime constraint coverage: The test method was narrow constraints (G:16-17, C:88-90); the verification result showed that the timing was strictly within the constraint range. 10. Infeasibility constraint rollback: The testing method is contradictory constraints (C: 50-60, G: 15-20); the verification result is automatic normalization to the feasible range. 11. Phase bottleneck direction protection: The test method is to use loads of 30 and 10 in two directions within the same phase, respectively; the verification result is that the phase control load is distributed according to 30, and is not diluted due to the low load direction. 12. Boundary Freeze and Redistribution: The test method is to perform total cycle compression when a phase is close to the lower boundary; the verification result is that the phase that has touched the boundary value retains the boundary value, and the remaining compression is continued by other phases.

[0059] Test Example 1: Adaptive Timing in the Scenario of Congestion on Main Roads During Morning Rush Hour 1. In a standard four-phase intersection, cameras continuously collect video from the four approach lanes, and the target detection and tracking module analyzes the real-time status of the east-west main road where the vehicle load is significantly higher than that of the north-south branch road.

[0060] 2. The system converts buses, heavy trucks, and cars in the east-west direction into PCUs and aggregates them into the main phase load, while retaining the minimum guarantee constraints for the north-south phase and pedestrian demand.

[0061] 3. The timing calculation module allocates longer green light time to the main road phases within the minimum and maximum green light boundaries based on the load ratio, retains the basic release time for the branch road phases, and simultaneously calculates the new total cycle length that meets the cycle constraints.

[0062] 4. When the system detects a significant difference between the green light time of the main phase in the previous cycle and the calculated value in the current cycle, it automatically activates a 15% limiting smoothing strategy to gradually adjust the green light change over multiple cycles.

[0063] Implementation results: Without compromising the conditions for clearing all red lights, changing to yellow lights, and pedestrian safety when crossing the street, the main roads achieved significantly higher traffic capacity, while the secondary roads maintained basic traffic needs, and the overall control process was continuous and stable.

[0064] Test Case 2: Enhanced Safety Timing in Severe Weather and Pedestrian Demand Scenarios 1. After receiving the heavy rain weather status, the system maps the weather conditions to parameters such as yellow light extension, all-red light extension, and minimum green light extension, and outputs an environmental correction factor greater than 1.0.

[0065] 2. If a pedestrian queuing request is detected at an entrance lane containing a pedestrian sub-phase within a certain cycle, the system will perform a minimum pedestrian clearance time check on that phase to ensure that the green light time is not less than the sum of the pedestrian green light and green flashing time.

[0066] 3. When the total timing cycle after environmental correction exceeds the upper limit of operation, the system reallocates the difference based on the available adjustment space of each phase, giving priority to preserving the minimum release time and clearing time necessary for safety.

[0067] 4. The final output timing scheme is executed by the state machine, and the new weather parameters, cycle, and phase green light time are saved as smooth reference values ​​for the next cycle.

[0068] Implementation results: Under the conditions of increased braking distance in rainy weather and more conservative driving behavior, the system simultaneously takes into account vehicle efficiency, pedestrian safety and cycle feasibility, avoiding cycle loss of control caused by simply extending the green light.

[0069] Example 3 This application also provides a terminal device for implementing the steps of the above-described adaptive traffic signal timing method, or the steps of the above-described adaptive traffic signal timing method. The terminal device includes a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. A communication control program is stored in the memory and can run on the processor. When executed by the processor, the communication control program implements the steps of the above-described adaptive traffic signal timing method. The processor can call logical instructions in the memory. These logical instructions can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0070] Example 4 This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described adaptive timing method for traffic signals.

[0071] Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0072] The common English terms or letters used in this invention for clarity of description are for illustrative purposes only and are not limiting interpretations or specific uses. They should not be used to limit the scope of protection of this invention based on their possible Chinese translations or specific letters.

[0073] It should also be noted that in this article, relational terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations.

Claims

1. A traffic signal adaptive timing method, characterized by, Includes the following steps: S1. Calculate the phase control load L_phase(p) for each phase based on the acquired road video data, where the phase control load L_phase(p) is the maximum value of the passenger vehicle load in each approach direction contained in the phase; S2. Based on the proportional distribution of the phase control load L_phase(p) for each phase, linearly allocate it within the preset phase green light time interval [G_min_phase(p), G_max_phase(p)] to obtain the first green light time G_1(p) for each phase; S3. Based on environmental factors, the first green light time G_1(p) of each phase is corrected to obtain the corresponding second green light time G_2(p); S4. Set a joint constraint interval [lower(p), upper(p)], and perform a clipping process on the second green light time G_2(p) based on the joint constraint interval [lower(p), upper(p)] to obtain the third green light time G_3(p), where the third green light time G_3(p) = clamp(G_2(p), lower(p), upper(p)), and clamp() is the clipping function; S5. Calculate the signal period C and compare it with the preset period constraint interval [C_min, C_max]. If the signal period C is within the period constraint interval [C_min, C_max], proceed to step S7; otherwise, calculate the available adjustment time flex(p) for each phase using the following formula: δ_total=current_green_total-target_green_total; target_green_total=C_target-Σ_p(T_yellow(p)+T_allred(p)); current_green_total=C-Σ_p(T_yellow(p)+T_allred(p)); S6. Based on the available adjustment time flex(p) of each phase, allocate the adjustment difference δ_total to the third green light time G_3(p) of different phases, and perform boundary freezing when the third green light time G_3(p) of any phase touches the boundary of the joint constraint interval [lower(p), upper(p)], so that the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], and obtain the fourth green light time G_4(p); S7. Controlling the change in green light time of the same phase within adjacent signal cycles to not exceed the maximum allowable change δ_max, the fifth green light time G_5(p) is obtained. The calculation formula for the fifth green light time G_5(p) is as follows: δ_max = α × G_prev(p) Where α is the preset ratio, and G_prev(p) is the actual green light time of the same phase in the previous signal cycle; S8. Generate a traffic signal timing plan based on the green light time of each obtained phase.

2. The traffic signal adaptive timing method of claim 1, wherein, In step S1, the process of calculating the phase control load L_phase(p) of each phase includes: Use the YOLO object detection model to identify the category of each vehicle in the road video data; Assign a unique tracking identification number to each vehicle through a multi-object tracking algorithm, and confirm the entrance direction to which the vehicle belongs by crossing the virtual detection line with the vehicle trajectory; Take the sum of the equivalent coefficients of the vehicles corresponding to each tracking identification number in the same entrance direction as the passenger car load in the corresponding entrance direction, and each tracking identification number is only accumulated once in the same entrance direction; Take the maximum value of the passenger car loads in each entrance direction included in each phase as the phase control load L_phase(p) of the corresponding phase.

3. The traffic signal adaptive timing method according to claim 2, characterized in that, The categories of the vehicles include cars, buses, light trucks, heavy trucks, special vehicles, bicycles and pedestrians; The identification process of the light truck and the heavy truck includes: Use the YOLO object detection model to identify the trucks in the road video data; Judge whether the ratio of the area of the detection frame of the truck to the area of the video frame where it is located is greater than a preset threshold. If so, it is identified as a heavy truck. If not, it is identified as a light truck.

4. The adaptive timing method for traffic signals according to claim 1, characterized in that, It also includes: Detect the joint constraint interval [lower(p), upper(p)]. If upper(p) < lower(p), then roll back to the phase green light time interval [G_min_phase(p), G_max_phase(p)], and continue to generate a timing plan based on the rolled-back phase green light time interval [G_min_phase(p), G_max_phase(p)].

5. The traffic signal adaptive timing method according to claim 1, characterized in that, In step S2, the calculation formula of the first green light time G_1(p) is: G_1(p) = G_min_phase(p) + [L_phase(p) / L_max] × [G_max_phase(p) - G_min_phase(p)]; Where, G_min_phase(p) is the preset minimum green light time of each phase, G_max_phase(p) is the preset maximum green light time of each phase, L_phase(p) is the phase control load of each phase, and L_max is the maximum value of all phase control loads.

6. The traffic signal adaptive timing method according to claim 1, characterized in that, In step S3, the second green light time G_2(p) = G_1(p) × F_env, where F_env is a preset environmental correction factor; It also includes: Detect whether each phase includes a pedestrian sub-phase and detect whether there is a pedestrian waiting request in the pedestrian sub-phase; When there is a pedestrian sub-phase and there is a pedestrian waiting request, the calculation formula of the second green light time G_2(p) is as follows: T_ped_min = T_ped_green + T_ped_flash; Where T_ped_min is the minimum crossing time for pedestrians, T_ped_green is the green light time for pedestrians, and T_ped_flash is the flashing green light time.

7. The adaptive timing method for traffic signals according to claim 1, characterized in that, In step S4, the joint constraint interval [lower(p), upper(p)] is: lower(p)=max(G_min_phase(p),G_min)+T_green_ext; upper(p)=min(G_max_phase(p), G_max); Where G_min is the global minimum green light time, G_max is the global maximum green light time, and T_green_ext is the minimum green light extension time.

8. The traffic signal adaptive timing method according to claim 1, characterized in that, In step S6, the process of obtaining the fourth green light time G_4(p) includes: S61. Calculate the adjustment value share(p) for each phase in sequence. The adjustment value share(p) = δ_residual × flex(p) / Σflex(p), where δ_residual is the remaining difference to be allocated in the current iteration round, and the initial value of δ_residual is equal to the difference to be adjusted δ_total. S62. The adjustment value share(p) is assigned to the third green light time G_3(p) of each phase to obtain the adjusted green light time. S63. If the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], the adjusted green light time is used as the fourth green light time G_4(p) of the corresponding phase; otherwise, proceed to step S64. S64. The boundary value in the joint constraint interval [lower(p), upper(p)] that is smaller than the adjusted green light time is taken as the fourth green light time of the corresponding phase, and the adjustment value share(p) of the remaining phase is recalculated. S65. The recalculated adjustment value share(p) is allocated to the third green light time G_3(p) of the remaining phase to obtain the adjusted green light time. S66. If the adjusted green light time is within the joint constraint interval [lower(p), upper(p)], the adjusted green light time is used as the fourth green light time G_4(p) of the corresponding phase; otherwise, proceed to step S67. S67. Repeat steps S64 to S66 iteratively until |δ_residual|≤ε or the number of iterations reaches N+2 rounds, where ε is the convergence threshold and N is the number of phases.

9. A traffic signal adaptive timing system, characterized in that, include: The camera module is used to acquire road video data; An edge computing module is used to execute a traffic signal adaptive timing method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the traffic signal adaptive timing method according to any one of claims 1-8.