Genetic scheduling optimization method and system for repairing infeasible solutions based on large language model

By embedding a large language model into the genetic algorithm for targeted repair of infeasible solutions, the problems of low search efficiency and interpretability of the genetic algorithm under complex constraints are solved, achieving efficient production scheduling optimization and interpretable decision support.

CN122334801APending Publication Date: 2026-07-03XIAN YIKU INTELLIGENT TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAN YIKU INTELLIGENT TECHNOLOGY CO LTD
Filing Date
2026-03-31
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing genetic algorithms are inefficient in handling complex hard constraints and cannot adapt to dynamic changes in constraints. Furthermore, the combination of large language models and genetic algorithms is not deeply coupled and lacks interpretability.

Method used

The large language model is embedded as a constraint satisfaction inference engine in each generation of the genetic algorithm. Semantic-level, fine-grained targeted repair is performed on infeasible individuals generated by crossover and mutation. Repair prompt words are constructed and the large language model is called to generate structured repair instructions, gradually transforming infeasible solutions into feasible solutions.

Benefits of technology

It significantly improves the search efficiency of genetic algorithms in complex constraint scenarios, realizes the interpretability of the production scheduling process, and allows planners to trace the basis of decisions through the system interface, supporting business-driven real-time strategy adjustments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334801A_ABST
    Figure CN122334801A_ABST
Patent Text Reader

Abstract

This invention discloses a genetic scheduling optimization method and system based on a large language model to repair infeasible solutions. The method includes formal definition of the scheduling problem and semantic constraint modeling, chromosome encoding and initial population generation, genetic operations to generate a set of offspring individuals, constraint violation detection and infeasible individual identification, targeted repair based on a large language model, fitness evaluation and population update, iteration termination and optimal solution output, and human-machine collaborative constraint incremental update and model closed-loop optimization. The system includes a human-machine collaborative interaction module, a constraint semantic modeling module, a genetic algorithm engine module, a constraint violation detection module, a repair prompt construction module, a large language model invocation module, a repair instruction parsing and execution module, a repair experience management module, and a scheduling solution decoding and visualization module. This invention transforms a large number of infeasible solutions into high-quality feasible solutions, significantly improving search efficiency and solution quality, while simultaneously making the scheduling process interpretable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of advanced manufacturing and intelligent scheduling technology, and in particular relates to a genetic scheduling optimization method and system based on large language model to repair infeasible solutions. Background Technology

[0002] Intelligent scheduling is a core component for discrete manufacturing enterprises to reduce costs and increase efficiency. Currently, the mainstream intelligent scheduling technologies can be divided into the following three categories: (1) Exact algorithms based on operations research optimization: Mathematical models of production scheduling problems are established using methods such as mixed integer programming and branch and bound, and optimal solutions are obtained through solvers. Representative solutions include the application of commercial solvers such as IBM ILOG CPLEX and Gurobi in flow shop scheduling and job shop scheduling. These methods can obtain strictly optimal solutions in small-scale problems, but as the problem size increases, the solution time explodes exponentially, which cannot meet the real-time requirements of dynamic production environments. (2) Intelligent optimization based on heuristic / metaheuristic algorithms: Metaheuristic methods such as genetic algorithms, particle swarm optimization, simulated annealing, and ant colony optimization are used to approximate the optimization of the production scheduling problem. Among them, genetic algorithms have become the most widely used algorithm kernel in industrial production scheduling systems due to their strong parallel search capabilities and low requirements for the mathematical model of the problem. Published invention patents include: CN111210062B, which discloses a workpiece intelligent scheduling method based on genetic algorithms, incorporating operator time into the fitness function and employing roulette wheel selection, single-point crossover, and binary mutation; CN111724044A, which discloses an intelligent scheduling system based on genetic algorithms, using dual-chromosome encoding to represent task-equipment allocation and equipment overtime time, and designing 7 chromosome 1 mutations and 2 chromosome 2 mutations; and CN112232548B, which discloses a mechanical... A smart scheduling optimization method for processing workshops employs a two-point crossover and sequence repair strategy to maintain population legitimacy; CN114707432B discloses a smart scheduling method for forging plants based on genetic algorithms, targeting furnace batch-heating equipment encoding and employing tournament selection and elite retention strategies; CN115719143A discloses a smart scheduling method for coal preparation plants based on improved genetic algorithms, employing high-dimensional 0-1 chromosome encoding and constructing a elimination operator-constrained solution space; CN121119228A discloses a smart scheduling method based on fixed-order genetic algorithms, avoiding invalid solutions by maintaining the internal process order of tasks unchanged. The common technical feature of these genetic algorithm patents is: encoding the scheduling scheme into chromosomes, iteratively searching through selection, crossover, and mutation, and using penalty functions or repair strategies to handle individuals violating constraints; (3) Generative scheduling based on large language models: This method attempts to introduce large language models into production scheduling decisions. Related patents include: CN120218478A discloses a scheduling management system based on LLM, featuring a scheduling module based on a large model. It leverages the analytical reasoning capabilities of the large language model, combined with genetic algorithms and simulated annealing, to generate the optimal scheduling scheme; CN120012956A discloses a dynamic scheduling strategy generation method based on a large language model, utilizing the large model to generate and improve scheduling heuristic algorithms, reducing the computational burden of genetic programming; and CN121436440A discloses an intelligent batch production optimization method, where a large model analyzes digital twin simulation feedback and dynamically adjusts the reward function to optimize the model and generate new schemes.

[0003] Although genetic algorithms have been widely used in the field of intelligent scheduling and large models have begun to be introduced, existing technologies still have the following common defects: First, genetic algorithms are weak in handling complex hard constraints, resulting in seriously low search efficiency; second, existing repair methods rely on manually preset rules and cannot adapt to dynamic changes in constraints; third, the combination of large models and genetic algorithms remains at a shallow level of connection and has not achieved deep coupling; fourth, the scheduling process lacks interpretability, making it difficult for planners to trust and intervene. Summary of the Invention

[0004] This invention provides a genetic scheduling optimization method and system based on a large language model to repair infeasible solutions. The core inventive concept of this invention is to embed a large language model as a constraint satisfaction inference engine into each generation iteration of the genetic algorithm, and to perform semantic-level, fine-grained targeted repair on infeasible individuals generated by crossover mutation, thereby transforming a large number of originally discarded infeasible solutions into high-quality feasible solutions, significantly improving search efficiency and solution quality, while realizing the interpretability of the scheduling process.

[0005] This invention also provides a genetic scheduling optimization method based on a large language model to repair infeasible solutions, which includes the following steps: Step S1, formal definition of the production scheduling problem and semantic modeling of constraints, includes the following steps: Step S11: Obtain production resource data, process route data, and order demand data from the discrete manufacturing workshop, and define the decision variables, objective function, and set of constraints for the production scheduling optimization problem; The decision variables include the allocation relationship between processes and processing equipment, the start time of processes on the corresponding equipment, and the processing sequence of processes on the corresponding equipment; the objective function is configured based on production scheduling business requirements and includes one or more combinations of the following: minimizing the maximum completion time, minimizing the total delay time, balancing the total equipment load, minimizing the total energy consumption, and minimizing the production changeover cost; Step S12: Encode each constraint condition into a structured constraint semantic description tuple: (1) in: : Constrain unique identifier; Constraint types include sequence constraints, resource exclusivity constraints, material completeness constraints, tooling constraints, personnel qualification constraints, time window constraints, etc. : The scope of the constraint, which includes the specific set of processes, equipment, materials, and tooling entities involved; : The mathematical expression of the constraint; : Constrained natural language semantic description; : The severity level of constraint violation (hard constraint / soft constraint); Step S13: Establish a constraint-semantic mapping library to convert the constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples in the format of Step S12 through human-machine collaboration.

[0006] Step S2, chromosome coding and initial population generation, includes the following steps: Step S21: Using a process-based coding method, the production scheduling scheme is encoded as a chromosome sequence: (2) Each gene locus Each number represents a process step. The number of times the same workpiece number appears represents the processes for that workpiece. The order of processes in the chromosome represents the interleaving order between processes for different workpieces. Step S22: Equipment allocation information is stored using an auxiliary coding table, which corresponds one-to-one with the process sequence; Step S23: Generate the initial population using a random generation method. ,in Population size.

[0007] Step S3, Genetic Operations: Selection, Crossover, and Mutation to generate a set of offspring individuals. This includes the following steps: Step S31: Using the tournament selection method, select parent individuals from the current population based on individual fitness; Step S32: Perform a crossover operation on the selected parent individuals, using partial matching crossover as the crossover operator to generate child individuals; Step S33: Perform mutation operation on the offspring individuals, using exchange mutation as the mutation operator to introduce population diversity.

[0008] Step S4: Constrain violation detection and infeasible individuals Identification includes the following steps: Step S41: Process the set of offspring individuals generated in step S3. Iterate through the constraint set constructed in step S1 one by one. ; Step S42: For each constraint , call its A mathematical expression is used to detect whether the current individual violates the constraint, and to record the violation status and details. The violation details include: the ID of the violated constraint; the specific process / equipment / material entity identifier involved; the deviation between the current value and the constraint threshold; and the semantic description text of the constraint. Step S43: If an individual violates any hard constraint ( If it is an individual, then it is marked as an infeasible individual. This information, along with all instances of constraint violations, constitutes an individual's constraint violation report.

[0009] Step S5, Targeted Repair Based on Large Language Model, includes the following steps: Step S51, Build Repair Tips: For each infeasible entity Build repair prompts; The repair prompts include the following information modules, as shown in Table 1 below: Table 1. Information modules included in the repair prompts. Module content Example Task Context Current production schedule scale, number of equipment, number of workpieces "A total of 15 workpieces, 87 processes, and 8 pieces of equipment." Chromosome coding Simplified summary of the process sequence for infeasible individuals. "Workpiece 2, Operation 1; Workpiece 1, Operation 1; Workpiece 2, Operation 2; Workpiece 3, Operation 1..." Violation of constraint set Semantic descriptions of constraint violations ranked by severity "Process 3 for workpiece 5 can only begin after material Z-102 arrives at the warehouse. The estimated arrival time is t=245, and the current start time is t=210." Historical Restoration Cases Successful examples of fixing a small number of similar constraint violations (few samples) In the example above, shifting the start time of the process to t=245 and adjusting subsequent processes successfully satisfied the constraints. Repair Action Command Template Define the format of repair actions that the large language model can output. JSON format, including operation type, target gene locus, and adjustment parameters. Step S52: Call the large language model service: Input the repair prompt into the large language model service interface, and call the large language model to perform reasoning and generation; Step S53: The large language model generates structured repair instructions: Based on its understanding of constraint semantics, reasoning ability of scheduling logic, and guidance from few sample examples, the large language model outputs a sequence of structured repair action instructions, including but not limited to those shown in Table 2 below: Table 2 Repair Action Command Types Instruction type Semantics Example ShiftStart Shift the start time of a certain process. {"op":"ShiftStart", "task":"W5_OP3", "delta":35} ReassignMachine Reallocate available equipment to the process {"op":"ReassignMachine", "task":"W2_OP1", "from":"M03", "to":"M05"} SwapSequence Swap the processing order of the two processes. {"op":"SwapSequence", "pos1":24, "pos2":31} SplitBatch Split a batch into two sub-batches {"op":"SplitBatch", "task":"W8_OP2", "ratio":0.6} InsertIdleTime Insert idle time at the specified position {"op":"InsertIdleTime", "pos":45, "duration":20} HoldForMaterial Wait until all materials are ready before starting. {"op":"HoldForMaterial", "task":"W5_OP3", "wait_until":245} Step S54, Repair Instruction Parsing and Execution: The repair instruction parser receives the structured instructions output by the large language model, verifies the rationality and feasibility of each instruction, and performs corresponding adjustments to the chromosome coding and accessory allocation table; Step S55: Perform constraint violation detection again: Generate the repaired individual. Then, perform the constraint violation detection in step S4 again. If the individual satisfies all hard constraints after repair, mark it as a feasible individual and add it to the next generation of the population. If there are still hard constraints that are violated, determine whether the number of iterations for repair has reached the upper limit. If the upper limit has not been reached, concatenate the current individual state with the remaining violated constraints to form a new prompt and iteratively call the large language model for secondary repair. If the upper limit has been reached, abandon the individual or add it to the population as a low-fitness feasible individual. Step S56: Store successful cases in the repair knowledge base. Store successful cases in the repair experience knowledge base during this repair process as a dynamic expansion source for subsequent few-sample examples. Successful cases consist of the original individual + constraint violation + repair instruction + repaired individual.

[0010] Step S6, Fitness Assessment and Population Renewal, includes the following steps: Step S61: Decode all feasible individuals generated in step S5, calculate the objective function value of their production scheduling scheme, and convert it into fitness value. All feasible individuals include the original feasible individuals and the repaired individuals. Step S62: Adopt the elite preservation strategy and directly copy the best individual in the current population to the next generation; Step S63: Select individuals from the set of feasible individuals using a tournament method to fill the next generation population size. .

[0011] Step S7, Iteration Termination and Optimal Solution Output, includes the following steps: Step S71: Determine whether the preset maximum number of iterations has been reached. Or, the optimal fitness has not improved over multiple generations; Step S72: If the termination condition is met, decode the globally optimal individual, generate a production scheduling Gantt chart containing a three-dimensional mapping of process-equipment-time, and output a complete production scheduling plan. Step S73: Simultaneously output the production scheduling decision support report. The report includes: the objective function value and key performance indicators of the optimal solution, confirmation of the satisfaction of each hard constraint, repair process statistics, and a summary of the basis for repairing the large language model. The repair process statistics include: the total number of repaired individuals, the average number of repair rounds, and the repair success rate.

[0012] Step S8, Constraint Incremental Update and Model Closed-Loop Optimization in Human-Machine Collaboration, includes the following steps: Step S81: When the enterprise adjusts its production process, introduces new equipment, or changes its material supply strategy, the planner describes the new / changed constraints through the natural language interactive interface. Step S82: The system calls the large language model to parse the natural language description into structured constraint tuples in the format of step S12, and dynamically injects them into the constraint library after confirmation by the planner. Step S83: Periodically organize the high-quality repair cases in the repair experience knowledge base accumulated in step S56 into a fine-tuning dataset, perform efficient parameter fine-tuning on the dedicated large language model, form a domain-adaptive repair model, and reduce online inference latency and API call costs.

[0013] A genetic scheduling optimization system for targeted repair of infeasible solutions using a large language model, used to implement the aforementioned genetic scheduling optimization method for repairing infeasible solutions based on a large language model, includes: The human-machine collaborative interaction module formally defines the production scheduling problem in a human-machine collaborative manner, acquires production resource data, process route data, and order demand data from the discrete manufacturing workshop, defines the decision variables, objective function, and constraint set of the production scheduling optimization problem, and encodes each constraint as a structured constraint semantic description tuple; The constraint semantic modeling module establishes a constraint-semantic mapping library, which transforms constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples through human-machine collaboration. The genetic algorithm engine module includes chromosome encoding and initial population generation, genetic operations (selection, crossover, mutation), and generation of offspring sets. ; Constraint violation detection module, constraint violation detection and infeasible individuals Identification involves performing constraint traversal detection on the current population, recording violation states and details, and identifying individuals that violate any hard constraint. If it is an individual, then it is marked as an infeasible individual. This information, along with all the constraints that have been violated, constitutes a constraint violation report for that individual. Repair the build module for each infeasible individual Build repair prompts; The large language model calling module inputs the repair prompts to the large language model service interface, calls the large language model to perform reasoning and generation, and the large language model generates structured repair instructions; Repair the instruction parsing and execution module, repair the instruction parser to receive structured instructions output by the large language model, verify the rationality and feasibility of each instruction, and perform corresponding adjustments to the chromosome coding and accessory allocation table; Repair the experience management module, perform constraint violation detection again, and store successful cases in the repair process into the repair experience knowledge base as a dynamic expansion source for subsequent few sample examples; The production scheduling solution decoding and visualization module decodes all feasible individuals, calculates the objective function value of their production scheduling solution, converts it into a fitness value, updates the population, terminates the iteration, outputs the optimal production scheduling solution, and performs human-machine collaborative constraint incremental update and model closed-loop optimization.

[0014] Compared with existing technologies, the beneficial effects of this application's genetic scheduling optimization method and system based on a large language model for repairing infeasible solutions are as follows: It breaks through the current shallow combination mode of "large model first, genetic algorithm later" in large model + genetic algorithm patents, and for the first time uses the large language model as an embedded component of the genetic evolution cycle, allowing it to directly participate in the individual generation and quality improvement process. The main advantages of this invention are as follows: First, by transforming infeasible individuals into feasible individuals, it significantly improves the search efficiency of genetic algorithms in complex constraint scenarios; second, it changes the traditional method of developers writing repair logic line by line, and realizes business-driven real-time scheduling strategy adjustment through planners' natural language input; third, planners can trace the decision basis for the scheduling position of any process through the system interface, giving the scheduling system interpretability. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a genetic scheduling optimization method based on a large language model to repair infeasible solutions. Figure 2 This is a flowchart of a targeted repair sub-process of a genetic scheduling optimization method based on a large language model to repair infeasible solutions; Figure 3 This is a modular architecture diagram of a genetic scheduling optimization system based on a large language model for targeted repair of infeasible solutions. Detailed Implementation

[0016] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the specific embodiments of this application are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this application. Therefore, this application is not limited to the specific embodiments disclosed below.

[0017] This embodiment uses an aerospace electrical equipment assembly workshop as an application scenario. This workshop is responsible for the electronic assembly and testing of products such as satellite control units and power modules, and has the following typical characteristics: Product types: 12 product models in production, with a wide variety and small batches; Process flow: Each product has an average of 11 processes, including SMT placement, manual soldering, conformal coating, temperature cycling screening, functional testing, aging testing, etc. Equipment resources: 21 main process equipment, of which 5 are flexible shared equipment (capable of processing multiple processes); Tooling constraints: There are only 4 sets of tooling for a certain type of temperature cycling chamber and only 2 sets of special fixtures for a certain type of vibration table; Material constraints: The supply cycle of imported connectors is uncertain, and the process needs to be arranged according to the dynamic arrival time of the goods; Personnel qualifications: The X-ray inspection machine requires a Level 3 qualified operator, and currently there are only 2 people with this qualification.

[0018] Please refer to Figures 1-3 This embodiment presents a genetic scheduling optimization method and system based on a large language model to repair infeasible solutions, which includes the following steps: Step S1: Formal definition of the production scheduling problem and semantic modeling of constraints: Acquire production resource data, process route data, and order demand data from discrete manufacturing workshops; define the decision variables, objective function, and constraint set for the production scheduling optimization problem; encode each constraint as a structured constraint semantic description tuple; establish a constraint-semantic mapping library; and transform constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples through human-machine collaboration.

[0019] Based on documents such as the "Electrical Assembly Workshop Production Management Specifications", "Equipment Operation Procedures", and "Process Cards" provided by the enterprise, a constraint library was constructed using a human-machine collaborative approach, defining a total of 78 hard constraints (including sequence constraints, equipment monopoly, tooling monopoly, material completeness, and personnel qualifications) and 12 soft constraints (including equipment load balancing, minimizing overtime hours, and continuous processing preference).

[0020] Step S2, Chromosome Encoding and Initial Population Generation: A process-based coding method is adopted, encoding the production scheduling plan as a chromosome sequence. Equipment allocation information is stored in an auxiliary coding table, corresponding one-to-one with the process sequence. An initial population is generated using a random generation method. ,in Population size.

[0021] Set population size =150, maximum number of iterations =300; The process arrangement coding is adopted, and the chromosome length L=132 (the sum of all product processes); Initial population: 30% of individuals are generated heuristically using priority scheduling rules, and 70% of individuals are generated completely randomly.

[0022] Step S3: Genetic operations (selection, crossover, mutation) to generate a set of offspring individuals. : Selection strategy: Tournament selection (scale 3), which selects parent individuals from the current population based on individual fitness; Crossover operator: partial matching crossover, crossover probability =0.85, perform crossover operation on the selected parent individual, using partial matching crossover as the crossover operator to generate child individuals; Mutation operators: exchange mutation, mutation probability =0.10, perform mutation operation on offspring individuals, use exchange mutation as the mutation operator, and introduce population diversity.

[0023] Step S4: Constrain violation detection and infeasible individuals Identification: set of offspring individuals Iterate through the constraint set constructed in step S1 one by one. For each constraint , call its The mathematical expression checks whether the current individual violates the constraint, records the violation status and details, and determines if the individual violates any hard constraint. If it is an individual, then it is marked as an infeasible individual. This information, along with all instances of constraint violations, constitutes an individual's constraint violation report.

[0024] Constraint ergodic testing was performed on the current population. Statistics show that the proportion of feasible individuals in the initial population is 0% (all 150 individuals violate at least one hard constraint); the proportion of feasible offspring individuals after crossover and mutation is 3.2%.

[0025] Step S5: Targeted repair based on a large language model: For each infeasible individual The repair prompt words are constructed and input into the large language model service interface, which then calls the large language model for inference and generation.

[0026] The large language model was used to repair 145 infeasible offspring individuals from the first generation: the success rate of the first repair was 71.0% (103 individuals became feasible after one round of repair); the success rate of the second repair was 18.6% (27 individuals became feasible after two rounds of repair); and 15 individuals were ultimately abandoned (accounting for 10.3%). After the repair, the number of feasible individuals in the current population increased from 5 to 135, with feasible individuals accounting for 90%.

[0027] The original individual violated the constraint: "C041: The electrical assembly process can only begin after connector J30J-15 arrives at the warehouse, with an estimated arrival time of t=245. The start time of the current process W7-OP2 is t=210."

[0028] Based on its understanding of constraint semantics, reasoning ability regarding scheduling logic, and guidance from few sample examples, the large language model outputs a structured sequence of repair action instructions. The large language model generates structured repair instructions: [ {"op": "HoldForMaterial", "task": "W7_OP2", "wait_until": 245}, {"op": "ShiftStart", "task": "W7_OP3", "delta": 35}, {"op": "ShiftStart", "task": "W8_OP1", "delta": 35}, {"op": "SwapSequence", "pos1": 47, "pos2": 52} ].

[0029] Repair instruction parsing and execution: The repair instruction parser receives the structured instructions output by the large language model, verifies the rationality and feasibility of each instruction, and performs corresponding adjustments to the chromosome coding and accessory allocation table.

[0030] The start time for process W7_OP2 has been moved to 245 minutes later; The subsequent process W7_OP3 and the resource conflict process W8_OP1 are moved synchronously for 35 minutes; The processes at positions 47 and 52 are swapped to optimize equipment idle time.

[0031] Re-execute constraint violation detection: Generate a repaired individual Then, perform the constraint violation detection in step S4 again. If the individual satisfies all hard constraints after repair, mark it as a feasible individual and add it to the next generation population. If there are still hard constraints that are violated, determine whether the number of iterations for repair has reached the upper limit. If the upper limit has not been reached, concatenate the current individual state with the remaining violated constraints to form a new prompt and iteratively call the large language model for secondary repair. If the upper limit has been reached, abandon the individual or add it to the population as a low-fitness feasible individual.

[0032] Post-repair testing showed that all hard constraints were met, and the completion time increased by 3.8% compared to the original individual, but was better than the re-generated feasible individuals (which increased by an average of 7.2%).

[0033] Successful cases from this repair process will be stored in the repair experience knowledge base as a dynamic source for subsequent few-sample examples.

[0034] Step S6, Fitness Assessment and Population Renewal: Decode all feasible individuals generated in step S5, calculate the objective function value of their production plan, and convert it into fitness value. Using an elite retention strategy, directly copy the best individual in the current population to the next generation. Then, select individuals from the set of feasible individuals using a tournament approach to fill the next generation population size. .

[0035] After 300 iterations, the optimal production scheduling scheme obtained by the method of this invention has a completion time of 389 minutes.

[0036] Step S7, Iteration Termination and Optimal Solution Output: Determine if the preset maximum number of iterations has been reached. If the optimal fitness does not improve for several consecutive generations, and the termination condition is met, the globally optimal individual is decoded, a Gantt chart containing a three-dimensional mapping of process-equipment-time is generated, and a complete production schedule is output, along with a production schedule decision support report.

[0037] Confirmation of key constraints for optimal solution: Hard constraint satisfaction rate: 100% (78 / 78); Material completeness constraint C041: After the large language model was repaired, all processes involving imported connectors were started after the arrival time, which is confirmed to be satisfied; Personnel qualification constraint C057: All X-ray inspection processes were assigned to employee IDs 1082 and 1095, which is satisfied.

[0038] Repair process statistics: Total number of individuals repaired: 2,847; Average number of repair rounds: 1.24; Repair success rate: 89.7%; Summary of Large Language Model Repair Basis (Tracing Case): Repair Basis for Process W7_OP2: "The arrival time of material J30J-15 at t=245 is a hard constraint, and the current start time t=210 cannot be met. Shift this process to t=245 and postpone its subsequent process, while swapping W9_OP1 and W10_OP1 to optimize the idle fragments of equipment M07—this has been detected as the current minimum cost repair path." Step S8: Constraint Incremental Update and Model Closed-Loop Optimization in Human-Machine Collaboration: When a company adjusts its production process, introduces new equipment, or changes its material supply strategy, the planner describes the new / changed constraints through a natural language interface. The system calls the large language model to parse the natural language description into structured constraint tuples in step 1, and after confirmation by the planner, dynamically injects them into the constraint library. The system also periodically organizes high-quality repair cases from the repair experience knowledge base accumulated in step S5 into a fine-tuning dataset, and efficiently fine-tunes the parameters of the dedicated large language model to form a domain-adaptive repair model, reducing online inference latency and API call costs.

[0039] This embodiment also provides a genetic scheduling optimization system for targeted repair of infeasible solutions using a large language model, which includes: The human-machine collaborative interaction module formally defines the production scheduling problem in a human-machine collaborative manner, acquires production resource data, process route data, and order demand data from the discrete manufacturing workshop, defines the decision variables, objective function, and constraint set of the production scheduling optimization problem, and encodes each constraint as a structured constraint semantic description tuple; The constraint semantic modeling module establishes a constraint-semantic mapping library, which transforms constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples through human-machine collaboration. The genetic algorithm engine module includes chromosome encoding and initial population generation, genetic operations (selection, crossover, mutation), and generation of offspring sets. ; Constraint violation detection module, constraint violation detection and infeasible individuals Identification involves performing constraint traversal detection on the current population, recording violation states and details, and identifying individuals that violate any hard constraint. If it is an individual, then it is marked as an infeasible individual. This information, along with all the constraints that have been violated, constitutes a constraint violation report for that individual. Repair the build module for each infeasible individual Build repair prompts; The large language model calling module inputs the repair prompts to the large language model service interface, calls the large language model to perform reasoning and generation, and the large language model generates structured repair instructions; Repair the instruction parsing and execution module, repair the instruction parser to receive structured instructions output by the large language model, verify the rationality and feasibility of each instruction, and perform corresponding adjustments to the chromosome coding and accessory allocation table; Repair the experience management module, perform constraint violation detection again, and store successful cases in the repair process into the repair experience knowledge base as a dynamic expansion source for subsequent few sample examples; The production scheduling solution decoding and visualization module decodes all feasible individuals, calculates the objective function value of their production scheduling solution, converts it into a fitness value, updates the population, terminates the iteration, outputs the optimal production scheduling solution, and performs human-machine collaborative constraint incremental update and model closed-loop optimization.

[0040] The technical features of the above embodiments 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 this specification.

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

Claims

1. A genetic scheduling optimization method based on a large language model for repairing infeasible solutions, characterized in that: Includes the following steps: Step S1: Formal definition of the production scheduling problem and semantic modeling of constraints; Step S2: Chromosome encoding and initial population generation; Step S3, Genetic Operations: Selection, Crossover, and Mutation to generate a set of offspring individuals. ; Step S4: Constraining violation detection and infeasible individuals Identification; Step S5: Targeted repair based on a large language model; Step S6: Fitness assessment and population renewal; Step S7: Iteration termination and output of the optimal solution; Step S8: Constraint incremental update and model closed-loop optimization for human-machine collaboration.

2. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 1, characterized in that: Step S1 includes: Step S11: Obtain production resource data, process route data, and order demand data from the discrete manufacturing workshop, and define the decision variables, objective function, and set of constraints for the production scheduling optimization problem; The decision variables include the allocation relationship between processes and processing equipment, the start time of processes on the corresponding equipment, and the processing sequence of processes on the corresponding equipment; the objective function is configured based on production scheduling business requirements and includes one or more combinations of the following: minimizing the maximum completion time, minimizing the total delay time, balancing the total equipment load, minimizing the total energy consumption, and minimizing the production changeover cost; Step S12: Encode each constraint condition into a structured constraint semantic description tuple: (1) in: : Constrain unique identifier; Constraint types include sequence constraints, resource exclusivity constraints, material completeness constraints, tooling constraints, personnel qualification constraints, time window constraints, etc. : The scope of the constraint, which includes the specific set of processes, equipment, materials, and tooling entities involved; : The mathematical expression of the constraint; : Constrained natural language semantic description; : The severity level of constraint violation (hard constraint / soft constraint); Step S13: Establish a constraint-semantic mapping library to convert the constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples in the format of Step S12 through human-machine collaboration.

3. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 1, characterized in that: Step S2 includes: Step S21: Using a process-based coding method, the production scheduling scheme is encoded as a chromosome sequence: (2) Each gene locus Each number represents a process step. The number of times the same workpiece number appears represents the processes for that workpiece. The order of processes in the chromosome represents the interleaving order between processes for different workpieces. Step S22: Equipment allocation information is stored using an auxiliary coding table, which corresponds one-to-one with the process sequence; Step S23: Generate the initial population using a random generation method. ,in Population size.

4. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 1, characterized in that: Step S3 includes: Step S31: Using the tournament selection method, select parent individuals from the current population based on individual fitness; Step S32: Perform a crossover operation on the selected parent individuals, using partial matching crossover as the crossover operator to generate child individuals; Step S33: Perform mutation operation on the offspring individuals, using exchange mutation as the mutation operator to introduce population diversity.

5. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 2, characterized in that: Step S4 includes: Step S41: Process the set of offspring individuals generated in step S3. Iterate through the constraint set constructed in step S1 one by one. ; Step S42: For each constraint , call its A mathematical expression is used to detect whether the current individual violates the constraint, and to record the violation status and details. The violation details include: the ID of the violated constraint; the specific process / equipment / material entity identifier involved; the deviation between the current value and the constraint threshold; and the semantic description text of the constraint. Step S43: If an individual violates any hard constraint ( If it is an individual, then it is marked as an infeasible individual. This information, along with all instances of constraint violations, constitutes an individual's constraint violation report.

6. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 2, characterized in that: Step S5 includes: Step S51, Build Repair Tips: For each infeasible entity Build repair prompts; Step S52: Call the large language model service: Input the repair prompt into the large language model service interface, and call the large language model to perform reasoning and generation; Step S53: The large language model generates structured repair instructions: Based on its understanding of constraint semantics, reasoning ability of scheduling logic, and guidance from few sample examples, the large language model outputs a sequence of structured repair action instructions. Step S54, Repair Instruction Parsing and Execution: The repair instruction parser receives the structured instructions output by the large language model, verifies the rationality and feasibility of each instruction, and performs corresponding adjustments to the chromosome coding and accessory allocation table; Step S55: Perform constraint violation detection again: Generate the repaired individual. Then, perform the constraint violation detection in step S4 again. If the individual satisfies all hard constraints after repair, mark it as a feasible individual and add it to the next generation of the population. If there are still hard constraints that are violated, determine whether the number of iterations for repair has reached the upper limit. If the upper limit has not been reached, concatenate the current individual state with the remaining violated constraints to form a new prompt and iteratively call the large language model for secondary repair. If the upper limit has been reached, abandon the individual or add it to the population as a low-fitness feasible individual. Step S56: Store successful cases in the repair knowledge base; Store successful cases in the repair experience knowledge base during this repair process as a dynamic expansion source for subsequent few-sample examples. Successful cases consist of the original individual + constraint violation + repair instruction + repaired individual.

7. The genetic scheduling optimization method based on large language model for repairing infeasible solutions as described in claim 1, characterized in that: Step S6 includes: Step S61: Decode all feasible individuals generated in step S5, calculate the objective function value of their production scheduling scheme, and convert it into fitness value. All feasible individuals include the original feasible individuals and the repaired individuals. Step S62: Adopt the elite preservation strategy and directly copy the best individual in the current population to the next generation; Step S63: Select individuals from the set of feasible individuals using a tournament method to fill the next generation population size. .

8. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 1, characterized in that: Step S7 includes: Step S71: Determine whether the preset maximum number of iterations has been reached. Or, the optimal fitness has not improved over multiple generations; Step S72: If the termination condition is met, decode the globally optimal individual, generate a production scheduling Gantt chart containing a three-dimensional mapping of process-equipment-time, and output a complete production scheduling plan. Step S73: Simultaneously output the production scheduling decision support report. The report includes: the objective function value and key performance indicators of the optimal solution, confirmation of the satisfaction of each hard constraint, repair process statistics, and a summary of the basis for repairing the large language model. The repair process statistics include: the total number of repaired individuals, the average number of repair rounds, and the repair success rate.

9. The genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in claim 6, characterized in that: Step S8 includes: Step S81: When the enterprise adjusts its production process, introduces new equipment, or changes its material supply strategy, the planner describes the new / changed constraints through the natural language interactive interface. Step S82: The system calls the large language model to parse the natural language description into structured constraint tuples in the format of step S12, and dynamically injects them into the constraint library after confirmation by the planner. Step S83: Periodically organize the high-quality repair cases in the repair experience knowledge base accumulated in step S56 into a fine-tuning dataset, perform efficient parameter fine-tuning on the dedicated large language model, form a domain-adaptive repair model, and reduce online inference latency and API call costs.

10. A genetic scheduling optimization system for targeted repair of infeasible solutions in a large language model, characterized in that, It is used to complete the genetic scheduling optimization method based on a large language model for repairing infeasible solutions as described in any one of claims 1 to 9, and includes: The human-machine collaborative interaction module formally defines the production scheduling problem in a human-machine collaborative manner, acquires production resource data, process route data, and order demand data from the discrete manufacturing workshop, defines the decision variables, objective function, and constraint set of the production scheduling optimization problem, and encodes each constraint as a structured constraint semantic description tuple; The constraint semantic modeling module establishes a constraint-semantic mapping library, which transforms constraint clauses in unstructured documents such as enterprise production management systems, equipment operating procedures, and process specifications into structured constraint tuples through human-machine collaboration. The genetic algorithm engine module includes chromosome encoding and initial population generation, genetic operations (selection, crossover, mutation), and generation of offspring sets. ; Constraint violation detection module, constraint violation detection and infeasible individuals Identification involves performing constraint traversal detection on the current population, recording violation states and details, and identifying individuals that violate any hard constraint. If it is an individual, then it is marked as an infeasible individual. This information, along with all the constraints that have been violated, constitutes a constraint violation report for that individual. Repair the build module for each infeasible individual Build repair prompts; The large language model calling module inputs the repair prompts to the large language model service interface, calls the large language model to perform reasoning and generation, and the large language model generates structured repair instructions; Repair the instruction parsing and execution module, repair the instruction parser to receive structured instructions output by the large language model, verify the rationality and feasibility of each instruction, and perform corresponding adjustments to the chromosome coding and accessory allocation table; Repair the experience management module, perform constraint violation detection again, and store successful cases in the repair process into the repair experience knowledge base as a dynamic expansion source for subsequent few sample examples; The production scheduling solution decoding and visualization module decodes all feasible individuals, calculates the objective function value of their production scheduling solution, converts it into a fitness value, updates the population, terminates the iteration, outputs the optimal production scheduling solution, and performs human-machine collaborative constraint incremental update and model closed-loop optimization.