Intelligent traffic system signal lamp timing method and device and electronic device
By using the gated Transformer model in the intelligent transportation system to model and predict real-time traffic data and dynamically adjust the signal light timing, it solves the problems of slow response speed of the existing system and the inability to predict future traffic trends, and achieves a more efficient Traffic signal control and better adaptability.
Patent Information
- Application Number
- CN202411542202.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-01-24
AI Technical Summary
The existing intelligent transportation system responds slowly when adjusting signal lights, and cannot effectively predict future traffic trends, slow data processing speed, low data utilization rate, and difficult to adapt to changes in the traffic environment.
Using the door control Transformer model to collect traffic data through the deployment of perceived equipment, training and deployment of door control transformer models, the sequence modeling of real -time traffic data and rewarding, analyze and predict traffic and travel status, and dynamically adjust the signal lights allocation Time.
It significantly improves the response speed and accuracy of traffic signal adjustment, can more effectively predict and respond to changes in traffic flow, improve the data utilization rate, and enhance the adaptability and long -term effectiveness of the system.
Smart Images

Figure CN119360637A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent transportation, and more specifically, to a method, device and electronic device for timing signal lights in an intelligent transportation system. Background Art
[0002] In the current urban traffic management system, with the increase in the number of vehicles and the aggravation of urban congestion, the traditional traffic signal control system has gradually been unable to meet the increasingly complex traffic flow needs. Traditional systems mostly rely on fixed-time signal timing schemes, which often seem to be inadequate when dealing with emergencies or changing traffic flows, and cannot respond to rapid changes in traffic conditions in real time. Therefore, the development and application of intelligent transportation systems (ITS) have become a key way to solve this problem.
[0003] The intelligent transportation system uses advanced information technology, data communication transmission technology, electronic sensor technology, control technology, etc. to integrate into the entire ground traffic management system, which can effectively improve road utilization, ensure traffic safety, and reduce environmental impact. Among them, the intelligent signal control system, as an important part of ITS, collects traffic data in real time and dynamically adjusts traffic lights to adapt to the ever-changing traffic conditions. The core of the system lies in how to accurately and quickly process and respond to real-time traffic data.
[0004] Existing intelligent signal control systems mainly include fixed program-based control methods and adaptive control methods based on traffic flow detection. Fixed program control methods rely on preset signal timing schemes, while adaptive control methods collect traffic data in real time through sensors installed at intersections and automatically adjust the changes in traffic lights based on the data. Although adaptive methods are more flexible than fixed program control, they still have limitations such as slow response speed and inability to effectively predict future traffic trends. In addition, with the expansion of urban traffic networks and the popularization of monitoring equipment, the amount of data that traffic management systems need to process has increased dramatically. When processing large amounts of real-time data, existing systems often face problems such as slow processing speed and low data utilization, which limits the effectiveness of the system in real-time scenarios. Traditional traffic signal systems are usually difficult to adapt to new or unforeseen changes in the traffic environment after deployment, such as new roads, urban activities, etc. This limits the long-term effectiveness and sustainability of the system.
[0005] Regarding the related technologies, the methods of adjusting traffic lights in intelligent transportation systems have problems such as slow response speed, inability to effectively predict future traffic trends, slow data processing speed, low data utilization, and difficulty in adapting to changes in the traffic environment. No effective solutions have yet been proposed. Summary of the invention
[0006] The embodiments of the present application provide a method, device and electronic device for timing signal lights in an intelligent traffic system, so as to at least solve the problem of slow response speed in the method for adjusting signal lights in an intelligent traffic system in the related art.
[0007] According to an embodiment of the present application, a method for timing a signal light in an intelligent transportation system is provided, comprising: Obtain and process traffic data collected in real time by sensing devices deployed at pedestrian crossings and adjacent intersections; Train and deploy a gated Transformer model; Use the gated Transformer model to model the state and reward sequence of the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status; The gated Transformer model processes and parses real-time data streams, outputs signal timing adjustment data, and dynamically adjusts the timing of traffic lights.
[0008] Optionally, the training gated Transformer model includes: Use historical traffic data to train the gated Transformer model. After the model is trained, perform evaluation tests in a simulated environment to check the performance of the model. Adopt offline reinforcement learning methods to optimize model performance without directly intervening in actual traffic flow; Formula for maximizing cumulative rewards: Maximize Sum(R_t) R_t = gamma^t × r_t Where: R_t: discounted reward at time t; gamma: discount rate of future rewards, used to assess the importance of future rewards relative to the current ones, with a value between 0 and 1. A lower gamma value means that the model attaches more importance to recent rewards, while a higher value makes the model attach more importance to long-term benefits. r_t: The immediate reward obtained at time t, calculated based on traffic flow and other relevant parameters.
[0009] Optionally, the deploying a gated Transformer model includes: Deploy the trained gated Transformer model in the actual traffic control system, and perform self-adjustment and optimization based on real-time traffic data to complete online update of model parameters; Online adjustment uses an iterative update formula: theta_new = theta_old + eta × grad(Loss(theta_old, data_new)) in: theta_new and theta_old: represent the values of model parameters before and after the update respectively; eta: learning rate, which determines the step size of model parameter updates and affects the speed at which the model learns new data; grad: the gradient of the loss function to the model parameters, which is used to guide how the model parameters should be adjusted to reduce prediction errors; Loss: Loss function measures the difference between the model prediction results and the actual data, and is the goal that needs to be minimized during the optimization process.
[0010] Optionally, the step of obtaining real-time traffic data collected by sensing devices deployed at pedestrian crossings and adjacent intersections includes: Deploy sensing devices at crosswalks and adjacent intersections to collect traffic data in real time; The traffic data includes: vehicle flow, pedestrian flow, vehicle queue length, vehicle speed, vehicle type, and pedestrian movement speed.
[0011] Optionally, the data processing includes: Normalization of data; The formula is: X_norm = (X - X_min) / (X_max - X_min) Where: X represents the raw data points collected from the sensor; X_min is the minimum value of this type of data in a specific acquisition period or window; X_max is the maximum value in the same period; X_norm is the normalized data, usually ranging from 0 to 1.
[0012] Optionally, the gated Transformer model is used to perform state and action sequence modeling of the traffic data collected at each time point, and the state and reward are analyzed and predicted, including: By using the gated Transformer model to sequentially model the data points collected from sensing devices, the state of traffic and pedestrian flow can be analyzed and predicted; The state vector s(t) and reward r(t) are defined as follows: s(t) = [traffic_density, pedestrian_wait_time, vehicle_flow, pedestrian_flow] r(t) = - (alpha × pedestrian_wait_time + beta × traffic_flow_disruption) Among them: traffic_density represents the density of vehicles at a specific time and place; pedestrian_wait_time is the average time pedestrians wait to cross the road at an intersection; vehicle_flow and pedestrian_flow represent the flow of vehicles and pedestrians respectively; Alpha and beta are trade-off coefficients used to adjust the impact of pedestrian waiting time and traffic flow disruption, and these two parameters are adjusted according to the needs of urban traffic policies or specific traffic scenarios.
[0013] Optionally, the gated Transformer model includes: The gated Transformer model uses a gating mechanism to optimize the Transformer network; The formula for the gating mechanism is: Gate = sigma(W_g × [Q; K; V]) Gated_Attention = Gate × Attention(Q, K, V) in: Q, K, V are the query, key, and value vectors in the Transformer model, which are the basic components of the model processing input data; W_g is the gating weight matrix, which is used to adjust the output of the gating layer and affect the strength of the gating signal; sigma is an activation function, usually a nonlinear function such as sigmoid, which is used to ensure that the output range of the gating signal is reasonable, usually between 0 and 1, and to control the flow of information, that is, to allow some information to pass while blocking other information; Attention(Q, K, V) is a standard self-attention mechanism that calculates the weighted sum of all input data, with the weights determined by the relevance of the input data; Gated_Attention is the attention output after gated modulation.
[0014] Optionally, the gated Transformer model processes and parses the real-time data stream, outputs signal timing adjustment data, and dynamically adjusts the signal light timing time, including: Signal timing adjustment: T_green = T_base + delta × (traffic_index - pedestrian_index) Among them: T_green: adjusted green light time; T_base: basic green light time, that is, the green light duration under standard conditions without the influence of additional traffic factors; delta: sensitivity coefficient, used to adjust the impact of changes in traffic conditions on the green light time; traffic_index: traffic index, reflecting the vehicle flow at a specific time and place; pedestrian_index: pedestrian index, reflecting the pedestrian flow at the same time and place.
[0015] According to another embodiment of the present application, there is also provided a signal light timing device for an intelligent traffic system, comprising: The data collection and processing module is used to obtain real-time traffic data collected by sensing devices deployed at pedestrian crossings and adjacent intersections and to process the data; Model training and deployment module: used to train and deploy gated Transformer models; State and reward sequence modeling module: used to use the gated Transformer model to perform state and reward sequence modeling on the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status; Timing adjustment module: used to process and parse real-time data streams through the gated Transformer model, output signal timing adjustment data, and dynamically adjust the timing of traffic lights.
[0016] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the intelligent traffic system signal light timing method through the computer program.
[0017] In an embodiment of the present application, a method for dynamically adjusting traffic signals using a gated Transformer model is used to collect traffic data in real time by deploying sensing devices at key traffic intersections, including vehicle flow, number of pedestrians, and other information. The collected data undergoes normalized data processing to ensure the quality and consistency of the input data, providing an accurate basis for subsequent data analysis and model training. A gated Transformer model is used to conduct in-depth analysis and learning of real-time traffic data. By introducing a gating mechanism, the model effectively filters noise and focuses on key data that has a significant impact on current traffic conditions, thereby improving the accuracy of decision-making and response speed. The model training adopts an offline learning method, and uses historical traffic data to train the model, so that it can optimize performance without directly affecting traffic flow, reducing the learning cost in actual deployment; the dynamic signal adjustment strategy is the core part of the present invention, and the green light time of the traffic light is dynamically adjusted according to the data output by the model to adapt to the real-time and predicted traffic conditions. This strategy makes traffic signal control more flexible and efficient, which can alleviate traffic congestion and improve road use efficiency; in addition, the system continues to perform online adjustment and optimization after deployment, and continuously updates and improves the model according to new traffic data to ensure the long-term operation effect and adaptability of the system; through this method, the present invention can significantly improve the level of intelligence of urban traffic management, improve traffic flow, and enhance the public travel experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 is a flow chart of a signal light timing method for an intelligent transportation system according to an embodiment of the present application; Figure 2 It is a structural block diagram of a signal light timing of an intelligent traffic system according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] In this embodiment, a method is provided. Figure 1 is a flow chart of a signal light timing method for an intelligent transportation system according to an embodiment of the present application. Figure 1 As shown, the process includes the following steps: S101 obtains traffic data collected in real time by sensing devices deployed at pedestrian crossings and adjacent intersections and processes the data; S102 training and deploying a gated Transformer model; S103 uses the gated Transformer model to model the state and reward sequence of the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status; The S104 gated Transformer model processes and parses real-time data streams, outputs signal timing adjustment data, and dynamically adjusts the timing of traffic lights.
[0024] Optionally, the training gated Transformer model includes: Use historical traffic data to train the gated Transformer model. After the model is trained, perform evaluation tests in a simulated environment to check the performance of the model. Adopt offline reinforcement learning methods to optimize model performance without directly intervening in actual traffic flow; Formula for maximizing cumulative rewards: Maximize Sum(R_t) R_t = gamma^t × r_t Where: R_t: discounted reward at time t; gamma: discount rate of future rewards, used to assess the importance of future rewards relative to the current ones, with a value between 0 and 1. A lower gamma value means that the model attaches more importance to recent rewards, while a higher value makes the model attach more importance to long-term benefits. r_t: The immediate reward obtained at time t, calculated based on traffic flow and other relevant parameters.
[0025] In intelligent transportation systems, model training and offline learning are key steps to ensure the accuracy and efficiency of traffic signal systems. This step involves using historical traffic data to train the gated Transformer model, using offline reinforcement learning methods to optimize model performance without directly intervening in actual traffic flow. Through offline learning, the model can establish a deep understanding of traffic flow patterns before deployment, thereby reducing the number of trial and error in actual operation and improving the accuracy and response speed of decision-making.
[0026] The gated Transformer module is the core of the algorithm, which optimizes the processing of information flow by introducing a gating mechanism. This mechanism enables the model to effectively filter out irrelevant noise when receiving continuous traffic data streams, and focus on key data that has a significant impact on the current traffic conditions. The effective operation of this module ensures the accuracy of decision-making and the response speed of the system, making traffic signal adjustments more precise and timely.
[0027] Before actually deploying the model, it is necessary to train the gated Transformer model through offline learning. This process uses a large amount of historical traffic data to allow the model to learn and optimize without actually intervening in traffic flow. In this way, the model can foresee and adapt to various traffic conditions before deployment, greatly reducing the risk and cost of actual deployment.
[0028] After the model is trained, an evaluation test is conducted in a simulated environment to check the model's performance, such as response speed, accuracy, and robustness. Based on the test results, the model parameters are adjusted and the training strategy is refined to further improve the efficiency and effectiveness of the model.
[0029] In urban traffic management, this offline-trained gated Transformer model is used to predict and manage traffic flow during special events (such as holidays, large public events, etc.). For example, before the model is deployed, these special events are simulated through historical data, and the model is trained to learn the optimal traffic signal control strategy under various stress tests. This pre-training enables the system to quickly adjust signal timing when actual events occur, effectively manage sudden increases in traffic and pedestrian flow, reduce traffic congestion and accidents, and improve overall traffic efficiency. In this way, offline learning not only optimizes traffic flow, but also significantly improves the city's emergency response capabilities and residents' satisfaction.
[0030] Optionally, the deploying a gated Transformer model includes: Deploy the trained gated Transformer model in the actual traffic control system, and perform self-adjustment and optimization based on real-time traffic data to complete online update of model parameters; Online adjustment uses an iterative update formula: theta_new = theta_old + eta × grad(Loss(theta_old, data_new)) in: theta_new and theta_old: represent the values of model parameters before and after the update respectively; eta: learning rate, which determines the step size of model parameter updates and affects the speed at which the model learns new data; grad: the gradient of the loss function to the model parameters, which is used to guide how the model parameters should be adjusted to reduce prediction errors; Loss: Loss function measures the difference between the model prediction results and the actual data, and is the goal that needs to be minimized during the optimization process.
[0031] Deploying the trained gated Transformer model in an actual traffic control system is a key step in achieving intelligent traffic management. After deployment, the model not only needs to process real-time traffic data, but also needs to self-adjust and optimize based on this data. This process involves online updating of model parameters to ensure that the system can adapt to the ever-changing traffic environment and different traffic modes.
[0032] After the model is deployed, continuous online adjustments are key to ensure long-term effectiveness and adaptability. The system continuously receives new traffic data and adjusts model parameters based on this real-time data feedback. This continuous optimization process ensures that the system can adapt to new or unforeseen traffic conditions, maintaining and improving the performance and efficiency of the traffic management system.
[0033] Based on real-time data and a pre-set loss function, the gradient required for parameter updates is calculated. This process is performed through optimization algorithms (such as gradient descent), which continuously adjust the model parameters to adapt to new traffic conditions. The learning rate eta plays a key role in this process, which determines how quickly the model adapts to new data. A larger learning rate may cause the model to respond quickly but easily over-adjust, while a smaller learning rate may make the model adjustment process too slow. The system continuously monitors the performance of the model, such as prediction accuracy, response time and other indicators, and adjusts the model parameters or structure based on these feedbacks. This includes adjusting the learning rate, optimizing the depth and width of the algorithm or model, etc.
[0034] In the urban traffic management system, the deployed intelligent traffic signal control system continuously adjusts the timing of the signal lights to cope with real-time traffic flow changes by receiving real-time data from various traffic nodes. For example, when a main road is monitored to be congested during rush hour, the system will automatically increase the green light time in that direction and reduce the green light time in the cross flow direction accordingly to relieve traffic pressure. In addition, the system can also predict future traffic flow based on factors such as holidays and weather changes, and make adjustments in advance. In the event of an accident or emergency, the system can quickly adjust the signal timing to give priority to the passage of rescue vehicles, showing extremely high adaptability and flexibility. This online adjustment mechanism not only improves traffic efficiency, but also enhances the safety and reliability of the urban transportation system, greatly improving the travel experience and satisfaction of citizens.
[0035] Optionally, the real-time collection of traffic data by sensing devices deployed at crosswalks and adjacent intersections comprises: deploying sensing devices at crosswalks and adjacent intersections to collect traffic data in real time; the traffic data comprises: vehicle flow, pedestrian flow, vehicle queue length, vehicle speed, vehicle type, and pedestrian moving speed.
[0036] Optionally, the data processing includes: data normalization processing; the formula is: X_norm = (X - X_min) / (X_max - X_min); where: X represents the original data point collected from the sensor; X_min is the minimum value of this type of data in a specific acquisition cycle or window; X_max is the maximum value in the same cycle; X_norm is the data after normalization processing, and the range is usually between 0 and 1.
[0037] The above traffic data is first converted into digital format through an analog to digital converter (A / D conversion) to facilitate subsequent electronic processing.
[0038] The main purpose of normalization is to eliminate the difficulty of direct comparison of raw data in different dimensions or measurement ranges, making data processing more standardized and consistent. For example, the count of vehicle flow may vary from hundreds to thousands, while the waiting time of pedestrians may be a value in seconds. Directly processing these data will cause the model to be biased towards variables with large dimensions. Through normalization, these data are converted to the same scale, which is convenient for comprehensive analysis and processing.
[0039] This normalized data is used to train decision models, for example, in intelligent transportation systems, to dynamically adjust the signal timing of traffic lights based on real-time data. The normalized data can be directly input into machine learning models, such as neural networks, which can predict the optimal traffic signal change strategy based on real-time traffic and pedestrian data, thereby reducing traffic congestion and pedestrian waiting time. In addition, normalization also improves the numerical stability of data processing and helps speed up the calculation process, because the numerical processing errors of data of the same magnitude are smaller and converge faster. This is particularly important in real-time systems, which can ensure that traffic control systems can respond quickly to complex and changing traffic conditions. Through this series of data collection, processing and normalization steps, intelligent transportation systems can more accurately understand and respond to the dynamic changes of urban traffic flows, and provide more scientific and reasonable traffic management decision support.
[0040] Optionally, the gated Transformer model is used to perform state and action sequence modeling of the traffic data collected at each time point, and the state and reward are analyzed and predicted, including: By using the gated Transformer model to sequentially model the data points collected from sensor devices, the state of traffic and pedestrian flow can be analyzed and predicted; The state vector s(t) and reward r(t) are defined as follows: s(t) = [traffic_density, pedestrian_wait_time, vehicle_flow, pedestrian_flow] r(t) = - (alpha × pedestrian_wait_time + beta × traffic_flow_disruption) Among them: traffic_density represents the density of vehicles at a specific time and place; pedestrian_wait_time is the average time pedestrians wait to cross the road at an intersection; vehicle_flow and pedestrian_flow represent the flow of vehicles and pedestrians respectively; Alpha and beta are trade-off coefficients used to adjust the impact of pedestrian waiting time and traffic flow disruption, and these two parameters are adjusted according to the needs of urban traffic policies or specific traffic scenarios.
[0041] In intelligent transportation systems, it is crucial to accurately simulate and predict traffic status. This paper analyzes and predicts the status of traffic and pedestrian flow by using a gated Transformer model to serialize and model data points collected from various sensors and camera systems. This model not only captures the status at each time point, but also predicts future status through sequence dependencies, thereby achieving the purpose of dynamically adjusting traffic signal timing.
[0042] Using the self-attention mechanism of the gated Transformer model, the model can understand and analyze how data at different time points are related. The self-attention layer allows the model to assign different weights to each data point in the entire data sequence and identify the key factors that affect the current traffic conditions. The gated Transformer model is used to process time series data. The gating mechanism in the model optimizes the processing of information by controlling the flow of information, and strengthens the model's attention and accuracy when processing information at key time points. The Transformer's self-attention mechanism allows the model to identify and emphasize important features in the sequence, such as sudden increases in traffic flow or sudden changes in pedestrian flow.
[0043] In an actual traffic system deployment, such as at a busy urban intersection, this gated Transformer model can receive traffic data input from sensing devices in real time and analyze the current traffic and pedestrian flow conditions. By continuously collecting and analyzing data, the model is able to learn how to adjust the timing of traffic lights according to changes in traffic and pedestrian flow at different times of a particular day. For example, during rush hour, the model may predict a sharp increase in vehicle flow and adjust signal timing accordingly to reduce vehicle congestion. Similarly, if the model detects a large number of pedestrians waiting to cross the road, it may increase the green light time to reduce pedestrian waiting time, thereby improving the overall efficiency and safety of the intersection. This technology can not only improve the efficiency of urban traffic management, but also provide a smoother and safer travel environment for drivers and pedestrians, significantly improving the quality of urban life.
[0044] Optionally, the gated Transformer model includes: the gated Transformer model utilizes a gating mechanism to optimize a Transformer network; The formula for the gating mechanism is: Gate = sigma(W_g × [Q; K; V]) Gated_Attention = Gate × Attention(Q, K, V) Where: Q, K, V are the query, key, and value vectors in the Transformer model, which are the basic components of the model processing input data; W_g is the gate weight matrix, which is used to adjust the output of the gate layer and affect the strength of the gate signal; sigma is the activation function, usually a nonlinear function such as sigmoid, which is used to ensure that the output range of the gate signal is reasonable, usually between 0 and 1, and control the flow of information, that is, allowing some information to pass while blocking other information; Attention(Q, K, V) is a standard self-attention mechanism, which calculates the weighted sum of all input data, and the weight is determined by the relevance of the input data; Gated_Attention is the attention output after gate modulation.
[0045] In intelligent transportation systems, processing and parsing real-time data streams are key to achieving effective signal control. The gated Transformer module plays a vital role in this process. It uses a gating mechanism to optimize the Transformer network and enhance the accuracy and stability of the model when processing traffic data. The introduction of the gating mechanism helps the model effectively filter noise and focus on useful information when facing complex traffic data streams, thereby improving the quality of traffic signal decisions.
[0046] The data is processed through the standard self-attention mechanism to produce preliminary output. This step helps the model capture the relationship and interdependence between different data points. At the same time, the gating signal is calculated to adjust the weight of each data point in the final output according to the actual importance of the data. The gating weight matrix W_g and the activation function sigma are combined with the input vector to generate the gating signal. This signal dynamically adjusts its importance according to the characteristics of the input data, allowing the model to pay more attention to key information when processing data. The gating signal is combined with the output of self-attention to form Gated_Attention. This output not only takes into account the intrinsic relevance of the data, but also enhances the model's responsiveness to key data through the gating mechanism.
[0047] By deploying this gated Transformer system at the main intersections of the city, the system can analyze vehicle and pedestrian flow data from all directions in real time. For example, when the system detects a sudden increase in vehicle flow in a certain direction, the gating mechanism can help the model focus on this key information and alleviate possible congestion by increasing the green light time in that direction. At the same time, if the pedestrian flow in the other direction is low, the model can reduce the green light time in that direction accordingly to optimize the overall traffic flow. The application of this technology not only improves the response efficiency of the traffic signal system, but also improves the intelligence and automation level of urban traffic management, making traffic control more flexible and efficient, and greatly improving the operating efficiency of the traffic system and the satisfaction of urban residents.
[0048] Optionally, the gated Transformer model processes and parses the real-time data stream, outputs signal timing adjustment data, and dynamically adjusts the signal light timing time, including: Signal timing adjustment: T_green = T_base + delta × (traffic_index - pedestrian_index) Among them: T_green: adjusted green light time; T_base: basic green light time, that is, the green light duration under standard conditions without the influence of additional traffic factors; delta: sensitivity coefficient, used to adjust the impact of changes in traffic conditions on the green light time; traffic_index: traffic index, reflecting the vehicle flow at a specific time and place; pedestrian_index: pedestrian index, reflecting the pedestrian flow at the same time and place.
[0049] In intelligent transportation systems, dynamic signal adjustment strategies are a core component to ensure that signal timing can flexibly respond to real-time and predicted traffic conditions. The strategy adjusts the green time of the signal lights based on the data analysis results received from the gated Transformer model to optimize traffic flow and reduce congestion. This method specifically considers changes in real-time traffic conditions and future trends to improve traffic efficiency and pedestrian safety. The new green time T_green is calculated using the base green time T_base plus a factor adjusted by the sensitivity coefficient delta. This process ensures that the adjustment of the green time can reflect actual traffic needs and quickly adapt to sudden traffic changes.
[0050] At a major intersection in the city, this dynamic signal adjustment strategy is implemented to cope with different traffic demands during the morning and evening rush hours. For example, during the morning rush hour, there are usually more vehicles than pedestrians. The system effectively reduces vehicle congestion by increasing the green light time in the direction with high vehicle flow and reducing the green light time in the direction with low pedestrian flow. During the rush hour after get off work, especially near schools or office areas, the pedestrian flow increases, and the system increases the green light time in these directions accordingly to ensure pedestrians can cross the street safely. In addition, the system can also respond to special events or emergencies, such as when a large-scale event or traffic accident occurs nearby. The system can quickly adjust the signal light timing of the corresponding intersection to optimize traffic flow and ensure safe and smooth traffic. This dynamic adjustment strategy not only improves traffic efficiency, but also enhances the adaptability and intelligence level of the urban transportation system.
[0051] According to another embodiment of the present application, Figure 2 As shown, a signal light timing device for an intelligent traffic system is also provided, comprising: The data collection and processing module 201 is used to obtain the real-time traffic data collected by the sensing devices deployed at the pedestrian crossing and its adjacent intersections and perform data processing; Model training and deployment module 202: used to train and deploy a gated Transformer model; The state and reward sequence modeling module 203 is used to perform state and reward sequence modeling on the traffic data collected at each time point using a gated Transformer model, and analyze and predict the traffic and pedestrian flow state; Timing adjustment module 204: used to process and parse the real-time data stream through the gated Transformer model, output signal timing adjustment data, and dynamically adjust the timing time of the traffic lights.
[0052] According to another aspect of an embodiment of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the intelligent traffic system signal light timing method through the computer program.
[0053] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0054] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for timing signal lights in an intelligent traffic system, characterized in that: include: Obtain and process traffic data collected in real time by sensing devices deployed at pedestrian crossings and adjacent intersections; Train and deploy a gated Transformer model; Use the gated Transformer model to model the state and reward sequence of the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status; The gated Transformer model processes and parses real-time data streams, outputs signal timing adjustment data, and dynamically adjusts the timing of traffic lights.
2. The method according to claim 1, characterized in that The training gated Transformer model includes: Use historical traffic data to train the gated Transformer model. After the model is trained, perform evaluation tests in a simulated environment to check the performance of the model. Adopt offline reinforcement learning methods to optimize model performance without directly intervening in actual traffic flow; Formula for maximizing cumulative rewards: Maximize Sum(R_t) R_t = gamma^t × r_t Where: R_t: discounted reward at time t; gamma: discount rate of future rewards, used to assess the importance of future rewards relative to the current ones, with a value between 0 and 1. A lower gamma value means that the model attaches more importance to recent rewards, while a higher value makes the model attach more importance to long-term benefits. r_t: The immediate reward obtained at time t, calculated based on traffic flow and other relevant parameters.
3. The method according to claim 1, characterized in that: The deployment of the gated Transformer model includes: Deploy the trained gated Transformer model in the actual traffic control system, and perform self-adjustment and optimization based on real-time traffic data to complete online update of model parameters; Online adjustment uses an iterative update formula: theta_new = theta_old + eta × grad(Loss(theta_old, data_new)) in: theta_new and theta_old: represent the values of model parameters before and after the update respectively; eta: learning rate, which determines the step size of model parameter updates and affects the speed at which the model learns new data; grad: the gradient of the loss function to the model parameters, which is used to guide how the model parameters should be adjusted to reduce prediction errors; Loss: Loss function measures the difference between the model prediction results and the actual data, and is the goal that needs to be minimized during the optimization process.
4. The method according to claim 1, characterized in that: The real-time collection of traffic data by sensing devices deployed at pedestrian crossings and adjacent intersections includes: Deploy sensing devices at crosswalks and adjacent intersections to collect traffic data in real time; The traffic data includes: vehicle flow, pedestrian flow, vehicle queue length, vehicle speed, vehicle type, and pedestrian moving speed.
5. The method according to claim 4, characterized in that The data processing includes: Normalization of data; The formula is: X_norm = (X - X_min) / (X_max - X_min) Where: X represents the raw data points collected from the sensor; X_min is the minimum value of this type of data in a specific acquisition period or window; X_max is the maximum value in the same period; X_norm is the normalized data, usually ranging from 0 to 1.
6. The method according to claim 1, characterized in that The gated Transformer model is used to model the state and action sequence of the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status, including: By using the gated Transformer model to sequentially model the data points collected from sensor devices, the state of traffic and pedestrian flow can be analyzed and predicted; The state vector s(t) and reward r(t) are defined as follows: s(t) = [traffic_density, pedestrian_wait_time, vehicle_flow, pedestrian_flow] r(t) = - (alpha × pedestrian_wait_time + beta × traffic_flow_disruption) Among them: traffic_density represents the vehicle density at a specific time and place; pedestrian_wait_time is the average time pedestrians wait to cross the road at an intersection; vehicle_flow and pedestrian_flow represent the flow of vehicles and pedestrians respectively; Alpha and beta are trade-off coefficients used to adjust the impact of pedestrian waiting time and traffic flow disruption, and these two parameters are adjusted according to the needs of urban traffic policies or specific traffic scenarios.
7. The method according to claim 1, characterized in that The gated Transformer model includes: The gated Transformer model uses a gating mechanism to optimize the Transformer network; The formula for the gating mechanism is: Gate = sigma(W_g × [Q; K; V]) Gated_Attention = Gate × Attention(Q, K, V) in: Q, K, V are the query, key, and value vectors in the Transformer model, which are the basic components of the model processing input data; W_g is the gating weight matrix, which is used to adjust the output of the gating layer and affect the strength of the gating signal; sigma is an activation function, usually a nonlinear function such as sigmoid, which is used to ensure that the output range of the gating signal is reasonable, usually between 0 and 1, and to control the flow of information, that is, to allow some information to pass while blocking other information; Attention(Q, K, V) is a standard self-attention mechanism that calculates the weighted sum of all input data, with the weights determined by the relevance of the input data; Gated_Attention is the attention output after gated modulation.
8. The method according to claim 1, characterized in that: The gated Transformer model processes and parses real-time data streams, outputs signal timing adjustment data, and dynamically adjusts the timing of traffic lights, including: Signal timing adjustment: T_green = T_base + delta × (traffic_index - pedestrian_index) Among them: T_green: adjusted green light time; T_base: basic green light time, that is, the green light duration under standard conditions without the influence of additional traffic factors; delta: sensitivity coefficient, used to adjust the impact of changes in traffic conditions on the green light time; traffic_index: traffic index, reflecting the vehicle flow at a specific time and place; pedestrian_index: pedestrian index, reflecting the pedestrian flow at the same time and place.
9. A signal light timing device for an intelligent traffic system, characterized in that: include: The data collection and processing module is used to obtain real-time traffic data collected by sensing devices deployed at pedestrian crossings and adjacent intersections and to process the data; Model training and deployment module: used to train and deploy gated Transformer models; State and reward sequence modeling module: used to use the gated Transformer model to perform state and reward sequence modeling on the traffic data collected at each time point, analyze and predict the traffic and pedestrian flow status; Timing adjustment module: used to process and parse real-time data streams through the gated Transformer model, output signal timing adjustment data, and dynamically adjust the timing of traffic lights.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 8 through the computer program.