Control system automation repair method and system based on large language model
By using an interactive goal conflict resolution framework based on a large language model, complex demand conflicts in automated control systems are automatically processed, improving the quality and efficiency of solutions, reducing human resource requirements, and achieving more efficient and reliable goal conflict resolution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2026-03-20
AI Technical Summary
Traditional automated control systems are inefficient at handling complex demand conflicts, neglecting demand specifications and boundary conditions, resulting in an inability to fully utilize detailed information and excessive reliance on human intervention.
An interactive goal conflict resolution framework based on a large language model is adopted. Through role-based operation and iterative interaction, the solution is generated and verified by the analyst, repairer and inspector. Combined with the knowledge base and reasoning ability of the large language model, goal conflict is automatically processed.
It significantly improves the quality and efficiency of solutions, reduces human resource requirements, enhances the adaptability and reliability of solutions, and supports the generation of highly customized solutions.
Smart Images

Figure CN120065871B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of automation control, and particularly relates to a control system automation repair method and system based on a large language model. BACKGROUND
[0002] The field of automation control is an important part of industrial production, and its task is to control different hardware and software in the production process to obtain a stable and safe production environment. In reality, such as the control system of water pumps inside the mine, the production control system of the assembly line, and the control of traffic lights, there are special software and hardware for control. Among these control software, a series of goals (desired purposes), domain attributes (the working effect of different hardware), and boundary conditions (the situation where the goals and domain attributes conflict) can be abstracted. Among them, the goals, domain attributes, and boundary conditions can be represented by linear temporal logic formulas, because linear temporal logic formulas can formally abstract a large class of goal, domain attribute, and boundary condition specifications.
[0003] In order to solve the possible conflicts between goals and domain attributes, requirement engineers need to formally describe the complex requirement conflicts through linear temporal logic in order to better understand and solve these conflicts. Since the requirements come from different aspects, requirement engineers need to analyze and understand the specific situation and background of these requirements (i.e. boundary conditions) to clarify the nature of the interaction and conflict between requirements, so as to achieve the stability and safety of the system by modifying the goals. This process requires a high level of professional knowledge and systematic analysis methods to ensure that various control systems can effectively meet various complex and variable business requirements.
[0004] In this process, traditional goal conflict resolution methods usually rely on search algorithms to explore different goal configurations and solutions, rather than in-depth analysis of requirement specifications and boundary conditions. Existing traditional methods may ignore specific information about the requirements themselves, similar to understanding a sentence by searching for keywords without a deep understanding of the text's meaning. In short, traditional conflict resolution methods require a large number of requirement engineers to participate, and ignore the information provided by requirement specification and boundary condition analysis, resulting in the inability to fully utilize detailed information in requirement analysis to solve conflicts. Therefore, these traditional methods are not efficient and accurate in handling complex requirement conflicts. SUMMARY
[0005] In order to solve the problems existing in the prior art, the present application proposes a control system automation repair method and system based on a large language model, which adopts an automated interactive goal conflict resolution framework based on a large language model, analyzes conflicts and generates solutions through iterative interaction, can quickly and accurately analyze and solve goal conflicts, and significantly improves the quality and efficiency of the solutions.
[0006] In one aspect, the embodiment of the present application provides a control system automatic repair method based on a large language model, comprising the following steps:
[0007] S1, initializing and pre-training a large language model to obtain an adjusted large language model;
[0008] S2, establishing an interactive target conflict resolution framework with three roles of an analyst, a repairer and an inspector; iteratively generating and evaluating conflict resolution solutions based on the adjusted large language model according to target, domain attribute and boundary condition data, the repairer generating a revised target using the analysis result obtained from the analyst, and the inspector being responsible for checking whether the revised target meets the requirements of conflict resolution, finally obtaining a repaired target and a solution set;
[0009] S3, obtaining the required information from the solution set to realize repair of the control system;
[0010] The boundary condition is used in requirement engineering to capture specific situations leading to target conflicts.
[0011] In another aspect, the embodiment of the present application also provides a control system automatic repair system based on a large language model, which is used to implement the above automatic repair method and comprises the following modules:
[0012] A model adjustment module is used to initialize and pre-train a large language model to obtain an adjusted large language model;
[0013] A solution set generation module establishes an interactive target conflict resolution framework with three roles of an analyst, a repairer and an inspector; iteratively generates and evaluates conflict resolution solutions based on the adjusted large language model according to target, domain attribute and boundary condition data, the repairer generates a revised target using the analysis result obtained from the analyst, and the inspector is responsible for checking whether the revised target meets the requirements of conflict resolution, finally obtaining a repaired target and a solution set;
[0014] A repair module is used to obtain the required information from the solution set to realize repair of the control system;
[0015] The boundary condition is used in requirement engineering to capture specific situations leading to target conflicts.
[0016] Compared with the prior art, the present application has the following beneficial effects:
[0017] 1. Improve the efficiency and quality of solutions: The invention can quickly and accurately analyze and solve target conflicts by utilizing the extensive knowledge base and reasoning ability of large language models, significantly improving the quality and efficiency of solutions. Compared with traditional methods that rely on manual or basic algorithms, it can more effectively handle more complex problems.
[0018] 2. Reduce human resource needs and costs: The invention reduces the dependence on professional demand engineers through automation and iterative methods, which not only reduces the burden on engineering teams, but also significantly reduces the human cost required to solve target conflicts.
[0019] 3. Improve the adaptability and reliability of solutions: Interactive and iterative methods allow the invention to adjust according to actual conditions during the solution process, which improves the adaptability and reliability of solutions. In the process of continuous feedback and optimization, specific needs and conditions can be more accurately met.
[0020] 4. Easy to operate and easy to implement: Role-based operations and chain thinking prompts make the operation process of the invention more intuitive and simple, even non-professionals can start and control the solution generation process through simple interaction.
[0021] 5. Improve the innovation and customization of solutions: The invention supports highly customized solution generation, which can generate innovative and effective solutions for specific conflict scenarios, which is of great value for handling specific or unconventional target conflicts. BRIEF DESCRIPTION OF DRAWINGS
[0022] Figure 1 The overall flow of the control system automation repair method based on large language models in the embodiment of the invention;
[0023] Figure 2 The flowchart for obtaining a solution by analyzing information through role interaction in the embodiment of the invention;
[0024] Figure 3 The flowchart for updating the solution in the embodiment of the invention. DETAILED DESCRIPTION
[0025] To make the invention purpose, technical scheme and advantages of the invention clearer, the invention will be further described below in conjunction with the drawings and embodiments, but the implementation of the invention is not limited to this.
[0026] In addition, it should be noted that for the sake of description, only the parts related to the present application are shown in the drawings. It is understandable that some well-known structures and their descriptions may be omitted in the drawings for those skilled in the art.
[0027] The present application provides a large language model-based control system automation repair method and system, which iteratively analyzes, generates and verifies solutions through role operation (analyst, repairer and checker) and chain thinking prompt engineering. In order to better describe the technical scheme of the present application, the following basic concepts are described first:
[0028] 1. Goal-conflict analysis: Goal-conflict analysis is usually driven by the identify-evaluate-control cycle, aiming to identify, evaluate and solve inconsistent problems that may hinder the realization of expected goals. In this work, the present application focuses on the solution phase. Based on the competitive hypothesis technique and argument pattern analysis, the existing method cannot be directly used to solve the differences captured by the boundary conditions. Modern search-based algorithms are used to explore the syntactic variants of the goal, and candidate solutions are achieved through multi-objective adaptation functions; however, this algorithm ignores the information provided by the requirement specification and the analysis of the reasons for the goal conflict caused by the given boundary conditions.
[0029] 2. Linear temporal logic: It is a logic system used to describe the behavior and relationship of events in a time sequence. In software engineering, linear temporal logic is used to formalize requirement specifications, especially those involving time order or constraints. By using linear temporal logic, developers can accurately describe the conditions that software should meet at different time points or time periods, as well as the dependencies and interactions between various functions. In addition to basic logical rules (and, or, not), a series of time-related logical rules such as eventually, always, until, next step, etc. are added to represent the changing relationship of different atomic propositions on the time axis.
[0030] 3. Boundary conditions: In requirement engineering, boundary conditions are used to capture specific situations that lead to goal conflicts, which are some situations that make the satisfaction of certain goals inhibit the satisfaction of other goals.
[0031] 4. Large language model: A large language model based on a transformer pre-trained language model is one of the major advances in the field of artificial intelligence. Large language models are large neural networks composed of up to 176 billion parameters, such as the pre-trained generative transformer series. Large language models perform well in verification, reasoning, and automatic formalization of mathematical and formal specifications.
[0032] 5. Interactive goal conflict resolution framework: This is a collaborative framework proposed by the present application, which has three roles of analyst, repairer and checker, and uses large language models to iteratively generate and evaluate conflict resolution solutions. The repairer uses the analysis results obtained from the analyst to generate revised goals, while the checker is responsible for checking whether the revised goals meet the requirements of conflict resolution.
[0033] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. Embodiment
[0034] Reference Figure 1 The embodiment provides an automatic repair method of a control system based on a large language model, and the method comprises the following steps:
[0035] S1, initializing and pre-training a large language model to obtain an adjusted large language model.
[0036] In an automatic control system and / or software, a target corresponding to the control system, a domain attribute and a boundary condition are manually or automatically extracted as data, the target can be a safety index or a quantity and quality requirement of production, the domain attribute can be the utility of different hardware, and the boundary condition is a state in which the target and the domain attribute conflict. The above data is used as a training set to pre-train an existing large language model, and a large language model required by the application is obtained.
[0037] The specific process of pre-training the large language model comprises the following steps:
[0038] S11, data collection and processing: relevant text data are obtained from an automatic control system and / or automatic control software, and the text data include operation logs, fault reports, operation manuals and the like of the automatic control system.
[0039] S12, preprocessing: the text data are subjected to cleaning, word segmentation, removal of irrelevant words and the like, so as to facilitate subsequent training and fine-tuning.
[0040] S13, model selection: a large language model based on text, such as a bidirectional encoder based on a transformer, is selected as a basic model.
[0041] S14, pre-training: the selected basic model is pre-trained using the collected text data of the control system, and a method such as a masked language model and next sentence prediction is used in the training process, that is, the word units in the mask and the content of the next sentence are predicted.
[0042] S15, adjustment: after the pre-training is completed, the large language model is adjusted using artificially labeled data about a target conflict resolution task, that is, the artificially answered repaired target is given for the input target, domain attribute and boundary condition, each group of corresponding data is input to the large language model, the lower parameters of the large language model are frozen, and only the upper parameters of the large language model are adjusted, so that the performance of the model for the subsequent target conflict resolution task is improved.
[0043] S16, evaluation and optimization: after the pre-training and fine-tuning are completed, the large language model is evaluated, so that the large language model is obviously improved in the accuracy of the target conflict resolution task compared with an existing model and an artificial solution framework.
[0044] S2, an interactive target conflict resolution framework is established, which has three roles of an analyzer, a fixer and an inspector; a conflict resolution solution is iteratively generated and evaluated based on the adjusted large language model according to the target, domain attribute and boundary condition data, the fixer generates a revised target by using the analysis result obtained from the analyzer, and the inspector is responsible for checking whether the revised target meets the requirements of conflict resolution, and finally a repaired target is obtained, and a solution set is obtained.
[0045] As shown in Figure 2 , 3 , the method specifically comprises the following steps:
[0046] S21, initializing the large language model of the analyzer and the fixer respectively by using role instructions, and starting the background service of the inspector.
[0047] In this embodiment, the role instructions of step S21 are as follows:
[0048] The role instruction of the analyzer is: your task is to help me analyze the reason why a certain formula does not meet the requirements under a certain condition.
[0049] The role instruction of the fixer is: your task is to generate a repaired target that meets the boundary conditions in the domain.
[0050] The domain, target and boundary condition are all written in linear temporal logic formula. The domain and the repaired target can both be satisfied. The repaired target should be similar to the target in syntax and semantics. The repaired target can only be modified on the given target. The returned format is the repaired target.
[0051] S22, inputting the linear temporal logic formula as the target, domain attribute and boundary condition to the analyzer respectively.
[0052] The domain attribute in step S22 is a descriptive statement of the problem domain, which is used to capture the scope of the requirements; the target is a prescriptive statement, which requires the system to achieve the target; the boundary condition describes the combination of specific conditions under which the target cannot be satisfied as a whole, which is used to capture the occurrence conditions of the target divergence. The above three inputs can be expressed as legal linear temporal logic formulas, which can be verified by a logic checker.
[0053] In this embodiment, the control system is a water pump control system in a mine, the target can be "no flood, no explosion", the domain attribute is "water pump effect", and the boundary condition can be "high water level and methane existing at the same time" being true.
[0054] S23, obtaining analysis information through the analyzer, adding the analysis information, the input target, the domain attribute and the boundary condition to the total information. The total information will be input into the trained large language model.
[0055] S24, iteratively interact, let the analyst, the fixer, the checker continuously interact until the condition of the end of the interaction is met; when the condition of the end of the interaction is met, the cycle of continuous interaction ends, and finally the solution set is extracted from all the information in step S23.
[0056] In the process of role interaction, the analyst gives analysis information, the fixer gives the repaired target according to the information of the analyst, and the checker checks whether the answer of the fixer meets the condition until all the conditions are met, so as to gradually generate a solution.
[0057] In this embodiment, the condition of the end of the interaction is that the repaired target can pass the syntax check, the semantic check and the satisfiability check. The syntax check is to check whether the repaired target is a legal linear temporal logic formula; the semantic check is to check whether the repaired target can contain the semantics of the original target; and the satisfiability check is to check whether the repaired target meets the domain attribute and the boundary condition. By using a regular expression, the matching information such as "repaired target:" is located in the text, and the related content after the colon is extracted. In a similar way, the solution is extracted from all the information obtained in step S23 to form the final result.
[0058] Referring to Figure 3 , this step further includes the following steps:
[0059] S241, initialize the solution set to be an empty set.
[0060] S242, if the solution set is not empty, input the checking information obtained by the logic checker to the fixer, the fixer obtains the solution information, adds the solution information to the all information, and extracts the solution and adds it to the solution set.
[0061] S243, if the solution set is empty, input the all information to the fixer, the fixer obtains the solution information, extracts the solution and adds it to the solution set.
[0062] Since the solution set is not empty at this time, the checking information obtained by the logic checker is that the next time of high water level does not exist methane and the water pump is opened, and the next time of low water level and the water pump is closed when methane exists, which cannot meet the boundary condition "high water level and methane exist at the same time", and the repaired target needs to be given again.
[0063] The above checking information is input to the fixer, and the fixer obtains the solution information: the repaired target is "when the water level is high and there is no methane, open the water pump at the next time; when the water level is low and there is methane, close the water pump at the next time".
[0064] Then the solution information is added to the total information, and the solution is extracted and added to the solution set.
[0065] S244, repeat step S242 and step S243 until the end condition is met, return the final solution set R.
[0066] The logic checker includes syntax checking, semantic checking and satisfiability checking, which are implemented based on the code library. After being verified by the logic checker, the solution can pass the syntax checking, semantic checking and satisfiability checking, so the loop ends.
[0067] Finally returning the final solution set can be explained as: 1. When the water level is high and there is no methane, the water pump is turned on at the next time; 2. When the water level is low and there is methane, the water pump is turned off at the next time.
[0068] S3, the engineer obtains the required information from the solution set, and realizes the repair of the control system by repairing the corresponding content in the control system or software.
[0069] The embodiment also provides a control system automatic repair system based on a large language model, which is used to realize the automatic repair method and includes the following modules.
[0070] The model adjustment module is used to initialize and pre-train the large language model to obtain the adjusted large language model.
[0071] The solution set generation module establishes an interactive target conflict resolution framework, and has three roles of an analyst, a repairer and a checker; according to the target, the domain attribute and the boundary condition data, the conflict resolution solution is iteratively generated and evaluated based on the adjusted large language model, the repairer generates the modified target by using the analysis result obtained from the analyst, and the checker is responsible for checking whether the modified target meets the requirements of conflict resolution, finally the repaired target is obtained, and the solution set is obtained.
[0072] The repair module obtains the required information from the solution set to realize the repair of the control system.
[0073] The boundary condition is used to capture specific situations leading to target conflicts in requirement engineering.
[0074] The detailed implementation process of each module of the automatic repair system can refer to the foregoing steps.
[0075] The present application not only improves the overall process of target conflict resolution, but also improves the efficiency and quality of the overall solution through technical innovation. It shows its efficiency and innovation in dealing with complex problems, especially in the comparison with artificial solutions, the high consistency shown further verifies its practicability and reliability.
[0076] Table 1 is the conflict resolution results of the present application under five different demand specifications, from control systems in different fields, the present application can handle specific boundary conditions in each demand specification and generate solutions. These solutions are verified by the checking module to confirm that they can successfully resolve conflicts in boundary conditions.
[0077]
[0078] Table 1: Effectiveness of the present application in generating solutions
[0079]
[0080] Table 2: Comparison of experimental results of two methods on target conflict resolution problems
[0081] From Table 2, compared with manually written solutions, the present application can more effectively generate accurate or more generalized solutions.
[0082] From the above, in the present application, first, a large language model is used as the core technology to automatically handle target conflicts with its rich knowledge base and powerful reasoning ability. Second, through an interactive method, the large language model is used as a user role (analyzer, fixer, checker) to continuously interact and gradually generate and optimize solutions. The design of role-based operations assigns tasks to different roles, such as the analyzer responsible for inputting demand specifications and boundary conditions, the fixer using the large language model to generate corrected targets, and the checker verifying the generated solutions. In addition, the chain thinking prompt engineering provides guiding information to help the large language model more accurately understand and solve target conflicts. Finally, an iterative method is used to continuously optimize solutions to ensure their adaptability to different demands and boundary conditions. In summary, the present application combines a large language model with interactive role-based operations and chain thinking prompt engineering to achieve the goal of automatically analyzing, generating, and verifying target conflict resolution solutions.
[0083] The above embodiments are the preferred embodiments of the present application, but the embodiments of the present application are not limited by the above embodiments, and any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the present application are equivalent replacement methods and are included in the protection scope of the present application.
Claims
1. An automated repair method for control systems based on a large language model, characterized in that, Includes the following steps: S1. Initialize and pre-train a large language model to obtain an adjusted large language model; S2. Establish an interactive goal conflict resolution framework with three roles: analyst, fixer, and checker. Based on goal, domain attribute, and boundary condition data, conflict solutions are iteratively generated and evaluated using an adjusted large language model. The fixer uses the analysis results obtained from the analyst to generate a modified goal, while the checker is responsible for verifying whether the modified goal meets the requirements of conflict resolution. Finally, the fixed goal is obtained, and a set of solutions is obtained. S3. Obtain the necessary information from the solution set to repair the control system; The boundary conditions are used in requirements engineering to capture specific situations that lead to target conflicts; Step S1: Manually or automatically extract the target, domain attributes, and boundary conditions corresponding to the automatic control system and / or software as data for pre-training a large language model; the target is the safety indicator or quantity and quality requirements of production, the domain attributes are the utility of different hardware, and the boundary conditions are the states in which the target and domain attributes conflict. Step S2 includes: S21. Initialize the large language models of the analyst and repairer respectively using role instructions, and start the background service of the inspector; S22. Input the linear temporal logic formulas as the target, domain attribute, and boundary condition to the analyst respectively; S23. Obtain analysis information through the analyst, and add the analysis information, input target, domain attributes and boundary conditions to all information; S24. Iterative interaction: The analyst, repairer, and inspector continue to interact until the condition for the interaction to end is met. When the condition for the interaction to end is met, the continuous interaction loop ends, and finally the solution set is extracted from all the information in step S23. In step S22, the domain attributes are descriptive statements of the problem domain, used to capture the scope of the requirements; the objective is a prescriptive statement, requiring the system to achieve the goal; the boundary conditions describe combinations where the objective cannot be satisfied as a whole under specific circumstances, used to capture the conditions under which objective divergence occurs. The condition for the interaction to end in step S24 is that the repaired target can pass the syntax check, semantic check, and satisfiability check; where the syntax check is to check whether the repaired target is a valid linear temporal logic formula; the semantic check is to check whether the repaired target can contain the semantics of the original target; and the satisfiability check is to check whether the repaired target satisfies the domain attributes and boundary conditions. In step S22, the control system is the water pump control system inside the mine, the objective is "no flood, no explosion", the domain attribute is "water pump effect", and the boundary condition is "high water level and methane coexist" is true. In step S24, when the solution set is not empty, the check information obtained by the logic checker is: there is no methane and the water pump is on in the next time when the water level is high and the water pump is off in the next time when methane is present. The boundary condition "high water level and methane exist at the same time" cannot be satisfied, and the corrected target needs to be given again. The inspection information is input to the repairer, who then receives the solution: the goal after repair is "when the water level is high and there is no methane, turn on the water pump at the next time; when the water level is low and there is methane, turn off the water pump at the next time".
2. The automated repair method according to claim 1, characterized in that, Step S24 includes: S241. Initialize the solution set to an empty set; S242. If the solution set is not empty, the inspection information obtained by the logic checker will be input to the fixer. The fixer will then obtain the solution information and add it to all information. At the same time, the solution will be extracted and added to the solution set. S243. If the solution set is empty, all information is input to the fixer, who receives the solution information, extracts the solution, and adds it to the solution set. S244. Repeat steps S242 and S243 until the termination condition is met, and return the final solution set.
3. The automated repair method according to claim 1, characterized in that, The role instructions in step S21 include: The analyst's role instruction is: Please help analyze why a certain formula is not satisfied under certain conditions; The repairer's role instruction is: Please generate a repair target in the domain that satisfies the boundary conditions.
4. The automated repair method according to claim 1, characterized in that, Step S1 involves adjusting a large language model after pre-training using manually labeled data related to the target conflict resolution task. This involves providing the input target, domain attributes, and boundary conditions, and having a human respond to the corrected target. Each set of corresponding data is then input into the large language model, freezing the lower-level parameters of the large language model, and adjusting only the upper-level parameters.
5. An automated repair system for control systems based on a large language model, used to implement the automated repair method according to any one of claims 1-4, characterized in that, Includes the following modules: The model tuning module is used to initialize and pre-train a large language model to obtain a tuned large language model. The solution set generation module establishes an interactive goal conflict resolution framework with three roles: analyst, fixer, and checker. Based on goal, domain attribute, and boundary condition data, it iteratively generates and evaluates conflict solutions using an adjusted large-scale language model. The fixer uses the analysis results obtained from the analyst to generate revised goals, while the checker is responsible for verifying whether the revised goals meet the requirements of conflict resolution. Finally, the revised goals are obtained, resulting in a solution set. The repair module obtains the necessary information from the solution set to repair the control system. The boundary conditions are used in requirements engineering to capture specific situations that lead to conflict with the objectives.
Citation Information
Patent Citations
Code repairing system and method based on large language model
CN116991467A
Program repairing method and device and computer readable storage medium
CN118981433A