Traffic signal lamp regulation and control method and system, terminal and storage medium
By obtaining traffic data in real time and using LSTM and SVM models to dynamically adjust the operating parameters of traffic lights, it solves the problem that traditional control methods cannot cope with real-time traffic changes, improves traffic efficiency and alleviates congestion, and ensures traffic safety.
Patent Information
- Application Number
- CN202410700067.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-03
AI Technical Summary
Traditional traffic light control methods cannot dynamically adjust according to real-time traffic conditions, resulting in low traffic efficiency and frequent congestion. They lack the ability to predict future traffic conditions and cannot effectively alleviate traffic congestion.
By obtaining real-time traffic data, using the pre-trained LSTM traffic prediction model and SVM traffic status classification model, dynamically adjust the operating parameters of traffic lights, including calculating the initial signal period, green light duration and red light duration, and predict real-time and short-term traffic flow based on value and current traffic status type.
It achieves real-time response to changes in traffic conditions, rationally allocates road resources, reduces traffic congestion, improves traffic efficiency, timely detects traffic congestion and abnormal accidents, reduces traffic accident rates, ensures traffic safety, and reduces labor costs and the impact of human factors.
Smart Images

Figure CN118587916A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic light control, and in particular to a traffic light control method, system, terminal and storage medium. Background Art
[0002] With the acceleration of urbanization and the continuous increase in the number of cars, traffic congestion has become one of the important factors restricting urban development. Traditional traffic light control methods often use fixed time periods to adjust signal timing, which cannot be flexibly adjusted according to real-time traffic conditions, resulting in low traffic efficiency and frequent congestion. Therefore, developing a control method that can respond to traffic conditions in real time and dynamically adjust traffic light operating parameters is of great significance to improving urban traffic efficiency and alleviating traffic congestion.
[0003] Traditional traffic light control methods mainly rely on fixed time periods and preset timing schemes. These methods cannot accurately reflect changes in real-time traffic conditions, resulting in a mismatch between traffic light operating parameters and traffic demand. In addition, traditional control methods often lack the ability to predict future traffic conditions and cannot make reasonable signal timing adjustments in advance, thus failing to effectively alleviate traffic congestion. Summary of the invention
[0004] To solve the above problems, the present invention provides a traffic light control system, method, terminal and storage medium, which dynamically adjust traffic lights through big data and artificial intelligence, can respond to changes in traffic conditions in real time, improve traffic efficiency and reduce the occurrence of congestion.
[0005] In a first aspect, the technical solution of the present invention provides a traffic signal light control method, comprising the following steps: Get real-time traffic data, including real-time traffic flow; Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Based on real-time traffic data, the current traffic status type is obtained using a pre-trained SVM traffic status classification model; The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status type.
[0006] In an optional implementation, the current traffic state type is obtained based on real-time traffic data using a pre-trained SVM traffic state classification model, specifically including: Screening target traffic data, including vehicle density, average speed, real-time traffic flow, queue length, vehicle type ratio, lane occupancy rate, vehicle spacing, road congestion index, environmental characteristics and time period classification; Preprocessing the target traffic data; The preprocessed target traffic data is input into the pre-trained SVM traffic state classification model to obtain the current traffic state type; Among them, traffic status types include smooth, slow and congested; The SVM traffic state classification model uses the Hinge loss function to measure the classification error.
[0007] In an optional embodiment, the method further comprises: The vehicle density D is calculated by the following formula: D = N / L, where N is the number of vehicles passing through the target section per unit time, and L is the length of the target section; The real-time traffic flow Q is calculated by the following formula: Q=D*Vavg, where Vavg is the average speed of vehicles passing through the target road section; The road congestion index C is calculated by the following formula: C=Tstop / Ttotal, where Tstop is the average stop time of vehicles on the target road section, and Ttotal is the average total travel time of vehicles passing through the target road section.
[0008] In an optional implementation, the operating parameters of the traffic light are controlled according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type, specifically including: The initial signal period is set according to the real-time traffic flow, short-term traffic flow prediction value and the current traffic state type.
[0009] In an optional implementation, the initial signal period is set according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type, specifically including: Based on the real-time traffic flow, short-term traffic flow prediction value and current traffic state type, the total failure time and saturation flow ratio are obtained using a pre-trained neural network model; The initial signal period is calculated by the following formula, C0=(1.5d+5) / (1-Y); Among them, C0 is the initial signal period, d is the total failure time, and Y is the saturation flow ratio.
[0010] In an optional implementation, the operating parameters of the traffic light are controlled according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type, and specifically also include: The green light duration is calculated by the following formula: Gi=C0*Qi / Qtotal; Among them, Gi is the green light duration in the i-th direction, Qi is the short-term traffic flow forecast value in the i-th direction, and Qtotal is the total traffic flow at the target intersection.
[0011] In an optional implementation, the operating parameters of the traffic light are controlled according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type, and specifically also include: The red light duration is determined based on the initial signal cycle, the green light duration and the preset yellow light duration.
[0012] In a second aspect, the technical solution of the present invention provides a traffic signal light control system, comprising: Traffic data acquisition module: obtain real-time traffic data, including real-time traffic flow; Short-term traffic flow prediction module: Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Traffic status classification module: obtain the current traffic status type based on real-time traffic data using the pre-trained SVM traffic status classification model; Traffic light control module: controls the operating parameters of traffic lights according to real-time traffic flow, short-term traffic flow forecast and current traffic status type.
[0013] In a third aspect, the technical solution of the present invention provides a terminal, including: A memory, used for storing a traffic light control program; A processor is used to implement the steps of any of the above-mentioned traffic light control methods when executing the traffic light control program.
[0014] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium, on which a traffic light control program is stored. When the traffic light control program is executed by a processor, the steps of the traffic light control method as described in any one of the above items are implemented.
[0015] The traffic light control system, method, terminal and storage medium provided by the present invention have the following beneficial effects compared with the prior art: by responding to changes in traffic conditions in real time and dynamically adjusting the operating parameters of traffic lights, it is possible to reasonably allocate road resources, reduce traffic congestion and improve traffic efficiency. By predicting and classifying traffic conditions, it is possible to promptly discover abnormal situations such as traffic congestion and accidents, and take corresponding control measures to reduce the traffic accident rate and ensure traffic safety. In addition, it is possible to automatically adjust the operating parameters of traffic lights according to real-time traffic data without manual intervention, thereby reducing labor costs and also reducing the impact of human factors on the traffic environment. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 The present invention provides a flow chart of a traffic light control method.
[0017] Figure 2 The present invention provides a traffic light control system structure schematic diagram.
[0018] Figure 3 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0021] Figure 1 This is a flow chart of a traffic signal light control method provided by an embodiment of the present invention. Figure 1 The execution subject may be a traffic light control system. The traffic light control method provided in the embodiment of the present invention is executed by a computer device, and accordingly, the traffic light control system runs in the computer device. According to different requirements, the order of the steps in the flowchart may be changed, and some may be omitted.
[0022] like Figure 1 As shown, the method includes the following steps.
[0023] S1, obtain real-time traffic data.
[0024] In this embodiment, the real-time traffic data includes real-time traffic flow, so as to facilitate subsequent short-term traffic flow prediction and the like.
[0025] Specifically, sensors and cameras are installed on the target road section, and real-time traffic data is obtained through the sensors and cameras.
[0026] S2, based on real-time traffic data, uses the pre-trained LSTM traffic prediction model to obtain short-term traffic flow prediction values.
[0027] SS2.1, data preprocessing.
[0028] First, data cleaning is performed to check and remove outliers, missing values, or duplicate data. Then feature selection is performed to select features related to traffic flow prediction, such as timestamps (which can be converted into features such as time of day, day of the week, etc.), weather conditions, historical traffic flow, etc. The data is then normalized or standardized.
[0029] SS2.2, load the pre-trained LSTM model.
[0030] Load the pre-trained LSTM traffic prediction model. This model should have been trained using historical traffic flow data and achieved good prediction performance.
[0031] SS2.3, format the real-time traffic data according to the model input requirements, including converting the time series data into a format that the model can process.
[0032] It should be noted that, if necessary, a sliding window or recursive approach can be used to process time series data to capture temporal dependencies.
[0033] SS2.4, input the preprocessed and formatted real-time traffic data into the LSTM model, let the model perform forward propagation calculations, and generate short-term traffic flow prediction values.
[0034] S3, based on real-time traffic data, uses a pre-trained SVM traffic state classification model to obtain the current traffic state type.
[0035] S3.1, screen target traffic data, including vehicle density, average vehicle speed, real-time traffic flow, queue length, vehicle type ratio, lane occupancy rate, vehicle spacing, road congestion index, environmental characteristics and time period classification.
[0036] It should be noted that environmental characteristics refer to weather, visibility, etc. Different weather conditions have an impact on vehicle traffic. Time period classification can be peak period and non-peak period, etc.
[0037] The vehicle density D is calculated by the following formula: D=N / L, where N is the number of vehicles passing through the target section per unit time and L is the length of the target section.
[0038] The real-time traffic flow Q is calculated by the following formula: Q=D*V avg , where V avg It is the average speed of vehicles passing through the target section.
[0039] The road congestion index C is calculated by the following formula: C=T stop / T total , where T stop is the average stagnation time of the vehicle on the target road section, T total It is the average total travel time of vehicles passing through the target road segment.
[0040] S3.2, preprocessing the target traffic data.
[0041] The preprocessing of target traffic data includes data cleaning and normalization. Data cleaning includes detecting outliers using the local agenda factor (LOF) algorithm. After outlier detection, missing values are processed by interpolation or mean filling.
[0042] S3.3, inputting the preprocessed target traffic data into the pre-trained SVM traffic state classification model to obtain the current traffic state type; This embodiment uses a support vector machine (SVM) to classify traffic status. The formula of the SVM model is expressed as: f(x) = w * x + b Among them, f(x) is the classification decision function, w is the weight vector, x is the input feature vector, and b is the bias.
[0043] In this embodiment, x=[D,V avg ,Q,L q ,R type ,O lane ,G,CI,E,M], from left to right are vehicle density, average speed, real-time traffic flow, queue length, vehicle type ratio, lane occupancy, vehicle spacing, road congestion index, environmental characteristics and time period classification.
[0044] In this embodiment, the traffic state types include smooth, slow and congested. The SVM model is trained using historical traffic data and marked traffic states (such as smooth, slow and congested), and the weight vector W and the bias b are updated using gradient descent or other optimization algorithms to minimize the classification error. The Hinge loss function is used to measure the classification error, and overfitting is prevented by minimizing the loss function and adding a regularization term.
[0045] S4, controlling the operating parameters of the traffic light according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type.
[0046] The traffic light operation parameter control of this embodiment includes the control of the initial signal cycle, the green light duration and the red light duration. Specifically, the following steps are included.
[0047] S4.1, set the initial signal period according to the real-time traffic flow, the short-term traffic flow forecast value and the current traffic state type.
[0048] The setting of the initial signal period is related to the total failure time and the saturated flow rate. This embodiment first obtains the total failure time and the saturated flow rate based on the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type using a pre-trained neural network model. Then, the initial signal period is calculated based on the following formula.
[0049] C0=(1.5d+5) / (1-Y) Among them, C0 is the initial signal period, d is the total failure time, and Y is the saturation flow ratio.
[0050] S4.2, calculate the green light duration using the following formula.
[0051] G i =C0*Q i / Q total Among them, G i is the green light duration in the i-th direction, Q i is the short-term traffic flow forecast value in the i-th direction, Q total is the total traffic flow at the target intersection.
[0052] S4.3, determining the duration of the red light based on the initial signal cycle, the duration of the green light, and the preset duration of the yellow light.
[0053] The yellow light duration is preset, and the initial signal cycle is the sum of the green light duration, the yellow light duration and the red light duration. The initial signal cycle and the green light duration have been known through the above steps, and the yellow light duration is preset. The red light duration can be obtained by subtracting the sum of the green light duration and the yellow light duration from the initial signal cycle.
[0054] This embodiment can reasonably allocate road resources, reduce traffic congestion, and improve traffic efficiency by dynamically adjusting the operating parameters of traffic lights in real time in response to changes in traffic conditions. By predicting and classifying traffic conditions, abnormal situations such as traffic congestion and accidents can be discovered in a timely manner, and corresponding regulatory measures can be taken to reduce the traffic accident rate and ensure traffic safety. In addition, the operating parameters of traffic lights can be automatically adjusted according to real-time traffic data without manual intervention, which reduces labor costs and also reduces the impact of human factors on the traffic environment. An embodiment of a traffic light control method is described in detail above. Based on the traffic light control method described in the above embodiment, an embodiment of the present invention further provides a traffic light control device corresponding to the method.
[0055] Figure 2 2 is a schematic block diagram of a traffic light control system provided by an embodiment of the present invention. In this embodiment, the traffic light control system 200 can be divided into multiple functional modules according to the functions it performs. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory.
[0056] Traffic data acquisition module 210: acquires real-time traffic data, including real-time traffic flow.
[0057] Short-term traffic flow prediction module 220: obtains short-term traffic flow prediction values based on real-time traffic data using a pre-trained LSTM traffic prediction model.
[0058] Traffic state classification module 230: obtains the current traffic state type based on real-time traffic data using a pre-trained SVM traffic state classification model.
[0059] Traffic light control module 240: controls the operating parameters of traffic lights according to the real-time traffic flow, the short-term traffic flow prediction value and the current traffic state type.
[0060] The traffic light control system of this embodiment is used to implement the aforementioned traffic light control method. Therefore, the specific implementation method of the system can be seen in the embodiment part of the traffic light control method in the previous text. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part, which will not be introduced in detail here.
[0061] In addition, since the traffic light control system of this embodiment is used to implement the aforementioned traffic light control method, its function corresponds to that of the aforementioned method and will not be described in detail here.
[0062] Figure 3 A schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention includes: a processor 310, a memory 320 and a communication unit 330. The processor 310 is used to implement the following steps when implementing the traffic light control program stored in the memory 320: Get real-time traffic data, including real-time traffic flow; Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Based on real-time traffic data, the current traffic status type is obtained using a pre-trained SVM traffic status classification model; The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status type.
[0063] The terminal 300 includes a processor 310, a memory 320 and a communication unit 330. These components communicate via one or more buses. It can be understood by those skilled in the art that the structure of the server shown in the figure does not constitute a limitation of the present invention, and it can be a bus structure or a star structure, and can also include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0064] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.
[0065] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0066] The communication unit 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.
[0067] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0068] The computer storage medium stores a traffic light control program, and when the traffic light control program is executed by the processor, the following steps are implemented: Get real-time traffic data, including real-time traffic flow; Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Based on real-time traffic data, the current traffic status type is obtained using a pre-trained SVM traffic status classification model; The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status type. Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0069] In the several embodiments provided by the present invention, 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0070] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0071] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0072] The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto. Any non-creative changes that can be thought of by a person skilled in the art, as well as several improvements and modifications made without departing from the principle of the present invention, should fall within the protection scope of the present invention.
Claims
1. A traffic light control method, characterized in that: The following steps are involved: Get real-time traffic data, including real-time traffic flow; Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Based on real-time traffic data, the current traffic status type is obtained using a pre-trained SVM traffic status classification model; The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status type.
2. The traffic signal light control method according to claim 1, characterized in that: Based on real-time traffic data, the pre-trained SVM traffic state classification model is used to obtain the current traffic state type, including: Screening target traffic data, including vehicle density, average speed, real-time traffic flow, queue length, vehicle type ratio, lane occupancy rate, vehicle spacing, road congestion index, environmental characteristics and time period classification; Preprocessing the target traffic data; The preprocessed target traffic data is input into the pre-trained SVM traffic state classification model to obtain the current traffic state type; Among them, traffic status types include smooth, slow and congested; The SVM traffic state classification model uses the Hinge loss function to measure the classification error.
3. The traffic signal light control method according to claim 2, characterized in that: The method also includes, The vehicle density D is calculated by the following formula: D = N / L, where N is the number of vehicles passing through the target section per unit time, and L is the length of the target section; The real-time traffic flow Q is calculated by the following formula: Q=D*V avg , where V avg is the average speed of vehicles passing through the target road section; The road congestion index C is calculated by the following formula: C=T stop / T total , where T stop is the average stagnation time of the vehicle on the target road section, T total It is the average total travel time of vehicles passing through the target road segment.
4. The traffic signal light control method according to any one of claims 1 to 3, characterized in that: The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status types, including: The initial signal period is set according to the real-time traffic flow, short-term traffic flow prediction value and the current traffic state type.
5. The traffic signal light control method according to claim 4, characterized in that: The initial signal period is set according to the real-time traffic flow, short-term traffic flow forecast value and current traffic state type, including: Based on the real-time traffic flow, short-term traffic flow prediction value and current traffic state type, the total failure time and saturation flow ratio are obtained using a pre-trained neural network model; The initial signal period is calculated by the following formula, C0=(1.5d+5) / (1-Y); Among them, C0 is the initial signal period, d is the total failure time, and Y is the saturation flow ratio.
6. The traffic signal light control method according to claim 5, characterized in that: The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status types, including: The green light duration is calculated by the following formula: G i =C0*Q i / Q total ; Among them, G i is the green light duration in the i-th direction, Q i is the short-term traffic flow forecast value in the i-th direction, Q total is the total traffic flow at the target intersection.
7. The traffic signal light control method according to claim 6, characterized in that: The operating parameters of traffic lights are controlled according to real-time traffic flow, short-term traffic flow forecast values and current traffic status types, including: The red light duration is determined based on the initial signal cycle, the green light duration and the preset yellow light duration.
8. A traffic light control system, characterized in that: include, Traffic data acquisition module: obtain real-time traffic data, including real-time traffic flow; Short-term traffic flow prediction module: Based on real-time traffic data, the pre-trained LSTM traffic prediction model is used to obtain short-term traffic flow prediction values; Traffic status classification module: obtain the current traffic status type based on real-time traffic data using the pre-trained SVM traffic status classification model; Traffic light control module: controls the operating parameters of traffic lights according to real-time traffic flow, short-term traffic flow forecast and current traffic status type.
9. A terminal, characterized in that: include: A memory, used for storing a traffic light control program; A processor is used to implement the steps of the traffic light control method as described in any one of claims 1 to 7 when executing the traffic light control program.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores a traffic light control program, and when the traffic light control program is executed by the processor, the steps of the traffic light control method as described in any one of claims 1-7 are implemented.
