A traffic timing method and system based on multi-agent collaboration using a large language model

CN122575130APending Publication Date: 2026-08-14WUHAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-04
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]本发明实施例提供一种基于大语言模型多智能体协同的交通配时方法、系统、电子设备和存储介质,以解决现有技术中传统固定配时方案易退化且维护成本高、强化学习方法决策黑盒不可解释、单一大语言模型方法易产生数值幻觉且缺乏全生命周期自演化闭环的技术问题

Benefits of technology

(1)以物理公式与安全边界为硬约束,彻底杜绝大语言模型常见的数值幻觉,确保底层执行指令准确合规。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122575130A_ABST
    Figure CN122575130A_ABST
Patent Text Reader

Abstract

This invention provides a traffic timing method, system, electronic device, and storage medium based on multi-agent collaboration using a large language model, constructing a closed-loop architecture with five large language model agents working collaboratively. Specifically, the cognitive agent automatically divides the boundaries of multiple time periods throughout the day based on historical traffic flow data, forming a macro-scheduling framework; the phase sequence design agent generates an interpretable and compliant physical benchmark timing scheme based on traffic engineering physical formulas and safety boundary verification; the evaluation agent and the execution agent cooperate to obtain the optimal timing scheme through iterative processes of micro-simulation deduction, qualitative diagnostic report generation, quantitative adjustment, and mathematical boundary constraints; and the monitoring agent continuously collects intersection operation indicators after the scheme is actually deployed. Once performance degradation exceeds a preset threshold, a full-process reconstruction is automatically triggered, thereby achieving lifelong self-evolution of the timing scheme.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the fields of intelligent traffic control and artificial intelligence technology, and in particular to a traffic timing method, system, electronic device and storage medium based on multi-agent collaboration of a large language model. Background Technology

[0002] Currently, traffic signal timing methods at urban intersections are mainly divided into three categories. The first category is the traditional engineering method, which widely employs fixed timing calculations based on classical physics formulas such as Webster's algorithm, or manually divided multi-time-of-day (TOD) scheduling plans. This method relies on traffic engineers conducting periodic on-site surveys and timing calculations. The second category is the data-driven method. With the development of artificial intelligence technology, many studies have introduced reinforcement learning (RL) and deep reinforcement learning (DRL) algorithms, training models in simulation environments to dynamically adjust signal timing. The third category is a preliminary exploration based on large language models (LMM), which attempts to directly generate or optimize signal timing schemes using their logical reasoning capabilities.

[0003] However, each of the aforementioned existing technologies has fundamental technical flaws, which have had a serious negative impact on practical applications. First, traditional engineering methods use an open-loop static architecture, which cannot cope with the inherent conceptual drift of traffic flow (such as the long-term evolution of traffic characteristics due to the development of surrounding land parcels). Their timing schemes inevitably experience performance degradation after implementation, and correcting this degradation requires lengthy manual re-evaluation, resulting in extremely high lifecycle maintenance costs and leaving many intersections in a suboptimal operating state for extended periods. Second, reinforcement learning and deep reinforcement learning methods are essentially black-box models; their output control commands completely lack interpretability from a traffic engineering perspective. Once the system makes an incorrect decision under complex road conditions (such as causing severe queue overflow), managers cannot trace the root cause, making it difficult to meet the stringent high safety requirements of real intersections. Furthermore, their ability to generalize to sudden traffic surges is extremely weak, making engineering implementation difficult. Finally, existing large language model timing solutions adopt a single large model architecture, which is prone to cognitive overload and numerical illusion when handling macro-analysis and micro-calculation tasks simultaneously (such as outputting illegal instructions with negative durations or non-closed cycles). At the same time, its generation process is deviated from the rigid constraints of traffic physics laws and is mostly one-time static generation, completely lacking online performance monitoring and proactive reconstruction mechanisms. Therefore, it cannot provide a stable, reliable, and long-term engineering solution.

[0004] In summary, no existing technology can simultaneously balance the reliability of physical laws, the interpretability of decision-making logic, the accuracy of numerical calculations, and the adaptability throughout the entire lifecycle of traffic signal timing. Traditional methods, reinforcement learning methods, and single large language model methods, each starting from their respective technical paths, cannot independently overcome the aforementioned contradictions. This results in intelligent traffic signal timing technology facing multiple technical barriers when deployed on a large scale in engineering, including high maintenance costs, low interpretability, frequent numerical errors, and a lack of self-evolution capabilities. Summary of the Invention

[0005] This invention provides a traffic timing method, system, electronic device, and storage medium based on multi-agent collaboration using a large language model, to address the technical problems in existing technologies such as the easy degradation and high maintenance cost of traditional fixed timing schemes, the uninterpretable black box decision-making of reinforcement learning methods, and the tendency of single large language model methods to produce numerical illusions and lack of a full lifecycle self-evolutionary closed loop.

[0006] In a first aspect, embodiments of the present invention provide a traffic timing method based on multi-agent collaboration using a large language model, comprising: S1. Obtain historical traffic flow data at the intersection; input the historical traffic flow data into the cognitive agent, identify the temporal peak and valley characteristics of the historical traffic flow data, and generate a multi-time period control boundary set that is non-overlapping and non-omitted within 24 hours as a macro-scheduling framework; the cognitive agent is the first major language model; S2. Based on the macro scheduling framework and the traffic flow parameters of the current time period, calculate the initial timing parameters using the preset traffic engineering physical formula; generate a compliant phase sequence that conforms to the conflict matrix constraint through the phase sequence design agent; apply safety boundary verification to the initial timing parameters and the compliant phase sequence to generate a physical benchmark timing scheme; S3. The physical baseline timing scheme is injected into the microscopic traffic simulation platform for simulation to obtain simulation evaluation indicators. The simulation evaluation indicators are input into the evaluation agent, which generates a qualitative diagnostic report containing bottleneck location and adjustment direction. The evaluation agent is the third major language model. The qualitative diagnostic report and the current timing parameters are input into the execution agent. The execution agent performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints to generate an updated timing scheme. The execution agent is the fourth major language model. S3 is repeated until the preset iteration termination condition is met to obtain the optimal timing scheme. S4. After the optimal timing scheme is deployed to the physical traffic signal controller, the actual operating indicators of the intersection are collected in real time by the monitoring agent, and the actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained by comparison indicates that the performance degradation of the scheme exceeds the preset threshold, steps S1 to S3 are executed again to generate and issue a new optimal timing scheme. The monitoring agent is the fifth language model.

[0007] Preferably, S1 specifically includes: S11. Obtain historical traffic flow data of the intersection over several consecutive days through traffic flow sensors and traffic management historical database, perform noise reduction and smoothing processing on the historical traffic flow data, and construct a state matrix containing the arrival rate, saturation flow, queue length and turning ratio vector of each lane. S12. The state matrix, intersection channelization information, and preset traffic engineering time constraints are converted into structured engineering prompts and input into the cognitive agent. S13. The cognitive agent performs reasoning based on traffic engineering prior rules and structured engineering prompts to identify the peak and trough points of traffic flow. The peak and trough points are used as time period boundaries and connected in chronological order to generate a multi-time period control boundary set that is non-overlapping and non-omitted within 24 hours. S14. Output a macro scheduling framework, which includes the time range, flow characteristic labels and tidal flow direction characteristics of each time period divided by the multi-time period control boundary set.

[0008] Preferably, in step S2, the initial timing parameters are calculated using a preset traffic engineering physics formula, specifically including: Extract the arrival rate, saturation flow and total lost time parameters for the current time period. Based on the logic of Webster's optimal timing formula, calculate the single-phase flow ratio, the total flow ratio of the intersection, the optimal initial cycle and the effective green light time of each phase in sequence to obtain the initial timing parameters. The safety boundary verification includes: verification of the minimum green light time for pedestrians crossing the street, verification of the minimum and maximum green light time for motor vehicle phases, and global constraint verification of the proportion of the green light duration of a single phase to the cycle duration.

[0009] Preferably, in step S2, generating a compliant phase sequence that conforms to the conflict matrix constraints through a phase sequence design agent specifically includes: Construct a traffic flow spatial conflict matrix based on intersection channelization topology and traffic flow trajectory; The traffic flow spatial conflict matrix, intersection channelization information, macro scheduling framework, and intersection traffic flow information for the current time period are input into the phase sequence design agent, which is the second largest language model. The phase sequence design agent performs reasoning based on traffic engineering conflict avoidance logic and outputs a compliant phase sequence that is conflict-free and conforms to traffic engineering specifications.

[0010] Preferably, in step S3, the qualitative diagnostic report includes: the spatial location of the bottleneck phase, a qualitative description of the cause of congestion, and a recommended adjustment direction; The executing agent performs quantitative adjustments and applies mathematical boundary constraints based on the qualitative diagnostic report, including: For idle phases with green light utilization rates below a preset threshold, reduce the green light duration for the corresponding phases; For congested phases where the queue length exceeds a preset threshold, the green light duration for the corresponding phase will be increased. When the overall queue length at the intersection exceeds the overall threshold, the total signal cycle duration is extended. When the overall idle rate of an intersection exceeds the overall threshold, shorten the total signal cycle time. The quantitative adjustment is constrained by mathematical boundaries: the adjusted green light time for each phase is not less than the minimum green light time for pedestrians crossing the street and not greater than the maximum green light time for motor vehicles, while the yellow light duration and the all-red clearing time remain fixed.

[0011] Preferably, in step S3, the preset iteration termination condition includes: The absolute difference between the comprehensive evaluation function values ​​of two adjacent iterations is less than or equal to the preset lower limit of the allowable error for optimization, or the number of iterations reaches the preset maximum number of iterations; the comprehensive evaluation function is a single quantitative index calculated based on the weighted average delay, average queue length and number of stops.

[0012] Preferably, in step S4, the monitoring agent collects the actual operating indicators of the intersection in real time using a sliding time window, and the actual operating indicators include the actual average delay. The actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme, including: When the actual average delay of multiple consecutive sliding windows is greater than the sum of the simulation optimal delay and the preset degradation tolerance threshold, the performance degradation of the scheme is determined to exceed the preset threshold.

[0013] Secondly, embodiments of the present invention provide a traffic timing system based on multi-agent collaboration using a large language model, comprising: The cognitive agent module is used to acquire historical traffic flow data at intersections, identify the temporal peak and valley characteristics of the historical traffic flow data, and generate a set of multi-time period control boundaries that are non-overlapping and complete within 24 hours, serving as a macro-scheduling framework; the cognitive agent module is the first major language model. The phase sequence design intelligent agent module calculates the initial timing parameters based on the macro scheduling framework and the traffic flow parameters of the current time period using a preset traffic engineering physical formula; generates a compliant phase sequence that conforms to the conflict matrix constraint; applies a safety boundary check to the initial timing parameters and the compliant phase sequence, and generates a physical benchmark timing scheme. The evaluation agent module injects the physical benchmark timing scheme into the microscopic traffic simulation platform for simulation to obtain simulation evaluation indicators; based on the simulation evaluation indicators, a qualitative diagnostic report including bottleneck location and adjustment direction is generated, and the evaluation agent module is the third major language model; The execution agent module receives the qualitative diagnostic report and the current timing parameters, performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints, generates an updated timing scheme, and repeats the above simulation deduction, qualitative diagnosis and quantitative adjustment until the preset iteration termination condition is met to obtain the optimal timing scheme; the execution agent module is the fourth major language model; The monitoring agent module, after deploying the optimal timing scheme to the physical traffic signal controller, collects the actual operating indicators of the intersection in real time and compares the actual operating indicators with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained from the comparison indicates that the performance degradation of the scheme exceeds a preset threshold, the cognitive agent module, the phase sequence design agent module, the evaluation agent module, and the execution agent module are triggered to re-execute the corresponding functions, generate and issue a new optimal timing scheme. The monitoring agent module is the fifth language model.

[0014] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the traffic timing method based on multi-agent collaboration of a large language model as described in the first aspect of the present invention.

[0015] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the traffic timing method based on multi-agent collaboration using a large language model as described in the first aspect of the present invention.

[0016] This invention provides a traffic timing method, system, electronic device, and storage medium based on a large language model and multi-agent collaboration, constructing a closed-loop architecture with five large language model agents working collaboratively. Specifically, the cognitive agent automatically divides the boundaries of multiple time periods throughout the day based on historical traffic flow data, forming a macro-scheduling framework; the phase sequence design agent generates an interpretable and compliant physical benchmark timing scheme based on traffic engineering physical formulas and safety boundary verification; the evaluation agent and the execution agent cooperate to obtain the optimal timing scheme through repeated iterations of micro-simulation deduction, qualitative diagnostic report generation, quantitative adjustment, and mathematical boundary constraints; and the monitoring agent continuously collects intersection operation indicators after the scheme is actually deployed. Once performance degradation exceeds a preset threshold, a full-process reconstruction is automatically triggered, thereby achieving lifelong self-evolution of the timing scheme. Compared with existing technologies, it has the following beneficial effects: (1) By using physical formulas and safety boundaries as hard constraints, the numerical illusions common in large language models are completely eliminated, ensuring that the underlying execution instructions are accurate and compliant.

[0017] (2) The dual-agent mechanism that separates diagnosis and execution makes the attribution logic of timing adjustment clear and traceable, breaks the black box dilemma, and significantly improves interpretability and engineering safety.

[0018] (3) The online monitoring and active reconstruction mechanism effectively addresses the long-term conceptual drift of traffic flow, avoids the problem of static scheme degradation, and significantly reduces the cost of manual operation and maintenance.

[0019] (4) The overall architecture can automatically complete the entire link work from macro-time period division to micro-second-level adjustment without manual intervention, providing a long-term, reliable, implementable and highly adaptive signal timing solution for real intersections. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of a traffic timing method based on multi-agent collaboration using a large language model, provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the global structure data of an intersection provided in an embodiment of the present invention; Figure 3 A general flowchart of the method provided in the embodiments of the present invention; Figure 4This is a flowchart of the micro-iterative optimization process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the traffic timing system structure based on multi-agent collaboration using a large language model, provided in an embodiment of the present invention. Figure 6 This is a schematic diagram of a physical structure provided for an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] Figure 1 This is a flowchart of a traffic timing method based on a large language model and multi-agent collaboration according to an embodiment of the present invention, with reference to... Figure 1 , Figure 3 The method includes: S1. Obtain historical traffic flow data at the intersection; input the historical traffic flow data into the cognitive agent, identify the temporal peak and valley characteristics of the historical traffic flow data, and generate a multi-time period control boundary set that is non-overlapping and non-omitted within 24 hours as a macro-scheduling framework; the cognitive agent is the first major language model.

[0024] In intersection traffic signal control scenarios, it is necessary to process historical data such as traffic flow and queue length over multiple consecutive days and 24 hours a day. In this embodiment, for example... Figure 2 As shown, historical traffic flow data refers to information such as arrival rate, saturation flow, queue length, and turning ratio of each lane collected by sensors such as radar and video, as well as traffic management databases; temporal peak and valley characteristics refer to the flow peaks and valleys such as morning peak, evening peak, off-peak, and nighttime valley; multi-period control boundary set refers to the set of start and end times of dividing a 24-hour day into several continuous periods (such as morning peak, off-peak, evening peak, etc.); and the macro-scheduling framework includes the time range of each period, flow characteristic labels (peak / off-peak / valley), and tidal flow characteristics.

[0025] Existing technologies rely on manual surveying and experience-based time-segmentation, which is not only inefficient but also severely ineffective when static time-segmentation schemes become outdated over time (conceptual drift), resulting in extremely high maintenance costs. This step uses a cognitive intelligent agent (the first major language model) to automatically identify peaks and troughs and connect them chronologically to generate non-overlapping and complete 24-hour time-segment boundaries, replacing manual segmentation. This solves the technical problems of the inability to automatically generate macro-level timing frameworks and their difficulty in coping with long-term traffic flow drift, achieving experience-free and adaptive generation of timing frameworks and reducing manual maintenance costs.

[0026] S2. Based on the macro scheduling framework and the traffic flow parameters of the current time period, calculate the initial timing parameters using the preset traffic engineering physical formula; generate a compliant phase sequence that conforms to the conflict matrix constraint through the phase sequence design agent; apply safety boundary verification to the initial timing parameters and the compliant phase sequence to generate a physical benchmark timing scheme.

[0027] Step S1 outputs the macro-scheduling framework and specific traffic flow parameters (arrival rate, saturation flow, total loss time, etc.) for the current time period. In this embodiment, S2 outputs the large language model using physical formulas and safety boundary constraints. The preset traffic engineering physical formula refers to Webster's optimal timing formula, which calculates the single-phase flow ratio, the total flow ratio at the intersection, the optimal cycle, and the effective green light time for each phase to obtain the initial timing parameters. The conflict matrix is ​​a conflict relationship table constructed based on the intersection channelization topology and traffic flow trajectory. The compliant phase sequence refers to the signal phase execution order that conforms to conflict avoidance logic, national standards, and the actual intersection shape (cross / T / roundabout). Safety boundary verification includes minimum green light verification for pedestrian crossings, minimum / maximum green light verification for motor vehicles, and global constraints on the proportion of green lights in a single phase, and mandatory correction of out-of-bounds parameters.

[0028] This refers to the time period within a signal cycle during which one or more non-conflicting traffic flows (including motor vehicles, non-motor vehicles, and pedestrians) simultaneously obtain the right of way. Each phase corresponds to a specific combination of green light signals. For example, phase A1 indicates that east-west straight traffic is allowed, phase A2 indicates that east-west left turns are allowed, phase A3 indicates that north-south straight traffic is allowed, and phase A4 indicates that north-south left turns are allowed.

[0029] Multiple phases are executed sequentially in a specific order, forming a phase sequence. In a complete signal cycle, each phase receives a green light in turn, and phases are switched between each other by a yellow light or a full red light period to ensure safety.

[0030] Existing single large language models are prone to numerical illusions (such as negative durations and non-closed periods) when handling macroscopic analysis and microscopic actuarial calculations, and they deviate from physical laws. This step deeply couples Webster's formula with the phase sequence design agent (the second large language model) and superimposes rigid safety boundaries to generate a physical benchmark timing scheme as a safety anchor for subsequent iterations, thereby blocking numerical illusions at the source and ensuring that the initial scheme is compliant and interpretable.

[0031] S3. Inject the physical baseline timing scheme into the microscopic traffic simulation platform for simulation to obtain simulation evaluation indicators; input the simulation evaluation indicators into the evaluation agent, and generate a qualitative diagnostic report containing bottleneck location and adjustment direction based on the evaluation agent, which is the third major language model; input the qualitative diagnostic report and the current timing parameters into the execution agent, which performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints to generate an updated timing scheme, which is the fourth major language model; repeat S3 until the preset iteration termination condition is met to obtain the optimal timing scheme.

[0032] After obtaining the physical baseline timing scheme, S3 in this embodiment seeks the optimal solution through a closed-loop iteration of simulation, qualitative diagnosis, and quantitative adjustment. Specifically, micro-level traffic simulation platforms such as SUMO (Simulation of UrbanMobility) need to import real intersection channelization and traffic flow data, simulate and output indicators such as average delay, average queue length, and number of stops, and construct a weighted comprehensive evaluation function. The qualitative diagnosis report is generated by the evaluation agent (the third major language model), including the location of bottleneck phases, the causes of congestion (insufficient green lights / uneven distribution), and a clear direction for adjustment, using traffic engineering terminology throughout. The quantitative adjustment is executed by the execution agent (the fourth major language model) based on the diagnosis report: reducing the green light duration for idle phases, increasing the green light duration for congested phases, extending the cycle if the overall queue is too long, and shortening the cycle if the overall idle rate is too high, and applying mandatory mathematical boundaries (minimum green light for pedestrians, maximum green light for vehicles, and fixed yellow / all-red lights).

[0033] Existing reinforcement learning methods are black-box and uninterpretable, and suffer from cognitive overload due to the single large model. This step employs a diagnostic-execution dual-agent decoupling, separating qualitative attribution from quantitative computation, thus avoiding cognitive overload of the single model, making the adjustment logic transparent and traceable, and obtaining the optimal timing scheme through iterative convergence, significantly improving interpretability and optimization performance.

[0034] S4. After the optimal timing scheme is deployed to the physical traffic signal controller, the actual operating indicators of the intersection are collected in real time by the monitoring agent, and the actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained by comparison indicates that the performance degradation of the scheme exceeds the preset threshold, steps S1 to S3 are executed again to generate and issue a new optimal timing scheme. The monitoring agent is the fifth language model.

[0035] After the optimal timing scheme obtained in S3 is sent to the physical signal controller, S4 in this embodiment constructs an online monitoring and self-evolving reconfiguration closed loop. Actual operating indicators are transmitted back through the physical signal controller, and actual average delays, queue lengths, etc., are collected in sliding time windows (e.g., 1 hour). The degradation tolerance threshold is typically set at 15%–20%. When the actual average delay for multiple consecutive sliding windows (e.g., 5) is greater than the simulated optimal delay multiplied by (1 + threshold), the scheme is deemed to have degraded.

[0036] In existing technologies, traditional fixed timing and single-generation large model solutions lack long-term maintenance mechanisms. After several months of operation, these solutions inevitably become ineffective due to long-term traffic flow evolution (surrounding development, changes in travel habits), requiring periodic manual re-surveying and re-scheduling. In this embodiment, S4 compares actual and simulation indicators in real time through a monitoring agent (the fifth language model). Once degradation caused by long-term concept drift is confirmed, it automatically triggers the re-execution of S1 to S3, pulls the latest 30 days of data to re-divide time periods, generates a baseline solution, iteratively optimizes, and distributes it. This achieves unmanned self-evolution throughout the entire lifecycle, completely replacing manual operation and maintenance, and solving the industry pain point of long-term degradation of static timing.

[0037] Based on the above embodiments, as a preferred implementation, step S1 specifically includes: S11. By using traffic flow sensors and a traffic management historical database, obtain historical traffic flow data of the intersection over several consecutive days, perform noise reduction and smoothing processing on the historical traffic flow data, and construct a state matrix containing the arrival rate, saturation flow, queue length, and turning ratio vector of each lane.

[0038] In real-world intersection signal timing scenarios, traffic flow sensors (such as radar and video surveillance) and historical traffic management databases continuously record raw data such as arrival times, queue lengths, and turning ratios for each lane over multiple days. The historical traffic flow data in this step refers to the aforementioned multi-source raw data. Noise reduction and smoothing processes remove abnormal fluctuations caused by occasional events (such as accidents or severe weather) and retain the flow sequence that reflects normal traffic patterns. The state matrix is ​​a multi-dimensional data structure, denoted as M, whose elements include: the arrival rate of each lane at different time granularities. q i (Number of vehicles arriving per unit time), saturation flow si (Maximum number of vehicles passing through under consecutive green lights), queue length Q i (Number of vehicles waiting at the station) and the turning ratio vector (percentage of straight, left, and right turns). Existing technologies rely on manual surveying and input of these parameters, which is not only tedious and error-prone but also difficult to handle long-term changes. This step automatically acquires and constructs a state matrix through sensors and a database, solving the problem of efficiently cleaning and organizing raw traffic flow data into structured input. This provides an accurate and reliable data foundation for subsequent intelligent agent reasoning, automates data acquisition and preprocessing, and reduces the workload of manual intervention.

[0039] S12. The state matrix, intersection channelization information, and preset traffic engineering time constraints are converted into structured engineering prompts and input into the cognitive agent.

[0040] The state matrix M itself is a numerical traffic parameter, but the large language model needs to understand its physical meaning and engineering rules. The intersection channelization information in this step includes spatial features such as intersection geometry (cross, T, roundabout), lane layout, and traffic flow trajectories in each direction; the preset traffic engineering time period constraints are the engineering rules: each time period is a minimum of 15 minutes and a maximum of 120 minutes, and must cover 24 hours continuously without overlap; the structured engineering prompts are inputs that combine the above numerical information, spatial information, and rule information in a format that the large language model can understand (such as text templates with field descriptions).

[0041] In existing technologies, engineers directly divide time periods based on experience, lacking a unified and reusable reasoning basis. This step transforms the state matrix, channelization information, and constraints into standardized prompt words, enabling the cognitive agent to perform logical reasoning based on prior rules of traffic engineering. This solves the interface problem where raw data cannot directly interact with a large language model, ensuring the standardization and reproducibility of subsequent reasoning and improving the system's adaptability to different intersections.

[0042] S13. The cognitive agent performs reasoning based on traffic engineering prior rules and structured engineering prompts to identify peaks and troughs in traffic flow. The peaks and troughs are used as time-limit boundaries and connected in chronological order to generate a set of non-overlapping and non-omitted time-of-day (TOD) control boundaries within 24 hours.

[0043] After receiving structured engineering prompts, the cognitive agent (the first major language model) performs temporal feature inference. The traffic engineering prior rules in this step refer to typical patterns in traffic flow theory: a sharp increase in traffic flow during the morning peak, a prolonged evening peak, and stable traffic flow during the nighttime trough; peaks and troughs are local maxima and minima in the traffic flow time series, corresponding to peak values ​​and trough values ​​respectively; time period boundaries refer to the transition time between two adjacent time periods, for example, the end of the morning peak is the beginning of the off-peak period; connecting in chronological order means arranging all identified boundaries in ascending order of time, forming […]. T 0, T 1],[ T 1, T 2],…,[ T n 1, T n ],in, T 0 represents 0:00. T n The time is 24:00. This process automatically generates a set of multi-time control boundaries that are non-overlapping (each time point belongs to only one time period) and non-omission (covering the entire day) within 24 hours.

[0044] In existing technologies, traffic engineers need to repeatedly check traffic flow curves and manually divide time periods, and these divisions need to be manually re-divided as traffic flow patterns evolve, resulting in a large workload and a high risk of errors. This step utilizes the logical reasoning ability of a cognitive agent to automatically identify peaks and troughs and form continuous boundaries, solving the problem that macro-level time period division relies on human experience and cannot cope with long-term conceptual drift. It achieves fully automated generation of TOD scheduling, and the generated results strictly conform to engineering constraints, avoiding fragmentation of short time periods.

[0045] S14. Output a macro scheduling framework, which includes the time range, flow characteristic labels and tidal flow direction characteristics of each time period divided by the multi-time period control boundary set.

[0046] The output macro-scheduling framework is the final product of S1, providing the organizational framework for the subsequent time-segmented scheduling in S2. The time range in this step refers to the specific start and end times of each time period (e.g., morning peak 7:30-9:00); traffic characteristic labels include categories such as peak, off-peak, and trough, automatically assigned by the cognitive agent based on peak and trough values ​​and absolute traffic volume; tidal flow characteristics refer to the asymmetry in direction during morning and evening peaks (e.g., high inbound traffic during morning peak and high outbound traffic during evening peak), automatically identified and labeled by the cognitive agent through analysis of turning ratios and bidirectional traffic differences. The final output macro-scheduling framework is structured data, clearly defining the time interval, traffic type, and presence of tidal phenomena for each time period.

[0047] In existing technologies, even when time periods are defined, traffic flow characteristic labels and tidal markings are often missing, making it impossible to specifically set dedicated left-turn phases or single-phase release phases in subsequent phase sequence design. This step solves the information gap between macro-level scheduling and micro-level phase sequence design by outputting a framework containing rich semantic information. This enables the phase sequence design agent to generate more reasonable solutions based on time period characteristics (such as dedicated left-turn phases during peak hours and single-phase release phases during tidal periods), thereby improving the overall system's adaptability and optimization effect.

[0048] Based on the above embodiments, as a preferred implementation, step S2, which involves calculating the initial timing parameters using a preset traffic engineering physics formula, specifically includes: Extract the arrival rate, saturation flow, and total lost time parameters for the current time period. Based on the logic of Webster's optimal timing formula, calculate the single-phase flow ratio, the total flow ratio of the intersection, the optimal initial cycle, and the effective green light time for each phase in sequence to obtain the initial timing parameters.

[0049] In intersection signal timing engineering, it is necessary to calculate the initial cycle and green light time based on the traffic demand of the current time period (such as morning rush hour). The arrival rate in this step... q i Refers to the time it takes to reach the lane i Number of vehicles (vehicles / hour), saturation flow s i lane i Maximum number of vehicles passing through during consecutive green lights (vehicles / hour) and total lost time L This includes the sum of the yellow light duration, the all-red light duration, and the time lost during vehicle startup.

[0050] In existing technologies, engineers directly apply Webster's formula for calculation, but this lacks coupling with the logical reasoning of a large language model and cannot automatically adapt to different time periods. This step calculates the single-phase flow ratio based on the logic of Webster's optimal timing formula. y i = q i / s i This refers to the ratio of phase demand to traffic capacity; the total traffic volume ratio at the intersection. Y =∑ y i That is, the sum of the flow ratios of all phases; optimal initial period C =(1.5 L +5) / (1 Y This formula provides the cycle length with the minimum delay when the total flow ratio is less than 1; the effective green time for each phase. This means allocating the total effective green light time according to the traffic flow ratio. Through the above logic, the traffic parameters for the current time period are transformed into specific initial timing parameters.

[0051] Existing fixed timing schemes or manual multi-period schemes rely on manual calculations by engineers, which are inefficient and prone to errors. Furthermore, directly generating timing parameters using pure large language models can easily lead to numerical illusions. This step combines the classic Webster's physical formula with a phase sequence design agent (the second large language model). The agent extracts parameters and drives the formula calculation, ensuring both the physical rationality of the values ​​and achieving automation. This solves the problems of initial timing schemes relying on manual calculations and lacking physical constraints, providing a safe, compliant, and interpretable benchmark scheme (safety anchor) for subsequent iterations.

[0052] The safety boundary verification includes: verification of the minimum green light time for pedestrians crossing the street, verification of the minimum and maximum green light time for motor vehicle phases, and global constraint verification of the proportion of the green light duration of a single phase to the cycle duration.

[0053] After obtaining the initial timing parameters (period) C and green lights for each phase g i Afterwards, it must be verified whether it meets the safety red lines of traffic engineering. The minimum green light time for pedestrians crossing the street in this step... The green light duration is calculated by dividing the intersection crossing width by the standard pedestrian walking speed (1.2 m / s). For example, if the crossing width is 15 m, the minimum green light duration is 12.5 seconds. The minimum green light duration for motor vehicle phases is typically 10 seconds, and the maximum green light duration is 60 seconds to ensure clearing capacity and avoid excessive waiting time for drivers. The global constraint on the proportion of green light duration in a single phase to the total cycle duration requires that the green light duration of any phase must not exceed 60% of the total cycle duration to ensure that other phases also have reasonable passage opportunities. The verification process is as follows: check the green light duration of each phase one by one. If it is less than the minimum green light duration for pedestrians or motor vehicles, it is forcibly raised to the corresponding lower limit; if it is greater than the maximum green light duration for motor vehicles, it is forcibly reduced to the upper limit; if the green light duration of a certain phase exceeds 60%, the green light duration of that phase is reduced proportionally and compensated for by other phases or the cycle is adjusted. Meanwhile, the yellow light duration and the all-red clearing time remain fixed and are not adjusted.

[0054] In existing technologies, when a single large language model directly outputs timing parameters, it often violates the aforementioned basic safety rules (such as generating a 5-second green light or failing to close the cycle), and cannot be automatically corrected. This step, through rigid safety boundary verification and forced correction, fundamentally blocks the numerical illusion of large models, ensuring that the generated physical benchmark timing scheme conforms to the laws of traffic engineering physics under any circumstances. This solves the problem of non-compliant and safety-constrained timing parameters in large models, improving the engineering reliability and feasibility of the system.

[0055] Based on the above embodiments, as a preferred implementation, in step S2, generating a compliant phase sequence that conforms to the conflict matrix constraints through a phase sequence design agent specifically includes: A traffic flow spatial conflict matrix is ​​constructed based on the intersection channelization topology and traffic flow trajectories. In intersection signal timing, if traffic flows from different directions (such as straight-ahead and oncoming left-turn, motor vehicles and pedestrians) have spatially intersecting trajectories, they cannot be allowed to proceed simultaneously and need to be divided into different phases. This step constructs the traffic flow spatial conflict matrix based on the intersection channelization topology (cross, T, roundabout, etc.) and the traffic flow trajectories of each direction. C i,j The matrix has dimensions N×N, where N is the total number of traffic directions at the intersection (e.g., east-west straight, east-west left turns, north-south straight, north-south left turns, pedestrian crossings, etc.). If the traffic flow... i With traffic flow j If the trajectories have intersections or merging points (e.g., east-west straight traffic and north-south straight traffic intersect perpendicularly in the center of an intersection, east-west straight traffic and east-west left-turn traffic merge, opposite straight traffic and left-turn traffic weave together, or motor vehicles and pedestrians crossing the street in the same phase conflict), then a conflict risk is determined to exist. C i,j =1; If the two trajectories are completely separated and have no interaction (such as no conflict between straight-ahead and right-turning traffic in the same direction, or two parallel and non-intersecting traffic flows), then let C i,j =0, conflict determination covers all types of scenarios including motor vehicle-motor vehicle, motor vehicle-pedestrian, straight-through-left-turn, and oncoming traffic.

[0056] In existing technologies, whether manually designed phase sequences or reinforcement learning models, it is difficult to systematically and automatically express and process all conflict relationships, which easily leads to missed conflicts or overly conservative approaches resulting in low efficiency. This step constructs an explicit conflict matrix to transform the spatial conflict relationships at intersections into structured data, providing a clear constraint basis for subsequent phase sequence agents. This solves the problem of the lack of a unified conflict quantification model in phase sequence design, making phase sequence generation computable and verifiable.

[0057] The traffic flow spatial conflict matrix, intersection channelization information, macro scheduling framework, and intersection traffic flow information for the current time period are input into the phase sequence design agent, which is the second largest language model.

[0058] After the conflict matrix is ​​constructed, it needs to be input into the phase sequence design agent along with other necessary information. The intersection channelization information in this step includes intersection type (cross / T / roundabout), lane function division (dedicated lanes for straight, left turn, and right turn), channelization islands, and other geometric features. The macro-scheduling framework comes from step S1 and includes whether the current time period is peak, off-peak, or off-peak, and whether tidal flow characteristics exist. The intersection traffic flow information for the current time period refers to the actual arrival rate, queue length, and turning ratio in each direction. All of the above information is organized into structured prompts and input into the second major language model, the phase sequence design agent.

[0059] In existing technologies, manual phase sequence design relies on the experience of traffic engineers, which is time-consuming and difficult to cover changes across all time periods. Furthermore, a single large model lacks explicit understanding of the conflict matrix and channelization information, easily resulting in conflicting phase sequences. This step integrates rich intersection geometry, time, and traffic flow information and inputs it into a dedicated intelligent agent, providing it with sufficient reasoning basis. This solves the problem of information silos in phase sequence design, ensuring that the agent can generate differentiated and reasonable phase sequences for different time periods and intersection configurations.

[0060] The phase sequence design agent performs reasoning based on traffic engineering conflict avoidance logic and outputs a compliant phase sequence that is conflict-free and conforms to traffic engineering specifications.

[0061] The phase sequence design agent (the second major language model) reasons based on traffic engineering conflict avoidance logic. This conflict avoidance logic refers to combining conflict-free traffic flows into a single phase while satisfying conflict matrix constraints, determining the execution order of each phase, and adhering to the national standard GB 14887-2011 and actual engineering specifications. For example, if left-turn traffic volume is high and conflicts with oncoming straight traffic, a dedicated left-turn phase is designed; if there are significant morning and evening traffic flows at the intersection, a single-lane phase (i.e., all lanes in a certain direction are allowed to pass simultaneously) is designed; if pedestrian crossing demand is high, a pedestrian-following phase is designed. The agent outputs a conflict-free, compliant, and executable signal phase sequence set. P ={ p 1, p 2,…, p m}, where each p k A phase is defined as a set of traffic flows that are allowed to proceed in that phase, along with basic timing constraints.

[0062] In existing technologies, the phase sequence output by reinforcement learning methods is difficult to interpret and may violate basic conflict rules, while manual methods cannot adapt to dynamic changes. This step utilizes the powerful logical reasoning capabilities of a large language model, combined with conflict matrices and traffic engineering priors, to automatically generate a reasonable phase sequence. This solves the problems of low automation in phase sequence design and inability to dynamically adapt to time period characteristics, while ensuring the conflict-free nature and engineering compliance of the phase sequence, providing a correct phase structure foundation for subsequent timing parameter calculations.

[0063] Based on the above embodiments, as a preferred implementation, in step S3, the qualitative diagnostic report includes: the spatial location of the bottleneck phase, a qualitative description of the causes of congestion, and recommended adjustment directions; simulation is performed on the micro-simulation platform SUMO (Simulation of Urban Mobility), with the simulation duration consistent with the TOD period, and the comprehensive evaluation function value is derived. J ( t )= αD + βQ + γN ( α + β + γ =1, D is Average delay Q For average queue length, N For the number of stops, the weight is usually taken as the delay. α= 0.6, Queuing β= 0.3 γ =0.1.

[0064] The qualitative diagnostic report generated for the evaluation agent will include the evaluation indicators for this round of simulation. J ( tThe third language model (evaluation agent) is input with the green light utilization rate of each phase, the timing scheme of the previous round, and the intersection constraints. The agent outputs a standardized "Traffic Diagnosis Report" based on traffic engineering reasoning of the thought chain: (1) accurately locate the bottleneck phase (such as the queue length of the east-west straight direction exceeds the limit, and the green light of the north-south left turn direction is empty); (2) qualitatively attribute the cause of congestion (insufficient green light / uneven green light time distribution); (3) give a clear adjustment direction. The report uses traffic engineering professional terminology throughout and has no vague expressions, providing a precise basis for quantitative adjustment. Among them, the bottleneck phase refers to the signal phase with the queue length exceeding the limit or the green light utilization rate being extremely low, such as the queue overflow of the east-west straight direction or the green light of the north-south left turn direction being empty; the qualitative description of the cause of congestion refers to the root cause analyzed based on the traffic engineering thought chain, such as insufficient green light time causing vehicle congestion or uneven green light time distribution causing a certain phase to be empty; the recommended adjustment direction gives a clear operation suggestion, such as increasing the green light of the east-west straight phase by 10 seconds or reducing the green light of the north-south left turn phase by 5 seconds. The evaluation agent (the third major language model) receives simulation evaluation indicators, green light utilization rates for each phase, the timing scheme of the previous round, and intersection constraints. It generates the above three parts through logical reasoning. The entire report uses traffic engineering terminology and is free of ambiguity.

[0065] In existing technologies, reinforcement learning models can only output specific addition and subtraction values ​​for seconds, without explaining why adjustments are made; while manual analysis is time-consuming and labor-intensive. This step generates a readable qualitative diagnostic report by evaluating the agent, explicitly presenting the causes of congestion and the direction of adjustment. This solves the problem of the black box and unexplainable nature of the timing optimization process, enabling traffic management personnel to understand and trust the system's decision-making logic, while providing the agent with accurate adjustment basis.

[0066] Furthermore, after receiving the qualitative diagnostic report, the executing agent (the fourth major language model) needs to translate the adjustment direction in the report into specific timing parameter changes. The executing agent then performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints, including: For idle phases with green light utilization rates below a preset threshold, the green light duration of the corresponding phase will be reduced. Green light utilization rate refers to the ratio of the actual number of vehicles passing through to the number of vehicles that can pass under saturated flow. If the utilization rate is too low (below the preset threshold, such as 30%), it is considered an idle phase.

[0067] For congested phases where the queue length exceeds a preset threshold, the green light duration for the corresponding phase will be increased; where queue length exceeding the limit means that the actual queue length of traffic in a certain phase exceeds the maximum allowed queue threshold for that phase (e.g., 100 meters).

[0068] When the overall queue length at an intersection exceeds the overall threshold, the total signal cycle duration is extended. The overall queue length at an intersection refers to the weighted sum or maximum value of the queue lengths of all phases. Exceeding the overall threshold (e.g., 200 meters) indicates that the intersection capacity is insufficient.

[0069] When the overall idle rate of the intersection exceeds the overall threshold, the total signal cycle time is shortened. The overall idle rate refers to the proportion of the total idle time of the green light in all phases to the total cycle time. If it is too high (exceeding the overall threshold, such as 40%), it means that the cycle is too long.

[0070] The quantitative adjustment is constrained by mathematical boundaries: the adjusted green light time for each phase is not less than the minimum green light time for pedestrians crossing the street (calculated by dividing the crossing width by 1.2m / s, which is the standard walking speed for pedestrians) and not greater than the maximum green light time for motor vehicle phases (usually 60 seconds). The yellow light duration and the all-red clearing time remain fixed.

[0071] In existing technologies, directly outputting seconds from a single large model can easily result in illegal values ​​(such as negative durations or exceeding safety boundaries) and cannot handle inter-phase coupling relationships. This step solves the problems of cognitive overload, numerical illusion, and violation of physical constraints by having the agent perform step-by-step addition and subtraction of seconds and period scaling calculations based on the diagnostic report and forcibly applying mathematical boundaries. This ensures that each adjustment is compliant and interpretable, and gradually approaches the optimal timing scheme through closed-loop iteration.

[0072] Based on the above embodiments, as a preferred implementation, in step S3, such as Figure 4 As shown, the preset iteration termination condition includes: The absolute difference between the comprehensive evaluation function values ​​of two adjacent iterations is less than or equal to the preset lower limit of the allowable error for optimization, or the number of iterations reaches the preset maximum number of iterations; the comprehensive evaluation function is a single quantitative index calculated based on the weighted average delay, average queue length and number of stops.

[0073] In the closed-loop iterative optimization process of microscopic simulation, a quantitative metric is needed to measure the performance of each timing scheme and determine whether to continue iterating. The average delay in this step... D Average queue length Q Number of parking sessions N These three indicators reflect the operational efficiency of the intersection from different dimensions, but they have different units of measurement and need to be weighted and combined into a single quantitative indicator. According to traffic engineering industry standards, the weight is usually taken as the delay. α =0.6, queue length β =0.3, number of stops γ =0.1, construct a comprehensive evaluation function J ( t )= αD +βQ + γN ,in, t This indicates the current iteration round. The smaller the value of this function, the better the performance of the timing scheme.

[0074] The iteration termination conditions include two: one is the convergence condition, which is that the absolute difference between the comprehensive evaluation function values ​​of two adjacent iterations is less than or equal to the preset lower limit of the allowable optimization error. ε , that is | J ( t ) J ( t 1) |≤ ε Default value ε =0.1 seconds, at which point the performance improvement from further iterations is considered negligible, and the optimization is stopped; the second is a forced termination condition, namely, the number of iterations reaches the preset maximum number of iterations. N max (Default is 20 iterations) to prevent infinite loops caused by certain special traffic flows that prevent convergence. If any of the above conditions are met, the iteration stops, the optimal timing scheme for the current round is fixed, and an iteration log and optimization description are generated simultaneously to record the adjustment logic and indicator changes for each round, achieving full traceability of the timing optimization process.

[0075] In existing technologies, whether manual debugging or reinforcement learning, there is a lack of unified and interpretable iterative termination criteria. Often, fixed numbers of iterations are set based on experience or subjective observation, leading to insufficient optimization or overfitting. This step addresses the lack of objective stopping criteria in iterative optimization by constructing a weighted comprehensive evaluation function that maps multi-objective performance to a single numerical value and sets clear convergence thresholds and maximum iteration counts. This ensures that the system can efficiently converge to the optimal solution and automatically exit under complex conditions. Furthermore, the generated log files make the optimization process transparent and auditable, enhancing its engineering practicality and credibility.

[0076] Based on the above embodiments, as a preferred implementation, in step S4, the monitoring agent collects the actual operating indicators of the intersection in real time using a sliding time window. These actual operating indicators include the actual average delay. After the optimal timing scheme is deployed to the physical traffic signals and put into actual operation, traffic flow may experience conceptual drift due to factors such as surrounding land development and long-term evolution of travel habits, leading to a gradual decline in the performance of the original timing scheme. The sliding time window in this step refers to the monitoring agent (the fifth language model) continuously collecting actual operating data within a fixed duration (default 1 hour) and updating it over time. The actual operating indicators include the actual average delay. D actualActual queue length and actual traffic flow are obtained through feedback from physical signal controllers; the simulation optimal index refers to the simulation optimal delay corresponding to the optimal timing scheme obtained after the iteration convergence in step S3. D opt Degradation tolerance threshold θ It is a percentage, usually taken as 15% to 20%, to allow for a certain degree of normal fluctuation.

[0077] The actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme, including: When the actual average delay of multiple consecutive sliding windows is greater than the sum of the simulation optimal delay and the preset degradation tolerance threshold, the performance degradation of the scheme is determined to exceed the preset threshold.

[0078] To avoid misjudgments triggered by unforeseen events such as accidents or severe weather, the system only retains long-term steady-state characteristics: when continuous... K Sliding window (default) K =5) actual average delay D actual All satisfy the inequality D actual > D opt ×(1+ θ When the traffic flow has undergone substantial long-term changes and the performance degradation of the current timing scheme exceeds a preset threshold, the monitoring agent automatically triggers the reconstruction process, re-executes steps S1 to S3 (retrieving the latest traffic flow data from the last 30 days, re-dividing time periods, generating a baseline scheme, and iteratively optimizing), and distributes the new scheme to the physical traffic signals.

[0079] Existing technologies, whether fixed timing or single-generation large model solutions, lack online performance monitoring and proactive reconstruction mechanisms, leading to inevitable failure after several months of operation and requiring periodic manual re-surveying and reconfiguration. This step solves the problems of unautomated detection of solution degradation and unscientific reconstruction triggering conditions by using real-time data acquisition via sliding window, continuous multi-window judgment, and anomaly filtering. It achieves unmanned self-evolution throughout the entire lifecycle, completely replacing manual operation and maintenance, and ensuring that the intersection always operates in an optimal or near-optimal state.

[0080] Secondly, embodiments of the present invention provide a traffic timing system based on multi-agent collaboration using a large language model. Based on the methods described in the above embodiments, the system 500 includes: The cognitive agent module 510 is used to acquire historical traffic flow data at intersections, identify the temporal peak and valley characteristics of the historical traffic flow data, and generate a multi-time period control boundary set that is non-overlapping and has no omissions within 24 hours as a macro-scheduling framework; the cognitive agent module is the first major language model. The phase sequence design intelligent agent module 520 calculates the initial timing parameters based on the macro scheduling framework and the traffic flow parameters of the current time period using a preset traffic engineering physical formula; generates a compliant phase sequence that conforms to the conflict matrix constraint; applies a safety boundary check to the initial timing parameters and the compliant phase sequence, and generates a physical benchmark timing scheme. The evaluation agent module 530 injects the physical benchmark timing scheme into the microscopic traffic simulation platform for simulation to obtain simulation evaluation indicators; based on the simulation evaluation indicators, it generates a qualitative diagnostic report including bottleneck location and adjustment direction. The evaluation agent module is the third major language model. The execution agent module 540 receives the qualitative diagnosis report and the current timing parameters, performs quantitative adjustments based on the qualitative diagnosis report and applies mathematical boundary constraints, generates an updated timing scheme, and repeats the above simulation deduction, qualitative diagnosis and quantitative adjustment until the preset iteration termination condition is met to obtain the optimal timing scheme; the execution agent module is the fourth major language model; The monitoring agent module 550, after deploying the optimal timing scheme to the physical traffic signal controller, collects the actual operating indicators of the intersection in real time and compares the actual operating indicators with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained from the comparison indicates that the performance degradation of the scheme exceeds a preset threshold, the cognitive agent module 510, the phase sequence design agent module 520, the evaluation agent module 530, and the execution agent module 540 are triggered to re-execute the corresponding functions, generate and issue a new optimal timing scheme. The monitoring agent module is the fifth language model.

[0081] Based on the same concept, this invention also provides a schematic diagram of a physical structure, such as... Figure 6 As shown, the server may include a processor 610, a communications interface 620, a memory 630, and a communication bus 660. The processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute the steps of the traffic timing method based on a large language model and multi-agent collaboration as described in the above embodiments.

[0082] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0083] Based on the same concept, embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program containing at least one piece of code that can be executed by a master control device to control the master control device to implement the steps of the traffic timing method based on multi-agent collaboration of a large language model as described in the above embodiments.

[0084] Based on the same technical concept, this application also provides a computer program, which, when executed by a main control device, is used to implement the above-described method embodiments.

[0085] The program may be stored, in whole or in part, on a storage medium packaged with the processor, or in part or in whole on a memory not packaged with the processor.

[0086] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A traffic timing method based on multi-agent collaboration using a large language model, characterized in that, include: S1. Obtain historical traffic flow data at the intersection; The historical traffic flow data is input into the cognitive agent to identify the temporal peak and valley characteristics of the historical traffic flow data and generate a set of multi-time control boundaries that are non-overlapping and non-omitted within 24 hours, which serves as a macro-scheduling framework. The cognitive agent is the first major language model; S2. Based on the macro-scheduling framework and the traffic flow parameters of the current time period, calculate the initial timing parameters using the preset traffic engineering physical formula; The phase sequence design agent generates a compliant phase sequence that conforms to the conflict matrix constraint. Apply safety boundary checks to the initial timing parameters and the compliant phase sequence to generate a physical reference timing scheme; S3. Inject the physical benchmark timing scheme into the microscopic traffic simulation platform for simulation and obtain simulation evaluation indicators; The simulation evaluation indicators are input into the evaluation agent, which generates a qualitative diagnostic report containing bottleneck location and adjustment direction. The evaluation agent is the third major language model. The qualitative diagnostic report and the current timing parameters are input into the execution agent, which performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints to generate an updated timing scheme. The execution agent is the fourth major language model. S3 is repeated until the preset iteration termination condition is met to obtain the optimal timing scheme. S4. After the optimal timing scheme is deployed to the physical traffic signal controller, the actual operating indicators of the intersection are collected in real time by the monitoring agent, and the actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained by comparison indicates that the performance degradation of the scheme exceeds the preset threshold, steps S1 to S3 are executed again to generate and issue a new optimal timing scheme. The monitoring agent is the fifth language model.

2. The traffic timing method based on multi-agent collaboration using a large language model according to claim 1, characterized in that, S1 specifically includes: S11. Obtain historical traffic flow data of the intersection over several consecutive days through traffic flow sensors and traffic management historical database, perform noise reduction and smoothing processing on the historical traffic flow data, and construct a state matrix containing the arrival rate, saturation flow, queue length and turning ratio vector of each lane. S12. The state matrix, intersection channelization information, and preset traffic engineering time constraints are converted into structured engineering prompts and input into the cognitive agent. S13. The cognitive agent performs reasoning based on traffic engineering prior rules and structured engineering prompts to identify the peak and trough points of traffic flow. The peak and trough points are used as time period boundaries and connected in chronological order to generate a multi-time period control boundary set that is non-overlapping and non-omitted within 24 hours. S14. Output a macro scheduling framework, which includes the time range, flow characteristic labels and tidal flow characteristics of each time period divided by the multi-time period control boundary set.

3. The traffic timing method based on multi-agent collaboration using a large language model according to claim 2, characterized in that, In step S2, the initial timing parameters are calculated using a preset traffic engineering physics formula, specifically including: Extract the arrival rate, saturation flow and total lost time parameters for the current time period. Based on the logic of Webster's optimal timing formula, calculate the single-phase flow ratio, the total flow ratio of the intersection, the optimal initial cycle and the effective green light time of each phase in sequence to obtain the initial timing parameters. The safety boundary verification includes: verification of the minimum green light time for pedestrians crossing the street, verification of the minimum and maximum green light time for motor vehicle phases, and global constraint verification of the proportion of the green light duration of a single phase to the cycle duration.

4. The traffic timing method based on multi-agent collaboration using a large language model according to claim 1, characterized in that, In step S2, the phase sequence design agent generates a compliant phase sequence that conforms to the conflict matrix constraints, specifically including: Construct a traffic flow spatial conflict matrix based on intersection channelization topology and traffic flow trajectory; The traffic flow spatial conflict matrix, intersection channelization information, macro scheduling framework, and intersection traffic flow information for the current time period are input into the phase sequence design agent, which is the second largest language model. The phase sequence design agent performs reasoning based on traffic engineering conflict avoidance logic and outputs a compliant phase sequence that is conflict-free and conforms to traffic engineering specifications.

5. The traffic timing method based on multi-agent collaboration using a large language model according to claim 1, characterized in that, In S3, the qualitative diagnostic report includes: the spatial location of the bottleneck phase, a qualitative description of the cause of congestion, and recommended adjustment directions; The executing agent performs quantitative adjustments and applies mathematical boundary constraints based on the qualitative diagnostic report, including: For idle phases with green light utilization rates below a preset threshold, reduce the green light duration for the corresponding phases; For congested phases where the queue length exceeds a preset threshold, the green light duration for the corresponding phase will be increased. When the overall queue length at the intersection exceeds the overall threshold, the total signal cycle duration is extended. When the overall idle rate of an intersection exceeds the overall threshold, shorten the total signal cycle time. The quantitative adjustment is constrained by mathematical boundaries: the adjusted green light time for each phase is not less than the minimum green light time for pedestrians crossing the street and not greater than the maximum green light time for motor vehicles, while the yellow light duration and the all-red clearing time remain fixed.

6. The traffic timing method based on multi-agent collaboration using a large language model according to claim 1, characterized in that, In S3, the preset iteration termination condition includes: The absolute difference between the comprehensive evaluation function values ​​of two adjacent iterations is less than or equal to the preset lower limit of the allowable error for optimization, or the number of iterations reaches the preset maximum number of iterations; the comprehensive evaluation function is a single quantitative index calculated based on the weighted average delay, average queue length and number of stops.

7. The traffic timing method based on multi-agent collaboration using a large language model according to claim 1, characterized in that, In S4, the monitoring agent collects the actual operating indicators of the intersection in real time using a sliding time window, and the actual operating indicators include the actual average delay. The actual operating indicators are compared with the simulation optimal indicators corresponding to the optimal timing scheme, including: When the actual average delay of multiple consecutive sliding windows is greater than the sum of the simulation optimal delay and the preset degradation tolerance threshold, the performance degradation of the scheme is determined to exceed the preset threshold.

8. A traffic timing system based on multi-agent collaboration using a large language model, characterized in that, include: The cognitive intelligent agent module is used to acquire historical traffic flow data at intersections, identify the temporal peak and valley characteristics of the historical traffic flow data, and generate a set of multi-time control boundaries that are non-overlapping and non-omitted within 24 hours as a macro-scheduling framework. The cognitive agent module is the first major language model; The phase sequence design intelligent agent module calculates the initial timing parameters based on the macro scheduling framework and the traffic flow parameters of the current time period using a preset traffic engineering physics formula; Generate a compliant phase sequence that conforms to the constraints of the conflict matrix; Apply safety boundary checks to the initial timing parameters and the compliant phase sequence to generate a physical reference timing scheme; The evaluation agent module injects the physical benchmark timing scheme into the microscopic traffic simulation platform for simulation to obtain simulation evaluation indicators; based on the simulation evaluation indicators, a qualitative diagnostic report including bottleneck location and adjustment direction is generated, and the evaluation agent module is the third major language model; The execution agent module receives the qualitative diagnostic report and the current timing parameters, performs quantitative adjustments based on the qualitative diagnostic report and applies mathematical boundary constraints, generates an updated timing scheme, and repeats the above simulation deduction, qualitative diagnosis and quantitative adjustment until the preset iteration termination condition is met to obtain the optimal timing scheme; the execution agent module is the fourth major language model; The monitoring agent module, after deploying the optimal timing scheme to the physical traffic signal controller, collects the actual operating indicators of the intersection in real time and compares the actual operating indicators with the simulation optimal indicators corresponding to the optimal timing scheme. When the deviation obtained from the comparison indicates that the performance degradation of the scheme exceeds a preset threshold, the cognitive agent module, the phase sequence design agent module, the evaluation agent module, and the execution agent module are triggered to re-execute the corresponding functions, generate and issue a new optimal timing scheme. The monitoring agent module is the fifth language model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the traffic timing method based on multi-agent cooperation of a large language model as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the traffic timing method based on multi-agent cooperation of a large language model as described in any one of claims 1 to 7.