Off-line generation and optimization method and system of ring intersection induction control logic
Patent Information
- Application Number
- CN202611120852.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-30
AI Technical Summary
部分方案将大语言模型作为在线控制器直接参与实时决策,但存在响应时延、输出波动、非法动作拦截和运行安全校验等问题;另有方案将大语言模型用于定时控制方案生成或自适应控制算法合成,但其输出形式与既有感应控制规则体系不兼容,且未针对环形交叉口特有的三模式控制结构进行专门设计
1. 降低大语言模型在线控制风险
Smart Images

Figure CN123010395A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic signal control technology, specifically to an offline generation and optimization method and system for inductive control logic at roundabouts, applicable to the automatic generation and updating of control rules for roundabouts with deployed inductive control systems under different traffic demand scenarios. Background Technology
[0002] Roundabouts can maintain continuous operation under low traffic demand using yield rules. However, as approach traffic increases, directional distribution becomes uneven, or pedestrian crossing demand rises, problems such as uneven queuing at approach points, vehicle congestion in the roundabout, localized queue overflow, and conflicts between pedestrian and vehicular rights can easily arise. For roundabouts with signal control already deployed, a multi-mode sensor control structure is often used, consisting of pedestrian sensing mode, roundabout clearing mode, and vehicle sensing mode. Vehicle sensing rules determine the initiation, maintenance, and termination of vehicle phases, while mode switching rules determine the transition between different operating modes. Existing rules are usually written by traffic engineers based on experience and revised through repeated simulations or on-site debugging. When total traffic demand, approach traffic distribution, turning ratios, or pedestrian demand change, the original rules may no longer be applicable; the update process is time-consuming and heavily reliant on personnel experience.
[0003] Existing research on signal control at roundabouts has explored various approaches, including timed control, adaptive control, and reinforcement learning control. While timed control methods are structurally simple, they rely on manual surveys and timing calculations, making it difficult to respond promptly to changes in traffic demand. Adaptive control and reinforcement learning methods, although capable of dynamic decision-making based on traffic conditions, typically require redesigning the state space, action space, or online inference modules. Their policy expressions differ significantly from existing sensor-based control rule systems, leading to challenges in interpretability, logic verification, and modification costs during engineering deployment. In recent years, Large Language Models (LLMs) have been explored for use in traffic signal control. Some schemes directly utilize LLMs as online controllers in real-time decision-making, but issues such as response delays, output fluctuations, illegal action interception, and operational safety verification arise. Other schemes use LLMs for generating timed control schemes or synthesizing adaptive control algorithms, but their output formats are incompatible with existing sensor-based control rule systems and lack specific design for the unique three-mode control structure of roundabouts. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides an offline generation and optimization method and system for roundabout sensing control logic that can automatically generate, verify, and filter executable control rules while retaining the existing control framework and detector deployment, and continuously improve the rules through simulation feedback.
[0005] This application provides an offline generation and optimization method for sensing control logic at roundabouts, including the following steps: S1: Based on the detector information and signal controller status of the roundabout approach lanes, roundabout lanes, and pedestrian crossing areas, construct structured traffic state indicators, which are divided into global level indicators, pattern level indicators, and phase level indicators according to their scope of application; register the structured traffic state indicators through a whitelist, and limit the indicator name, data type, value range, calculation method, and applicable rule type of each indicator. S2: The whitelist of indicators, rule syntax constraints, allowed actions, current optimization stage information, current rule combination, and the previous simulation evaluation report are organized into inputs for a large language model, which generates several structured candidate rules. The rule syntax constraints include field structure, logical operators, comparison operators, and executable actions. The current rule combination includes vehicle sensing rules and mode switching rules. S3: Before performing simulation evaluation, the structured candidate rules are sequentially checked for format validity, index reference validity, and control constraint consistency. Candidate rules that fail the checks will not be included in the simulation evaluation and will be regenerated. Among them, the engineering hard constraints, which include at least the minimum green light time and the minimum duration of the loop clearing mode, are enforced by the underlying control program and are not open to modification by the large language model. S4: Combine the verified candidate rules with the fixed rules of the current stage to form candidate rule combinations, run them in batches in the micro traffic simulation environment, obtain the running evaluation indicators of each candidate rule combination, generate an evaluation report, and feed the evaluation report back to the next round of rule generation. Repeat steps S2 to S4 for iterative optimization. The iterative optimization is divided into three stages: Phase 1: Fixed mode switching rules, with vehicle sensing score as the target, iteratively optimize the vehicle sensing rules to obtain the optimal vehicle sensing rules for this phase; Phase Two: Fix the optimal vehicle sensing rule for the phase, and iteratively optimize the mode switching rule with the mode switching score as the target to obtain the optimal mode switching rule for the phase; Phase 3: From the historical candidate rule combinations accumulated in the first two phases, the optimal rule combinations are selected according to the comprehensive score. The vehicle sensing rules and mode switching rules are extracted from them. After deduplication, they are cross-combined. The historical simulation results are reused for the existing combinations, and the simulation evaluation is supplemented for the new combinations. Finally, the optimal rule combination is selected according to the comprehensive score as the optimal rule combination applicable to the target traffic demand scenario.
[0006] Preferably, the global-level indicators are used to describe the current operating mode and the switchable target mode; the mode-level indicators are used to describe the number of roundabout congestion zones, the number of upstream long queue entrances, the number of roundabout clearing sections, the entrance queue pressure indicator, and the clearing and release readiness indicator; the phase-level indicators are used to describe the current vehicle phase green light duration, the detector headway status, the candidate phase light color status, and the adjacent entrance phase status; the roundabout's sensing control system includes a pedestrian sensing mode, a roundabout clearing mode, and a vehicle sensing mode. The pedestrian sensing mode is used to respond to pedestrian crossing requests, the roundabout clearing mode is used to restrict entrance vehicles from entering the roundabout and release vehicles accumulating in the roundabout, and the vehicle sensing mode is used to organize the release of vehicle phases based on the detection status.
[0007] Preferably, the vehicle sensing rules include activation rules and deactivation rules, which are used to determine whether the candidate vehicle phase has been activated and whether the current vehicle phase has ended, respectively; the mode switching rules adopt a hierarchical structure, with the top-level field corresponding to the current operating mode, and several ordered rules set in each mode. The rule engine judges the rule conditions one by one in a preset order, and the first rule that meets the conditions triggers the corresponding mode switching action.
[0008] Preferably, the format validity check includes checking the validity of JSON syntax, top-level structure, required fields, and logical operators; the indicator reference validity check includes checking whether the indicator is within the indicator whitelist and whether it exceeds the indicator's applicable scope; the control constraint consistency check includes checking the validity of the schema name, the schema conversion relationship, the action type, and the integrity of fixed fields.
[0009] Preferably, the operational evaluation indicators include average vehicle delay d, average number of vehicle stops s, number of passing vehicles v, cumulative duration a during which all imported motor vehicle phases are simultaneously in a red light state under vehicle sensing mode, number of times right-of-way transmission is obstructed b, average number of ring road parking sections c, total number of mode switching m, and average number of upstream long queue imports u. The vehicle sensing score Calculate using the following formula: ; The mode switching score and the overall score All calculations are performed according to the following formula: ; ; Among them, the mode switching score The comprehensive score is used for ranking candidate rules in Phase Two. The final rule combination sorting is used for Phase 3.
[0010] Preferably, the structured candidate rules are output in JSON format, and each candidate scheme includes a strategy description, an applicable scenario description, and a JSON object of the rule to be optimized at the current stage; in the simulation evaluation, the duration of a single simulation is set to 4500 seconds, of which the first 900 seconds are the warm-up period and the last 3600 seconds are the statistical period, and each traffic demand scenario is run repeatedly using multiple random seeds.
[0011] Preferably, the selection of optimal rule combinations based on the comprehensive score in stage three specifically involves: selecting based on the comprehensive score... The top t combinations are selected from the historical candidate rule combinations of Phase 1 and Phase 2 respectively, and merged to form a set of preferred historical rule combinations. After deduplication, q vehicle sensing rules and p mode switching rules are obtained, and cross-combined to form q×p joint candidate rule combinations. The existing results of historical combinations that have completed simulation evaluation are directly reused, and the simulation evaluation is supplemented for newly added combinations.
[0012] Preferably, after the optimal rule combination is written into the field signal controller or edge controller, only the deterministic rule engine and underlying security constraints are executed during the field operation phase, and the large language model is no longer called.
[0013] This application also provides an electronic device, including: a memory and a processor, wherein the memory stores computer program instructions for execution on the processor, and when the processor executes the computer program instructions, it implements the method described above.
[0014] This application also provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. Reduce the risks of online control of large language models This invention uses a large language model for offline rule generation, rather than directly participating in real-time field control, which effectively reduces the impact of interface latency, output fluctuations, and abnormal responses on signal operation. During the field operation phase, only deterministic rule engines and underlying safety constraints are executed, without invoking the large language model, thus ensuring the determinism and stability of the control system. This is fundamentally different from existing solutions that use large language models as online controllers.
[0016] 2. Highly compatible with existing control frameworks This invention generates structured JSON rules that can be directly written into field signal controllers or edge controllers without altering existing detector deployment, signal light group structure, or control framework, facilitating engineering deployment and subsequent maintenance. This offers significant engineering advantages compared to solutions like EvolveSignal (outputting Python functions) and SignalClaw (outputting code skills), which require substantial modifications to the control system.
[0017] 3. The phased optimization strategy effectively solves the problem of mutual influence between the two types of rules. This invention addresses the problem of mutual interference between vehicle sensing rules and mode switching rules by employing a three-stage strategy: "vehicle sensing rule optimization → mode switching rule optimization → joint recombination optimization." This strategy effectively reduces the combined size of the joint search and can identify the contribution of different rule categories to control performance. Experimental results show that vehicle sensing rule optimization can reduce average vehicle delay by 45.7% to 64.6% compared to the initial rules. After further optimization of the mode switching rules, the number of mode switches decreased from 28.6 to 38.2 times to 1.2 to 1.4 times.
[0018] 4. Three-layer validity verification ensures rule enforceability This invention employs a three-layer static verification system—format validity verification, indicator reference validity verification, and control constraint consistency verification—to confine the output of a large language model within an executable range. Simultaneously, hard engineering constraints such as minimum green light time and minimum duration of the loop clearing mode are enforced by the underlying program and not accessible for model modification, fundamentally preventing generated rules from exceeding safety boundaries.
[0019] 5. Simulation feedback-driven iterative optimization mechanism This invention reduces repetitive manual debugging and improves rule update efficiency through simulation evaluation, diagnostic feedback, and phased optimization. Experiments show that when using the Large Language Model (GLM) as the rule generation model, the average vehicle delay of the resulting rule combination is 28.24 seconds, which is 35.9% lower than the manually designed multi-level pedestrian signal control baseline rule (44.03 seconds).
[0020] 6. Adaptability to different traffic demand scenarios This invention can generate adaptive rules for different traffic demand scenarios. Cross-scenario test results show that the rules generated for specific demand structures all achieve the best or tied-best comprehensive evaluation scores in the corresponding scenarios; for high-demand scenarios with adjacent entrances, the customized rules reduce the average vehicle delay by 25.4% compared to the wide-domain demand rules. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0022] Figure 1 A schematic diagram of the overall process of offline generation and optimization method for roundabout sensing control logic provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a three-mode sensing control structure; Figure 3 A schematic diagram of the control logic iterative framework driven by a large language model; Figure 4 A schematic diagram of the phased optimization process for control rules.
[0023] The realization of the objectives, functional features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0024] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0025] Before providing a further detailed description of the present invention, the nouns and terms used in the embodiments of the present invention will be explained, and the nouns and terms used in the embodiments of the present invention shall be interpreted as follows.
[0026] Please see Figure 1 This application provides an offline generation and optimization method for inductive control logic at roundabouts, comprising the following steps: S1: Based on the detector information and signal controller status of the roundabout approach lanes, roundabout lanes, and pedestrian crossing areas, construct structured traffic state indicators, which are divided into global level indicators, pattern level indicators, and phase level indicators according to their scope of application; register the structured traffic state indicators through a whitelist, and limit the indicator name, data type, value range, calculation method, and applicable rule type of each indicator. S2: The whitelist of indicators, rule syntax constraints, allowed actions, current optimization stage information, current rule combination, and the previous simulation evaluation report are organized into inputs for a large language model, which generates several structured candidate rules. The rule syntax constraints include field structure, logical operators, comparison operators, and executable actions. The current rule combination includes vehicle sensing rules and mode switching rules. S3: Before performing simulation evaluation, the structured candidate rules are sequentially checked for format validity, index reference validity, and control constraint consistency. Candidate rules that fail the checks will not be included in the simulation evaluation and will be regenerated. Among them, the engineering hard constraints, which include at least the minimum green light time and the minimum duration of the loop clearing mode, are enforced by the underlying control program and are not open to modification by the large language model. S4: Combine the verified candidate rules with the fixed rules of the current stage to form candidate rule combinations, run them in batches in the micro traffic simulation environment, obtain the running evaluation indicators of each candidate rule combination, generate an evaluation report, and feed the evaluation report back to the next round of rule generation. Repeat steps S2 to S4 for iterative optimization. The iterative optimization is divided into three stages: Phase 1: Fixed mode switching rules, with vehicle sensing score as the target, iteratively optimize the vehicle sensing rules to obtain the optimal vehicle sensing rules for this phase; Phase Two: Fix the optimal vehicle sensing rule for the phase, and iteratively optimize the mode switching rule with the mode switching score as the target to obtain the optimal mode switching rule for the phase; Phase 3: From the historical candidate rule combinations accumulated in the first two phases, the optimal rule combinations are selected according to the comprehensive score. The vehicle sensing rules and mode switching rules are extracted from them. After deduplication, they are cross-combined. The historical simulation results are reused for the existing combinations, and the simulation evaluation is supplemented for the new combinations. Finally, the optimal rule combination is selected according to the comprehensive score as the optimal rule combination applicable to the target traffic demand scenario.
[0027] In one embodiment, the global-level indicators are used to describe the current operating mode and the switchable target mode; the mode-level indicators are used to describe the number of roundabout congestion zones, the number of upstream long queue entrances, the number of roundabout clearing sections, the entrance queue pressure indicator, and the clearing and release readiness indicator; the phase-level indicators are used to describe the current vehicle phase green light duration, the detector headway status, the candidate phase light color status, and the adjacent entrance phase status; the roundabout's sensing control system includes a pedestrian sensing mode, a roundabout clearing mode, and a vehicle sensing mode. The pedestrian sensing mode is used to respond to pedestrian crossing requests, the roundabout clearing mode is used to restrict entrance vehicles from entering the roundabout and release vehicles accumulating in the roundabout, and the vehicle sensing mode is used to organize the release of vehicle phases based on the detection status.
[0028] In one embodiment, the vehicle sensing rules include activation rules and deactivation rules, which are used to determine whether a candidate vehicle phase has been activated and whether the current vehicle phase has ended, respectively. The mode switching rules adopt a hierarchical structure, with the top-level field corresponding to the current operating mode. Several ordered rules are set in each mode. The rule engine judges the rule conditions one by one in a preset order, and the first rule that meets the conditions triggers the corresponding mode switching action.
[0029] In one embodiment, the format validity check includes checking the validity of JSON syntax, top-level structure, required fields, and logical operators; the indicator reference validity check includes checking whether the indicator is within the indicator whitelist and whether it exceeds the indicator's applicable scope; the control constraint consistency check includes checking the validity of the schema name, the schema transformation relationship, the action type, and the integrity of fixed fields.
[0030] In one embodiment, the operational evaluation indicators include average vehicle delay d, average number of vehicle stops s, number of passing vehicles v, cumulative duration a during which all imported motor vehicle phases are simultaneously red under vehicle sensing mode, number of times right-of-way transfer is obstructed b, average number of ring road parking sections c, total number of mode switching m, and average number of upstream long queues at imports u. The vehicle sensing score Calculate using the following formula: ; The mode switching score and the overall score All calculations are performed according to the following formula: ; ; Among them, the mode switching score The comprehensive score is used for ranking candidate rules in Phase Two. The final rule combination sorting is used for Phase 3.
[0031] In one embodiment, the structured candidate rules are output in JSON format. Each candidate scheme includes a strategy description, an applicable scenario description, and a JSON object of the rule to be optimized at the current stage. In the simulation evaluation, the duration of a single simulation is set to 4500 seconds, of which the first 900 seconds are the warm-up period and the last 3600 seconds are the statistical period. Each traffic demand scenario is run repeatedly using multiple random seeds.
[0032] In one implementation, the selection of optimal rule combinations based on the comprehensive score in stage three specifically means: based on the comprehensive score... The top t combinations are selected from the historical candidate rule combinations of Phase 1 and Phase 2 respectively, and merged to form a set of preferred historical rule combinations. After deduplication, q vehicle sensing rules and p mode switching rules are obtained, and cross-combined to form q×p joint candidate rule combinations. The existing results of historical combinations that have completed simulation evaluation are directly reused, and the simulation evaluation is supplemented for newly added combinations.
[0033] In one implementation, after the optimal rule combination is written into the field signal controller or edge controller, only the deterministic rule engine and underlying security constraints are executed during the field operation phase, and the large language model is no longer invoked.
[0034] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The simulation data involved in the following embodiments comes from experimental verification on a four-way roundabout model using the method of the present invention. The data used is only for illustrating the technical effects of the present invention and should not be regarded as a limitation on the scope of the present invention.
[0035] Example 1: Simulation Environment and Scene Setup This embodiment uses a four-way roundabout as the application scenario and establishes a micro-traffic simulation model based on VISSIM. The intersection adopts a symmetrical layout with four entrances. Each entrance has four lanes, including one dedicated right-turn lane, two dedicated straight-ahead lanes, and one shared straight-left lane; the roundabout has three lanes. Each entrance has its own independent pedestrian crossing. Detectors are deployed in the entrances, roundabout, and pedestrian crossing areas. The data collected by the detectors includes, but is not limited to, headway, occupancy rate, and queue length.
[0036] The control program includes pedestrian sensing mode, roundabout clearing mode, and vehicle sensing mode, such as Figure 2As shown. The pedestrian sensing mode responds to pedestrian crossing requests. When a pedestrian demand is detected and the vehicle phase conflicting with the pedestrian crossing meets the release constraints, the corresponding pedestrian phase gains the right of way. The roundabout clearing mode restricts incoming vehicles from entering the roundabout and releases vehicles accumulating in the roundabout. When vehicles accumulate in the roundabout or the right-of-way needs adjustment, incoming vehicles temporarily delay entering the roundabout, providing conditions for vehicles within the roundabout to leave. The vehicle sensing mode is mainly used to organize vehicle release, adjusting the vehicle release phase based on detection information from the incoming lane and the roundabout.
[0037] In this embodiment, the duration of a single simulation is set to 4500 seconds, with the first 900 seconds being a warm-up period and the following 3600 seconds being a statistical period. Each traffic demand scenario is simulated repeatedly using 5 random seeds to reduce the impact of random arrival fluctuations on the evaluation results. Pedestrian demand at each entrance is independently and uniformly sampled within the range of 20–150 ped / h.
[0038] To test the adaptability of the method of this invention under different traffic demand structures, this embodiment sets up four traffic demand scenarios. The expected total flow of incoming motor vehicles in each scenario is 4000 veh / h, but the flow distribution structure between the incoming directions is different. The sampling range of vehicle demand for each scenario is shown in Table 1.
[0039] Table 1. Sampling range of vehicle demand for each scenario (veh / h) Example 2: Construction of Structured Traffic State Indicators and Whitelist Registration Before offline optimization begins, the system reads the initial vehicle sensing rules and initial mode switching rules, and generates an indicator whitelist based on detector information and controller status.
[0040] Based on detector information and signal controller status at roundabout approach lanes, roundabouts, and pedestrian crossing areas, a structured traffic state index is constructed. According to its scope of application, the structured traffic state index is divided into the following three levels: (1) Global-level indicators: used to describe the current operating mode and the switchable target mode; (2) Model-level indicators: used to describe the number of ring road congestion zones, the number of upstream long queue inlets, the number of ring road clearing sections, inlet queue pressure indicators, and clearing release ready indicators; (3) Phase-level indicators: used to describe the current vehicle phase green light duration, detector headway status, candidate phase light color status and adjacent inlet phase status.
[0041] Each indicator is registered through a whitelist, which limits the indicator name, data type, value range, calculation method, and applicable rule type. When generating rules offline, the large language model can only call indicators registered in the whitelist and cannot reference unregistered indicators. Table 2 shows the hierarchical structure and typical examples of indicators that the rule engine can call.
[0042] Table 2. Hierarchical structure of metrics that can be invoked by the rule engine Example 3: Large Language Model Input Organization, Candidate Rule Generation, and Validity Verification Step 1: Input Information Organization The system organizes the following five parts of information into a large language model input: (1) Available indicators and rule syntax: including the indicator whitelist shown in Table 2, as well as rule syntax constraints such as field structure, logical operators, comparison operators and executable actions; (2) Stage tasks and optimization constraints: Names and functions of the three types of operating modes, allowed mode conversion relationships, optimization focus of the current stage, fixed rules and modifiable rules, and prohibited operations; (3) Task configuration: Generation parameters such as the number of candidate rule combinations and current iteration information; (4) Current rule combination: The complete JSON content of the current mode switching rule and the vehicle sensing rule; (5) Simulation evaluation report: The operational performance of the current rule combination, including key evaluation indicators and operational diagnostic information.
[0043] The above information is passed to the large language model through system prompts and task prompts. System prompts specify generation constraints that remain unchanged across rounds, including rule syntax, general output structure, fixed field protection, and prohibition of calling unregistered metrics. Task prompts organize the dynamic information required for rule generation in this round.
[0044] Step 2: Candidate Rule Generation and Output The large language model generates several structured candidate rules based on the input information. Vehicle sensing rules and mode switching rules are stored in JSON format and interfaced with the control program.
[0045] The mode switching rules adopt a hierarchical structure. The top-level field corresponds to the current operating mode, and several ordered rules are set for each mode. The rule engine evaluates the rule conditions one by one in a preset order, and the first rule that meets the conditions triggers the corresponding mode switching action. Each rule consists of a name, a condition expression, and action parameters. The condition expression supports logical combination and comparison operations.
[0046] Vehicle sensing rules include start rules and stop rules, used to determine whether a candidate vehicle phase has started and whether the current vehicle phase has ended, respectively. The control program enforces unmodifiable protective conditions such as minimum green light, while the large language model only adjusts the conditional expressions that allow opening.
[0047] Each candidate solution includes: (1) strategy description; (2) applicable scenario description; (3) JSON object of the rules to be optimized at the current stage.
[0048] Step 3: Three-layer validity verification Candidate rules generated by the large language model must undergo automated static validation before entering simulation evaluation. The validation content is shown in Table 3.
[0049] Table 3. Contents of Candidate Rule Legality Verification Format validity checks identify issues such as JSON parsing failures, missing fields, and illegal operators, ensuring that candidate rules can be correctly read by the rule engine. Indicator reference validity checks restrict the traffic status indicators that the large language model can call, preventing the reference of unregistered indicators or indicators beyond their applicable scope. Control constraint consistency checks exclude rules with illegal pattern names, unopened actions, and rules that do not conform to established pattern transformation relationships, and check whether unmodifiable fields remain complete. Candidate rules that fail the checks are not included in the simulation evaluation and are regenerated.
[0050] Hard constraints such as minimum green light time and minimum duration of loop clearing mode are not included in the optimization of the large language model. These constraints are passed to the large language model along with the rule generation task, enabling it to understand the rule modification boundaries. These hard constraints remain unchanged during iteration and are enforced by the control program at runtime to prevent generation behavior from exceeding the underlying control constraints.
[0051] Example 4: Simulation Evaluation and Adaptability Verification of Different Large Language Models Candidate rules that pass legitimacy checks are combined with the fixed rules for the current stage to form executable candidate rule combinations. Each candidate rule combination is then run in batches using VISSIM simulations under preset traffic demand scenarios, such as... Figure 3 As shown in Table 4, after the simulation, the results of running multiple random seeds are aggregated to generate a comprehensive evaluation report of candidate rule combinations. The evaluation report includes four modules: basic performance, running characteristics, diagnostic analysis, and score decomposition.
[0052] Table 4. Structure of the Comprehensive Evaluation Report for Candidate Rule Combinations To verify the adaptability of the method of this invention to different large language models, four models—DeepSeek-V4-Pro, Kimi-K2.6, GLM-5.1, and Qwen3.5-397B-A17B—were selected for comparative experiments. Each model independently completed three rounds of phased optimization under the same experimental conditions. Phases one and two each iterated for five generations, generating four candidate rules per generation; phase three involved joint recombination optimization. All experiments used the same prompt word template, input information, output constraints, and number of candidates. Under the same automatic retry strategy, all four models ultimately generated executable candidate rules that met the required number. The rule generation adaptability evaluation results for each model in phases one and two are shown in Table 5.
[0053] Table 5. Evaluation results of rule generation adaptability of different models Note: E1 indicates JSON parsing failure, E2 indicates metric referencing violation, E3 indicates incomplete schema conversion, E4 indicates missing required field, and E5 indicates other errors.
[0054] As shown in Table 5, Qwen and GLM have relatively high initial generation validity rates, with an average number of API calls close to the theoretical optimal value of 1.0, indicating that they have good stability under fixed output format and rule constraints. Kimi has a relatively low initial generation validity rate, especially in Phase 2, where it experiences more JSON parsing failures and incomplete schema conversion.
[0055] Regarding control performance, Table 6 presents the average performance of the initial rule, the multi-level pedestrian signal control (MPS) baseline rule, and the optimal rule combination obtained from four large language models. The initial rule is the starting scheme for iterative optimization in this invention; the MPS baseline rule is a control scheme manually configured according to the method proposed by Xu et al.
[0056] Table 6. Average performance of rule combinations obtained by different methods As shown in Table 6, compared with the initial rules, the MPS baseline rules reduced the average vehicle delay from 82.72 seconds to 44.03 seconds, a reduction of 46.8%. The average vehicle delay and overall evaluation score of the rule combinations obtained from the four large language models were further reduced. Among them, the rule combination obtained by GLM had the lowest average vehicle delay at 28.24 seconds, a reduction of 35.9% compared to the MPS baseline rules; its number of passing vehicles and overall evaluation score were also better than the other models. In terms of overall rule generation adaptability and control performance, GLM performed better in terms of first-time generation validity rate, average number of API calls, and overall evaluation score.
[0057] Example 5: Phased Optimization Process and Ablation Assessment This embodiment illustrates the specific implementation process of the core of the method of the present invention—the phased optimization strategy.
[0058] like Figure 4 As shown, the iterative optimization is divided into three stages: Phase 1 (Vehicle Sensing Rule Optimization): Fix the initial mode switching rules, based on vehicle sensing scores. To achieve the goal, the vehicle sensing rules are iteratively optimized. Each generation generates n candidate rules from the large language model (n=4 in this embodiment), and combines them with fixed mode switching rules to form n candidate rule combinations. After the candidate rule combinations undergo legality verification and simulation evaluation, they are then... Update the current optimal vehicle sensing rule. After K iterations (K=5 in this example), the stage-optimal vehicle sensing rule is obtained.
[0059] Phase Two (Mode Switching Rule Optimization): Fix the optimal vehicle sensing rules obtained in Phase One, and use mode switching scores. To achieve the goal, the mode switching rule is iteratively optimized. In each generation, a large language model generates n candidate rules, which are then combined with fixed vehicle sensing rules. After K iterations, the optimal mode switching rule for the stage is obtained.
[0060] Phase Three (Joint Reorganization Optimization): This phase no longer uses the large language model to generate new rules, but instead reorganizes the historical candidate rule combinations accumulated in the first two phases. First, based on the comprehensive score... The first t combinations (t=10 in this embodiment) are selected from the historical candidate rule combinations of Phase 1 and Phase 2 respectively, and merged to form a preferred historical rule combination set. Then, the mode switching rules and vehicle sensing rules are extracted from these sets, and after deduplication, q vehicle sensing rules and p mode switching rules are obtained. These are then cross-combined to form q×p joint candidate rule combinations. For historical combinations that have already undergone simulation evaluation, the existing results are directly reused; for newly added combinations, additional simulation evaluations are conducted. Finally, according to... The joint candidate rule combinations are sorted to determine the optimal rule combination.
[0061] To differentiate the screening focus at each stage, a vehicle sensing score is defined. Mode switching score and overall score All three scores are evaluation scores to be minimized; the lower the score, the better the performance of the rule combination. The formulas for calculating the three scores are as follows: ; ; ; Wherein, d, s, and v represent average vehicle delay (in seconds), average number of vehicle stops, and number of vehicles passing through (in vehicles), respectively. These three indicators use the same coefficient across different scores to maintain a consistent evaluation of basic operational efficiency. a represents the cumulative duration (in seconds) during which all inbound vehicle phases are simultaneously red under vehicle sensing mode, reflecting the degree of exposure to a deadlock-like state. b represents the number of times the next inbound vehicle phase is blocked clockwise, reflecting the degree of obstruction in right-of-way transmission. c represents the average number of parking sections in the ring road, reflecting the degree of ring road congestion. m represents the total number of mode switches. u represents the average number of long queues at upstream inbound points, reflecting inbound queuing pressure. All coefficients are set based on the magnitude of the indicators and their engineering meaning in the corresponding control links, and remain consistent across all optimization tasks in this invention to ensure a unified evaluation caliber.
[0062] To evaluate the incremental contribution of each optimization stage, a comparative experiment was conducted using a cumulative ablation scheme. The experiment used the S1 wide-domain random demand scenario. The scheme settings are shown in Table 7: P1 is the initial rule baseline scheme; P2 retains only the results of stage one; P3 adds the results of stage two to P2; P4 further adds the results of stage three to P3.
[0063] Table 7 Ablation Experimental Protocol Setup The comprehensive evaluation scores and main operating indicators of each scheme are shown in Table 8.
[0064] Table 8 Ablation Experiment Control Performance As shown in Table 8, compared with the initial rule P1, scheme P2 significantly reduced the average vehicle delay and the average number of vehicle stops, while increasing the number of passing vehicles. The second round showed the greatest improvement, with the overall score decreasing from 119.27 to 15.11 and the average vehicle delay decreasing from 82.72 seconds to 29.32 seconds. After adding mode-switching rule optimization to P2, the overall evaluation score of P3 further decreased in all three rounds of experiments: the number of mode switches decreased from 28.6-38.2 times in P2 to 1.2-1.4 times, and the average vehicle delay and the average number of vehicle stops also decreased further. P4 added joint recombination optimization to P3, and the overall evaluation score in the first round of experiments decreased slightly from 5.36 to 5.34; the optimal results in the second and third rounds remained unchanged. Therefore, stage three showed relatively small marginal improvement in this group of experiments, but it did not require additional large language model calls and could utilize the historical candidate rules accumulated in the first two stages for supplementary combination evaluation, thereby reducing the possibility of sequential optimization missing better rule combinations.
[0065] Example 6: Adaptability Assessment for Requirement Scenarios To test the adaptability of control rules under different traffic demand structures, this embodiment conducts rule generation and cross-scenario testing experiments based on four traffic demand scenarios (S1-S4) shown in Table 1.
[0066] Three independent, phased optimizations were conducted based on S1-S4, and the rule combinations with the lowest overall evaluation scores in each scenario were selected and denoted as R1-R4. Subsequently, the four rule combinations were deployed in four different requirement scenarios for cross-testing. The performance of different rule combinations in each scenario is shown in Table 9.
[0067] Table 9. Performance of different rule combinations under various demand scenarios Table 9 shows that all rules corresponding to the test scenarios achieved the best or tied-best comprehensive evaluation scores. In scenario S1, R1 had the lowest comprehensive evaluation score with an average vehicle delay of 24.26 seconds. In scenarios S2 and S3, R2 and R3 achieved tied-best results. In scenario S4, R4 showed a significant advantage: its average vehicle delay was 26.17 seconds, a 25.4% reduction compared to R1, and its comprehensive evaluation score decreased from 13.39 to -1.50. The results indicate that optimizing rules for specific demand structures helps to obtain control rules adapted to the corresponding scenarios.
[0068] Cross-scenario test results further reflect the differences in the adaptability of different rules. R1, generated based on a wide-range random demand scenario, maintains relatively stable performance in scenarios S2 and S3, but is weaker than its corresponding rule R4 in scenario S4. On the other hand, while R4 achieves the best results in scenario S4, it is no longer dominant after migrating to S2 and S3. This shows that rules generated based on a wider demand range can adapt to a certain degree of demand fluctuation; for scenarios with significant differences in traffic distribution structures, re-optimizing the rules can still help improve control effectiveness.
[0069] Example 7: On-site Deployment The optimal rule combination based on comprehensive evaluation is written into the field signal controller or edge controller. During the field operation phase, only the deterministic rule engine and underlying safety constraints are executed, and the large language model is no longer invoked.
[0070] For scenarios with large fluctuations in demand, rules generated under wide-range random demand conditions can be used first; when the traffic demand structure changes significantly, offline optimization can be re-executed and control rules updated.
[0071] Summary of parameters involved in the specific implementation method For ease of understanding and implementation, the main parameters involved in the method of this invention are summarized as follows: This application also provides an electronic device, including a processor and a memory, wherein the memory stores computer program instructions for execution on the processor, and when the processor executes the computer program instructions, it implements the method for generating high-risk test scenarios for autonomous driving as described above.
[0072] This application embodiment also provides a storage medium storing computer instructions, which, when executed by a processor, implement the method for generating key safety scenarios for autonomous driving based on test result feedback as described above.
[0073] It is understood that the above scenarios are merely examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, as those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0074] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0075] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0076] The units in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0077] In this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions are generally described in detail only when they appear for the first time. When they appear again, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions that are not described in detail later can be referred to their previous relevant detailed descriptions.
[0078] In this application, the descriptions of the various embodiments have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0079] The technical features of the present application can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.
[0081] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, storage disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0082] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An offline generation and optimization method for inductive control logic at a roundabout, characterized in that, Includes the following steps: S1: Based on the detector information and signal controller status of the roundabout approach lanes, roundabout lanes, and pedestrian crossing areas, construct structured traffic state indicators, which are divided into global level indicators, pattern level indicators, and phase level indicators according to their scope of application; register the structured traffic state indicators through a whitelist, and limit the indicator name, data type, value range, calculation method, and applicable rule type of each indicator. S2: The whitelist of indicators, rule syntax constraints, allowed actions, current optimization stage information, current rule combination, and the previous simulation evaluation report are organized into inputs for a large language model, which generates several structured candidate rules. The rule syntax constraints include field structure, logical operators, comparison operators, and executable actions. The current rule combination includes vehicle sensing rules and mode switching rules. S3: Before performing simulation evaluation, the structured candidate rules are sequentially checked for format validity, index reference validity, and control constraint consistency. Candidate rules that fail the checks will not be included in the simulation evaluation and will be regenerated. Among them, the engineering hard constraints, which include at least the minimum green light time and the minimum duration of the loop clearing mode, are enforced by the underlying control program and are not open to modification by the large language model. S4: Combine the verified candidate rules with the fixed rules of the current stage to form candidate rule combinations, run them in batches in the micro traffic simulation environment, obtain the running evaluation indicators of each candidate rule combination, generate an evaluation report, and feed the evaluation report back to the next round of rule generation. Repeat steps S2 to S4 for iterative optimization. The iterative optimization is divided into three stages: Phase 1: Fixed mode switching rules, with vehicle sensing score as the target, iteratively optimize the vehicle sensing rules to obtain the optimal vehicle sensing rules for this phase; Phase Two: Fix the optimal vehicle sensing rule for the phase, and iteratively optimize the mode switching rule with the mode switching score as the target to obtain the optimal mode switching rule for the phase; Phase 3: From the historical candidate rule combinations accumulated in the first two phases, the optimal rule combinations are selected according to the comprehensive score. The vehicle sensing rules and mode switching rules are extracted from them. After deduplication, they are cross-combined. The historical simulation results are reused for the existing combinations, and the simulation evaluation is supplemented for the new combinations. Finally, the optimal rule combination is selected according to the comprehensive score as the optimal rule combination applicable to the target traffic demand scenario.
2. The method according to claim 1, characterized in that, The global-level indicators are used to describe the current operating mode and the switchable target mode; the mode-level indicators are used to describe the number of ring road congestion zones, the number of upstream long queue inlets, the number of ring road clearing sections, the inlet queue pressure indicator, and the clearing release ready indicator; the phase-level indicators are used to describe the current vehicle phase green light duration, the detector headway status, the candidate phase light color status, and the adjacent inlet phase status. The sensing control system of the roundabout includes a pedestrian sensing mode, a roundabout clearing mode, and a vehicle sensing mode. The pedestrian sensing mode is used to respond to pedestrian crossing requests. The roundabout clearing mode is used to restrict oncoming vehicles from entering the roundabout and release vehicles accumulating in the roundabout. The vehicle sensing mode is used to organize the phase release of motor vehicles based on the detection status.
3. The method according to claim 1, characterized in that, The vehicle sensing rules include activation rules and deactivation rules, which are used to determine whether the candidate vehicle phase has been activated and whether the current vehicle phase has ended, respectively. The mode switching rules adopt a hierarchical structure, with the top-level field corresponding to the current operating mode. Several ordered rules are set in each mode. The rule engine judges the rule conditions one by one in a preset order, and the first rule that meets the conditions triggers the corresponding mode switching action.
4. The method according to claim 1, characterized in that, The format validity check includes checking the validity of JSON syntax, top-level structure, required fields, and logical operators; the indicator reference validity check includes checking whether the indicator is within the indicator whitelist and whether it exceeds the indicator's applicable scope; the control constraint consistency check includes checking the validity of the schema name, schema conversion relationship, action type, and the integrity of fixed fields.
5. The method according to claim 1, characterized in that, The operational evaluation indicators include average vehicle delay d, average number of vehicle stops s, number of passing vehicles v, cumulative duration a of all imported motor vehicle phases being red simultaneously under vehicle sensing mode, number of times right-of-way transfer was obstructed b, average number of ring road parking sections c, total number of mode switching m, and average number of upstream long queues at imports u. The vehicle sensing score Calculate using the following formula: ; The mode switching score and the overall score All calculations are performed according to the following formula: ; ; Among them, the mode switching score The comprehensive score is used for ranking candidate rules in Phase Two. The final rule combination sorting is used for Phase 3.
6. The method according to claim 1, characterized in that, The structured candidate rules are output in JSON format. Each candidate solution includes a strategy description, an applicable scenario description, and a JSON object of the rule to be optimized at the current stage. In the simulation evaluation, the duration of a single simulation is set to 4500 seconds, of which the first 900 seconds are the warm-up period and the last 3600 seconds are the statistical period. Each traffic demand scenario is run repeatedly using multiple random seeds.
7. The method according to claim 5, characterized in that, The optimal combination of rules, as described in Phase Three, is selected based on the comprehensive score. Specifically, this is done according to the comprehensive score. The first t combinations are selected from the historical candidate rule combinations of Phase 1 and Phase 2 respectively, and merged to form a preferred historical rule combination set; after deduplication, q vehicle sensing rules and p mode switching rules are obtained, and cross-combined to form q×p joint candidate rule combinations; For historical combinations that have already undergone simulation evaluation, the existing results can be directly reused, while for newly added combinations, a supplementary simulation evaluation is provided.
8. The method according to claim 1, characterized in that, After the optimal rule combination is written into the field signal controller or edge controller, only the deterministic rule engine and underlying safety constraints are executed during the field operation phase, and the large language model is no longer called.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer program instructions for execution on the processor, wherein the processor, when executing the computer program instructions, implements the method as described in any one of claims 1 to 8.
10. A storage medium, characterized in that, It stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 8.
