An intersection phase structure optimization method based on a large language model
By combining a large language model with a value network, we have achieved the automatic generation of efficient and real-time adaptive intersection phase structures, which solves the problems of low efficiency and poor adaptability in traditional methods and improves the real-time response capability and traffic efficiency of traffic signal control.
Patent Information
- Application Number
- CN202511797426.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-12-02
AI Technical Summary
Traditional phase structure optimization methods rely heavily on historical data, are inefficient and have poor adaptability, making it difficult to cope with complex traffic flow scenarios. Furthermore, large language models are not widely used in the field of traffic signal control.
By constructing a semantic mapping relationship between traffic flow features and phase structure, a large language model is used to automatically generate phase structure schemes, and a value network is combined for iterative optimization to achieve dynamic phase structure generation and real-time adaptability.
It significantly improves the efficiency of intersection traffic, can respond to sudden traffic events in real time, reduces the impact of human factors, and realizes the automatic generation of efficient signal control configurations.
Smart Images

Figure CN121234786B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of urban traffic planning and intelligent transportation systems, relates to large language model technology and phase structure combination method, and specifically relates to a phase structure optimization method for an intersection based on a large language model. BACKGROUND
[0002] The phase structure of an intersection is a global design framework for allocating traffic rights in a signal cycle in a traffic signal control system, and the core thereof is composed of a phase combination scheme and a phase switching scheme. The phase combination scheme defines a traffic flow set that can share traffic rights in a specific time window, and eliminates the motion conflict within the intersection by discretizing the traffic timing of the conflicting traffic flow, so as to maximize the intersection traffic efficiency, and therefore the phase combination scheme is the first key step in signal timing optimization. However, the traditional phase optimization method highly depends on historical data and has problems such as low efficiency and poor adaptability. With the continuous development of artificial intelligence technology, some studies attempt to introduce methods such as reinforcement learning to optimize phase parameters, such as the document “Single Intersection Traffic Signal Control Method Based on Q-Learning” which proposes to dynamically adjust the phase length through the Q-Learning algorithm, but such methods still face many challenges, such as being limited by the constraints of fixed phase structure, being difficult to meet the demand for dynamic adjustment of phase structure under complex traffic flow scenarios, having a large state space dimension resulting in low learning efficiency and poor model generalization ability, and the “black box” structure lacking explainability, which limits its deployment feasibility in real traffic systems. In recent years, large language models have shown strong semantic understanding and logical reasoning capabilities in the field of natural language processing, but their application in the field of traffic signal control is still in the exploratory stage. SUMMARY
[0003] To solve the problems of traditional phase structure optimization such as strong dependence on historical data and poor adaptability of fixed phase structure, the application provides a phase structure optimization method based on a large language model, which realizes the dynamic generation of intersection phase structure by fusing traffic data and the semantic reasoning capability of a large language model. The application realizes automatic generation of phase structure schemes through a semantic reasoning and feedback optimization mechanism, effectively improving the intersection traffic efficiency and adaptability.
[0004] The technical scheme of the application is as follows:
[0005] A phase structure optimization method for an intersection based on a large language model, which includes four core steps: data preparation, simulation platform construction, value network training, and large language model optimization (including interaction, cycle calculation, and iterative optimization). By constructing the semantic mapping relationship between traffic flow characteristics and phase structure, the large language model can select the phase structure.
[0006] The specific steps are as follows:
[0007] Step 1: Preparation of traffic flow data and road network information data
[0008] Collect the traffic flow and road network information of the area to be optimized in a specific time period for traffic simulation model construction and phase optimization scheme design, which includes two parts:
[0009] Step 1.1, traffic flow data collection:
[0010] Collect the data of straight traffic and turning traffic of the intersection to be optimized in a specific time period through magnetic sensors, radars, video detectors and other detection equipment.
[0011] Step 1.2, acquisition of road network information data:
[0012] Obtain the road network geometric parameters (such as road network topology, number of lanes, lane function division, channelization design, etc.), traffic control parameters (such as existing phase structure, cycle length) and traffic management system (such as left turn prohibition, right turn prohibition, etc. Traffic control information).
[0013] Step 2: Construction of simulation platform
[0014] On the basis of the data obtained in step 1, construct a traffic simulation model to simulate the traffic running effect under different phase structures, and realize the following functions through simulation software:
[0015] Step 2.1, dynamic loading of real-time traffic flow data;
[0016] Step 2.2, simulate the traffic flow running state under different phase structure schemes;
[0017] Step 2.3, output multi-objective performance evaluation indexes including delay, queue length, traffic capacity, etc.
[0018] Step 3: Value network training
[0019] Based on the constructed traffic simulation model, train the value network, which includes the following sub-steps:
[0020] Step 3.1, data generation:
[0021] Randomly perturb the intersection flow in the traffic simulation model to construct diversified traffic scenarios; let the original flow of a certain intersection be , and the new flow after perturbation be :
[0022]
[0023] where is the set flow adjustment amplitude parameter, is a random function.
[0024] Step 3.2, Phase scheme simulation:
[0025] For each generated traffic scenario, enumerate all possible phase structure schemes, calculate the basic green time ratio of each scheme using the Webster method, and record the multi-objective evaluation results of each scheme; Let the phase structure scheme set be For any phase structure scheme , the comprehensive evaluation index under traffic flow is:
[0026]
[0027] where represents the intersection topology feature vector, including geometric layout, lane configuration and other static attributes; Function represents the average waiting time of vehicles under traffic flow and phase scheme , function represents the average travel time of vehicles under traffic flow and phase scheme ; represents the weight coefficient, satisfying and , respectively, indicating the weight of waiting time and travel time in the comprehensive evaluation, which can be initially set to 0.5 according to the optimization goal; represents the normalization coefficient, which is used to eliminate the influence of dimension, and takes the maximum value of the corresponding index in all alternative schemes under the current traffic scenario , that is, .
[0028] Step 3.3, Data enhancement:
[0029] Repeat steps 3.1 and 3.2 to enhance the diversity and coverage of data. The final constructed dataset is composed of samples, each of which is a five-tuple:
[0030]
[0031] where is the traffic flow data generated by the th random disturbance, is the number of disturbances, is the total number of phase structure schemes.
[0032] Step 3.4, Multi-intersection data expansion:
[0033] Suppose there are intersections, for each intersection Repeat steps 3.1 to 3.3 to finally obtain the complete data set:
[0034]
[0035] wherein, represents a multi-intersection data set, represents the data set of the th intersection;
[0036] Step 3.5, value network training:
[0037] Based on the constructed multi-intersection data set , a nonlinear residual neural network model is established as a value network for predicting the comprehensive evaluation index of the phase scheme. The network model is composed of embedding layers and residual blocks, which accepts three types of input features: intersection topology features , traffic flow information and signal parameters of phase scheme ; among them, the topology features and signal parameters are soft coded as classification features through embedding layers, and then combined with numerical traffic information as feature vectors . The network mapping can be represented as , wherein is the predicted value of the comprehensive evaluation index , and is the network parameter. The training target is to minimize the mean square error loss function :
[0038]
[0039] wherein, is the total number of training samples, is the real evaluation index obtained by simulation.
[0040] Step 4: Interactive iteration of large language model
[0041] Intelligent generation and interactive optimization of phase structure scheme are adopted by using large language model, which combines actual traffic flow, road network information and professional traffic knowledge to obtain traffic signal control strategy; the obtained traffic signal control strategy is evaluated by the network model trained in step 3; specific steps include the following sub-steps:
[0042] Step 4.1, prompt word generation and input construction:
[0043] Based on the traffic information of the intersection to be optimized , traffic network structure and supplementary traffic background information , construct prompt words for guiding large language model to generate initial phase structure scheme. Prompt word generation function is:
[0044]
[0045] wherein, is the prompt word generation function, which is used to convert the input into a text format acceptable to the large language model, and can also contain heuristic language optimization strategies for guiding the large language model to output control suggestions.
[0046] interact with the prompt word and the large language model (such as GPT model) to obtain the initial phase structure scheme generated by the large language model , wherein each represents a signal configuration of a phase, including the covered lanes and turns.
[0047] Step 4.2, calculate the green ratio of the phase structure based on the large language model:
[0048] In order to convert the text scheme generated by the large language model into implementable control parameters, the specific signal cycle and green time of each phase need to be calculated according to the traffic engineering method. According to the phase structure scheme given by the large language model , combined with traffic flow information and Webster optimal cycle length calculation method, the optimal cycle length and the green ratio of each approach are calculated. If there are phases, then the cycle is calculated as:
[0049]
[0050] wherein, is the total loss time in the cycle, is the green ratio of the th phase, which satisfies:
[0051]
[0052] wherein, is the green time of the th phase;
[0053] If the th phase acts on the approach of the intersection, there are approaches, then the calculated green time set of the phase approach is :
[0054]
[0055] Step 4.3, scheme evaluation and value network driven iterative optimization:
[0056] The performance of the phase structure scheme generated by the large language model is evaluated by the value network, and the prompt words are updated based on the evaluation results to guide the large language model to iteratively generate a scheme with better performance. The process specifically includes:
[0057] Step 4.3.1, scheme evaluation:
[0058] The phase structure scheme calculated in step 4.2, the green ratio, and the current intersection topology characteristics and traffic flow are input into the value network model trained in step 3 to obtain the performance evaluation results of the scheme under the current traffic scenario.
[0059] Let the current scheme be , and the value network outputs its comprehensive evaluation index as:
[0060]
[0061] Wherein, is the current traffic flow, is the current phase structure, is the trained neural network model, is the network parameter.
[0062] Step 4.3.2, optimality judgment:
[0063] Compare the score of the current scheme with the historical optimal result . If the score of the current scheme is better than the known optimal solution, update the optimal scheme :
[0064]
[0065] Step 4.3.3, feedback guidance and prompt word update:
[0066] If the current scheme does not reach the preset optimal evaluation or still has obvious optimization space, construct feedback information containing the current scheme structure and performance score , and update the prompt words of the large language model :
[0067]
[0068] Wherein, the function combines traffic data, background information, and performance feedback to construct new optimization prompt words to guide the large language model to generate the next round of scheme .
[0069] Step 4.3.4, iterative optimization process:
[0070] Steps 4.3.1-4.3.3 are iteratively performed, with each round generating a new candidate solution by the large language model and independently scoring the performance by the value network. The entire process continues until the solution score meets the set optimal evaluation target or reaches the maximum number of iterations , at which point it is terminated. Finally, the phase structure solution evaluated by the value network as optimal is output as the final traffic signal control configuration solution.
[0071] Advantages of the present application:
[0072] (1) Dynamic phase structure generation: Utilizing the semantic reasoning ability of the large language model, automatically identifying the matching relationship between traffic flow characteristics and phase structure, breaking through the limitations of traditional fixed phase solutions. For example, when the left-turn traffic exceeds the threshold, the model can automatically generate a left-turn dedicated phase and adjust the phase order.
[0073] (2) Real-time adaptability enhancement: Optimizing the phase solution based on real-time traffic data, shortening the response period from hours in traditional methods to minutes, significantly improving the ability to respond to sudden traffic incidents.
[0074] (3) Reducing human dependence: Changing the phase structure design from traffic engineers' design to large language model's automated design, reducing the deviation of the solution caused by human factors. BRIEF DESCRIPTION OF DRAWINGS
[0075] Figure 1 is the basic flowchart of the method of the present application.
[0076] Figure 2 is a regional road network structure diagram (6 intersections) in an embodiment of the present application.
[0077] Figure 3 is a regional road network structure diagram (31 intersections) in an embodiment of the present application. DETAILED DESCRIPTION
[0078] The specific embodiments of the present application will be further described below in combination with the drawings and technical solutions.
[0079] The basic flow of the method of the present application is shown in Figure 1 , and the following uses SUMO software to select part of the road network in a certain area (31 intersections and the simplified 6 intersections of the road network) as an example.
[0080] Step 1: Preparation of traffic flow data and traffic road network data
[0081] Step 1.1, Traffic Flow Data Preparation
[0082] Obtain the traffic flow and density of each turning direction at the intersection within 7:00-8:00 through traffic sensors and video monitoring on the regional traffic network.
[0083] Step 1.2, Road Network Data Preparation
[0084] Obtain the data required for the regional road network topology and related traffic information: the number of lanes, lane capacity, and speed limit of the target regional road network.
[0085] Step 2: Building of Simulation Platform
[0086] Based on the collected traffic flow data and traffic network data, build a traffic simulation model, as shown in the example regional road network Figure 2 .
[0087] Step 3: Value Network Training
[0088] Based on the simulation model built in step 2, select multiple intersections to be optimized, construct disturbance flow samples and corresponding multiple phase structure combinations. For each intersection, use a random function to disturb the straight and turning traffic to form diversified traffic scenarios; for each disturbance traffic scenario, enumerate the phase structure scheme and calculate the evaluation index according to the Webster method; repeat the above process to form multiple sets of training data, covering multiple intersections and traffic intervals; build a three-layer fully connected neural network, taking the phase structure and traffic characteristics as input, to predict the traffic effect index; the model uses the activation function ReLU (Rectified Linear Unit), the optimizer Adam (Adaptive Moment Estimation), sets the learning rate to 0.001, and uses the MSE function (Mean Squared Error) as the loss function, and the training data and test data are divided according to the ratio of 8:2.
[0089] Obtain the value network as the scorer for subsequent large language model scheme evaluation and feedback iteration.
[0090] Step 4: Interaction of Large Language Model
[0091] Step 4.1, Dynamic Prompt Generation
[0092] Input the traffic flow information, traffic network information, and supplementary traffic background information of the intersection to be optimized, and construct prompt words that can clearly and accurately convey the problem situation and solution goal to the large language model (this example uses DeepSeek-V3).
[0093] Step 4.2, Interaction with Large Language Model
[0094] The prompt word generated according to the traffic flow characteristics is input into the large language model, and the model infers the initial phase structure scheme.
[0095] Step 4.3, calculate the cycle length and the preliminary phase length
[0096] According to the phase structure scheme given by the large language model and the traffic flow data, the signal cycle and the green light time of each phase are calculated by the Webster method.
[0097] Step 4.4, write the calculated results into the configuration file
[0098] The phase selection given by the large model and the calculated results are written into the configuration file to configure the signal lamp configuration file of a single intersection.
[0099] Step 4.5, iterative optimization
[0100] Step 4.5.1, integrate the phase scheme given by the large model and the calculated green ratio information into a complete scheme;
[0101] Step 4.5.2, use the model trained in step 3 to judge the advantages and disadvantages of the large language model scheme;
[0102] Step 4.5.3, if the current scheme does not reach the preset performance threshold or is not better than the historical optimal value, construct feedback information for prompting update.
[0103] Step 5: run simulation and perform result analysis
[0104] Run the test in the simplified 6-intersection road network (as shown in Figure 2 , check the road network structure and related phase configuration file, and then perform SUMO running simulation and analyze the output results. The weighted average waiting time of the vehicle is selected as the comparison index. In order to ensure the scientificity and accuracy of the results, the control effect of the phase scheme before and after optimization is compared in multiple experiments, and the data are shown in Table 1 (the original scheme refers to the phase scheme configured manually in the current actual project).
[0105] Table 1: Comparison of phase scheme results in 6-intersection environment
[0106]
[0107] As can be seen from the table, the phase structure of the present method can achieve a certain degree of optimization in most intersections. From the overall perspective of the 6-intersection road network, the weighted average waiting time of the phase scheme generated based on the large language model of the present method is optimized by 17% compared with the original phase scheme, verifying the optimization ability and actual applicability of the present method in small-scale road networks.
[0108] In addition, in the complete 31-intersection road network (as shown inFigure 3 The test is run in the environment shown in the figure, the SUMO running simulation is performed after checking the road network structure and the related phase configuration file, and the output result is analyzed. The weighted average waiting time of the vehicle is selected as the comparison index. In order to ensure the scientificity and accuracy of the result, a plurality of groups of experiments are compared with the results of the phase scheme, and the data is shown in Table 2.
[0109] Table 2: Comparison of phase scheme results under 31 intersection environments
[0110]
[0111] The experimental results show that in the large-scale urban road network covering 31 intersections, the phase structure scheme generated by the method based on the large language model reduces the weighted waiting time by about 20% compared with the original scheme, which fully embodies the optimization potential and generalization ability of the method in the large-scale traffic environment.
[0112] The present application realizes the automatic generation and performance evaluation of the signal control scheme by constructing the semantic mapping of the traffic data and the phase structure. The value network is combined as a scorer, and the input iteration optimization is guided and prompted based on the scoring result, so that the data-driven, structure-dynamic and performance-oriented intelligent signal control scheme configuration process is realized.
Claims
1. A method for optimizing the phase structure of intersections based on a large language model, characterized in that, The steps are as follows: Step 1: Preparation of traffic flow data and road network information data Collect traffic flow and road network information for the area to be optimized within a specific time period for use in traffic simulation model construction and phase optimization scheme design, specifically including: Step 1.1, Traffic Flow Data Collection: Data on through traffic flow and turning traffic flow at the intersection to be optimized within a specific time period is collected using detection equipment including geomagnetic sensors, radar, and video detectors. Step 1.2: Obtaining Road Network Information Data: Obtain the road network geometry parameters, traffic control parameters, and traffic management regulations for the target area; Step 2: Construction of the simulation platform Based on the data obtained in step 1, a traffic simulation model is constructed; Step 3: Value Network Training Based on the constructed traffic simulation model, the value network is trained, specifically including the following sub-steps: Step 3.1, Data Generation: In traffic simulation models, the traffic flow at intersections is randomly perturbed to construct diverse traffic scenarios; let the original traffic flow at a certain intersection be... The new flow after the disturbance is : in, The set flow rate adjustment range parameter, It is a random function; Step 3.2, Phase Scheme Simulation: For each generated traffic scenario, all possible phase structure schemes are enumerated, the Webster method is used to calculate the base green light ratio for each scheme, and the multi-objective evaluation results for each scheme are recorded; let the set of phase structure schemes be . For any phase structure scheme Its traffic flow Comprehensive evaluation indicators for: in, Represents the topological feature vector of an intersection, including its geometric layout and lane configuration; function Represents traffic and phase scheme Average waiting time for vehicles, function Represents traffic and phase scheme Average travel time for vehicles; Represents the weighting coefficient, satisfying and , respectively, represent the weights of waiting time and passage time in the overall evaluation; Represents the normalization coefficient, taken from the current traffic scenario. The maximum value of the corresponding indicator among all the alternative options, i.e. ; Step 3.3, Data Augmentation: Repeat steps 3.1 and 3.2 to enhance the diversity and coverage of the data; the final dataset is constructed. Depend on The sample consists of 5 tuples, each of which is a quintuple: in, For the first Traffic flow data generated by random perturbation. For the number of perturbations, This represents the total number of phase structure schemes; Step 3.4, Multi-intersection data expansion: Assume there is a total There are several intersections, for each intersection Repeat steps 3.1 to 3.3 to obtain the complete dataset: in, Represents a multi-intersection dataset. Indicates the first A dataset of intersections; Step 3.5, Value Network Training: Step 4: Interactive Iteration of the Large Language Model A large language model is used to intelligently generate and interactively optimize the phase structure scheme. This process combines actual traffic flow, road network information and professional traffic knowledge to obtain traffic signal control strategies. The obtained traffic signal control strategies are evaluated by the network model trained in step 3.
2. The method for optimizing the phase structure of an intersection based on a large language model according to claim 1, characterized in that, In step 1.2, the road network geometric parameters include the road network topology, number of lanes, lane function division and channelization design, the traffic control parameters include the existing phase structure and cycle duration, and the traffic management system includes prohibition of left turns and prohibition of right turns.
3. The method for optimizing the phase structure of an intersection based on a large language model according to claim 1, characterized in that, The traffic simulation model in step 2 is used to simulate the traffic operation effects under different phase structures, and the simulation software achieves the following functions: Step 2.1: Dynamically load real-time traffic flow data; Step 2.2: Simulate traffic flow operation under different phase structure schemes; Step 2.3: Output multi-objective performance evaluation indicators including delay, queue length, and throughput capacity.
4. The method for optimizing the phase structure of an intersection based on a large language model according to claim 1, characterized in that, Step 3.5 is as follows: Based on the constructed multi-intersection dataset Establish a nonlinear residual neural network model As a value network, it is used to predict the comprehensive evaluation index of phase schemes; network model It consists of an embedding layer and residual blocks, and accepts three types of input features: intersection topology features. Traffic flow information and phase scheme The traffic light parameters are used; among them, topological features and traffic light parameters are used as classification features and are soft-encoded through an embedding layer, and then combined with numerical traffic information to form a feature vector. Network mapping is represented as ,in For comprehensive evaluation indicators The predicted value, These are the network parameters; the training objective is to minimize the mean squared error loss function. : in, The total number of training samples, The actual evaluation index is obtained from the simulation.
5. The method for optimizing the phase structure of an intersection based on a large language model according to claim 1, characterized in that, Step 4 is as follows: Step 4.1, Prompt word generation and input construction: Traffic flow information based on the intersection to be optimized Transportation network structure And supplementary traffic background information Constructing prompt words This is used to guide the large language model in generating the initial phase structure scheme; the prompt word generation function is: in, The prompt word generation function is used to transform the input into a text format acceptable to large language models, and includes heuristic language optimization strategies to guide the output control suggestions of large language models; prompt words Interact with a large language model to obtain its generated initial phase structure scheme. Each of them A signal configuration that indicates a phase, including the lanes and steering directions covered; Step 4.2: Calculate the green light ratio based on the phase structure constructed from the large language model: To convert the text-based schemes generated by the large language model into implementable control parameters, it is necessary to calculate the specific signal cycles and green light durations for each phase using traffic engineering methods, based on the phase structure scheme provided by the large language model. By combining traffic flow information with Webster's optimal cycle length calculation method, the optimal cycle length is calculated. Compared with the green light of each import channel; If there is a common Each phase, Then the period The calculation formula is: in, This represents the total lost time within the period. For the first The green light ratio of each phase satisfies: in, For the first Green light duration for each phase; If the first The intersection entrance lanes with phase action have If there are 1, then the set of calculated green light durations for that phase's entrance lane is: : Step 4.3, Solution Evaluation and Value Network-Driven Iterative Optimization: The performance of phase structure schemes generated by a large language model is evaluated using a value network, and prompt words are updated based on the evaluation results. This guides the large language model to iteratively generate better-performing schemes. The process specifically includes: Step 4.3.1, Solution Evaluation: The phase structure scheme and green ratio calculated in step 4.2, as well as the current intersection topology and traffic flow, are used as inputs and fed into the value network model trained in step 3 to obtain the performance evaluation results of the scheme under the current traffic scenario. Let the current solution be The comprehensive evaluation index of the value network output is: in, For current traffic flow, For the current phase structure, For a trained neural network model, For network parameters; Step 4.3.2, Optimality Judgment: Compare the current solution score with the historical best result. The solution is compared; if the current solution scores better than the known optimal solution, the optimal solution is updated. : Step 4.3.3, Feedback Guidance and Prompt Update: If the current solution does not achieve the preset optimal evaluation, or if there is still significant room for optimization, then feedback information containing the structure and performance score of the current solution is constructed. Update the prompt words of the large language model. : Among them, the function By combining traffic data, background information, and performance feedback, new optimization prompts are constructed to guide the large language model in generating the next round of solutions. ; Step 4.3.4, Iterative optimization process: Steps 4.3.1-4.3.3 involve continuous iteration. In each round, the large language model generates new candidate solutions, and the value network independently scores their performance. The entire process continues until the solution score reaches the set optimal evaluation target or the maximum number of iterations is reached. The process terminates at a certain point; ultimately, the output is the phase structure scheme evaluated as optimal by the value network. As the final traffic signal control configuration scheme.
Citation Information
Patent Citations
Global traffic signal control method based on regional context enhanced large language model
CN120823722A
Intelligent interpretable traffic signal adaptive control method
CN121011094A