A method and system for incremental modeling and solving decision-making in large-scale transportation systems based on a large language model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-08-14
AI Technical Summary
其次,大规模工业调度MILP模型通常包含数以万计的决策变量,其中相当一部分变量在实际生产中几乎不会被激活,却显著增加了求解规模和时间
[0067] (1) This invention utilizes LoRA fine-tuning technology, enabling large language models to acquire optimization modeling capabilities with only a small number of training samples, thus reducing the burden of manual modeling. By formalizing business rule updates into structured constraint injection at the LP level, it is possible to add new business constraints to the deployed model while preserving the original objective function, supporting the rolling updates and continuous evolution of the traffic optimization model. Through data-driven variable pruning methods, redundant decision variables can be automatically identified and removed, reducing the size and solution complexity of the traffic optimization model.
Smart Images

Figure CN122572807A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology and transportation system optimization, and relates to a method and system for incremental modeling and solving of decision-making in large-scale transportation systems based on a large language model. Background Technology
[0002] Mixed-integer linear programming (MILP) is a core modeling tool in industrial planning and scheduling, playing a crucial role in manufacturing scheduling, supply chain management, and logistics. However, in practical applications, the construction and maintenance of traffic optimization models are highly dependent on manual intervention. Domain experts often describe planning requirements in natural language, but converting these requirements into mathematically correct MILP models requires both operations research expertise and programming skills, a process that is time-consuming, error-prone, and difficult to scale. Existing automated modeling methods based on large language models mostly remain at the one-time generation stage, with generated code often containing syntax errors or incompatibility with solvers, resulting in low practical usability. Meanwhile, industrial traffic optimization models are rarely static; as business rules evolve, new constraints must be continuously incorporated into existing traffic optimization models. Reconstructing the model from scratch is costly, and manually modifying LP files can easily damage the original structure. Currently, there is a lack of a method that can automatically inject new business constraints into existing traffic optimization models without changing the original objective function.
[0003] Against this backdrop, the intelligent improvement of optimization modeling technology has become an urgent problem to be solved. The primary challenge lies in how to accurately identify and extract modeling elements such as decision variables, constraints, and objective functions from natural language descriptions. Secondly, large-scale industrial scheduling MILP models typically contain tens of thousands of decision variables, a significant portion of which are rarely activated in actual production, yet significantly increase the solution scale and time. Existing solver preprocessing techniques mainly rely on algebraic rules, which struggle to characterize the regular patterns implicit in historical production behavior, resulting in redundant variables that cannot be effectively identified and eliminated. In summary, existing technologies have shortcomings in automatic model construction, dynamic evolution, and solution efficiency, necessitating an intelligent method that covers the entire lifecycle of model construction, constraint injection, and structural simplification. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for incremental modeling and solving of decision-making in large-scale transportation systems based on a large language model, which can reduce the burden of manual modeling, support rolling model updates, and reduce the solution scale.
[0005] To solve the above-mentioned technical problems, the present invention is implemented using the following technical solution.
[0006] Firstly, this invention proposes a method for incremental modeling and solving of decision-making in large-scale transportation systems based on a large language model, including:
[0007] Construct a dedicated training dataset for rolling optimization tasks of large-scale transportation systems. The dedicated training dataset includes at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset.
[0008] Based on a dedicated training dataset, an existing pre-trained large language model was used as the base model. A LoRA-based parameter tuning method was adopted to train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter, respectively.
[0009] Obtain a traffic system optimization requirement description in natural language or semi-structured form, call the automatic modeling task adapter, convert the traffic system optimization requirement description into a solver-executable optimization model including traffic decision variables, objective function and constraints, and process and repair the solver-executable optimization model to realize the initial model construction of a large-scale traffic system rolling optimization problem;
[0010] Obtain the existing executable traffic optimization model and the description of the newly added traffic business rules, call the constraint incremental injection task adapter, and automatically inject the new variables and corresponding new linear constraints into the existing executable traffic optimization model while keeping the original objective function and the core structure of the original traffic optimization model unchanged, so as to obtain the augmented traffic optimization model and realize the dynamic evolution of the executable optimization model in the rolling optimization process of the traffic system.
[0011] After obtaining the augmented traffic optimization model with completed constraint increment injection, the variable pruning task adapter is called to identify pruneable variables. The pruneable variables are redundant traffic decision variables that can be fixed to zero. The pruneable variables are fixed to zero or deleted from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model.
[0012] The compressed traffic optimization model is input into the optimization solver for solving, and the corresponding large-scale traffic system rolling optimization results are output.
[0013] In conjunction with the first aspect, the method for constructing the automatic modeling training dataset is as follows:
[0014] Collect descriptions of traffic system optimization problems in natural language form;
[0015] A corresponding mathematical formalization is constructed for the description of the natural language optimization problem;
[0016] Generate executable implementation code for solvers based on mathematical formal expressions;
[0017] The automatic modeling training dataset is obtained by pairing the description of the traffic system optimization problem in natural language, the corresponding mathematical formal expression, and the executable implementation code of the solver with the corresponding training samples.
[0018] The automatic modeling training dataset covers one or more types of optimization, including linear programming, integer programming, mixed integer linear programming, traffic network optimization, traffic operation scheduling optimization, stochastic risk optimization, and nonlinear optimization.
[0019] In conjunction with the first aspect, the method for constructing the constraint incremental injection training dataset is as follows:
[0020] Obtain an existing scheduling MILP model represented in LP format as a baseline model;
[0021] Randomly select a subset of one or more constraint types from the following constraints: road network capacity constraints, traffic signal timing constraints, public transportation operation organization constraints, vehicle route and task scheduling constraints, charging and swapping resource constraints, parking resource constraints, traffic control constraints, and emergency evacuation constraints.
[0022] Randomly sample relevant parameters within a preset range. These parameters include one or more of the following: road segment capacity, traffic demand, signal cycle, upper and lower limits of green light time, phase conflict relationship, bus departure interval, vehicle capacity, number of available vehicles, upper limit of charging power, capacity of charging and battery swapping stations, parking space capacity, road closure period, and traffic control intensity.
[0023] Generate new variables and new linear constraints corresponding to the selected constraint type, and append the new variables and new linear constraints to the LP file of the baseline model, while retaining the original objective function and original constraints, to obtain the enhanced LP file;
[0024] The baseline model's LP file, the natural language description of the business constraints, and the enhanced LP file are combined to form paired training samples, resulting in a constraint incremental injection training dataset.
[0025] In conjunction with the first aspect, the method for constructing the variable pruning training dataset is as follows:
[0026] Obtain large-scale LP model files corresponding to real or simulated traffic operation records;
[0027] Transform large-scale transportation system decision-making problems into structured, small-scale traffic optimization instances;
[0028] During the conversion process, the road network topology, OD demand structure, line-to-station relationship, vehicle-to-task matching relationship, signal phase conflict relationship, resource capacity constraints, and spatiotemporal state transition constraints are preserved.
[0029] During the transformation process, traffic decision variables are selected, constraints are compressed, data tables are simplified, and traffic demand or resource capacity parameters are scaled proportionally.
[0030] Generate variable pruning annotation files, and migrate the annotations to the corresponding small-scale traffic optimization instances through variable name mapping, index consistency matching, and traffic object correspondence;
[0031] The small-scale LP model file from the small-scale traffic optimization example is combined with the variable pruning annotation file to form a supervised training sample, resulting in a variable pruning training dataset.
[0032] In conjunction with the first aspect, further, the method of using a dedicated training dataset, calling an existing pre-trained large language model as the base model, and employing a LoRA-based parameter tuning approach to train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter, respectively, includes:
[0033] A pre-trained large language model was selected as the base model.
[0034] The automatic modeling training dataset is input into the base model, and the base model is subjected to the first LoRA adjustment to obtain the automatic modeling task adapter.
[0035] The constraint incremental injection training dataset is input into the base model, and the base model is subjected to a second LoRA adjustment to obtain the constraint incremental injection task adapter.
[0036] Input the variable pruning training dataset into the base model, perform third LoRA adjustment on the base model, and obtain the variable pruning task adapter;
[0037] The three task adapters mentioned above are configured independently of each other.
[0038] In conjunction with the first aspect, further processing and repair of the solver's executable optimization model includes one or more of the following:
[0039] Variable and parameter normalization is used to standardize naming rules and complete missing declarations;
[0040] Constraint format correction is used to eliminate mismatched brackets, incomplete expressions, or non-standard interface calls;
[0041] Solver compatibility conversion is used to convert a common syntax into the format required by the target solver.
[0042] Structural integrity completion is used to supplement index ranges, loop structures, and auxiliary definitions.
[0043] In conjunction with the first aspect, the constrained incremental injection process is further formally defined as follows:
[0044] Existing executable traffic optimization models consist of original traffic decision variables. and the original objective function Composition, in which The original objective function is... This represents the coefficient vector corresponding to each original traffic decision variable in the original objective function. This represents the transpose of the coefficient vector. After constraint increment injection, the original traffic optimization model is expanded to include the newly added variables. and corresponding new linear constraints The augmented traffic optimization model, in which This indicates the running status under the new business scenario, and the original objective function... This remains unchanged to ensure that the newly added linear constraint only shrinks the feasible region without altering the original optimization objective. This indicates the relationship between the newly added linear constraints and the original traffic decision variables. The corresponding coefficient matrix This indicates the relationship between the newly added linear constraints and the original traffic decision variables. The corresponding coefficient matrix This represents the vector of the right-hand side of the newly added linear constraint;
[0045] Constrained incremental injection uses the following data organization format:
[0046] (An executable traffic optimization model file already exists; add natural language descriptions of traffic business rules) → (Augmented traffic optimization model file).
[0047] In conjunction with the first aspect, the newly added business rules further include at least one or more of the following constraint types:
[0048] Road network capacity constraints, traffic signal timing constraints, public transportation operation organization constraints, vehicle route and task scheduling constraints, charging and battery swapping resource constraints, parking resource constraints, traffic control constraints, and emergency evacuation constraints;
[0049] Road network capacity constraints are achieved by setting variables such as road segment traffic flow, road segment capacity parameters, and road segment availability status variables; traffic signal timing constraints are achieved by setting variables such as signal cycle, phase green light time, phase activation, and phase conflict relationships; public transportation operation organization constraints are achieved by setting variables such as bus departure frequency, departure interval, vehicle input, and route service level constraints; vehicle routing and task scheduling constraints are achieved by setting variables such as vehicle route selection, vehicle spatiotemporal status, and task assignment; charging and battery swapping resource constraints are achieved by setting variables such as vehicle battery status, charging and battery swapping service, charging power, and station capacity constraints; parking resource constraints are achieved by setting variables such as parking space occupancy, parking demand, and parking capacity constraints; traffic control constraints are achieved by setting variables such as road control status, restricted traffic, and detour routes; and emergency evacuation constraints are achieved by setting variables such as evacuation flow, evacuation route selection, node capacity parameters, and time-period evacuation demand constraints.
[0050] In conjunction with the first aspect, the pruning variable is further defined as a traffic decision variable that satisfies any of the following conditions:
[0051] It is always equal to zero in all feasible solutions, that is... ,in For feasible regions, Indicates the first The traffic decision variables in the feasible solution The values in the vector; where feasible solution refers to the vector of variable values that satisfy all constraints of the traffic optimization model;
[0052] Or it is identically equal to zero in all optimal solutions, i.e. ,in The optimal solution set;
[0053] By fixing the pruning variables to zero, the feasible region of the augmented traffic optimization model is not changed, nor is the optimal objective value of the augmented traffic optimization model changed.
[0054] Secondly, this invention proposes a system for incremental modeling and solving of large-scale traffic system decisions based on a large language model, used to implement the aforementioned method for incremental modeling and solving of large-scale traffic system decisions based on a large language model, including:
[0055] The dataset construction module is configured to construct a dedicated training dataset for the rolling optimization task of a transportation system. The dedicated training dataset includes at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset.
[0056] The model fine-tuning module is configured to use an existing pre-trained large language model as the base model based on a dedicated training dataset, and to train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter respectively using a LoRA-based parameter tuning method.
[0057] The automatic modeling module is configured to acquire a traffic system optimization requirement description in natural language or semi-structured form, and call the automatic modeling task adapter to convert the traffic system optimization requirement description into a solver-executable optimization model that includes traffic decision variables, objective functions, and constraints.
[0058] The constraint incremental injection module is configured to obtain an existing executable traffic optimization model and a description of newly added traffic business rules, call the constraint incremental injection task adapter, and automatically inject the new variables and corresponding new linear constraints into the existing executable traffic optimization model to obtain an augmented traffic optimization model.
[0059] The variable pruning module is configured to obtain the augmented traffic optimization model after the constraint increment injection is completed, call the variable pruning task adapter to identify pruneable variables, which are redundant traffic decision variables that can be fixed to zero, and fix the pruneable variables to zero or delete them from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model.
[0060] The solution output module is configured to input the compressed traffic optimization model into the optimization solver for solving, and output the corresponding large-scale traffic system rolling optimization results.
[0061] Thirdly, the present invention proposes a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the above-mentioned method for incremental modeling and solving of decision-making in large-scale traffic systems based on a large language model.
[0062] Fourthly, the present invention provides a computer device, characterized in that it comprises:
[0063] Memory, used to store computer programs;
[0064] A processor is used to execute the computer program to implement the steps of the above-described method for incremental modeling and solving of large-scale traffic system decisions based on a large language model.
[0065] Fifthly, the present invention proposes a computer program product, including a computer program, characterized in that: when the computer program is executed by a processor, it implements the steps of the above-mentioned method for incremental modeling and solving of large-scale traffic system decisions based on a large language model.
[0066] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0067] (1) This invention utilizes LoRA fine-tuning technology, enabling large language models to acquire optimization modeling capabilities with only a small number of training samples, thus reducing the burden of manual modeling. By formalizing business rule updates into structured constraint injection at the LP level, it is possible to add new business constraints to the deployed model while preserving the original objective function, supporting the rolling updates and continuous evolution of the traffic optimization model. Through data-driven variable pruning methods, redundant decision variables can be automatically identified and removed, reducing the size and solution complexity of the traffic optimization model.
[0068] (2) This invention integrates three major modules—automatic modeling, constraint injection, and variable pruning—into a unified framework, realizing a closed-loop workflow from natural language description to executable optimization model construction, dynamic injection of business constraints, and simplification of model structure. Attached Figure Description
[0069] Figure 1 This is a flowchart illustrating the modeling and solving method in Embodiment 1 of the present invention;
[0070] Figure 2 This is a schematic diagram of the process for constructing the automatic modeling training dataset in Embodiment 1 of the present invention;
[0071] Figure 3 This is a schematic diagram of the process for constructing the constraint incremental injection training dataset in Embodiment 1 of the present invention;
[0072] Figure 4 This is a schematic diagram of the process of constructing the variable pruning training dataset in Embodiment 1 of the present invention;
[0073] Figure 5 This is a schematic diagram of the LoRA-based parameter fine-tuning process in Embodiment 1 of the present invention;
[0074] Figure 6 This is a performance curve of automated modeling in Embodiment 1 of the present invention;
[0075] Figure 7 This is a schematic diagram of the modeling and solving system in Embodiment 2 of the present invention. Detailed Implementation
[0076] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations thereof. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.
[0077] The term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0078] Example 1
[0079] like Figure 1 As shown in the figure, the steps of the incremental modeling and solution method for large-scale traffic system decision-making based on a large language model in this embodiment are as follows:
[0080] Step S1: Construct a dedicated training dataset for rolling optimization tasks of large-scale transportation systems. The dedicated training dataset shall include at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset.
[0081] like Figure 2 As shown in the figure, the specific method for constructing the automatic modeling training dataset in this embodiment is as follows:
[0082] This process involves collecting descriptions of traffic system optimization problems in natural language, constructing corresponding mathematical formalizations for these descriptions, generating executable solver code based on these formalizations, and pairing these natural language descriptions, mathematical formalizations, and solver code into a training dataset. This results in an automated modeling training dataset. The dataset covers one or more types of optimization problems, including linear programming, integer programming, mixed-integer linear programming, traffic network optimization, traffic operation scheduling optimization, stochastic risk optimization, and nonlinear optimization.
[0083] In this embodiment, the automatic modeling training dataset covers linear programming (22%), integer programming (14%), mixed integer linear programming (33%), traffic network optimization (12%), traffic operation scheduling optimization (9%), stochastic risk optimization (7%), and nonlinear optimization (3%). Through diverse samples, the model learns to identify and formalize key modeling elements from the text. Key modeling elements include sets, parameters, decision variables, constraints, and objective functions.
[0084] like Figure 3 As shown in the figure, the specific method for constructing the constraint incremental injection training dataset in this embodiment is as follows:
[0085] Obtain an existing scheduling MILP model represented in LP format as a baseline model;
[0086] Randomly select a subset of one or more constraint types from the following: road network capacity constraints, traffic signal timing constraints, public transportation operation organization constraints, vehicle route and task scheduling constraints, charging and battery swapping resource constraints, parking resource constraints, traffic control constraints, and emergency evacuation constraints. Randomly sample constraint-related parameters within a preset value range. These parameters include one or more of the following: road segment capacity, traffic demand, signal cycle, upper and lower limits of green light time, phase conflict relationship, bus departure interval, vehicle capacity, number of available vehicles, upper limit of charging power, charging and battery swapping station capacity, parking space capacity, road closure period, and traffic control intensity. Generate new variables and new linear constraints corresponding to the selected constraint types, and append these new variables and new linear constraints to the LP file of the baseline model, while retaining the original objective function and original constraints, resulting in an enhanced LP file.
[0087] The baseline model's LP file, the natural language description of the business constraints, and the enhanced LP file are combined to form paired training samples, resulting in a constraint incremental injection training dataset.
[0088] like Figure 4 As shown in the figure, the specific method for constructing the variable pruning training dataset in this embodiment is as follows:
[0089] Obtain large-scale LP model files corresponding to real or simulated traffic operation records;
[0090] Transform large-scale transportation system decision-making problems into structured, small-scale traffic optimization instances;
[0091] During the conversion process, the road network topology, OD demand structure, line-to-station relationship, vehicle-to-task matching relationship, signal phase conflict relationship, resource capacity constraints, and spatiotemporal state transition constraints are preserved.
[0092] During the transformation process, traffic decision variables are selected, constraints are compressed, data tables are simplified, and traffic demand or resource capacity parameters are scaled proportionally.
[0093] Generate variable pruning annotation files, and migrate the annotations to the corresponding small-scale traffic optimization instances through variable name mapping, index consistency matching, and traffic object correspondence;
[0094] The small-scale LP model file from the small-scale traffic optimization example is combined with the variable pruning annotation file to form a supervised training sample, resulting in a variable pruning training dataset.
[0095] It should be noted that, in this invention, the large-scale traffic system decision problem refers to a traffic optimization problem composed of multiple types of traffic objects, such as road segments, nodes, intersections, traffic zones, bus routes, vehicles, stations, charging and swapping facilities, parking facilities, time periods, and operating scenarios, which are combined by multi-dimensional indexes to form a large number of decision variables and constraints. The term "large-scale" can be comprehensively determined by considering the scope of the traffic network, the number of time periods, the number of traffic objects, and the size of the model file. For example, in a regional or city-level rolling optimization scenario for traffic systems, if the number of decision variables, constraints, or the number of non-zero elements in the constraint matrix in the model reaches tens of millions, it can be considered a large-scale traffic system decision problem. Small-scale traffic optimization instances refer to smaller instances formed by extracting a portion of road segments, routes, vehicles, stations, time periods, or OD demands, while maintaining consistency with the original road network topology, traffic demand structure, constraint types, and business semantics. For example, a traffic optimization instance with no more than 1500 total decision variables and no more than 1500 constraints can be used as a small-scale traffic optimization instance for training sample construction, variable pruning, annotation, transfer, and model performance verification.
[0096] Step S2: Based on the dedicated training dataset, using the pre-trained large language model as the base model, and employing LoRA (Low-Rank Adaptation) based parameter fine-tuning techniques, train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter respectively to obtain the fine-tuned base model.
[0097] like Figure 5 As shown in this embodiment, the method for training the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter using LoRA-based parameter fine-tuning technology is as follows:
[0098] Step S21: Select a pre-trained large language model as the base model. In this embodiment, the Pangu-7B large language model is selected as the base model.
[0099] Step S22: Input the automatic modeling training dataset into the base model, perform the first LoRA fine-tuning on the base model, and obtain the automatic modeling task adapter;
[0100] Step S23: Input the constraint incremental injection training dataset into the base model, perform a second LoRA fine-tuning on the base model, and obtain the constraint incremental injection task adapter;
[0101] Step S24: Input the variable pruning training dataset into the base model, perform third LoRA fine-tuning on the base model, and obtain the variable pruning task adapter.
[0102] The three task adapters mentioned above are configured independently to achieve efficient domain adaptation of parameters. The LoRA fine-tuning technique adds a low-rank trainable matrix next to the weight matrix of the pre-trained large language model, updating only a small number of parameters, thereby achieving effective domain specialization under limited labeled data conditions.
[0103] Step S3: Obtain the traffic system optimization requirement description in natural language or semi-structured form, call the automatic modeling task adapter to convert the traffic system optimization requirement description into a solver-executable optimization model including traffic decision variables, objective function, and constraints, and process and repair the solver-executable optimization model to obtain the initial executable optimization model of the traffic system rolling optimization problem; wherein, the initial executable optimization model refers to the traffic system decision model that can be input into the optimization solver for reading, parsing, and solving, and serves as the basis model for subsequent constraint increment injection, variable pruning, and solution output.
[0104] In this embodiment, the processing and repair of the solver's executable optimization model includes one or more of the following:
[0105] Variable and parameter normalization is used to standardize naming rules and complete missing declarations;
[0106] Constraint format correction is used to eliminate mismatched brackets, incomplete expressions, or non-standard interface calls;
[0107] Solver compatibility conversion is used to convert a common syntax into the format required by the target solver.
[0108] Structural integrity completion is used to supplement index ranges, loop structures, and auxiliary definitions.
[0109] Step S4: Obtain the existing executable optimization model and the description of the newly added traffic business rules. Call the constraint incremental injection task adapter. While retaining the original objective function, the original traffic decision variable definitions, the original constraint set, and the basic format of the model file, automatically inject the new variables and corresponding new linear constraints into the existing executable traffic optimization model to obtain the augmented traffic optimization model. This enables the dynamic evolution of the executable optimization model during the rolling optimization process of the traffic system. The existing executable traffic optimization model refers to the traffic system decision model that can be read, parsed, and solved by the optimization solver. It can be the initial executable optimization model generated in step S3 or a deployed traffic optimization model provided by the user. In this step, the existing executable traffic optimization model is also referred to as the original traffic optimization model. Dynamic evolution refers to the incremental update of the original traffic optimization model during the rolling optimization process based on the newly added traffic business rules, expanding it from the original traffic optimization model into an augmented traffic optimization model that includes new variables and new linear constraints.
[0110] In this embodiment, the constraint incremental injection process is formally defined as follows:
[0111] Existing executable traffic optimization models consist of original traffic decision variables. and the original objective function Composition, in which The original objective function is... This represents the coefficient vector corresponding to each original traffic decision variable in the original objective function. This represents the transpose of the coefficient vector. After constraint increment injection, the original traffic optimization model is expanded to include the newly added variables. and corresponding new linear constraints The augmented traffic optimization model, in which This indicates the running status under the new business scenario, and the original objective function... This remains unchanged to ensure that the newly added linear constraint only shrinks the feasible region without altering the original optimization objective. This indicates the relationship between the newly added linear constraints and the original traffic decision variables. The corresponding coefficient matrix This indicates the relationship between the newly added linear constraints and the original traffic decision variables. The corresponding coefficient matrix This represents the vector of the right-hand side of the newly added linear constraint;
[0112] Constrained incremental injection uses the following data organization format:
[0113] (An executable traffic optimization model file already exists; add natural language descriptions of traffic business rules) → (Augmented traffic optimization model file).
[0114] It should be noted that the existing executable traffic optimization model is the model to be updated input in step S4. It can be the initial executable optimization model obtained in step S3, or a deployed traffic optimization model provided by the user. The model file of the augmented traffic optimization model retains the original objective function and the original constraint structure, and adds new variables and new linear constraints corresponding to the newly added traffic business rules. Thus, during the rolling optimization process, the traffic system optimization model can be incrementally expanded from the existing executable traffic optimization model to the augmented traffic optimization model as the new traffic business rules, traffic control requirements, or operational scenarios change, realizing the dynamic evolution of the model.
[0115] In this embodiment, the newly added business rules include at least one or more of the following constraint types:
[0116] Road network capacity constraints, traffic signal timing constraints, public transportation operation organization constraints, vehicle route and task scheduling constraints, charging and battery swapping resource constraints, parking resource constraints, traffic control constraints, and emergency evacuation constraints;
[0117] Road network capacity constraints are achieved by setting variables such as road segment traffic flow, road segment capacity parameters, and road segment availability status variables; traffic signal timing constraints are achieved by setting variables such as signal cycle, phase green light time, phase activation, and phase conflict relationships; public transportation operation organization constraints are achieved by setting variables such as bus departure frequency, departure interval, vehicle input, and route service level constraints; vehicle routing and task scheduling constraints are achieved by setting variables such as vehicle route selection, vehicle spatiotemporal status, and task assignment; charging and battery swapping resource constraints are achieved by setting variables such as vehicle battery status, charging and battery swapping service, charging power, and station capacity constraints; parking resource constraints are achieved by setting variables such as parking space occupancy, parking demand, and parking capacity constraints; traffic control constraints are achieved by setting variables such as road control status, restricted traffic, and detour routes; and emergency evacuation constraints are achieved by setting variables such as evacuation flow, evacuation route selection, node capacity parameters, and time-period evacuation demand constraints.
[0118] Step S5: Obtain the augmented traffic optimization model after completing the constraint increment injection, call the variable pruning task adapter, identify the pruning variables, which are redundant traffic decision variables that can be fixed to zero, and fix the pruning variables to zero or delete them from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model.
[0119] In this embodiment, the pruning variables are traffic decision variables that satisfy any of the following conditions:
[0120] It is always equal to zero in all feasible solutions, that is... ,in For feasible regions, Indicates the first The traffic decision variables in the feasible solution The values in the vector; where feasible solution refers to the vector of variable values that satisfy all constraints of the augmented traffic optimization model;
[0121] Or it is identically equal to zero in all optimal solutions, i.e. ,in The optimal solution set;
[0122] Fixing prunable variables to zero does not change the feasible region or the optimal objective value of the augmented traffic optimization model. The variable pruning task adapter, fine-tuned using LoRA, identifies redundant traffic decision variables that can be fixed to zero based on variable definitions, constraint structures, index relationships, and traffic operation data within the augmented traffic optimization model. Redundant, prunable traffic decision variables include those that do not participate in effective decision-making due to network topology inaccessibility, traffic control restrictions, phase conflicts, vehicle-task mismatch, lack of coverage by the route service area, unavailable resource capacity, or no traffic demand during the corresponding time period. By fixing redundant traffic decision variables to zero or removing them from the model file, the model size can be reduced without altering model feasibility or the optimal objective value.
[0123] Step S6: Input the compressed traffic optimization model into the optimization solver for solving, and output the corresponding large-scale traffic system rolling optimization results.
[0124] Example 2
[0125] Based on the same inventive concept as Embodiment 1, such as Figure 7 As shown, this embodiment proposes a large-scale traffic system decision incremental modeling and solution system based on a large language model, used to implement the modeling and solution method in Embodiment 1, including:
[0126] Dataset construction module 11 is used to construct a dedicated training dataset for rolling optimization tasks of large-scale transportation systems. The dedicated training dataset includes at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset.
[0127] Model fine-tuning module 12 is used to train automatic modeling task adapter, constraint incremental injection task adapter and variable pruning task adapter respectively based on a dedicated training dataset, using a pre-trained large language model as the base model and employing LoRA-based parameter fine-tuning technology.
[0128] Automatic modeling module 13 is used to obtain the traffic system optimization requirement description in natural language or semi-structured form, call the automatic modeling task adapter, convert the traffic system optimization requirement description into a solver-executable optimization model including traffic decision variables, objective function and constraints, and process and repair the solver-executable optimization model to obtain the initial executable optimization model of the traffic system rolling optimization problem.
[0129] The constraint incremental injection module 14 is used to obtain the existing executable optimization model and the description of the new traffic business rules, call the constraint incremental injection task adapter, and inject the new variables and corresponding new linear constraints into the existing executable optimization model while keeping the original objective function and the core structure of the original traffic optimization model unchanged, so as to obtain the augmented traffic optimization model.
[0130] The variable pruning module 15 is used to obtain the augmented traffic optimization model after the constraint increment injection is completed, call the variable pruning task adapter, identify the pruning variables, the pruning variables are redundant traffic decision variables that can be fixed to zero, and fix the pruning variables to zero or delete them from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model.
[0131] The solution output module 16 is used to input the compressed traffic optimization model into the optimization solver for solving and output the corresponding large-scale traffic system rolling optimization results.
[0132] Example 3
[0133] This embodiment further illustrates the incremental modeling and solution method for large-scale transportation system decision-making based on a large language model using more specific data.
[0134] To further illustrate the feasibility and effectiveness of the modeling and solution method of this invention, a vehicle scheduling and transportation optimization scenario was selected for verification. The experimental platform adopted the Pangu-7B large language model, fine-tuned using LoRA technology. The experimental hardware platform used four Huawei Ascend 910B2 NPUs, each providing 64GB of high-bandwidth memory. The software environment was built based on PyTorch 2.5.1 and Transformers 4.53.2.
[0135] To verify the data efficiency of the automated modeling module in this invention, under the same test conditions, the number of samples in the fine-tuning dataset was gradually increased from 300 to 3000, and three evaluation metrics—generation rate, executability rate, and accuracy rate—were statistically analyzed. Figure 6As shown, the untuned basic large language model had zero in all three metrics during automated modeling. After fine-tuning with a small number of samples (400 or less), the pre-trained large language model loaded with the automatic modeling task adapter began to generate solver code, and the evaluation metrics increased. The solver code contained traffic decision variables, objective functions, and constraints representing the traffic system optimization problem. When the sample size increased to 600 and 900, the generation rate significantly improved, and executable and correct outputs began to appear. In the range of 1200 to 1500 samples, the executable rate increased from about 25% to about 40%, and the accuracy increased simultaneously. When the data size exceeded 2000 samples, all evaluation metrics steadily increased, eventually reaching a generation rate of 91%, an executable rate of 66%, and an accuracy of 26% with 3000 samples.
[0136] To verify the effectiveness of the constraint incremental injection module in this invention, an existing executable traffic optimization model was used, based on the LP file of the urban vehicle scheduling and traffic operation collaborative optimization problem. A new traffic business rule was input: "During the morning peak hours, priority passage rules are set for vehicles performing public transport connections or commuter services in key areas, and the capacity of relevant road segments, the number of available vehicles, and the service time windows are adjusted." In this embodiment, the large language model after loading the constraint incremental injection task adapter can generate an extended part of the LP file corresponding to the new traffic business rule while maintaining the original objective function and the original constraint structure. The extended part includes vehicle task assignment variables, vehicle route selection variables, road segment capacity adjustment parameters, service time window constraints, vehicle availability constraints, and related road segment, vehicle, task, and time period index set declarations. It can be converted into an augmented traffic optimization model executable by the solver through post-processing. The output of the basic large language model without the constraint incremental injection task adapter mainly remains at the conceptual description level, lacking clear traffic decision variable declarations, index set definitions, and linear constraint formats that meet the solver's requirements, making it difficult to directly use for incremental updates of the traffic optimization model.
[0137] Example 4
[0138] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method for incremental modeling and solving of large-scale traffic system decisions based on a large language model.
[0139] Example 5
[0140] Based on the same inventive concept as other embodiments, this embodiment introduces a computer device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-described method for incremental modeling and solving of large-scale traffic system decisions based on a large language model.
[0141] Example 6
[0142] Based on the same inventive concept as other embodiments, this embodiment introduces a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method for incremental modeling and solving of large-scale traffic system decisions based on a large language model.
[0143] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0144] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0147] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other modifications under the guidance of the present invention, and these modifications are all within the protection scope of the present invention.
Claims
1. A method for incremental modeling and solving of decision-making in large-scale transportation systems based on a large language model, characterized in that, include: Construct a dedicated training dataset for rolling optimization tasks of large-scale transportation systems. The dedicated training dataset includes at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset. Based on a dedicated training dataset, a pre-trained large language model was used as the base model. A LoRA-based parameter tuning method was adopted to train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter, respectively. Obtain a traffic system optimization requirement description in natural language or semi-structured form, call the automatic modeling task adapter, and convert the traffic system optimization requirement description into a solver-executable optimization model that includes traffic decision variables, objective function, and constraints; Obtain the existing executable traffic optimization model and the description of the newly added traffic business rules, call the constraint incremental injection task adapter, and automatically inject the new variables and corresponding new linear constraints into the existing executable traffic optimization model to obtain the augmented traffic optimization model. After obtaining the augmented traffic optimization model with completed constraint increment injection, the variable pruning task adapter is called to identify pruneable variables. The pruneable variables are redundant traffic decision variables that can be fixed to zero. The pruneable variables are fixed to zero or deleted from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model. The compressed traffic optimization model is input into the optimization solver for solving, and the corresponding large-scale traffic system rolling optimization results are output.
2. The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model according to claim 1, characterized in that, The method for constructing the automatic modeling training dataset is as follows: Collect descriptions of traffic system optimization problems in natural language form; A corresponding mathematical formalization is constructed for the description of the natural language optimization problem; Generate executable implementation code for solvers based on mathematical formal expressions; The automatic modeling training dataset is obtained by pairing the description of the traffic system optimization problem in natural language, the corresponding mathematical formal expression, and the executable implementation code of the solver with the corresponding training samples.
3. The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model according to claim 1, characterized in that, The method for constructing the constraint incremental injection training dataset is as follows: Obtain an existing scheduling MILP model represented in LP format as a baseline model; Randomly select a subset of one or more constraint types from the following constraints: road network capacity constraints, traffic signal timing constraints, public transportation operation organization constraints, vehicle route and task scheduling constraints, charging and swapping resource constraints, parking resource constraints, traffic control constraints, and emergency evacuation constraints. Randomly sample relevant parameters within a preset range. These parameters include one or more of the following: road segment capacity, traffic demand, signal cycle, upper and lower limits of green light time, phase conflict relationship, bus departure interval, vehicle capacity, number of available vehicles, upper limit of charging power, capacity of charging and battery swapping stations, parking space capacity, road closure period, and traffic control intensity. Generate new variables and new linear constraints corresponding to the selected constraint type, and append the new variables and new linear constraints to the LP file of the baseline model, while retaining the original objective function and original constraints, to obtain the enhanced LP file; The baseline model's LP file, the natural language description of the business constraints, and the enhanced LP file are combined to form paired training samples, resulting in a constraint incremental injection training dataset.
4. The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model according to claim 1, characterized in that, The method for constructing the variable pruning training dataset is as follows: Obtain large-scale LP model files corresponding to real or simulated traffic operation records; Transform large-scale transportation system decision-making problems into structured, small-scale traffic optimization instances; During the conversion process, the road network topology, OD demand structure, line-to-station relationship, vehicle-to-task matching relationship, signal phase conflict relationship, resource capacity constraints, and spatiotemporal state transition constraints are preserved. During the transformation process, traffic decision variables are selected, constraints are compressed, data tables are simplified, and traffic demand or resource capacity parameters are scaled proportionally. Generate variable pruning annotation files, and migrate the annotations to the corresponding small-scale traffic optimization instances through variable name mapping, index consistency matching, and traffic object correspondence. The small-scale LP model file from the small-scale traffic optimization example is combined with the variable pruning annotation file to form a supervised training sample, resulting in a variable pruning training dataset.
5. The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model according to claim 1, characterized in that, The method, based on a dedicated training dataset, uses a pre-trained large language model as the base model and employs a LoRA-based parameter tuning approach to train automatic modeling task adapters, constraint incremental injection task adapters, and variable pruning task adapters, including: A pre-trained large language model was selected as the base model. The automatic modeling training dataset is input into the base model, and the base model is subjected to the first LoRA adjustment to obtain the automatic modeling task adapter. The constraint incremental injection training dataset is input into the base model, and the base model is subjected to a second LoRA adjustment to obtain the constraint incremental injection task adapter. Input the variable pruning training dataset into the base model, perform third LoRA adjustment on the base model, and obtain the variable pruning task adapter; The three task adapters mentioned above are configured independently of each other.
6. The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model according to claim 1, characterized in that, The pruning variables are traffic decision variables that satisfy any of the following conditions: It is always equal to zero in all feasible solutions, that is... ,in For feasible regions, Indicates the first The traffic decision variables in the feasible solution The values in the vector refer to the possible solutions, where the feasible solution refers to the vector of variable values that satisfy all constraints of the augmented traffic optimization model. Or it is always equal to zero in all optimal solutions, i.e. ,in The optimal solution set; By fixing the pruning variables to zero, the feasible region of the augmented traffic optimization model is not changed, nor is the optimal objective value of the augmented traffic optimization model changed.
7. A system for incremental modeling and solving decision-making in large-scale transportation systems based on a large language model, characterized in that, The method for incremental modeling and solving of large-scale traffic system decisions based on a large language model, as described in any one of claims 1 to 6, includes: The dataset construction module is configured to construct a dedicated training dataset for the rolling optimization task of a transportation system. The dedicated training dataset includes at least an automatic modeling training dataset, a constraint incremental injection training dataset, and a variable pruning training dataset. The model fine-tuning module is configured to use a pre-trained large language model as the base model based on a dedicated training dataset, and to train the automatic modeling task adapter, the constraint incremental injection task adapter, and the variable pruning task adapter using a LoRA-based parameter tuning method. The automatic modeling module is configured to acquire a traffic system optimization requirement description in natural language or semi-structured form, and call the automatic modeling task adapter to convert the traffic system optimization requirement description into a solver-executable optimization model that includes traffic decision variables, objective functions, and constraints. The constraint incremental injection module is configured to obtain an existing executable traffic optimization model and a description of newly added traffic business rules, call the constraint incremental injection task adapter, and automatically inject the new variables and corresponding new linear constraints into the existing executable traffic optimization model to obtain an augmented traffic optimization model. The variable pruning module is configured to obtain the augmented traffic optimization model after the constraint increment injection is completed, call the variable pruning task adapter to identify pruneable variables, which are redundant traffic decision variables that can be fixed to zero, and fix the pruneable variables to zero or delete them from the model file of the augmented traffic optimization model to obtain the compressed traffic optimization model. The solution output module is configured to input the compressed traffic optimization model into the optimization solver for solving, and output the corresponding large-scale traffic system rolling optimization results.
8. A 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 incremental modeling and solution method for decision-making of large-scale transportation systems based on a large language model as described in any one of claims 1 to 6.
9. A computer device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the incremental modeling and solution method for large-scale traffic system decision-making based on a large language model, as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by the processor, it implements the steps of the incremental modeling and solution method for decision-making of large-scale transportation systems based on a large language model, as described in any one of claims 1 to 6.