Disclosure of Invention
The embodiment of the invention provides a control method and a control device of a traffic signal lamp, which can effectively reduce traffic jam.
In a first aspect, the present invention provides a method for controlling a traffic signal lamp, including:
determining at least one set time period corresponding to the current time point;
acquiring the average entering number of the automobiles entering the waiting area in the at least one set time period; acquiring the average passing number of the automobiles passing through the appointed place where the traffic signal lamp to be controlled is arranged in the waiting area in at least one set time period; the time length of the set time period is the same as the sum of the current red light display time length and the current green light display time length of the traffic signal lamp to be controlled;
calculating the average waiting number of the automobiles waiting to pass through the specified place in the specified area according to the average entering number and the average passing number; calculating the average queuing time length of each automobile in the waiting area according to the average entering number, the average passing number and the time length of the set time period;
and when the average waiting number is greater than a first preset threshold value and the average queuing time is greater than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be increased by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be decreased by the preset time.
Preferably, the first and second electrodes are formed of a metal,
further comprising: and when the average waiting number is smaller than a first preset threshold value and the average queuing time is smaller than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be reduced by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be increased by the preset time.
Preferably, the first and second electrodes are formed of a metal,
further comprising: and when the average waiting number is smaller than a third preset threshold value and the average queuing time is larger than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be increased by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be decreased by the preset time.
Preferably, the first and second electrodes are formed of a metal,
the calculating the average queuing time of each automobile in the waiting area comprises the following steps:
calculating the average queuing time of each automobile in the waiting area by the following formula:
wherein W represents the average queuing time, α represents the average entering number, β represents the average passing number, and t represents the time length of the set time period.
Preferably, the calculating an average waiting number of cars waiting to pass through the designated location in the designated area includes:
calculating an average waiting number of cars waiting to pass through the designated location within the designated area by the following formula:
where L characterizes the average wait number, α characterizes the average enter number, and β characterizes the average pass number.
In a second aspect, an embodiment of the present invention provides a control apparatus for a traffic signal lamp, including:
the determining module is used for determining at least one set time period corresponding to the current time point;
the acquisition module is used for acquiring the average entering number of the automobiles entering the waiting area in the at least one set time period; acquiring the average passing number of the automobiles passing through the appointed place where the traffic signal lamp to be controlled is arranged in the waiting area in at least one set time period; the time length of the set time period is the same as the sum of the current red light display time length and the current green light display time length of the traffic signal lamp to be controlled;
the calculation module is used for calculating the average waiting number of the automobiles waiting to pass through the specified place in the specified area according to the average entering number and the average passing number; calculating the average queuing time length of each automobile in the waiting area according to the average entering number, the average passing number and the time length of the set time period;
and the first control module is used for controlling the current green light display duration of the traffic signal lamp to be controlled to increase the preset duration and controlling the current red light display duration of the traffic signal lamp to be controlled to decrease the preset duration when the average waiting number is greater than a first preset threshold and the average queuing duration is greater than a second preset threshold.
Preferably, the first and second electrodes are formed of a metal,
further comprising: and the second control module is used for controlling the current green light display duration of the traffic signal lamp to be controlled to be reduced by the preset duration and controlling the current red light display duration of the traffic signal lamp to be controlled to be increased by the preset duration when the average waiting number is smaller than a first preset threshold and the average queuing duration is smaller than a second preset threshold.
Preferably, the first and second electrodes are formed of a metal,
further comprising: and the third control module is used for controlling the current green light display duration of the traffic signal lamp to be controlled to increase the preset duration and controlling the current red light display duration of the traffic signal lamp to be controlled to decrease the preset duration when the average waiting number is smaller than a third preset threshold and the average queuing duration is larger than a second preset threshold.
Preferably, the first and second electrodes are formed of a metal,
the calculation module comprises: a first calculation unit; wherein,
the first calculating unit is used for calculating the average queuing time of each automobile in the waiting area by the following formula:
wherein W represents the average queuing time, α represents the average entering number, β represents the average passing number, and t represents the time length of the set time period.
Preferably, the calculation module includes: a second calculation unit; wherein,
the second calculating unit is used for calculating the average waiting number of the automobiles waiting to pass through the specified place in the specified area by the following formula:
where L characterizes the average wait number, α characterizes the average enter number, and β characterizes the average pass number.
The embodiment of the invention provides a method and a device for controlling traffic lights, in the method, by obtaining the average entering number of automobiles which reach a waiting area corresponding to a traffic light to be controlled in a plurality of set time periods corresponding to a current time point and obtaining the average passing number of the automobiles which pass through a designated place where the traffic light to be controlled is set in the waiting area in the plurality of set time periods, because the time length of the set time periods is equal to the sum of the current red light display time length and the green light display time length of the traffic light to be controlled, the average waiting number and the average queuing time length of the automobiles in the waiting area can be calculated according to the average entering number, the average passing number and the time length of the set time periods, correspondingly, when the average waiting number is greater than a first preset threshold value and the average queuing time length is greater than a second preset threshold value, the method comprises the steps of judging that the green light display time length of a traffic signal lamp to be controlled is shorter, the red light display time length is longer, increasing the preset time length by controlling the current green light display time length of the traffic signal lamp to be controlled, and reducing the preset time length by controlling the current red light display time length of the traffic signal lamp to be controlled, a large number of automobiles in a waiting area can smoothly pass through a specified place within the longer green light display time length, the number of automobiles in the waiting area is reduced, meanwhile, the shorter red light display time length can enable the automobiles to quickly pass through the specified place only by waiting for a shorter time in the waiting area, and therefore traffic jam is effectively reduced.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer and more complete, the technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention, and based on the embodiments of the present invention, all other embodiments obtained by a person of ordinary skill in the art without creative efforts belong to the scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for controlling a traffic signal lamp, including:
step 101, determining at least one set time period corresponding to a current time point;
step 102, acquiring the average entering number of the automobiles entering the waiting area in at least one set time period; acquiring the average passing number of the automobiles passing through the appointed place where the traffic signal lamp to be controlled is arranged in the waiting area in at least one set time period; the time length of the set time period is the same as the sum of the current red light display time length and the current green light display time length of the traffic signal lamp to be controlled;
103, calculating the average waiting number of the automobiles waiting to pass through the specified place in the specified area according to the average entering number and the average passing number; calculating the average queuing time length of each automobile in the waiting area according to the average entering number, the average passing number and the time length of the set time period;
and 104, when the average waiting number is greater than a first preset threshold value and the average queuing time is greater than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be increased by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be decreased by the preset time.
In the above embodiment of the present invention, by obtaining the average entering number of cars arriving at the waiting area corresponding to the traffic signal lamp to be controlled in a plurality of setting time periods corresponding to the current time point, and obtaining the average passing number of cars passing through the designated location where the traffic signal lamp to be controlled passes through the waiting area in the plurality of setting time periods, since the time length of the setting time periods is equal to the sum of the current red light display duration and the green light display duration of the traffic signal lamp to be controlled, the average waiting number and the average queuing duration of cars in the waiting area can be calculated according to the average entering number, the average passing number and the time length of the setting time periods, and accordingly, when the average waiting number is greater than the first preset threshold and the average queuing duration is greater than the second preset threshold, it is indicated that the green light display duration of the traffic signal lamp to be controlled is shorter, the red light display duration is longer, the preset duration is increased by controlling the current green light display duration of the traffic signal lamp to be controlled, the preset duration is reduced by controlling the current red light display duration of the traffic signal lamp to be controlled, a large number of automobiles in the waiting area can smoothly pass through the appointed place within the longer green light display duration, the number of the automobiles in the waiting area is reduced, meanwhile, the shorter red light display duration enables the automobiles to quickly pass through the appointed place only by waiting for a shorter time in the waiting area, and therefore traffic jam is effectively reduced.
Specifically, in an embodiment of the present invention, the calculating the average queuing time of each car in the waiting area includes:
calculating the average queuing time of each automobile in the waiting area by the following formula:
wherein W represents the average queuing time, α represents the average entering number, β represents the average passing number, and t represents the time length of the set time period.
In an embodiment of the present invention, the calculating an average waiting number of cars waiting to pass through the designated location in the designated area includes:
calculating an average waiting number of cars waiting to pass through the designated location within the designated area by the following formula:
where L characterizes the average wait number, α characterizes the average enter number, and β characterizes the average pass number.
Because at least two traffic lights corresponding to each other are usually arranged at the same designated place, each traffic light can control the passing condition of the automobiles in one direction, when the number of the automobiles waiting to pass through the designated place in the waiting area is small and the average queuing time of each automobile is small, in order to ensure that the automobiles in other directions can also quickly pass through the designated place under the guidance of the traffic lights arranged correspondingly, one embodiment of the invention further comprises the following steps: and when the average waiting number is smaller than a first preset threshold value and the average queuing time is smaller than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be reduced by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be increased by the preset time.
In order to allow each car in the waiting area to pass the designation in a short time, an embodiment of the present invention further comprises: and when the average waiting number is smaller than a third preset threshold value and the average queuing time is larger than a second preset threshold value, controlling the current green light display time of the traffic signal lamp to be controlled to be increased by a preset time, and controlling the current red light display time of the traffic signal lamp to be controlled to be decreased by the preset time.
In order to more clearly illustrate the technical solution of the embodiment of the present invention, the present invention combines specific service scenarios, a traffic signal lamp B and a traffic signal lamp C are arranged at a specified place A on a straight road, the traffic signal lamp B and the traffic signal lamp C are correspondingly arranged, that is, the traffic light B and the traffic light C correspond to a waiting area B and a waiting area C, respectively, the traffic light B may control the cars traveling from the waiting area B toward the waiting area C through the designated location a, the traffic light C may control the cars traveling from the waiting area C toward the waiting area B through the designated location a, specifically, the current red light display time length and the current green light display time length of the traffic signal lamp B to be controlled are both 120 seconds as an example, when the traffic signal lamp to be controlled is controlled by the technical scheme provided by the invention, the method specifically comprises the following steps:
step 201, at least one set time period corresponding to the current time point is determined.
Step 202, obtaining the determined average entering number of the automobiles entering the waiting area b in at least one set time period.
For example, the red light display time period and the green light display time period of the traffic signal light B and the traffic signal light C are both set to 120 seconds by default. The current time point may be determined first, and the set time period may be determined according to the current time point. Specifically, taking the current time point as six pm as an example, the set time period may include 5 o 'clock 58 minutes to 6 o' clock 2 minutes each day, the time length of which is 240 seconds, and is the same as the sum of the red light display time period and the green light display time period of the traffic signal lamp B. The number of the set time periods can be reasonably set in combination with actual service requirements, for example, the previous 7 days of the current time point can be set. Through corresponding data acquisition and arrangement, in the embodiment of the invention, the average entering number of the automobiles entering the waiting area between 5: 58 and 6: 2 in the previous 7 days is taken as an example.
And step 203, acquiring the average passing number of the automobiles passing through the designated place A with the traffic signal lamp B from the waiting area B in at least one set time period.
Similarly, in the embodiment of the present invention, the average passing number of the automobiles passing through the designated location a where the traffic signal lamp B is set from the waiting area B in 5: 58 to 6: 2 in the previous 7 days of acquisition is taken as an example, and is 80.
And step 204, calculating the average waiting number according to the average entering number and the average passing number.
Specifically, the embodiment of the present invention may calculate the average waiting number by the following formula:
where L characterizes the average wait number, α characterizes the average enter number, and β characterizes the average pass number.
Accordingly, the embodiment of the present invention can calculate the average waiting number to be 7.
And step 205, calculating the average queuing time of each automobile in the waiting area b according to the average entering number, the average passing number and the time length of the set time period.
Specifically, the embodiment of the present invention may specifically calculate the average queuing time by using the following formula:
wherein W represents the average queuing time, α represents the average entering number, β represents the average passing number, and t represents the time length of the set time period.
Accordingly, the embodiment of the invention can calculate the average queuing time to be 21 seconds.
Step 206, judging whether the average queuing time is greater than a second preset threshold value or not, and the average waiting number is greater than a first preset threshold value, if so, executing step 207; otherwise, step 208 is performed.
And step 207, controlling the current green light display duration of the traffic signal lamp B to be controlled to increase the preset duration, and controlling the current red light display duration of the traffic signal lamp B to be controlled to decrease the preset duration.
In the embodiment of the present invention, the first preset threshold, the second preset threshold, and the preset duration may all be determined by combining actual service requirements and corresponding number of sample analyses, and in a possible implementation manner, the first preset threshold may be 5, the second preset threshold may be 15 seconds, and the preset duration may be 2 seconds.
By the technical scheme of the embodiment of the invention, the automobiles in the waiting area B corresponding to the traffic signal lamp B can quickly pass the designated place A from the waiting area B. On the one hand, the number of cars waiting to pass through the designated place A in the waiting area b is reduced; another convenience is that the cars in the waiting area b need to wait for a short time to pass the designated place a. Thereby reducing traffic jam more effectively.
Step 208, judging whether the average queuing time is smaller than a second preset threshold value or not, and the average waiting number is smaller than a first preset threshold value, if so, executing step 209; otherwise, ending the current business process.
And step 209, controlling the current green light display duration of the traffic signal lamp B to be controlled to be reduced by a preset duration, and controlling the current red light display duration of the traffic signal lamp B to be controlled to be increased by the preset duration.
Therefore, the traffic signal lamp C can increase the display time length of the green light by the preset time length and reduce the display time length of the red light by the preset time length under the control of the corresponding device, so that the automobiles in the waiting area C can quickly pass through the appointed place A from the waiting area C.
It should be understood that, when the average waiting number is smaller than the third preset threshold and the average queuing time is greater than the second preset threshold, the current green light display time of the traffic signal lamp B to be controlled may also be controlled to increase by the preset time, and the current red light display time of the traffic signal lamp B to be controlled may also be controlled to decrease by the preset time, and the third preset time may be determined in combination with the actual service scenario and the sample analysis of the corresponding number.
As shown in fig. 3, an embodiment of the present invention provides a control device for a traffic signal lamp, including:
a determining module 301, configured to determine at least one set time period corresponding to a current time point;
an obtaining module 302, configured to obtain a determined average entering number of automobiles entering the waiting area within the at least one set time period; acquiring the average passing number of the automobiles passing through the appointed place where the traffic signal lamp to be controlled is arranged in the waiting area in at least one set time period; the time length of the set time period is the same as the sum of the current red light display time length and the current green light display time length of the traffic signal lamp to be controlled;
a calculating module 303, configured to calculate an average waiting number of cars waiting to pass through the specified location in the specified area according to the average entering number and the average passing number; calculating the average queuing time length of each automobile in the waiting area according to the average entering number, the average passing number and the time length of the set time period;
the first control module 304 is configured to, when the average waiting number is greater than a first preset threshold and the average queuing time is greater than a second preset threshold, control the current green light display time of the traffic signal lamp to be controlled to increase a preset time, and control the current red light display time of the traffic signal lamp to be controlled to decrease the preset time.
As shown in fig. 4, in an embodiment of the present invention, the apparatus further includes: and the second control module 401 is configured to control the current green light display duration of the traffic signal lamp to be controlled to decrease by a preset duration and control the current red light display duration of the traffic signal lamp to be controlled to increase by the preset duration when the average waiting number is smaller than a first preset threshold and the average queuing duration is smaller than a second preset threshold.
As shown in fig. 5, in an embodiment of the present invention, the apparatus further includes: and the third control module 501 is configured to control the current green light display duration of the traffic signal lamp to be controlled to increase the preset duration and control the current red light display duration of the traffic signal lamp to be controlled to decrease the preset duration when the average waiting number is smaller than the first preset threshold and the average queuing duration is greater than the second preset threshold.
As shown in fig. 6, in an embodiment of the present invention, the calculating module 303 includes: a first calculation unit 3031; wherein,
the first calculating unit 3031 is configured to calculate an average queuing time of each car in the waiting area according to the following formula:
wherein W represents the average queuing time, α represents the average entering number, β represents the average passing number, and t represents the time length of the set time period.
As shown in fig. 6, in an embodiment of the present invention, the calculating module 303 includes: a second calculation unit 3032; wherein,
the second calculating unit 3032 is configured to calculate an average waiting number of cars waiting to pass through the designated location in the designated area by the following formula:
where L characterizes the average wait number, α characterizes the average enter number, and β characterizes the average pass number.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
The embodiment of the invention provides a readable medium, which comprises an execution instruction, and when a processor of a storage controller executes the execution instruction, the storage controller executes the control method of the traffic signal lamp provided in any embodiment of the invention.
An embodiment of the present invention provides a storage controller, including: a processor, a memory, and a bus;
the processor and the memory are connected through the bus;
the memory, when the memory controller runs, the processor executes the execution instructions stored in the memory, so that the memory controller executes the control method of the traffic signal lamp provided in any embodiment of the invention.
In summary, the embodiments of the present invention have at least the following advantages:
1. in one embodiment of the invention, by acquiring the average entering number of automobiles reaching the waiting area corresponding to the traffic signal lamp to be controlled in a plurality of set time periods corresponding to the current time point and acquiring the average passing number of automobiles passing through the appointed place where the traffic signal lamp to be controlled passes through the waiting area in the plurality of set time periods, because the time length of the set time periods is equal to the sum of the current red light display time length and the green light display time length of the traffic signal lamp to be controlled, the average waiting number and the average queuing time length of the automobiles in the waiting area can be calculated according to the average entering number, the average passing number and the time length of the set time periods, and correspondingly, when the average waiting number is greater than a first preset threshold value and the average queuing time length is greater than a second preset threshold value, the green light display time length of the traffic signal lamp to be controlled is shorter, the red light display duration is longer, the preset duration is increased by controlling the current green light display duration of the traffic signal lamp to be controlled, the preset duration is reduced by controlling the current red light display duration of the traffic signal lamp to be controlled, a large number of automobiles in the waiting area can smoothly pass through the appointed place within the longer green light display duration, the number of the automobiles in the waiting area is reduced, meanwhile, the shorter red light display duration enables the automobiles to quickly pass through the appointed place only by waiting for a shorter time in the waiting area, and therefore traffic jam is effectively reduced.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a" does not exclude the presence of other similar elements in a process, method, article, or apparatus that comprises the element.
Finally, it is to be noted that: the above description is only a preferred embodiment of the present invention, and is only used to illustrate the technical solutions of the present invention, and not to limit the protection scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.