Intelligent traffic light scheduling method and system based on PID control

By using a PID-based intelligent traffic light scheduling method to dynamically adjust the green light duration, the problem of low traffic efficiency in existing traffic light systems under complex traffic conditions is solved, and more efficient traffic flow management is achieved.

CN121438596APending Publication Date: 2026-01-30SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511796545.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-01-30

AI Technical Summary

Technical Problem

Existing traffic light control systems struggle to achieve optimal traffic flow management when faced with complex and ever-changing traffic conditions, leading to increased vehicle waiting times and low traffic efficiency. In particular, their adaptive capabilities are insufficient in situations involving multi-lane merging and dynamic imbalances in traffic demand.

Method used

A smart traffic light scheduling method based on PID control is adopted. By acquiring the number of vehicles in each main traffic direction, the PID controller is used to calculate the duration adjustment amount. Combined with the preset basic green light duration and constraints, the green light duration is dynamically adjusted to optimize the switching of traffic light states.

Benefits of technology

It effectively reduces vehicle queue length, lowers average waiting time, improves overall traffic efficiency at intersections, better adapts to dynamic traffic demands, and can be optimized according to the characteristics of different intersections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121438596A_ABST
    Figure CN121438596A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent traffic light scheduling method and system based on PID control. The method comprises the following steps: obtaining vehicle number information in each master control traffic direction; wherein the vehicle number information comprises the number of vehicles in one or more driving directions in each master control traffic direction; when the signal lamp is switched and a new green light direction is started, calculating a duration adjustment amount based on a PID controller; wherein the duration adjustment amount is an adjustment amount calculated according to an error between the current vehicle number and the target vehicle number in the new green light direction; the actual green light duration is determined by combining the preset basic green light duration and the duration adjustment amount, and the minimum duration constraint and the maximum duration constraint are applied to the actual green light duration; and controlling signal lamp state switching according to the constrained green light duration and the fixed yellow light duration. The method has obvious advantages in the aspects of reducing the vehicle queuing length and reducing the average waiting time, dynamic traffic flow can be more effectively handled, and the overall operation efficiency of the intersection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic control technology, and in particular to an intelligent traffic light scheduling method and system based on PID control. Background Technology

[0002] Traditional traffic signal control systems mostly employ fixed-cycle timing schemes or make limited adjustments based solely on simple vehicle detection. These methods often fail to achieve optimal traffic flow management when faced with complex and ever-changing traffic conditions, easily leading to unnecessary vehicle congestion and reducing intersection efficiency.

[0003] Although some attempts have been made to introduce smarter algorithms, there are still problems such as insufficient response to real-time traffic flow changes and insufficient optimization, especially in the case of multi-lane merging and dynamic imbalance of traffic demand. The adaptive capabilities and efficiency of the existing system still have room for improvement.

[0004] Therefore, existing technologies still need improvement. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide an intelligent traffic light scheduling method and system based on PID control to address the shortcomings of existing technologies, thereby solving the problems of low traffic efficiency and poor adaptability in existing traffic light control methods.

[0006] The technical solution adopted by this invention to solve the technical problem is as follows: In a first aspect, the present invention provides an intelligent traffic light scheduling method based on PID control, comprising: Obtain vehicle quantity information for each main traffic direction; wherein, the vehicle quantity information includes the number of vehicles in one or more driving directions within each main traffic direction; When the traffic light changes and the new green light direction is enabled, the duration adjustment amount is calculated based on the PID controller; wherein, the duration adjustment amount is the adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction; The actual green light duration is determined by combining the preset base green light duration and the duration adjustment amount, and a minimum duration constraint and a maximum duration constraint are applied to the actual green light duration. The signal light status is switched based on the constrained green light duration and the fixed yellow light duration.

[0007] In one implementation, the step of obtaining the vehicle quantity information for each main traffic direction includes: Initialize the system and configure the control parameters of the PID controller and the basic system parameters; The control parameters include: proportional parameters, integral parameters, derivative parameters, integral limiting parameters, and output limiting parameters; The system's basic parameters include: basic green light duration for each direction, minimum green light duration, maximum green light duration, and the number of target vehicles.

[0008] In one implementation, obtaining the vehicle quantity information for each main traffic direction includes: When a main traffic direction includes multiple driving directions, the maximum number of vehicles in the multiple driving directions is obtained to get the corresponding vehicle quantity information.

[0009] In one implementation, the step of calculating the duration adjustment based on the PID controller when the traffic light changes and the new green light direction is enabled includes: When the green light phase of one of the main traffic directions ends, the traffic lights for the current main traffic direction will be switched sequentially to yellow and red lights; wherein the duration of the yellow light is a preset fixed duration; Identify another main traffic direction that has switched to a red light direction, and designate the other main traffic direction as the new green light direction.

[0010] In one implementation, the step of calculating the duration adjustment based on the PID controller when the traffic light changes and the new green light direction is enabled includes: The current number of vehicles in the new green light direction, the preset target number of vehicles, and the control parameters of the configured PID controller are obtained. The duration adjustment amount is calculated based on the error between the current number of vehicles in the new green light direction and the preset target number of vehicles.

[0011] In one implementation, determining the actual green light duration by combining a preset base green light duration and the duration adjustment amount, and applying minimum and maximum duration constraints to the actual green light duration, includes: Based on the duration adjustment amount, a corresponding duration is added to or subtracted from the preset basic green light duration to obtain the actual green light duration; The actual green light duration is adjusted according to the preset minimum and maximum duration constraints to obtain the constrained green light duration.

[0012] In one implementation, controlling the switching of traffic light states based on the constrained green light duration and the fixed yellow light duration includes: During the duration of the green light in any main traffic direction, the number of vehicles in the corresponding main traffic direction is reduced periodically or on an event-driven basis to simulate vehicle passage.

[0013] Secondly, the present invention provides an intelligent traffic light scheduling system based on PID control, comprising: The vehicle quantity monitoring unit is used to acquire vehicle quantity information for each main traffic direction; wherein, the vehicle quantity information includes the number of vehicles in one or more driving directions in each main traffic direction. A PID control unit is used to calculate the duration adjustment amount when the traffic light changes and the new green light direction is enabled; wherein, the duration adjustment amount is an adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction; The duration calculation unit is used to determine the actual green light duration by combining the preset basic green light duration and the duration adjustment amount, and to apply minimum duration constraints and maximum duration constraints to the actual green light duration; The traffic light control unit is used to control the switching of traffic light states based on the constrained green light duration and the fixed yellow light duration. The parameter configuration unit is used to modify the control parameters of the PID controller, the number of target vehicles, the basic green light duration, the minimum green light duration, and the maximum green light duration according to user operations.

[0014] Thirdly, the present invention provides a terminal, comprising: a processor and a memory, wherein the memory stores a PID-based intelligent traffic light scheduling program, and the PID-based intelligent traffic light scheduling program, when executed by the processor, is used to implement the operation of the PID-based intelligent traffic light scheduling method as described in the first aspect.

[0015] Fourthly, the present invention also provides a computer-readable storage medium storing a PID-based intelligent traffic light scheduling program, which, when executed by a processor, is used to implement the operation of the PID-based intelligent traffic light scheduling method as described in the first aspect.

[0016] The present invention, by employing the above technical solution, has the following effects: 1) This invention uses a PID controller to adjust the green light duration in real time according to traffic flow, which can better adapt to dynamically changing traffic demands; 2) This invention optimizes the allocation of green light time, reduces unnecessary waiting, and improves the overall traffic efficiency of intersections; 3) The PID parameters and base duration in this invention can be adjusted, so that the system can be optimized according to the characteristics of different intersections.

[0017] 4) By taking the maximum traffic flow in a specific direction as the PID input, this invention can more reasonably handle the situation of multiple lanes merging into the main road. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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 the structures shown in these drawings without creative effort.

[0019] Figure 1 This is a flowchart of the intelligent traffic light scheduling method based on PID control in this invention.

[0020] Figure 2 This is a schematic diagram of the architecture of the intelligent traffic light scheduling system in this invention.

[0021] Figure 3 This is the overall flowchart of the intelligent traffic light scheduling method in this invention.

[0022] Figure 4 This is a flowchart of the green light duration calculation based on PID control in this invention.

[0023] Figure 5 This is a flowchart of the traffic light switching logic in this invention.

[0024] Figure 6 This is a graph showing the experimental results comparing the queue length of the solution provided by this invention with that of a fixed-duration control method.

[0025] Figure 7 This is a graph showing the experimental results comparing the average waiting time of the solution provided by this invention with that of a fixed-duration control method.

[0026] Figure 8 This is a functional schematic diagram of the terminal in one implementation of the present invention.

[0027] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0029] Exemplary methods Traditional traffic signal control systems mostly employ fixed-cycle timing schemes or make limited adjustments based solely on simple vehicle detection. These methods often fail to achieve optimal traffic flow management when faced with complex and ever-changing traffic conditions, easily leading to unnecessary vehicle congestion and reducing intersection efficiency.

[0030] Although some attempts have been made to introduce smarter algorithms, there are still problems such as insufficient response to real-time traffic flow changes and insufficient optimization, especially in the case of multi-lane merging and dynamic imbalance of traffic demand. The adaptive capabilities and efficiency of the existing system still have room for improvement.

[0031] To address the above technical problems, this invention provides an intelligent traffic light scheduling method based on PID control, comprising: acquiring vehicle quantity information for each main controlled traffic direction; wherein the vehicle quantity information includes the number of vehicles in one or more travel directions within each main controlled traffic direction; when the traffic light changes and the new green light direction is activated, calculating a duration adjustment amount based on the PID controller; wherein the duration adjustment amount is an adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction; determining the actual green light duration by combining a preset basic green light duration and the duration adjustment amount, and applying minimum and maximum duration constraints to the actual green light duration; controlling the switching of traffic light states based on the constrained green light duration and a fixed yellow light duration. This invention has significant advantages in reducing vehicle queue length and lowering average waiting time, enabling more effective handling of dynamic traffic flow and improving the overall operational efficiency of intersections.

[0032] like Figure 1 As shown, this embodiment of the invention provides an intelligent traffic light scheduling method based on PID control, including the following steps: Step S100: Obtain vehicle quantity information for each main traffic direction; wherein, the vehicle quantity information includes the number of vehicles in one or more driving directions within each main traffic direction.

[0033] In this embodiment, the method is implemented based on a PID-controlled intelligent traffic light scheduling system, such as... Figure 2 As shown, the system may include: a vehicle input / detection module, a data processing core module, a traffic light status control module, and a user interface module. The vehicle input / detection module is responsible for acquiring vehicle arrival information from various specific directions (e.g., north, south, east, and west). In this embodiment, this can be simulated using keyboard keys (e.g., W, S, A, and D keys correspond to vehicles approaching from the north, south, west, and east directions, respectively); however, in real-world applications, the vehicle input / detection module can be connected to hardware devices such as geomagnetic induction coils, roadside cameras, radar, or infrared sensors to collect real-time vehicle arrival information from the actual road. Whenever an increase in vehicle traffic is detected in a direction, the corresponding direction counter increments.

[0034] The data processing core module is the heart of the system, used to maintain traffic status in two main control directions (e.g., "north-south" and "east-west"). For each main control direction, the current number of vehicles is set to the maximum of the number of vehicles in its two specific driving directions. For example, the number of vehicles in the "north-south" direction is the larger of the number of northbound vehicles and the number of southbound vehicles. This module is equipped with an independent PID controller for each main control direction. The PID controller, as defined in the PIDController class in the source code, has configurable proportional parameter Kp, integral parameter Ki, and derivative parameter Kd.

[0035] The configurable parameters of the PID controller also include integral term limiting and output limiting. Integral term limiting prevents integral saturation, while output limiting controls the range of duration adjustment. The target value (setpoint) of the PID controller is set to a desired number of vehicles passing through.

[0036] As an example, based on the modules in the intelligent traffic light scheduling system, this embodiment also includes a vehicle quantity monitoring unit, a PID control unit (PID controller), a duration calculation unit, a traffic light control unit, and a parameter configuration unit. In this embodiment, the PID control unit dynamically adjusts the green light duration, effectively adapting to real-time traffic flow changes, improving intersection throughput, and reducing vehicle waiting time.

[0037] In this embodiment, the intelligent traffic light scheduling system needs to be initialized before it can be put into operation.

[0038] Specifically, in one implementation of this embodiment, the process of obtaining vehicle quantity information for each main traffic direction includes: initializing the system and configuring the control parameters and system basic parameters of the PID controller; wherein, the control parameters include: proportional parameters, integral parameters, derivative parameters, integral limiting parameters, and output limiting parameters; the system basic parameters include: basic green light duration for each direction, minimum green light duration, maximum green light duration, and target vehicle quantity.

[0039] In this embodiment, the main method of system initialization is to set the PID controller parameters (Kp, Ki, Kd, ​​integral limit, output limit), the basic green light duration for each direction, the minimum and maximum green light duration, and the target number of vehicles, and set an initial direction (e.g., east-west) as the green light.

[0040] Specifically, the PID controller has configurable proportional (Kp), integral (Ki), and derivative (Kd) parameters, and includes integral limiting and output limiting mechanisms. In this embodiment, these parameters during the initialization process can be configured through the system's parameter configuration unit, which allows users to modify parameters such as the PID controller parameters, the target number of vehicles, the basic green light duration, the minimum green light duration, and the maximum green light duration.

[0041] Furthermore, in this embodiment, after system initialization, the system continuously monitors for vehicle increase events in each direction and asynchronously updates the vehicle count in the corresponding direction to obtain vehicle quantity information in each main traffic direction.

[0042] Specifically, in one implementation of this embodiment, obtaining the vehicle quantity information for each main traffic direction includes: when a main traffic direction includes multiple driving directions, obtaining the maximum value of the number of vehicles in the multiple driving directions to obtain the corresponding vehicle quantity information.

[0043] As an example, in this embodiment, the method for obtaining vehicle quantity information in each main traffic direction is as follows: Obtain vehicle quantity information for at least two main traffic directions, wherein the vehicle quantity for each main traffic direction is determined based on the vehicle quantity for one or more specific driving directions it includes; if a main traffic direction includes multiple specific driving directions, the vehicle quantity for that main traffic direction is taken as the maximum value of the vehicle quantity for the multiple specific driving directions it includes.

[0044] For example, real-time vehicle quantity information for each traffic direction (e.g., north-south, east-west) is obtained, and for each main control direction (e.g., north-south), the number of vehicles to be input to the PID controller is determined. This number of vehicles is the maximum value of the number of vehicles in each specific driving direction (e.g., northbound, southbound) included in each main control direction.

[0045] This embodiment obtains vehicle quantity information for each main traffic direction and uses a PID controller to adjust the green light duration in real time according to traffic flow, thus better adapting to dynamically changing traffic demands.

[0046] like Figure 1 As shown, this embodiment of the invention provides an intelligent traffic light scheduling method based on PID control, including the following steps: Step S200: When the traffic light changes and the new green light direction is enabled, the duration adjustment amount is calculated based on the PID controller; wherein, the duration adjustment amount is an adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction.

[0047] In this embodiment, a PID controller is set for each main traffic direction. The PID controller can calculate a duration adjustment amount based on the error between the number of vehicles in the current direction and the preset target number of vehicles.

[0048] Specifically, in one implementation of this embodiment, when the traffic light switches and the new green light direction is enabled, the calculation of the duration adjustment based on the PID controller includes: after the green light phase of one of the main traffic directions ends, the traffic lights of the current main traffic direction are sequentially switched to yellow and red lights; wherein the duration of the yellow light is a preset fixed duration; another main traffic direction that has switched to red light is determined, and the other main traffic direction is designated as the new green light direction.

[0049] When the traffic light changes and the new green light direction is enabled, the duration adjustment amount is calculated based on the PID controller, including: obtaining the current number of vehicles in the new green light direction, the preset target number of vehicles, and the control parameters of the configured PID controller; and calculating the duration adjustment amount based on the error between the current number of vehicles in the new green light direction and the preset target number of vehicles.

[0050] In the traffic light control process of this embodiment, when the green light phase of a main traffic direction ends, the traffic light in that direction is sequentially switched to yellow, and then to red, wherein the yellow light lasts for a preset fixed duration; then, another main traffic direction that has switched to red is determined as the new green light direction; for the new green light direction, a duration adjustment amount is calculated using a PID controller based on the error between the number of vehicles in that direction and the preset target number of vehicles in that direction.

[0051] like Figure 1 As shown, this embodiment of the invention provides an intelligent traffic light scheduling method based on PID control, including the following steps: Step S300: Determine the actual green light duration by combining the preset basic green light duration and the duration adjustment amount, and apply minimum duration constraints and maximum duration constraints to the actual green light duration.

[0052] In this embodiment, after the duration adjustment amount is calculated based on the PID controller, the actual green light duration can be determined by combining the preset basic green light duration and the duration adjustment amount. The duration is then subject to minimum / maximum constraints so that the traffic light status can be controlled to switch according to the determined green light duration and the fixed yellow light duration.

[0053] Specifically, in one implementation of this embodiment, determining the actual green light duration by combining a preset basic green light duration and the duration adjustment amount, and applying minimum and maximum duration constraints to the actual green light duration, includes: adding or subtracting a corresponding duration from the preset basic green light duration according to the duration adjustment amount to obtain the actual green light duration; and adjusting the actual green light duration according to the preset minimum and maximum duration constraints to obtain the constrained green light duration.

[0054] In this embodiment, the duration adjustment amount is used to add or subtract a duration from the basic green light duration to obtain the preliminary actual green light duration; the specific duration constraint method is as follows: Based on the preset base green light duration for the new green light direction and the duration adjustment amount calculated in step S200, the actual green light duration for the new green light direction is determined, and minimum and maximum duration constraints are applied to the actual green light duration.

[0055] In this embodiment, the actual green light duration for the current direction is calculated based on the preset basic green light duration and the duration adjustment amount output by the PID controller. Therefore, the actual green light duration is constrained between the preset minimum and maximum green light durations.

[0056] In this embodiment, the PID parameters and base duration can be adjusted, allowing the system to be optimized according to the characteristics of different intersections. This optimizes the allocation of green light time, reduces unnecessary waiting, and improves the overall traffic efficiency of the intersection.

[0057] like Figure 1 As shown, this embodiment of the invention provides an intelligent traffic light scheduling method based on PID control, including the following steps: Step S400: Control the switching of traffic light states according to the constrained green light duration and the fixed yellow light duration.

[0058] Specifically, in one implementation of this embodiment, controlling the switching of traffic light states based on the constrained green light duration and the fixed yellow light duration includes: periodically or event-drivenly reducing the number of vehicles in the corresponding main traffic direction during the green light duration of any main traffic direction to simulate vehicle passage.

[0059] In this embodiment, the passage time of vehicles can be adjusted by simulation. Specifically, the traffic lights in the new green light direction are controlled to remain green according to the final actual green light duration determined in step S300. After the green light ends, steps S200 to S300 are repeated to alternately control each main traffic direction.

[0060] Based on the above-mentioned traffic light duration and traffic light state switching scheme, this embodiment periodically or event-drivenly reduces the number of vehicles in any main traffic direction during the green light duration to simulate vehicle passage.

[0061] To further illustrate the technical solution of this embodiment, the system operation process is described below through specific application scenarios: like Figure 3 As shown, in this embodiment, the main flow of system operation is as follows: Step S201: System initialization. Set the PID parameters (Kp, Ki, Kd, ​​integral limit, output limit), basic green light duration for each direction, minimum and maximum green light duration, and target number of vehicles, and set an initial direction (e.g., east-west) as green light.

[0062] Step S203: The system continuously monitors for vehicle increase events in each direction and asynchronously updates the vehicle count for the corresponding direction. At this time, the main running loop begins (while (system running?) is (yes)).

[0063] Step S204: Start the current green light direction phase and set the green light countdown timer (based on the currently calculated green light duration). Enter the green light countdown loop (while (green light countdown > 0?) is (yes)).

[0064] Step S205: The green light countdown is in progress, while simulating vehicle passage (reducing the vehicle flow count according to the rules), and waiting for a time step (e.g., 1 second).

[0065] Step S207: Execute the traffic light switching logic (see details below). Figure 5 (As shown in the flowchart), after this step is completed, the new green light direction and duration are determined. Check if an exit command has been received; if not, continue the main running loop. After the main running loop ends (for example, upon receiving an exit command), step S208 is executed: the system stops.

[0066] Specifically, such as Figure 4 As shown, the calculation process for the green light duration in this embodiment is as follows (this process is in...). Figure 5 (called in the traffic light switching logic) The first activity block: The system acquires the input data needed to calculate the green light duration for the new green light direction. This includes the current number of vehicles in the new green light direction, the preset target number of vehicles for that direction, and the relevant PID controller configuration parameters.

[0067] The second activity block: The PID controller corresponding to this direction calculates a duration adjustment amount based on the acquired input data (especially the error between the current number of vehicles and the target number of vehicles).

[0068] The third activity block: The system combines the preset base green light duration for that direction with the duration adjustment calculated by the PID controller to calculate the initial green light duration. Subsequently, based on this initial duration, adjustments are made according to preset minimum and maximum green light duration constraints to obtain the final actual green light duration applied to the traffic light, and the system status is updated to reflect this duration.

[0069] like Figure 5 As shown, the switching logic of the traffic lights is as follows: The first activity block: The switching process is triggered when the green light phase for a traffic direction ends normally.

[0070] The second activity block: The traffic light for this direction (i.e., the direction that was originally green) will first change from green to yellow. The following note explains: The yellow light will last for a preset fixed duration.

[0071] The third activity block: After the fixed duration of the yellow light ends, the traffic light for that direction will change from yellow to red.

[0072] The fourth activity block: The system determines the next traffic direction that will turn green (usually another main control direction that is perpendicular to or alternates with the current direction that is turning red).

[0073] The fifth activity block: The system calculates the duration that the green light should last for this newly determined green light direction. This calculation process will call... Figure 4 The PID-based logic described in [the document].

[0074] The sixth activity block: Set the signal light for the newly determined green light direction to green and start its green light phase. The green light duration is the result calculated in the previous step.

[0075] In this embodiment, the system's user interface module provides a graphical interface for real-time display of the number of vehicles in each direction, the current traffic light status (visualization of red, yellow, and green lights), and the green light countdown for each direction. Furthermore, the interface allows adjustment of PID parameters (Kp, Ki, and Kd parameters), the base green light duration for each direction, the target number of vehicles, etc., to facilitate system debugging and optimization.

[0076] The core of the technical solution in this embodiment lies in using a PID controller to dynamically adjust the green light duration based on real-time traffic flow feedback, thereby achieving intelligent traffic flow scheduling.

[0077] To verify the effectiveness of the intelligent traffic light scheduling method based on PID control proposed in this embodiment, a comparative experiment was conducted. The experiment compared the method (PID control) in this embodiment with the traditional fixed-duration control method under a simulated traffic environment.

[0078] like Figure 6 As shown, this figure illustrates the changing number of waiting vehicles (i.e., queue length) over time in different traffic directions (north-south and east-west) under two control methods. From Figure 6 As can be seen, the queue length represented by the solid line (blue for north-south, green for east-west) using PID control is significantly lower than that of the dashed line using fixed-duration control in most cases. Especially during peak traffic periods, PID control can disperse vehicles more quickly and reduce queue length.

[0079] like Figure 7 As shown in the figure, this graph displays the cumulative average waiting time over time for different traffic directions under two control methods. From Figure 7 As can be seen, the solid line representing the PID control (blue for north-south and green for east-west) shows a much slower growth trend in average waiting time compared to the dashed line representing fixed-duration control. This indicates that the method in this embodiment can significantly reduce the average waiting time of vehicles and improve traffic efficiency.

[0080] In summary, the experimental results show that the intelligent traffic light scheduling method based on PID control proposed in this embodiment has significant advantages over the fixed-duration control method in reducing vehicle queue length and lowering average waiting time. It can more effectively cope with dynamic traffic flow and improve the overall operating efficiency of the intersection.

[0081] This embodiment achieves the following technical effects through the above technical solution: 1) This embodiment uses a PID controller to adjust the green light duration in real time according to traffic flow, which can better adapt to dynamically changing traffic demands; 2) This embodiment optimizes the allocation of green light time, reduces unnecessary waiting, and improves the overall traffic efficiency of the intersection; 3) The PID parameters and base duration in this embodiment can be adjusted, so that the system can be optimized according to the characteristics of different intersections.

[0082] 4) This embodiment uses the maximum traffic flow in a specific direction as the PID input, which can more reasonably handle the situation of multiple lanes merging into the main road.

[0083] Exemplary device Based on the above embodiments, the present invention also provides an intelligent traffic light scheduling system based on PID control, comprising: The vehicle quantity monitoring unit is used to acquire vehicle quantity information for each main traffic direction; wherein, the vehicle quantity information includes the number of vehicles in one or more driving directions in each main traffic direction. A PID control unit is used to calculate the duration adjustment amount when the traffic light changes and the new green light direction is enabled; wherein, the duration adjustment amount is an adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction; The duration calculation unit is used to determine the actual green light duration by combining the preset basic green light duration and the duration adjustment amount, and to apply minimum duration constraints and maximum duration constraints to the actual green light duration; The traffic light control unit is used to control the switching of traffic light states based on the constrained green light duration and the fixed yellow light duration. The parameter configuration unit is used to modify the control parameters of the PID controller, the number of target vehicles, the basic green light duration, the minimum green light duration, and the maximum green light duration according to user operations.

[0084] This embodiment achieves the following technical effects through the above technical solution: 1) This embodiment uses a PID controller to adjust the green light duration in real time according to traffic flow, which can better adapt to dynamically changing traffic demands; 2) This embodiment optimizes the allocation of green light time, reduces unnecessary waiting, and improves the overall traffic efficiency of the intersection; 3) The PID parameters and base duration in this embodiment can be adjusted, so that the system can be optimized according to the characteristics of different intersections.

[0085] 4) This embodiment uses the maximum traffic flow in a specific direction as the PID input, which can more reasonably handle the situation of multiple lanes merging into the main road.

[0086] Based on the above embodiments, the present invention also provides a terminal, the principle block diagram of which can be as follows: Figure 8 As shown.

[0087] The terminal includes: a processor, a memory, an interface, a display screen, and a communication module connected via a system bus; wherein, the processor of the terminal provides computing and control capabilities; the memory of the terminal includes a computer-readable storage medium and internal memory; the computer-readable storage medium stores an operating system and computer programs; the internal memory provides an environment for the operation of the operating system and computer programs in the computer-readable storage medium; the interface is used to connect to external devices; the display screen is used to display relevant information; and the communication module is used to communicate with a cloud server or other devices.

[0088] When executed by a processor, this computer program is used to implement the operation of an intelligent traffic light scheduling method based on PID control.

[0089] It will be understood by those skilled in the art that Figure 8 The schematic diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal to which the present invention is applied. A specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0090] In one embodiment, a terminal is provided, comprising: a processor and a memory, the memory storing a PID-based intelligent traffic light scheduling program, which, when executed by the processor, is used to implement the operation of the PID-based intelligent traffic light scheduling method described above.

[0091] In one embodiment, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a PID-based intelligent traffic light scheduling program, which, when executed by a processor, is used to implement the operation of the PID-based intelligent traffic light scheduling method described above.

[0092] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, database, or other media used in the embodiments provided by this invention can include both non-volatile and volatile memory.

[0093] In summary, this invention provides an intelligent traffic light scheduling method and system based on PID control, comprising: acquiring vehicle quantity information for each main controlled traffic direction; wherein the vehicle quantity information includes the number of vehicles in one or more travel directions within each main controlled traffic direction; when the traffic light changes and the new green light direction is activated, calculating a duration adjustment amount based on the PID controller; wherein the duration adjustment amount is an adjustment amount calculated based on the error between the current number of vehicles and the target number of vehicles in the new green light direction; determining the actual green light duration by combining a preset basic green light duration and the duration adjustment amount, and applying minimum and maximum duration constraints to the actual green light duration; and controlling the switching of traffic light states based on the constrained green light duration and the fixed yellow light duration. This invention has significant advantages in reducing vehicle queue length and lowering average waiting time, and can more effectively cope with dynamic traffic flow, improving the overall operational efficiency of intersections.

[0094] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A PID control-based intelligent traffic light scheduling method, characterized in that, The method comprises the following steps: acquiring vehicle quantity information of each master traffic direction; wherein the vehicle quantity information comprises vehicle quantity of one or more driving directions in each master traffic direction; when the signal light switches and a new green light direction is enabled, calculating a time length adjustment amount based on a PID controller; wherein the time length adjustment amount is an adjustment amount calculated according to an error between a current vehicle quantity and a target vehicle quantity of the new green light direction; determining an actual green light time length by combining a preset basic green light time length and the time length adjustment amount, and imposing minimum time length constraint and maximum time length constraint on the actual green light time length; controlling signal light state switching according to the constrained green light time length and a fixed yellow light time length.

2. The PID control based intelligent traffic light scheduling method of claim 1, wherein, Before the step of acquiring vehicle quantity information of each master traffic direction, the method comprises the following steps: initializing a system and configuring control parameters of the PID controller and system basic parameters; wherein the control parameters comprise proportional parameters, integral parameters, differential parameters, integral limit parameters and output limit parameters; the system basic parameters comprise basic green light time length of each direction, minimum green light time length, maximum green light time length and target vehicle quantity.

3. The PID control based intelligent traffic light scheduling method of claim 1, wherein, The step of acquiring vehicle quantity information of each master traffic direction comprises the following steps: when one master traffic direction comprises multiple driving directions, acquiring a maximum value of vehicle quantities of the multiple driving directions to obtain corresponding vehicle quantity information.

4. The PID control based intelligent traffic light scheduling method of claim 1, wherein, Before the step of calculating a time length adjustment amount based on a PID controller when the signal light switches and a new green light direction is enabled, the method comprises the following steps: after a green light phase of one master traffic direction ends, sequentially switching signal lights of the current master traffic direction to yellow light and red light; wherein the duration of the yellow light is a preset fixed time length; determining another master traffic direction which alternates with the direction switched to red light, and taking the another master traffic direction as the new green light direction.

5. The PID control based intelligent traffic light scheduling method of claim 1, wherein, The step of calculating a time length adjustment amount based on a PID controller when the signal light switches and a new green light direction is enabled comprises the following steps: acquiring a current vehicle quantity of the new green light direction, a preset target vehicle quantity and configured control parameters of the PID controller; calculating the time length adjustment amount according to an error between the current vehicle quantity of the new green light direction and the preset target vehicle quantity.

6. The PID control based intelligent traffic light scheduling method of claim 1, wherein, The step of determining an actual green light time length by combining a preset basic green light time length and the time length adjustment amount, and imposing minimum time length constraint and maximum time length constraint on the actual green light time length comprises the following steps: according to the time length adjustment amount, adding or subtracting a corresponding time length from the preset basic green light time length to obtain the actual green light time length; adjusting the actual green light time length according to preset minimum time length constraint and maximum time length constraint to obtain the constrained green light time length.

7. The PID control based intelligent traffic light scheduling method of claim 1, wherein, The step of controlling signal light state switching according to the constrained green light time length and a fixed yellow light time length comprises the following steps: periodically or based on event driving, reducing vehicle quantity of the corresponding master traffic direction to simulate vehicle passing during the green light duration of any master traffic direction.

8. A PID control based intelligent traffic light scheduling system characterized in that, The method comprises the following steps: A vehicle quantity monitoring unit is configured to obtain vehicle quantity information of each master traffic direction, wherein the vehicle quantity information comprises vehicle quantity of one or more driving directions in each master traffic direction. A PID control unit is configured to calculate a duration adjustment amount when the signal light switches and a new green light direction is enabled, wherein the duration adjustment amount is an adjustment amount calculated according to an error between a current vehicle quantity and a target vehicle quantity of the new green light direction. A duration calculation unit is configured to determine an actual green light duration by combining a preset basic green light duration and the duration adjustment amount, and to impose a minimum duration constraint and a maximum duration constraint on the actual green light duration. A signal light control unit is configured to control signal light state switching according to the constrained green light duration and a fixed yellow light duration. A parameter configuration unit is configured to modify control parameters of the PID controller, the target vehicle quantity, the basic green light duration, the minimum green light duration and the maximum green light duration according to user operation.

9. A terminal, characterized by comprising: The processor and the memory, wherein the memory stores a PID control based intelligent traffic light scheduling program, and the PID control based intelligent traffic light scheduling program is used to implement operations of the PID control based intelligent traffic light scheduling method according to any one of claims 1-7 when executed by the processor. The computer readable storage medium stores a PID control based intelligent traffic light scheduling program, and the PID control based intelligent traffic light scheduling program is used to implement operations of the PID control based intelligent traffic light scheduling method according to any one of claims 1-7 when executed by the processor.

10. A computer-readable storage medium, characterized in that, ​