Traffic signal lamp control method and device, equipment and storage medium

By dividing urban roads into waiting areas and using machine learning technology to identify vehicle types and calculate maximum capacity, the problem that traditional traffic light control systems cannot be adjusted in time is solved, and the rapid relief of traffic congestion is achieved.

CN120071645APending Publication Date: 2025-05-30POWER CHINA KUNMING ENG CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510341071.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The traditional traffic light control system cannot adjust the control strategy in time, resulting in the inability to effectively alleviate traffic congestion and thus reduce traffic efficiency.

Method used

By defining the urban road between two adjacent intersections as a waiting area, using machine learning algorithms to train and learn the proportion of vehicles, calculate the maximum capacity of the vehicle, give the congestion level, and adjust the waiting time for driving in and out according to the level.

Benefits of technology

Customized identification and learning of different waiting areas is realized, and the corresponding congestion levels and waiting time of traffic lights can be quickly matched, thereby effectively alleviating traffic congestion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071645A_ABST
    Figure CN120071645A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic signal lamp control method and device, equipment and a storage medium, and relates to the technical field of traffic control systems. According to the method, a road section between two intersections is defined as a waiting area, the number of vehicles in the waiting area is identified through target detection to judge whether the waiting area is congested or not, and meanwhile, in order to improve the detection accuracy, the characteristic that destinations of commuting, article transportation and public transportation are relatively fixed is utilized, so that the detection accuracy is improved. According to the method, the driving habits (such as the respective number or proportion of large-sized vehicles, medium-sized vehicles and small-sized vehicles) of the waiting area are obtained through machine learning, and the maximum vehicle capacity of the waiting area is calculated through the driving habits, so that customized identification and learning of different waiting areas are realized; and finally, matching the corresponding congestion level and the traffic signal lamp waiting duration of the intersections at the two ends by acquiring the ratio of the real-time vehicle number to the maximum vehicle number in the waiting area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of traffic control systems, and particularly to a control method, device, equipment and storage medium for traffic lights. Background Art

[0002] Transportation is a key driver of economic and social development. In modern urban traffic management, the control strategy of traffic lights plays a crucial role in alleviating traffic congestion and improving road capacity. With the increase in the per capita vehicle ownership, the problem of congestion has emerged, which brings many inconveniences to people's travel, increases driving risks, reduces logistics efficiency, causes energy waste, results in overall economic losses to society, and brings great pressure to the environment.

[0003] Traffic lights can alleviate the problem of traffic congestion to a certain extent by controlling the red and green light phases in different directions at intersections, thereby adjusting the traffic flow on different roads to achieve the purposes of traffic guidance, congestion reduction, and reduction of vehicle waiting time at intersections.

[0004] Currently, traffic light control methods are mainly divided into two types: timed control and manual control. Among them, timed control updates the signal light phases at intersections based on a predetermined schedule. This method does not consider the real-time traffic conditions, cannot optimize the signal light control in real time, lacks the ability to dynamically alleviate traffic congestion, and for peak traffic hours such as morning and evening rush hours, the method of manually controlling traffic lights is used to allow more vehicles to pass through the congested sections first.

[0005] However, traditional traffic light control systems often operate based on fixed time intervals and preset control modes, and it is difficult to perceive and respond to the dynamic changes of traffic flow in real time. As a result, when the actual traffic conditions change, the control strategy of the signal lights cannot be adjusted in time, leading to a further decline in traffic efficiency due to the inability to alleviate traffic congestion. Summary of the Invention

[0006] The main purpose of the present application is to provide a control method, device, equipment and storage medium for traffic lights to solve the problem that the control strategy of the traditional traffic light control system in the prior art cannot be adjusted in time, resulting in a further decline in traffic efficiency due to the inability to alleviate traffic congestion.

[0007] To achieve the above object, the present application provides the following technical solutions:

[0008] A control method for traffic lights, the traffic lights are installed at the intersections of urban roads, and the control method includes:

[0009] Step S1, defining the urban road between two adjacent intersections as a waiting area;

[0010] Step S2: Train and learn the vehicle type proportion in the current waiting area based on the vehicle type proportions at several historical moments through a machine learning algorithm;

[0011] Step S3: Calculate the maximum vehicle capacity of the current waiting area based on the road length, the number of lanes, and the vehicle type proportion in the current waiting area;

[0012] Step S4: Assign a congestion level to the current waiting area, and all congestion levels increase as the ratio of the real-time vehicle number in the current waiting area to the maximum vehicle capacity increases;

[0013] Step S5: Define the waiting time for the next cycle to enter and the waiting time for the next cycle to exit the current waiting area based on the congestion level. The waiting time for the next cycle to enter increases as the congestion level increases, and the waiting time for the next cycle to exit decreases as the congestion level increases;

[0014] Step S6: Starting from the moment when the waiting time for the current cycle to enter is zero and ending at the moment when the waiting time for the next cycle to enter begins, count the real-time vehicle number in the current cycle during the period from the start point to the end point;

[0015] Step S7: Obtain the ratio of the real-time vehicle number in the current cycle to the maximum vehicle capacity in the current cycle;

[0016] Step S8: Obtain the congestion level that matches the ratio in the current cycle, as well as the waiting time for the next cycle to enter and the waiting time for the next cycle to exit that match;

[0017] Step S9: Output the waiting time for the next cycle to enter to the traffic signal at the entry point of the current waiting area, and output the waiting time for the next cycle to exit to the traffic signal at the exit point of the current waiting area.

[0018] As a further improvement of the present application, in step S2, training and learning the vehicle type proportion in the current waiting area based on the vehicle type proportions at several historical moments through a machine learning algorithm includes:

[0019] Step S21: Obtain the image data of the waiting area respectively based on each historical moment;

[0020] Step S22: Obtain all the vehicles in each image data respectively through an object detection algorithm;

[0021] Step S23: Classify all the vehicles in the current historical moment into preset vehicle type categories through a classification algorithm, and obtain a vehicle number based on each preset vehicle type category;

[0022] Step S24: Obtain the numerical ratio of the vehicle numbers of all preset vehicle type categories;

[0023] Step S25, define the numerical ratio as the proportion of the vehicle models.

[0024] As a further improvement of the present application, in step S22, all vehicles in each image data are obtained respectively through a target detection algorithm, including:

[0025] Step S221, evenly divide the current image data into a number of grids;

[0026] Step S222, based on all grids, predict a number of bounding boxes for all vehicles according to the target detection algorithm;

[0027] Step S223, obtain the confidence level of each bounding box respectively, and obtain the bounding box with the highest confidence level and mark it as the first-order bounding box;

[0028] Step S224, calculate the intersection over union (IoU) of each other bounding box with the first-order bounding box respectively;

[0029] Step S225, select the bounding boxes with an intersection over union greater than or equal to a preset threshold as the second-order bounding boxes;

[0030] Step S226, obtain the second-order bounding box with the highest confidence level and define it as the vehicle.

[0031] As a further improvement of the present application, in step S9, output the waiting duration for the next cycle to enter to the traffic signal at the entry point located in the current waiting area, and output the waiting duration for the next cycle to exit to the traffic signal at the exit point located in the current waiting area. After that, it includes:

[0032] Step S100, obtain the ratio of the real-time vehicle quantity in the next cycle to the vehicle maximum capacity in the next cycle;

[0033] Step S200, obtain the congestion level in the next cycle that matches the ratio in the next cycle;

[0034] Step S300, determine whether the congestion level in the next cycle is lower than the congestion level in the current cycle. If not, execute step S400;

[0035] Step S400, repeatedly execute steps S1 to S9 until the congestion level in the next cycle is lower than the congestion level in the current cycle.

[0036] To achieve the above object, the present application also provides the following technical solutions:

[0037] A control device for a traffic signal, the control device is applied to the control method of the traffic signal as described above, and the control device includes:

[0038] A waiting area definition module for defining the urban road between two adjacent intersections as a waiting area;

[0039] A vehicle type proportion learning module for training and learning the vehicle type proportion in the current waiting area based on several historical moments through machine learning algorithms;

[0040] A maximum vehicle capacity calculation module for calculating the maximum vehicle capacity of the current waiting area based on the road length, the number of lanes, and the vehicle type proportion in the current waiting area;

[0041] A congestion level assignment module for assigning a congestion level to the current waiting area, where all congestion levels increase as the ratio of the real-time vehicle number in the current waiting area to the maximum vehicle capacity increases;

[0042] An in-out waiting time definition module for defining the next-cycle in-waiting time and the next-cycle out-waiting time of the current waiting area based on the congestion level, where the next-cycle in-waiting time increases as the congestion level increases, and the next-cycle out-waiting time decreases as the congestion level increases;

[0043] A real-time vehicle number statistics module for counting the real-time vehicle number in the current cycle from the start point where the next-cycle in-waiting time is reset to zero to the end point where the next-cycle in-waiting time starts;

[0044] A current-cycle ratio acquisition module for acquiring the current-cycle ratio of the real-time vehicle number in the current cycle to the maximum vehicle capacity;

[0045] A congestion level and waiting time matching module for acquiring the congestion level that matches the current-cycle ratio, as well as the next-cycle in-waiting time and the next-cycle out-waiting time that match;

[0046] A waiting time output module for outputting the next-cycle in-waiting time to the traffic signal at the in-point of the current waiting area, and outputting the next-cycle out-waiting time to the traffic signal at the out-point of the current waiting area.

[0047] To achieve the above object, the present application also provides the following technical solutions:

[0048] An electronic device includes a processor and a memory coupled to the processor, where the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, it implements the control method of the traffic signal as described above.

[0049] To achieve the above object, the present application also provides the following technical solutions:

[0050] A storage medium storing program instructions therein, and when the program instructions are executed by a processor, the control method of the traffic signal light as described above can be implemented.

[0051] In the present application, the urban road between two adjacent intersections is defined as a waiting area; the vehicle type proportion in the current waiting area based on several historical moments is trained and learned through a machine learning algorithm; the maximum vehicle capacity of the current waiting area is calculated based on the road length, the number of lanes, and the vehicle type proportion in the current waiting area; a congestion level is assigned to the current waiting area, and all congestion levels increase as the ratio of the real-time vehicle number to the maximum vehicle capacity in the current waiting area increases; based on the congestion level, the waiting time for the next cycle to enter and the waiting time for the next cycle to exit the current waiting area are defined, the waiting time for the next cycle to enter increases as the congestion level increases, and the waiting time for the next cycle to exit decreases as the congestion level increases; starting from the moment when the waiting time for the current cycle to enter reaches zero and ending at the moment when the waiting time for the next cycle to enter starts, the real-time vehicle number in the current cycle during the period from the starting point to the ending point is counted; the current cycle ratio of the real-time vehicle number in the current cycle to the maximum vehicle capacity is obtained; the congestion level that matches the current cycle ratio, as well as the waiting time for the next cycle to enter and the waiting time for the next cycle to exit that match it, are obtained; the waiting time for the next cycle to enter is output to the traffic signal light at the entry point of the current waiting area, and the waiting time for the next cycle to exit is output to the traffic signal light at the exit point of the current waiting area. In the present application, a section of road between two intersections is defined as a waiting area, and the number of vehicles in a waiting area is identified through object detection to determine whether the waiting area is congested. At the same time, in order to improve the detection accuracy, the present application utilizes the characteristic that the destinations of commuting, goods transportation, and public transportation are relatively fixed, and learns the driving habits (such as the respective numbers or proportions of large vehicles, medium-sized vehicles, and small vehicles) in the waiting area through machine learning, and then calculates the maximum vehicle capacity of the waiting area through the driving habits, realizing customized identification and learning of different waiting areas. Finally, by obtaining the ratio of the real-time vehicle number in the waiting area to the maximum vehicle number, the corresponding congestion level and the traffic signal waiting times at both ends of the intersection are matched. The advantage of the above process is that different optimization schemes can be formulated for different intersections, thereby relatively quickly achieving the purpose of alleviating traffic congestion. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic flowchart of the steps of an embodiment of the control method of the traffic signal light of the present application;

[0053] Figure 2Schematic diagram of functional modules of an embodiment of the traffic signal control device of the present application;

[0054] Figure 3 Schematic diagram of the structure of an embodiment of the electronic device of the present application;

[0055] Figure 4 Schematic diagram of the structure of an embodiment of the storage medium of the present application. Detailed implementation manners

[0056] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0057] The terms "first", "second", and "third" in the present application are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first", "second", and "third" may explicitly or implicitly include at least one of such features. In the description of the present application, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. All directional indications (such as up, down, left, right, front, back...) in the embodiments of the present application are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products, or devices.

[0058] Referring to "embodiments" herein means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present application. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0059] As Figure 1 shown, this embodiment provides an embodiment of the traffic signal control method. In this embodiment, the traffic signal is installed at the intersection of an urban road.

[0060] Specifically, the control method comprises the following steps:

[0061] Step S1, defining an urban road between two adjacent intersections as a waiting area.

[0062] It is worth noting that the waiting area in this embodiment is a one-way area. For a two-way lane, it can be divided into two side-by-side waiting areas according to the dividing line, and the two entrances of the two waiting areas are not on the same side.

[0063] Step S2, training and learning the vehicle type ratio in the current waiting area based on several historical moments through a machine learning algorithm.

[0064] Preferably, the interval between historical moments may be one signal light cycle.

[0065] For example, a municipal road has two-way four lanes, that is, each side has two lanes. At this time, the two-way four lanes are divided into two side-by-side waiting areas, each waiting area has two lanes. Through target detection, it is known that small cars (small cars, small buses, small trucks) account for 80% of the waiting area, medium-sized cars (medium-sized buses, medium-sized trucks) account for 10%, and large cars (large buses, large trucks) account for 10%, that is, the proportion of car models in the waiting area is small car: medium-sized car: large car = 0.8:0.1:0.1; through target detection, it is known that small cars (small cars, small buses, small trucks) account for 72% of the waiting area, medium-sized cars (medium-sized buses, medium-sized trucks) account for 18%, and large cars (large buses, large trucks) account for 10%, that is, the proportion of car models in the waiting area is small car: medium-sized car: large car = 0.72:0.18:0.1.

[0066] Step S3, calculating the maximum vehicle capacity of the current waiting area based on the road length, number of lanes, and vehicle type ratio of the current waiting area.

[0067] Preferably, this embodiment illustrates the principle by calculating the above-mentioned destination waiting area:

[0068] According to the public data, the length of the road leading to the waiting area is 100m, the number of lanes is 2, and the proportion of vehicle types is small vehicles: medium vehicles: large vehicles = 0.8:0.1:0.1. According to the public data of the vehicles, the average length of small vehicles is 4.05 meters (from 3.8 meters to 4.3 meters), the average length of medium vehicles is 4.75 meters (from 4.6 meters to 4.9 meters), and the average length of large vehicles is 5.4 meters (from 5.2 meters to 5.6 meters). The average distance between the front and rear vehicles when parking is 1.25 meters (from 1 meter to 1.5 meters). We get (4.05 + 1.25)x + (4.75 + 1.25)y + (5.4 + 1.25)z = 100, x:y:z = 0.8:0.1:0.1. At the same time, change the equal sign to an approximately equal sign to ensure that the waiting area is filled as much as possible. Solving the above equation, when x, y, and z are 14, 2, and 2 respectively, it is closest to filling the waiting area, that is, the maximum vehicle capacity is 18 vehicles. At this time, the occupancy of the waiting area reaches 74.2 + 12 + 13.3 = 99.5 meters. That is, 14 small vehicles, 2 medium vehicles, and 2 large vehicles.

[0069] It should be noted that the symbol meanings in the above equation are not the same as those in other contents, and are only used to show the calculation process. And the above calculation is only for principle explanation. More specific and practical calculations can be carried out through more accurate statistical data and linear fitting.

[0070] Step S4, assign a congestion level based on the current waiting area. All congestion levels increase as the ratio of the real-time vehicle quantity in the current waiting area to the maximum vehicle capacity increases.

[0071] Preferably, the congestion levels can be defined as 1, 2, 3, 4, 5 in sequence, corresponding to the ratios of the real-time vehicle quantity in the current waiting area to the maximum vehicle capacity being 0.2, 0.4, 0.6, 0.8, 1.0 respectively.

[0072] Step S5, define the waiting time for the next cycle to enter and the waiting time for the next cycle to leave the current waiting area based on the congestion level. The waiting time for the next cycle to enter increases as the congestion level increases, and the waiting time for the next cycle to leave decreases as the congestion level increases.

[0073] Preferably, the waiting time for the next cycle to enter and the waiting time for the next cycle to leave can be scaled proportionally according to the traffic signal timing plan usually used. See Table 1 (Waiting Time Scaling Table) below for details:

[0074]

[0075] Table 1: Waiting Time Scaling Table.

[0076] Preferably, according to the above table ratio, the design intention of this embodiment is that for relatively empty areas with a low congestion level, the waiting time can be appropriately extended and the vehicles from the previous intersection can be allowed to enter as soon as possible to achieve a buffering effect. At the same time, for relatively congested sections, the vehicles can be released faster and the entry of vehicles from the previous intersection can be postponed.

[0077] Preferably, the above-mentioned proportion can be adjusted according to the market price situation, and the values listed in this embodiment are only for illustrative purposes of the principle.

[0078] Step S6: Starting from the zeroing of the waiting duration for entry in the current cycle and ending at the start of the waiting duration for entry in the next cycle, count the real-time number of vehicles in the current cycle during the period from the start point to the end point.

[0079] Preferably, the above-mentioned object detection can be used for statistics.

[0080] Step S7: Obtain the ratio of the real-time number of vehicles in the current cycle to the maximum vehicle capacity in the current cycle.

[0081] Step S8: Obtain the congestion level that matches the ratio in the current cycle, as well as the waiting duration for entry and the waiting duration for exit in the next cycle that match it.

[0082] Step S9: Output the waiting duration for entry in the next cycle to the traffic signal at the entry point located in the current waiting area, and output the waiting duration for exit in the next cycle to the traffic signal at the exit point located in the current waiting area.

[0083] Preferably, the purpose of steps S7 to S9 is to match the above-mentioned level and scaling ratio according to the real-time situation.

[0084] Furthermore, in step S2, through a machine learning algorithm, train and learn the proportion of vehicle types in the current waiting area based on several historical moments, including:

[0085] Step S21: Obtain the image data of the waiting area based on each historical moment respectively.

[0086] Preferably, the image data can be directly obtained through a surveillance camera.

[0087] Step S22: Obtain all the vehicles in each image data through an object detection algorithm.

[0088] Preferably, since the number of surveillance cameras is not unique, they are located at a high position, with a wide angle and high definition, so vehicles are hardly blocked from all perspectives.

[0089] Preferably, the object detection algorithm can be implemented through object detection algorithms such as VJ, HOG, DPMDetector; deep learning two-stage object detection algorithms such as RCNN, SPPNet, FastRCNN, FasterRCNN; object detection algorithms with tricks such as FPN, CascadeRCNN; deep learning one-stage object detection algorithms such as Yolo,X, SSD, RetinaNet; deep learning anchor-free object detection algorithms such as CornerNet, CenterNet, FCOS; object detection algorithms based on Transformer such as DETR, etc.

[0090] Preferably, this embodiment preferably uses the Yolo algorithm.

[0091] Step S23, classify all vehicles at the current historical moment according to the preset vehicle type categories through a classification algorithm, and obtain a vehicle quantity based on each preset vehicle type category.

[0092] Preferably, this embodiment preferably uses Bayesian classification.

[0093] Step S24, obtain the numerical ratio of the vehicle quantities of all preset vehicle type categories.

[0094] Step S25, define the numerical ratio as the vehicle type occupancy situation.

[0095] Further, in step S22, all vehicles in each image data are obtained respectively through the object detection algorithm, including:

[0096] Step S221, evenly divide the current image data into a certain number of grids.

[0097] Preferably, the number of grids can be set to 448×448, and the size of the image data is adjusted to conform to the specification of 448×448. Then, the resized image is evenly divided into S×S (for example, 7×7) grids, and the size of each grid is 64×64.

[0098] Step S222, predict a number of bounding boxes for all vehicles based on all grids according to the object detection algorithm.

[0099] Step S223, obtain the confidence level of each bounding box respectively, and obtain the bounding box with the maximum confidence level and mark it as the first-order bounding box.

[0100] Step S224, calculate the intersection over union of each other bounding box and the first-order bounding box respectively.

[0101] Preferably, the intersection over union is the ratio obtained by dividing the intersection of the second-order bounding box with each first-order bounding box by the union of the second-order bounding box with each first-order bounding box (which can be an area ratio).

[0102] Step S225: Select the bounding boxes with an intersection over union greater than or equal to a preset threshold as the second-order bounding boxes.

[0103] Step S226: Obtain the second-order bounding box with the highest confidence and define it as the vehicle.

[0104] Preferably, each grid is used to predict the coordinates, width, and height of N first-order bounding boxes, as well as the confidence of each first-order bounding box, that is, each grid needs to predict N×(4 + 1) values.

[0105] It can be understood that each grid needs to predict N (x, y, w, h, confidence); where (x, y) is the offset of the center of the first-order bounding box relative to the grid, (w, h) is the ratio of the first-order bounding box relative to the adjusted-size image, and (confidence) is the confidence of the grid, with a value of 1 or 0.

[0106] Preferably, the confidence can be understood as whether there is a target in the current grid and the accuracy of the first-order bounding box.

[0107] For example: Suppose there is a target in an adjusted-size image, and the width and height of the adjusted-size image are (w a , h a ), then:

[0108] If the image is evenly divided into 7×7 (S×S) grids, and there is a grid located at the center of the target, then the coordinates of this grid are (x a , y a ). Suppose the coordinates of the center of the target are (x b , y b ), then the above offset can be calculated according to

[0109] Preferably, in actual detection, if the predicted first-order bounding box and the actual bounding box perfectly overlap, the value of the intersection over union is 1. In actual application, the value of the preset ratio is generally set to 0.5 first to determine whether the predicted second-order bounding box is correct, and the accuracy of the second-order bounding box is positively correlated with the intersection over union.

[0110] Preferably, the YOLO algorithm also needs to train the first-order bounding boxes to improve the accuracy of object detection.

[0111] ​Next, train the above training model with a preset target training set, and use the backpropagation algorithm to iteratively adjust the weights and biases of the training model a certain number of times to reduce the value of the loss function of the training model.

[0112] Preferably, the loss function is

[0113] where is an indicator function indicating whether the j-th first-order bounding box of the i-th grid is responsible for the target, taking values of 1 or 0; x i 、y i 、w i 、h i 、C i correspond to the (x, y, w, h, confidence) prediction values of the i-th grid respectively.

[0114] It can be understood that the loss function includes the deviation of the coordinate values of the first-order bounding box, the deviation of the confidence, and the deviation of the prediction probability (or class deviation).

[0115] where is the midpoint loss of the first-order bounding box in the coordinate value deviation, is the width and height loss of the first-order bounding box in the coordinate value deviation, is the deviation of the confidence, is the deviation of the prediction probability (or class deviation).

[0116] where λ coord is the localization error penalty. Generally, λ coord = 5; S 2 is the above-mentioned S×S grids; B is the number of first-order bounding boxes; and are the estimated values of the abscissa and ordinate of the midpoint of the i-th first-order bounding box; and are the estimated values of the width and height of the i-th first-order bounding box; C i is the confidence of the i-th first-order bounding box; is the estimated value of the confidence of the i-th first-order bounding box; λ noobj is the confidence prediction loss. Generally, λ noobj = 0.5; p i (c) is the class probability of the i-th first-order bounding box; is the estimated value of the class probability of the i-th first-order bounding box; p i (c) and in which c corresponds to classes.

[0117] It should be noted that since each grid may not necessarily contain a target, if there is no target in the grid, the value of (confidence) will be 0, resulting in an overly large gradient span in the subsequent backpropagation algorithm. Therefore, λ is introduced coord to control the loss of the predicted position of the first-order bounding box and introduce λ noobj to control the loss of the absence of a target within a single grid.

[0118] It should be noted that the symbolic meanings of the above YOLO algorithm are not interoperable with the symbolic meanings in other parts of this embodiment.

[0119] Further, in step S9, the waiting duration for the next cycle to enter is output to the traffic signal at the entry point located in the current waiting area, and the waiting duration for the next cycle to exit is output to the traffic signal at the exit point located in the current waiting area. After that, it includes:

[0120] Step S100, obtaining the ratio of the real-time vehicle number in the next cycle to the maximum vehicle capacity in the next cycle.

[0121] Step S200, obtaining the congestion level in the next cycle that matches the ratio in the next cycle.

[0122] Step S300, determining whether the congestion level in the next cycle is lower than the congestion level in the current cycle. If not, execute step S400.

[0123] Step S400, repeatedly execute steps S1 to S9 until the congestion level in the next cycle is lower than the congestion level in the current cycle.

[0124] Preferably, after the congestion level in the next cycle is lower than the congestion level in the current cycle, the control measures for maintaining this congestion level can be maintained.

[0125] In this embodiment, the urban road between two adjacent intersections is defined as a waiting area; the vehicle type proportion in the current waiting area based on several historical moments is trained and learned through a machine learning algorithm; the maximum vehicle capacity of the current waiting area is calculated based on the road length, the number of lanes, and the vehicle type proportion in the current waiting area; a congestion level is assigned to the current waiting area, and all congestion levels increase as the ratio of the real-time vehicle number to the maximum vehicle capacity in the current waiting area increases; the waiting time for the next cycle to enter and the waiting time for the next cycle to exit the current waiting area are defined based on the congestion level, where the waiting time for the next cycle to enter increases as the congestion level increases, and the waiting time for the next cycle to exit decreases as the congestion level increases; starting from the point where the waiting time for the current cycle to enter reaches zero and ending at the start of the waiting time for the next cycle to enter, the real-time vehicle number in the current cycle during the period from the start point to the end point is counted; the current cycle ratio of the real-time vehicle number to the maximum vehicle capacity in the current cycle is obtained; the congestion level that matches the current cycle ratio, as well as the waiting time for the next cycle to enter and the waiting time for the next cycle to exit that match it, are obtained; the waiting time for the next cycle to enter is output to the traffic signal at the entry point located in the current waiting area, and the waiting time for the next cycle to exit is output to the traffic signal at the exit point located in the current waiting area. In this embodiment, a section of road between two intersections is defined as a waiting area, and the number of vehicles in a waiting area is identified through object detection to determine whether the waiting area is congested. At the same time, to improve the detection accuracy, this embodiment utilizes the characteristic that the destinations of commuting, goods transportation, and public transportation are relatively fixed, and learns the driving habits in this waiting area (such as the respective numbers or proportions of large vehicles, medium-sized vehicles, and small vehicles) through machine learning, and then calculates the maximum vehicle capacity of this waiting area based on the driving habits, achieving customized identification and learning of different waiting areas. Finally, the corresponding congestion level and the waiting times of the traffic signals at both ends of the intersection are matched by obtaining the ratio of the real-time vehicle number to the maximum vehicle number in this waiting area. The advantage of the above process is that different optimization schemes can be formulated for different intersections, thus relatively quickly achieving the purpose of alleviating traffic congestion.

[0126] As Figure 2 shown, this embodiment provides an embodiment of a control device for a traffic signal. In this embodiment, the control device is applied to the control method in the above embodiment.

[0127] Specifically, the control device includes a waiting area definition module 1, a vehicle type proportion situation learning module 2, a maximum vehicle capacity calculation module 3, a congestion level assignment module 4, an entry / exit waiting time definition module 5, a real-time vehicle number statistics module 6, a current cycle ratio acquisition module 7, a congestion level and waiting time matching module 8, and a waiting time output module 9 that are electrically connected in sequence.

[0128] Among them, the waiting area definition module 1 is used to define the urban road between two adjacent intersections as a waiting area; the vehicle type proportion learning module 2 is used to train and learn the vehicle type proportion in the current waiting area based on the vehicle type proportions at a number of historical moments through machine learning algorithms; the maximum vehicle capacity calculation module 3 is used to calculate the maximum vehicle capacity of the current waiting area based on the road length, the number of lanes, and the vehicle type proportion in the current waiting area; the congestion level assignment module 4 is used to assign a congestion level to the current waiting area, and all congestion levels increase as the ratio of the real-time vehicle number in the current waiting area to the maximum vehicle capacity increases; the in-out waiting time definition module 5 is used to define the in-waiting time and the out-waiting time for the next cycle of the current waiting area based on the congestion level, where the in-waiting time for the next cycle increases as the congestion level increases and the out-waiting time for the next cycle decreases as the congestion level increases; the real-time vehicle number statistics module 6 is used to count the real-time vehicle number in the current cycle from the start point where the in-waiting time for the current cycle is reset to zero to the end point where the in-waiting time for the next cycle starts; the current cycle ratio acquisition module 7 is used to acquire the current cycle ratio of the real-time vehicle number in the current cycle to the maximum vehicle capacity; the congestion level and waiting time matching module 8 is used to acquire the congestion level that matches the current cycle ratio, as well as the in-waiting time and the out-waiting time for the next cycle that match; the waiting time output module 9 is used to output the in-waiting time for the next cycle to the traffic signal at the in-point of the current waiting area, and output the out-waiting time for the next cycle to the traffic signal at the out-point of the current waiting area.

[0129] Further, the vehicle type proportion learning module 2 specifically includes a first vehicle type proportion learning sub-module, a second vehicle type proportion learning sub-module, a third vehicle type proportion learning sub-module, a fourth vehicle type proportion learning sub-module, and a fifth vehicle type proportion learning sub-module that are electrically connected in sequence; the first vehicle type proportion learning sub-module is electrically connected to the waiting area definition module 1, and the fifth vehicle type proportion learning sub-module is electrically connected to the maximum vehicle capacity calculation module 3.

[0130] Among them, the first vehicle type proportion learning sub-module is used to obtain the image data of the waiting area based on each historical moment; the second vehicle type proportion learning sub-module is used to obtain all vehicles in each image data through the target detection algorithm; the third vehicle type proportion learning sub-module is used to classify all vehicles at the current historical moment into preset vehicle type categories through the classification algorithm, and obtain a vehicle quantity based on each preset vehicle type category; the fourth vehicle type proportion learning sub-module is used to obtain the numerical ratio of the vehicle quantities of all preset vehicle type categories; the fifth vehicle type proportion learning sub-module is used to define the numerical ratio as the vehicle type proportion situation.

[0131] Further, the second vehicle type proportion learning sub-module specifically includes a first vehicle type proportion learning unit, a second vehicle type proportion learning unit, a third vehicle type proportion learning unit, a fourth vehicle type proportion learning unit, a fifth vehicle type proportion learning unit, and a sixth vehicle type proportion learning unit that are electrically connected in sequence; the first vehicle type proportion learning unit is electrically connected to the first vehicle type proportion learning sub-module, and the sixth vehicle type proportion learning unit is electrically connected to the third vehicle type proportion learning sub-module.

[0132] Among them, the first vehicle type proportion learning unit is used to evenly divide the current image data into a certain number of grids; the second vehicle type proportion learning unit is used to predict a number of bounding boxes for all vehicles based on all grids according to the target detection algorithm; the third vehicle type proportion learning unit is used to obtain the confidence level of each bounding box respectively, and obtain the bounding box with the highest confidence level and mark it as the first-order bounding box; the fourth vehicle type proportion learning unit is used to calculate the intersection over union of each other bounding box with the first-order bounding box respectively; the fifth vehicle type proportion learning unit is used to select the bounding boxes with the intersection over union greater than or equal to the preset threshold as the second-order bounding boxes; the sixth vehicle type proportion learning unit is used to obtain the second-order bounding box with the highest confidence level and define it as a vehicle.

[0133] Further, the control device further includes a next cycle ratio obtaining module, a next cycle congestion level obtaining module, a next cycle congestion level judging module, and a process repeating module that are electrically connected in sequence; the next cycle ratio obtaining module is electrically connected to the waiting duration output module 9.

[0134] Among them, the next-cycle ratio acquisition module is used to acquire the ratio of the real-time vehicle quantity in the next cycle to the maximum vehicle capacity in the next cycle; the next-cycle congestion level acquisition module is used to acquire the next-cycle congestion level matching the ratio in the next cycle; the next-cycle congestion level judgment module is used to judge whether the next-cycle congestion level is lower than the current-cycle congestion level; the process repetition module is used to, if the next-cycle congestion level is not lower than the current-cycle congestion level, repeatedly execute the waiting area definition module 1 to the waiting duration output module 9 in sequence until the next-cycle congestion level is lower than the current-cycle congestion level.

[0135] It should be noted that this embodiment is a functional module embodiment based on the above method embodiment. For the preferred, extended, limited, exemplified, and principle description parts of this embodiment, reference may be made to the above embodiment, and details are not repeated herein.

[0136] In this embodiment, the urban road between two adjacent intersections is defined as a waiting area; the machine learning algorithm is used to train and learn the vehicle type ratio in the current waiting area based on several historical moments; the maximum vehicle capacity of the current waiting area is calculated based on the road length, the number of lanes, and the vehicle type ratio in the current waiting area; a congestion level is assigned to the current waiting area, and all congestion levels increase as the ratio of the real-time vehicle number to the maximum vehicle capacity in the current waiting area increases; the waiting time for the next cycle to enter and the waiting time for the next cycle to exit the current waiting area are defined based on the congestion level, where the waiting time for the next cycle to enter increases as the congestion level increases and the waiting time for the next cycle to exit decreases as the congestion level increases; starting from the point where the waiting time for the current cycle to enter reaches zero and ending at the start of the waiting time for the next cycle to enter, the real-time vehicle number in the current cycle during the period from the start point to the end point is counted; the current cycle ratio of the real-time vehicle number to the maximum vehicle capacity is obtained; the congestion level that matches the current cycle ratio, as well as the corresponding waiting time for the next cycle to enter and the waiting time for the next cycle to exit, are obtained; the waiting time for the next cycle to enter is output to the traffic signal at the entry point of the current waiting area, and the waiting time for the next cycle to exit is output to the traffic signal at the exit point of the current waiting area. In this embodiment, a section of road between two intersections is defined as a waiting area, and the number of vehicles in a waiting area is identified through object detection to determine whether the waiting area is congested. At the same time, to improve the detection accuracy, this embodiment utilizes the characteristic that the destinations of commuting, goods transportation, and public transportation are relatively fixed, and learns the driving habits (such as the respective numbers or ratios of large vehicles, medium-sized vehicles, and small vehicles) in the waiting area through machine learning. Then, the maximum vehicle capacity of the waiting area is calculated based on these driving habits, realizing customized identification and learning of different waiting areas. Finally, the corresponding congestion level and the waiting times of the traffic signals at both ends of the intersection are matched by obtaining the ratio of the real-time vehicle number to the maximum vehicle number in the waiting area. The advantage of the above process is that different optimization schemes can be formulated for different intersections, thereby relatively quickly achieving the purpose of alleviating traffic congestion.

[0137] Figure 3 An embodiment of the electronic device of the present application is shown. Refer to Figure 3 , the electronic device 10 includes a processor 101 and a memory 102 coupled to the processor 101.

[0138] The memory 102 stores program instructions for implementing the control method of the traffic signal in any of the above embodiments.

[0139] The processor 101 is configured to execute the program instructions stored in the memory 102 to control the traffic signal.

[0140] Among them, the processor 101 can also be referred to as a CPU (Central Processing Unit). The processor 101 may be an integrated circuit chip with signal processing capabilities. The processor 101 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor such as this processor, etc.

[0141] Furthermore, Figure 4 is a schematic structural diagram of a storage medium according to an embodiment of the present application. Refer to Figure 4 , the storage medium 11 of the embodiment of the present application stores program instructions 111 that can implement all the above methods. Among them, the program instructions 111 can be stored in the above storage medium in the form of a software product, including several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs, or terminal devices such as computers, servers, mobile phones, and tablets.

[0142] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in an electrical, mechanical, or other form.

[0143] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit. The above is only the implementation manner of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

[0144] The specific implementation manners of the present application have been described in detail above, but they are only examples, and the present application is not limited to the specific implementation manners described above. For those skilled in the art, any equivalent modification or substitution to the invention is also within the scope of the present application. Therefore, all equivalent transformations, modifications, improvements, etc. made without departing from the spirit and principles of the present application should be covered by the scope of the present application.

Claims

1. A method for controlling a traffic light, wherein the traffic light is installed at an intersection of a city road, characterized in that: The control method comprises: Step S1, defining an urban road between two adjacent intersections as a waiting area; Step S2, training and learning the proportion of vehicle types in the current waiting area based on several historical moments through a machine learning algorithm; Step S3, calculating the maximum vehicle capacity of the current waiting area based on the road length, the number of lanes, and the proportion of vehicle types in the current waiting area; Step S4, assigning a congestion level based on the current waiting area, and all congestion levels increase as the ratio of the real-time number of vehicles in the current waiting area to the maximum capacity of the vehicles increases; Step S5, defining the next cycle entry waiting time and the next cycle exit waiting time of the current waiting area based on the congestion level, wherein the next cycle entry waiting time increases as the congestion level increases, and the next cycle exit waiting time decreases as the congestion level increases; Step S6, taking the current cycle entry waiting time returning to zero as the starting point and the next cycle entry waiting time beginning as the end point, counting the real-time number of vehicles in the current cycle from the starting point to the end point; Step S7, obtaining the current cycle ratio of the real-time number of vehicles in the current cycle to the current cycle maximum capacity of the vehicles; Step S8, obtaining a congestion level that matches the current cycle ratio, and a matching next cycle entry waiting time and next cycle exit waiting time; Step S9, outputting the next cycle entry waiting time to the traffic light at the entry point of the current waiting area, and outputting the next cycle exit waiting time to the traffic light at the exit point of the current waiting area.

2. The control method according to claim 1, characterized in that: Step S2, training and learning the vehicle type ratio of the current waiting area based on several historical moments through a machine learning algorithm, including: Step S21, acquiring image data of the waiting area based on each historical moment; Step S22, obtaining all vehicles in each image data by using a target detection algorithm; Step S23, classifying all vehicles at the current historical moment according to preset vehicle type categories through a classification algorithm, and obtaining a vehicle quantity based on each preset vehicle type category; Step S24, obtaining the numerical ratio of the number of vehicles of all preset vehicle types; Step S25, defining the numerical ratio as the proportion of the vehicle types.

3. The control method according to claim 2, characterized in that: Step S22, obtaining all vehicles in each image data by using a target detection algorithm, including: Step S221, dividing the current image data into a plurality of grids on average; Step S222, predicting a number of bounding boxes for all vehicles based on all grids according to the target detection algorithm; Step S223, respectively obtain the confidence of each bounding box, obtain the bounding box with the largest confidence and mark it as the first-order bounding box; Step S224, calculating the intersection-over-union ratio of each other bounding box with the first-order bounding box; Step S225, selecting a bounding box whose intersection-over-union ratio is greater than or equal to a preset threshold as a second-order bounding box; Step S226, obtaining a second-order bounding box with the highest confidence and defining it as the vehicle.

4. The control method according to claim 1, characterized in that: Step S9, outputting the next cycle entry waiting time to the traffic light at the entry point of the current waiting area, and outputting the next cycle exit waiting time to the traffic light at the exit point of the current waiting area, and then including: Step S100, obtaining a next cycle ratio of the real-time number of vehicles in the next cycle to the maximum capacity of the vehicles; Step S200, obtaining a next cycle congestion level that matches the next cycle ratio; Step S300, determining whether the congestion level of the next cycle is lower than the congestion level of the current cycle, if not, executing step S400; Step S400, repeatedly executing steps S1 to S9 until the congestion level of the next cycle is lower than the congestion level of the current cycle.

5. A control device for a traffic signal light, the control device being applied to the control method for a traffic signal light according to any one of claims 1 to 4, characterized in that: The control device comprises: The waiting area definition module is used to define the urban road between two adjacent intersections as a waiting area; The vehicle model ratio learning module is used to train and learn the vehicle model ratio in the current waiting area based on several historical moments through machine learning algorithms; A vehicle maximum capacity calculation module is used to calculate the maximum vehicle capacity of the current waiting area based on the road length, the number of lanes, and the proportion of the vehicle types in the current waiting area; A congestion level assigning module, used to assign a congestion level based on the current waiting area, and all congestion levels increase as the ratio of the real-time number of vehicles in the current waiting area to the maximum capacity of the vehicles increases; A module for defining the waiting time for entry and exit, used to define the waiting time for entry and exit of the next cycle of the current waiting area based on the congestion level, wherein the waiting time for entry of the next cycle increases as the congestion level increases, and the waiting time for exit of the next cycle decreases as the congestion level increases; A real-time vehicle quantity statistics module is used to count the real-time vehicle quantity of the current cycle from the starting point to the end point, starting from the time when the waiting time for entry in the current cycle returns to zero and starting from the time when the waiting time for entry in the next cycle begins. A current cycle ratio acquisition module is used to obtain a current cycle ratio of the real-time number of vehicles in the current cycle to the maximum capacity of the vehicles; The congestion level and waiting time matching module is used to obtain the congestion level that matches the current cycle ratio, as well as the matching next cycle entry waiting time and next cycle exit waiting time; The waiting time output module is used to output the next cycle entry waiting time to the traffic light at the entry point of the current waiting area, and output the next cycle exit waiting time to the traffic light at the exit point of the current waiting area.

6. An electronic device, characterized in that: It comprises a processor and a memory coupled to the processor, wherein the memory stores program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the control method of the traffic light as described in any one of claims 1 to 4 is implemented.

7. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the method for controlling a traffic signal light according to any one of claims 1 to 4 can be implemented.