Agent-based device repair method, industrial control system, electronic device, and medium

By using an agent-driven equipment maintenance method, combined with a large language model and skill functions, autonomous closed-loop maintenance of intelligent manufacturing equipment has been achieved. This solves the problems of reliance on manual maintenance and insufficient real-time interaction in existing technologies, and improves the efficiency and accuracy of equipment fault repair.

CN122488698APending Publication Date: 2026-07-31ZHUHAI OUSENSI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUHAI OUSENSI TECH CO LTD
Filing Date
2026-07-02
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, fault repair after intelligent manufacturing equipment shutdown relies on manual troubleshooting, resulting in long response times. Furthermore, existing solutions lack real-time interaction and closed-loop autonomous repair capabilities, and cannot dynamically adjust diagnostic paths.

Method used

The equipment maintenance method driven by intelligent agents achieves a closed-loop iterative process of "thinking-action-observation" by iteratively executing equipment control loops and combining large language models and skill functions, thereby generating structured decision instructions and dynamically adjusting maintenance strategies.

Benefits of technology

It enables autonomous maintenance of industrial control systems, reduces manual intervention, improves fault repair efficiency and accuracy, and can dynamically adjust maintenance paths based on real-time feedback from equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122488698A_ABST
    Figure CN122488698A_ABST
Patent Text Reader

Abstract

This invention discloses an agent-based equipment maintenance method, industrial control system, electronic device, and medium. The method relates to an artificial intelligence system in the production field, specifically including: acquiring input instructions containing maintenance intentions; a first agent iteratively executing an equipment control loop, wherein each round of the equipment control loop includes: invoking a large language model to generate structured decision instructions based on the input instructions and the current equipment state context; invoking corresponding skill functions according to the function identifiers and control parameters in the decision instructions to obtain physical interpretation information; updating the execution results generated in this round to the equipment state context; and exiting the equipment control loop when the execution results meet preset termination conditions. In the method provided by this invention, the agent can obtain real-time physical state feedback of the equipment after each round of execution and dynamically adjust subsequent decision instructions accordingly, enabling the agent to autonomously attempt to repair faults.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence and industrial control, and in particular to an intelligent agent-based equipment maintenance method, industrial control system, electronic equipment, and medium. Background Technology

[0002] In AI systems for manufacturing, troubleshooting after downtime of intelligent manufacturing equipment such as semiconductor packaging and testing, and AOI inspection, heavily relies on manual labor. Maintenance personnel must travel to the site to consult manuals and troubleshoot the cause, with average downtime response times reaching tens of minutes. However, most equipment downtime issues can be resolved with simple operations such as restarting or repositioning the equipment. Manual on-site troubleshooting wastes significant time, and if the maintenance personnel make an incorrect diagnosis, the problem may remain unresolved. Existing technologies employ expert systems or large language models to analyze equipment logs and output fault diagnosis conclusions or maintenance suggestions in a single step. However, these solutions lack real-time interaction with the physical state of the equipment. When the diagnosis is inaccurate or the equipment remains abnormal after the suggested actions are performed, the system cannot dynamically adjust the diagnostic path and try alternative solutions based on real-time feedback from the equipment, failing to achieve closed-loop autonomous maintenance capabilities. Summary of the Invention

[0003] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes a device maintenance method, industrial control system, electronic equipment, and medium for intelligent agents, which can realize closed-loop autonomous maintenance of the industrial control system.

[0004] According to a first aspect of the present invention, a device maintenance method based on an intelligent agent is applied to an industrial control system, the system comprising a first intelligent agent and a plurality of system devices; the method comprising: Obtain input commands containing maintenance intent; The first intelligent agent iteratively executes a device control loop, wherein each round of the device control loop includes: The first intelligent agent invokes a large language model to generate structured decision instructions based on the input instructions and the current device state context, wherein the decision instructions include the function identifier of the skill function and the control parameters corresponding to the skill function; The first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform device actions, and / or is obtained after transforming the state parameters of the system device obtained by the skill function; The first intelligent agent updates the execution result generated in this round to the device state context, wherein the execution result is obtained based on the decision instruction and the physical interpretation information; When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

[0005] The embodiments of this invention have at least the following beneficial effects: This invention provides an agent-based equipment maintenance method, in which the agent invokes a large language model to iteratively execute a equipment control loop: In each loop, the agent generates a decision instruction based on user input commands and the current equipment state context. This decision instruction includes a skill function identifier and control parameters; the agent executes the decision instruction, driving the equipment to perform corresponding actions and obtain feedback information or equipment state parameters, and converts them into physical interpretation information; then, the execution result is updated in the equipment state context for reference in the next loop decision; when a preset termination condition is met, the first agent exits the loop. This invention combines the reasoning ability of a large language model with the real-time control capability of industrial equipment, forming a dynamic closed loop of "thinking-action-observation". After each execution, the agent obtains real-time physical state feedback of the equipment and dynamically adjusts subsequent decision instructions accordingly, enabling the agent to autonomously attempt to repair faults.

[0006] According to some embodiments of the present invention, the step of the first agent invoking a large language model to generate structured decision instructions based on the input instructions and the current device state context includes: The first intelligent agent performs keyword matching on the input instruction based on a preset keyword set, and determines the intent type corresponding to the input instruction based on the matching result; When the input instruction does not match any keyword in the preset keyword set, the first agent inputs the input instruction into the large language model and determines the intent type corresponding to the input instruction based on the analysis results of the large language model. The first intelligent agent retrieves supplementary diagnostic information associated with the intent type from a preset experience base according to the intent type, and generates an enhanced instruction based on the supplementary diagnostic information and the input instruction; wherein, the supplementary diagnostic information includes successful policy records and failed policy records; The first intelligent agent generates the decision instruction based on the enhanced instruction and the current device state context.

[0007] According to some embodiments of the present invention, after the step of the first intelligent agent calling the corresponding skill function according to the function identifier and the control parameters in the decision instruction to obtain physical interpretation information, the method further includes: The first intelligent agent obtains the execution result and generates an execution score based on the execution result; When the execution result is characterized as successful execution, the first agent generates the successful strategy record based on the skill function successfully invoked in this round and the physical interpretation information, and saves the successful strategy record and the execution score together in the experience base. When the execution result indicates execution failure, the first agent generates the failure strategy record based on the error information obtained in the current round of the device control loop, and saves the failure strategy record and the execution score together in the experience base.

[0008] According to some embodiments of the present invention, when the execution result indicates execution failure, the method further includes: The first intelligent agent inputs the error information into the large language model, determines the cause of failure based on the feedback result of the large language model, and updates the cause of failure into the device state context; In the next round of the device control cycle, the first agent generates the control parameters based on the failure reason in the device state context, and generates the decision instruction according to the control parameters.

[0009] According to some embodiments of the present invention, after the step of the first intelligent agent calling the corresponding skill function according to the function identifier and the control parameters in the decision instruction to obtain physical interpretation information, the method further includes: The first agent obtains at least one failed strategy record in the experience base whose execution score is lower than a preset threshold, and inputs the failed strategy record into the large language model to obtain an optimization scheme; The optimization scheme is written into the configuration file of the first intelligent agent in a hot-update manner, so that the subsequent device control loop is executed based on the updated configuration file.

[0010] According to some embodiments of the present invention, the system includes a plurality of first intelligent agents that can call each other, each first intelligent agent executing a corresponding device control loop; the step of the first intelligent agent calling a large language model to generate structured decision instructions based on the input instructions and the current device state context further includes: When the decision instruction generated by the first intelligent agent indicates that an assisting intelligent agent should be invoked, the first intelligent agent verifies whether the assisting intelligent agent belongs to the scope of target intelligent agents that are allowed to be invoked, according to a preset invocation whitelist. When the verification passes, the first agent sends a task request to the assisting agent specified by the decision instruction, wherein the assisting agent is another first agent, and the task request includes a task description and a global tracking identifier obtained based on the physical interpretation information. After receiving the task request, the assisting agent generates a collaborative analysis result based on the task description in its corresponding device control loop, and returns the collaborative analysis result to the first agent. The first intelligent agent updates the collaborative analysis results to the device state context and generates a new decision instruction based on the updated device state context.

[0011] According to some embodiments of the present invention, before the step of the first agent invoking a large language model to generate structured decision instructions based on the input instructions and the current device state context, the method further includes: The first intelligent agent matches the corresponding abnormal phenomenon node in a preset knowledge graph based on the input instruction or the physical explanation information in the device state context, and obtains at least one fault cause node connected to the matched abnormal phenomenon node; wherein, the knowledge graph includes multiple abnormal phenomenon nodes and multiple fault cause nodes, and the abnormal phenomenon nodes and the fault cause nodes are connected by association edges, each of the association edges having a corresponding probability weight. The first intelligent agent obtains the fault cause nodes based on the probability weights in descending order, forms a fault diagnosis result, and updates it to the device state context.

[0012] An industrial control system according to a second aspect of the present invention includes a first intelligent agent and a plurality of system devices, the system further comprising: The input module is used to acquire input commands that contain maintenance intentions; The intelligent agent maintenance module is used to iteratively execute a device control loop through the first intelligent agent, wherein each round of the device control loop includes: The first intelligent agent invokes a large language model to generate structured decision instructions based on the input instructions and the current device state context, wherein the decision instructions include the function identifier of the skill function and the control parameters corresponding to the skill function; The first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform device actions, and / or is obtained after transforming the state parameters of the system device obtained by the skill function; The first intelligent agent updates the execution result generated in this round to the device state context, wherein the execution result is obtained based on the decision instruction and the physical interpretation information; When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

[0013] An electronic device according to a third aspect of the present invention includes a memory and a processor, the memory being used to store at least one program, and the processor being used to load the at least one program to execute the agent-based device maintenance method described in the above-described aspects.

[0014] A computer-readable storage medium according to a fourth aspect of the present invention includes a memory and a processor, the memory being configured to store at least one program, and the processor being configured to load the at least one program to perform the agent-based device maintenance method described in the above-described aspects.

[0015] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0016] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart of the device control loop of the agent-based device maintenance method according to an embodiment of the present invention; Figure 2 This is a schematic block diagram of an industrial control system according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating the internal PLC communication module of the skill function in an embodiment of the present invention. Figure 4 This is a schematic block diagram of an industrial control system including multiple first intelligent agents according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the knowledge graph in an embodiment of the present invention; Figure 6 This is a structural diagram of an electronic device provided in another embodiment of the present invention. Detailed Implementation

[0017] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals characterize the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0018] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. Where "first," "second," etc., are used, they are merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly specifying the number of indicated technical features, or implicitly specifying the sequential relationship of the indicated technical features. The numbering of steps in this invention does not constitute a limitation on the order of execution.

[0019] In AI systems for manufacturing, troubleshooting after downtime of intelligent manufacturing equipment such as semiconductor packaging and testing, and AOI inspection, heavily relies on manual labor. Maintenance personnel must travel to the site to consult manuals and troubleshoot the cause, with average downtime response times reaching tens of minutes. However, most equipment downtime issues can be resolved with simple operations such as restarting or repositioning the equipment. Manual on-site troubleshooting wastes significant time, and if the maintenance personnel make an incorrect diagnosis, the problem may remain unresolved. Existing technologies employ expert systems or large language models to analyze equipment logs and output fault diagnosis conclusions or maintenance suggestions in a single step. However, these solutions lack real-time interaction with the physical state of the equipment. When the diagnosis is inaccurate or the equipment remains abnormal after the suggested actions are performed, the system cannot dynamically adjust the diagnostic path and try alternative solutions based on real-time feedback from the equipment, failing to achieve closed-loop autonomous maintenance capabilities.

[0020] The concepts involved in this invention are explained below: Large Language Model: A reasoning model trained on massive amounts of text data, capable of natural language understanding and generation; PLC: Programmable Logic Controller; CLI: Command Line Interface, is a text-based interactive method that allows direct control of the operating system or applications via text commands; MCP is an open standard protocol designed specifically for AI models to unify the connection with external data sources and tools, enabling AI to perform actual operations such as reading files and querying databases.

[0021] Please refer to Figures 1-3 , Figure 1 This is a flowchart of the equipment control loop in an agent-based equipment maintenance method, which is applied to... Figure 2 The industrial control system shown includes a first intelligent agent and several system devices; the method specifically includes: Step S100: Obtain an input command containing the maintenance intent; It should be noted that, in this embodiment of the invention, the input command is natural language text or JSON structured text input by the operator of the industrial control system through an interactive interface. It contains information such as error codes, descriptions of fault phenomena, or action debugging requirements. It describes the operator's maintenance requests for the system equipment, such as "The robotic arm is stuck, error code is D410=88". The maintenance intent refers to the user's actual needs and goals implied in the input command. These typically include fault diagnosis, status restoration, single-step action debugging, test sequence generation, or test log analysis of the system equipment. The maintenance intent can be semantically understood using a large language model or type-matched using keyword matching or other methods.

[0022] Step S200: The first agent iteratively executes the device control loop, wherein each round of the device control loop includes: It should be noted that the equipment control loop is a closed-loop iterative process of "Think-Action-Observe" (TAO) driven by a first agent, integrating large language model reasoning with real-time control of industrial equipment. In each round of the equipment control loop, the first agent relies on the large language model to sequentially execute the Think phase, the Act phase, and the Observe phase. The equipment control loop effectively combines the first agent's own "Think-Action-Observe" ability, the reasoning ability of the large language model, and the real-time control capability of the industrial equipment, realizing autonomous equipment maintenance of the industrial control system. The specific content of the equipment control loop is shown below.

[0023] Step S210: The first intelligent agent invokes the large language model to generate a structured decision instruction based on the input instruction and the current device state context. The decision instruction includes the function identifier of the skill function and the control parameters corresponding to the skill function. It should be noted that step S210 is the Think phase of the device control loop. In each Think phase, the first agent serializes the device state context into a device state context containing information such as user tasks, current execution records, and current iteration information. This enables the large language model to reason based on the complete device state context and generate decision instructions that dynamically match the current device state, thereby ensuring the continuity of the state and the dynamism of the decisions between multiple loops. In this embodiment of the invention, the device state context refers to a data structure maintained by the first agent during the iterative execution of the device control loop. It at least aggregates user input instructions, the current loop number, and the physical explanation information and skill execution results generated in each loop. The first agent can also construct the device state context as prompt text and input it into the large language model, so that the large language model, based on understanding the current fault phenomenon and the completed troubleshooting history, can output structured decision instructions containing the thinking process, skill function identifiers, and control parameters through reasoning. Understandably, during each iteration of the device control loop, information related to device maintenance is gradually added to the device state context. For example, the device state context in the first round includes indications such as the current loop number and the maximum iteration limit. When an input command is entered in the first round, it is integrated into the device state context to prevent the model from forgetting its initial purpose in subsequent iterations. In subsequent rounds, the device state context, in addition to containing the original input command, the current loop number, and the maximum iteration limit, also includes historical execution records generated and accumulated in each loop. Each historical execution record records the thought process, the skill identifier invoked, the execution result, and physical explanation information for that round. Furthermore, in some embodiments, the decision command refers to a structured object (such as JSON) output by the large language model during the Think phase of each device control loop. This object encapsulates the complete output of the inference in this round and, in some embodiments, includes the following fields: thought: The thought process text generated by the large language model regarding the current fault phenomenon and troubleshooting strategy, i.e., the thought text of the large language model; action_type: Action type identifier, used to indicate the type of action to be executed in this round. Typical action types include call_skill (calling device operation skills), call_agent (calling other intelligent agents), and finish (ending the task or requesting human intervention). skill_name: When the action type is call_skill, this field is the function identifier of the target skill function in the pre-configured set of skill functions, used for looking up in the skill registry, i.e., the function identifier of the skill function; skill_params: Control parameters passed to the target skill function, specifying specific execution details in key-value pairs, such as the axis of motion and the distance of motion; content: When the action type is finish or answer, this field contains the text content of the final answer or diagnosis.

[0024] A specific example of a decision instruction in JSON format is as follows: { "thought": "your thought process" "action_type": "call_skill / call_agent / answer / finish", "skill_name": "Skill Name", "skill_params": {{x1: ,x2: ,x3:}}, "content": "Answer content" } Decision instructions serve as a structured interface between the first agent's reasoning and skill execution. Their effect is to transform the natural language reasoning results of the large language model into formal instructions that can be precisely scheduled by the skill execution layer, so that subsequent device control actions can be accurately executed based on the latest diagnostic reasoning results, rather than simply outputting the natural text output by the large language model.

[0025] It is understood that the large language model invoked by the first intelligent agent in this embodiment of the invention can be deployed locally in the industrial control system or can communicate and connect with an external model.

[0026] In step S220, the first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform the device action, and / or is obtained after transforming the state parameters of the system device obtained by the skill function. It should be noted that step S220 is the Act phase of the device control loop. This phase specifically includes: the first agent parses the decision instruction generated in the current round, for example, extracting the action_type field from the JSON. When action_type is call_skill, the function identifier of the target skill function is obtained from the skill_name field, and the control parameters in key-value pair form are obtained from the skill_params field; the first agent calls the skill registry, using the current agent name and skill_name as parameters to find the corresponding skill function. After the search is completed, the skill function is called and the corresponding control parameters are passed in to drive the system device to perform device actions, and / or obtain the system device's status parameters and convert them into physical interpretation information.

[0027] Specifically, a skill function is essentially an executable functional unit. Each skill function encapsulates an atomic operation or status check capability for a system device. For device control skills, the skill function sends control commands to the programmable logic controller (PLC) controlling the corresponding system device via an industrial communication protocol, driving the system device to perform the corresponding physical action. For status check skills, the skill function reads the raw value (i.e., the status parameter, such as 88 read from D410) from a designated register of the PLC and uses the built-in status semantic mapping rules and / or the recognition of the large language model to convert the status parameter into physical interpretation information in the form of natural language text (e.g., mapping 88 to "robotic arm failed to grasp"). This allows the large language model to obtain an understandable semantic description of the device status without having to access the underlying register addresses and raw values.

[0028] In some embodiments, the functions that the skill function can achieve include three cases: driving the system device to perform actions and obtaining feedback information, obtaining state parameters and transforming them, and both driving the device to perform actions and obtaining and transforming state parameters.

[0029] In one embodiment, when the reset skill `reset_position` is called, a 1 is written to the M200 register of the programmable logic controller, triggering the robot arm to reset. Subsequently, the D430 register is read cyclically to confirm the completion status; if a timeout occurs, an error message is returned. It can be understood that the confirmation status here refers to "robot arm reset successful," and the error message can refer to "robot arm reset failed." This information can be converted into physical interpretation information by the built-in `error_map` dictionary of the skill function, or directly understood as physical interpretation information by the large language model.

[0030] In one embodiment, when the error checking skill check_machine_errors is invoked, the status parameter is read from the D410 register of the programmable logic controller, and the value is converted into physical interpretation information (such as 88 → "robotic arm grasping failed") through the built-in error_map dictionary or large language model, without sending any control commands to control the system equipment to move.

[0031] In one embodiment, when the move_to_dut_position skill is invoked, it first reads the device error status from register D410. If an error exists, it retrieves physical interpretation information based on the status parameters in the register; if normal, it writes 1 to register M100 to drive the robot arm to move, and then cyclically reads register D420 to confirm completion. This skill, in a single invocation, both sends control commands and reads register values, converting them into physical interpretation information. It is understandable that move_to_dut_position differs from a reset command; this command first requires acquiring status parameters, then driving the device to move, and finally obtaining feedback information.

[0032] In some embodiments, skill functions are derived based on the PLC's CLI encoding architecture. In this architecture, each skill function corresponds to a standardized command-line interface identifier, i.e., the function identifier. Specific examples of these function identifiers include: move_to_dut (the robot moves to the pick-up position); pick_dut (picks up the device under test); check_machine_errors (reads the PLC error code register and returns the fault description); and reset_position (the robot resets to the starting position). The mapping relationship between the function identifiers and the skill functions is recorded in the skill registry. After parsing the decision instruction, the first agent uses the corresponding function identifier as the key to find the object of the corresponding skill function and executes it. The specific function corresponding to the function identifier has been pre-injected into the device state context in the form of skill help text. The large language model can identify and output the corresponding skill name based on this when generating decision instructions. When a function identifier includes a parameter portion (e.g., move_to_dut -- target for material retrieval), the first agent first attempts to search for the complete string. If the search fails, it calls a CLI format parsing function to parse the command string, extracting the clean skill name and parameter dictionary, then queries the registry again and passes in the parameters for execution. This CLI encoding architecture allows the large language model to drive underlying industrial equipment to perform actions or obtain status data simply by outputting text according to the agreed CLI command format, without needing to understand the PLC's register addresses and communication protocols.

[0033] Furthermore, such as Figure 3As shown, the skill function also encapsulates a communication module based on industrial communication protocols (such as Modbus TCP), enabling direct read and write operations on the PLC registers of the control system equipment. This PLC communication module has a built-in address resolution function, supporting multiple PLC address formats, including M address (internal relay, decimal resolution), D address (data register, decimal resolution), X address (input terminal, hexadecimal resolution), and Y address (output terminal, hexadecimal resolution). Through this resolution mechanism, read and write operations on PLC registers within the skill function are initiated using a unified string address format (such as "D410", "M100"). The communication module automatically completes the address conversion and protocol encapsulation, shielding the underlying hardware differences. This eliminates the need for the upper-level first-level intelligent agent to handle physical address mapping and base conversion issues for different PLC models. Furthermore, the large language model can directly understand the function's purpose and function through the CLI instruction's corresponding function, without needing to obtain the code corresponding to the skill function itself.

[0034] Step S230: The first intelligent agent updates the execution result generated in this round to the device state context, wherein the execution result is obtained based on the decision instruction and physical interpretation information; It should be noted that step S230 is the Observe phase of the device control loop. In step S220, after the skill function completes execution, it returns a result to the first agent containing fields such as status_message (physical explanation information), success (execution result, used to indicate whether the execution was successful or not using True or False), and error_code (original state parameters). The specific content varies depending on the skill type, mainly including physical explanation information obtained based on the feedback information of the device actions, physical explanation information after the device state parameters are transformed by the conversion rules built into the skill function, and physical explanation information containing both of the above. The first agent writes the decision instruction generated in this round and the above execution result into the device state context. The updated context is serialized into prompt words in the next Think phase, enabling the large language model to dynamically adjust subsequent decision instructions based on the actual state feedback of the device after this round of operation.

[0035] Step S240: When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

[0036] It should be noted that step S240 is the exit judgment node of the device control loop, which is executed after each round of the Observe phase. The exit conditions include three situations: First, the physical interpretation information indicates that the system device is in normal operation. For example, after the state parameters read from the programmable logic controller by the state check skill function are transformed by the semantic mapping rules, the corresponding physical interpretation information indicates that the device is fault-free (e.g., error code 0 corresponds to "normal operation"); Second, the current round of the device control loop has reached the preset maximum round. This condition is used to prevent the large language model from getting stuck in an infinite loop when it cannot converge. If the fault is still not resolved in the device state context before exiting the loop based on this condition, it can be configured to notify maintenance personnel to intervene through system messages, etc.; Third, the large language model indicates in the decision instruction of the above-mentioned embodiment that the current fault is beyond the processing range of the skill function and outputs the conclusion that manual intervention is required (indicated in the thought field as "the probe needs to be replaced manually", and the action_type is finish). The judgment basis for the above three exit conditions is the objective data (physical explanation information, cycle count, and thinking results in decision instructions) generated in steps S220 and S230, without relying on external manual judgment.

[0037] It should be noted that steps S210 to S240 constitute a complete closed loop of the equipment control cycle. Through multiple iterations of "generating decision instructions—calling skill functions to obtain real-time feedback from the equipment—updating the semantic state to the context—making new decisions based on the updated context," the reasoning capabilities of the large language model are combined with the real-time control capabilities of industrial equipment. This enables the industrial control system to autonomously complete the entire maintenance process from fault identification and operation execution to repair verification when facing simple faults such as software crashes, incorrect parameter modifications, and temporary sensor jitter, restoring normal equipment operation without human intervention. At the same time, when facing faults that are difficult to repair autonomously, it can also promptly notify maintenance personnel to intervene.

[0038] Furthermore, step S210 in the above-described embodiments also includes, but is not limited to, the following steps: Step S211: The first intelligent agent performs keyword matching on the input command based on a preset keyword set, and determines the intent type corresponding to the input command based on the matching result; Step S212: When the input instruction does not match any keyword in the preset keyword set, the first agent inputs the input instruction into the large language model and determines the intent type corresponding to the input instruction based on the analysis results of the large language model. Step S213: The first intelligent agent retrieves supplementary diagnostic information associated with the intent type from a preset experience base according to the intent type, and generates enhanced instructions based on the supplementary diagnostic information and input instructions; wherein, the supplementary diagnostic information includes successful policy records and failed policy records; In step S214, the first intelligent agent generates a decision instruction based on the enhanced instruction and the current device state context.

[0039] It should be noted that steps S211-S212 constitute the two-level intent recognition mechanism of this invention, including an A1-level keyword matching mechanism and an A2-level large-scale model semantic recognition mechanism. Specifically, regarding the keyword matching mechanism in step S211, the first agent maintains a preset keyword set in the system. Each keyword in the preset keyword set corresponds to an intent type (e.g., "go to material retrieval position" corresponds to a single-action debugging intent, and "test sequence" corresponds to a test sequence generation intent). When the user input command contains a keyword associated with a certain intent type, the first agent directly determines that intent type as the intent type of the current maintenance task, without needing to call the large-scale language model. The large-scale language model inference mechanism in step S212 is the intent recognition method when keyword matching fails. This state indicates that the expression of the user input command is not within the scope of the preset keywords. In this case, the first agent submits the input command to the large-scale language model for semantic analysis. The large-scale language model understands the natural language meaning of the command and outputs the corresponding intent type. Steps S211-S212 transform the user's ambiguous repair intention into specific constraints on skill function selection, avoiding erroneous calls between unrelated skills by the large language model and improving the matching accuracy between decision instructions and the user's actual needs. Furthermore, this embodiment of the invention includes a persistent memory layer scheme, i.e., an experience base. After determining the intention type, the first agent retrieves supplementary diagnostic information associated with that intention type from the preset experience base. This supplementary diagnostic information specifically includes historical successful strategy records and failed strategy records. The first agent merges these records with the original input instruction to form an enhanced instruction. The enhanced instruction not only retains the user's repair needs but also implicitly or explicitly includes past handling experience for that intention—successful strategy records provide reusable solution references for decision-making, while failed strategy records warn of ineffective paths to be avoided. Finally, after determining the intent type, the first agent injects it as a constraint into the inference context of the large language model (e.g., loading the prompt word template and available skill list corresponding to the intent type). When generating decision instructions, the large language model is constrained by the intent type, and the output skill_name field will point to the skill function matching the intent type. For example, under the single-action debugging intent, the large language model tends to choose device control skills such as move_to_dut and reset_position, rather than log analysis skills. After obtaining the intent type, the first agent checks the experience database. If the same problem has been encountered before, the corresponding successful strategy record and / or failed strategy record will be transmitted to the large language model, making the decision instructions generated by the large language model more accurate and faster.

[0040] It is understandable that the experience base, which stores records of successful and failed strategies, differs from the device state context in the embodiments described above. The device state context is a temporary data structure maintained by the agent within a single maintenance session, used to provide real-time reasoning for the large language model in each round of device control loop, and is destroyed or archived after the session ends. In contrast, the experience base is a persistent storage component of the first agent, constituting the memory layer data of the agent's evolutionary system, which is saved across sessions in file form. It is used to accumulate historical success and failure experiences, providing the evolutionary layer with cross-session statistical analysis and global optimization in subsequent tasks.

[0041] In addition, after step S220 of the above-described embodiments, the following steps are included, but are not limited to: Step S221: The first intelligent agent obtains the execution result and generates an execution score based on the execution result; Step S222: When the execution result is characterized as successful execution, the first agent generates a successful strategy record based on the skill function and physical interpretation information successfully invoked in this round, and saves the successful strategy record and execution score together in the experience base. Step S223: When the execution result indicates execution failure, the first agent generates a failure strategy record based on the error information obtained in the current round of device control loop, and saves the failure strategy record and execution score together in the experience base.

[0042] It should be noted that this invention also integrates an evolutionary mechanism for the agent. This mechanism integrates a three-layer structure—a memory layer, a reflection layer, and an evolutionary layer—into the agent, enabling the first agent to persistently record the execution results in the recognition and control loop. These results serve as a reference for analysis by the large language model in subsequent loops, allowing the parameters corresponding to successful execution results to be retained as "experience." Steps S221 to S223 are the execution steps corresponding to the memory and reflection layers of this evolutionary mechanism. After the skill function is executed, regardless of success or failure, a structured execution result is returned, such as JSON format text. The text contains a "success" field indicating success, an "error" field indicating error information, and a "status_message" field indicating physical explanation information; or other data formats that can be understood by the large language model and represent the success or failure of execution. After extracting the returned information, the first agent generates an execution score based on preset scoring rules. In some embodiments, the scoring rules adopt a four-dimensional scoring system, including: a base score (BASE_SCORE_MAX, score is given if there are no errors), an accuracy score (ACCURACY_SCORE_MAX, degree of matching between the result and the expected goal), an efficiency score (EFFICIENCY_SCORE_MAX, number of iterations required to complete the task), and a safety score (SAFETY_SCORE_MAX, whether repetitive actions or dangerous operations occur). The maximum score for the above four dimensions is 20 points. In addition, if a repetitive action is detected, the execution result is directly rated as 0 points. It is understood that the above four-dimensional scores can be given after the execution result is understood and analyzed by a large language model. The large language model used for scoring is not the same model as the large language model called by the first agent. It cannot obtain other information (such as information outside the current iteration in the device state context) except for information related to the execution result, thus avoiding bias in the scoring of the execution result by the large language model.

[0043] Furthermore, when the execution result indicates successful execution (e.g., the success field is true), it indicates that the skill function called in this round of device control loop has successfully completed the expected operation. At this time, the first agent extracts the identifier of the successfully called skill function, the input control parameters, and the physical explanation information driving this call in the device state context (i.e., the phenomenon description based on which the large language model determines that this skill needs to be executed), and combines this information into a successful strategy record. This record is essentially a mapping triple of "symptom-diagnosis conclusion-effective solution". The first agent associates this successful strategy record with the execution score generated in step S221 and saves it together in the experience base maintained by the first agent. In subsequent maintenance tasks, when encountering a fault of the same type as one previously repaired (determined based on intent type or large language model considerations), the first agent can query the experience base, sort by execution score, and prioritize the reuse of verified high-scoring successful strategies, thereby shortening the diagnosis and repair path.

[0044] Furthermore, when the execution result indicates execution failure (e.g., the success field is false) or the returned result contains error information, it indicates that the skill function called in this round failed to execute successfully. At this time, the first agent extracts the error message text from the error field returned by the skill function, performs text content recognition to determine the root cause type of failure. Specific root cause types include: interface errors (e.g., network timeout, slow service response), logic errors (e.g., intent recognition failure, incorrect skill function selection), and ambiguous prompts (e.g., unclear instructions, missing parameters). Based on the identified root cause type, combined with the error information and context of this round, the first agent generates a failure strategy record containing the root cause type, error mode, and corresponding scenario description, and associates this record with the execution score of this round, saving it to the experience base.

[0045] In addition, after step S223 in the above-described embodiments, the following steps are included, but are not limited to: Step S2231: The first intelligent agent inputs the error information into the large language model, determines the cause of failure based on the feedback result of the large language model, and updates the cause of failure to the device state context; In step S2232, in the next round of device control loop, the first agent generates control parameters based on the failure reasons included in the device state context, and generates decision instructions based on the control parameters.

[0046] It should be noted that steps S224 and S225 are steps to adjust the control parameters based on the feedback of the failed execution result. When the execution result of the skill function in step S220 indicates execution failure, the first agent extracts error information from the execution result returned by the skill function (such as "movement timeout", "parameter verification failure", or the abnormal status code returned by the PLC in the error field). Subsequently, the first agent submits this error information along with the device status context of the current round to the large language model. The large language model combines the above information to perform reasoning analysis and identify the specific reason for the execution failure. The feedback result of the large language model may include the category of the failure reason (such as communication timeout, unreasonable parameters, device busy, etc.) and the corresponding text description. After writing the failure reason into the device state context in step S224, in the Think phase of the next round of device control loop, when the large language model generates decision instructions, in addition to referring to user input instructions and physical explanation information from the previous round, it can also modify the corresponding parameters in the skill_params field in the decision instructions generated in this round after determining that the failure in the previous round was due to unreasonable control parameters (such as insufficient movement distance, too short waiting time, or too fast movement speed), generate adjusted control parameters, and call the same target skill function again.

[0047] In one embodiment of the present invention, when the first intelligent agent calls the move_to_dut_position skill function via a decision instruction and passes in the original control parameters {"distance": 10, "speed": 5} to drive the robot arm to move 10cm to the picking position, if the skill function returns the error message "movement timeout" after execution, then step S224 is executed. The large language model analyzes the error message and determines the cause of failure based on the context as "insufficient movement distance, the target position may not be at 10cm". In the next round of equipment control loop, the first intelligent agent generates the control parameters {"distance": 20, "speed": 5} based on the cause of failure and calls the move_to_dut_position skill function again to try to move the robot arm to a further 20cm. If the execution is successful after modifying the parameters, the successful experience can be saved to the experience base as a successful strategy record in subsequent steps; if it still fails, further adjustments can be made based on the new error message, or the fault can be judged to be beyond the scope of automatic processing and manual intervention can be triggered.

[0048] In addition, after step S220 of the above-described embodiments, the following steps are included, but are not limited to: Step S224: The first agent obtains at least one failed policy record from the experience base whose execution score is lower than a preset threshold, and inputs the failed policy record into the large language model to obtain an optimization scheme; Step S225: The optimization scheme is written into the configuration file of the first intelligent agent in a hot update manner so that subsequent device control loops are executed based on the updated configuration file.

[0049] It should be noted that steps S224-S225 are the execution steps corresponding to the evolutionary layer of the first agent's evolutionary mechanism. After multiple rounds of equipment control cycles or multiple maintenance sessions, a certain number of failure strategy records have accumulated in the experience base (each record includes the failure root cause type, error mode, corresponding skill function identifier, and execution score). When the evolutionary layer is triggered, the first agent filters out failure strategy records from the experience base whose execution scores are lower than a preset threshold (e.g., 10 points, which is defined in the field of the configuration file). The first agent constructs the filtered failure strategy records and their corresponding context information (e.g., the physical explanation information at the time, the cycle number, the sequence of skill functions called, etc.) into analysis prompt words and inputs them into the large language model. This optimization scheme may include: suggestions for adjusting the default values ​​of skill function control parameters, optimized text for prompt word templates of specific intent types, guiding constraints on skill selection strategies, or corrections to configuration parameters such as timeout thresholds under specific failure modes. Furthermore, the optimization scheme generated by the large language model is verified by the first agent and then written into the agent's configuration file in a hot-update manner. Understandably, the agent's configuration file is a YAML file (such as llm_config_maintenance.yaml), containing tunable items such as evolution configuration, intent cue word templates, and default values ​​for skill parameters. The first agent converts the optimization scheme generated in step S224 into modifications to the aforementioned YAML configuration items and takes effect immediately through a hot update mechanism without requiring a service restart. For example, if the optimization scheme suggests adjusting the timeout threshold, the corresponding parameter in evolution_config is updated; if the optimization scheme improves the cue word for a certain intent type, the prompt field under the corresponding intention_prompts is modified. The updated configuration file is loaded in subsequent device control loops, ensuring that the inference context of the large language model, the default parameters for skill invocation, and the threshold for evolution scoring all follow the optimized rules.

[0050] It is understandable that steps S224 and S225, together with the aforementioned steps S222 and S223, constitute a complete three-layer evolutionary architecture. Specifically, step S222 corresponds to the memory layer (storing successful experiences), step S223 corresponds to the reflection layer (analyzing and categorizing individual failures), and steps S224 and S225 correspond to the evolutionary layer (aggregating analysis across sessions and generating persistent optimization solutions). The effect of this architecture is that the agent accumulates structured experience data through the memory and reflection layers in a single maintenance task, identifies systemic problem patterns and generates optimization solutions across tasks through the evolutionary layer, achieving continuous improvement of its own decision-making logic. This allows the agent's diagnostic accuracy and repair success rate to automatically increase with the number of uses.

[0051] Additionally, refer to Figure 4 The industrial control system of this invention includes multiple first intelligent agents that can call each other, and each first intelligent agent executes a corresponding device control loop; in step S210 of the above-mentioned embodiment, the following steps are also included but not limited to: Step S214: When the decision instruction generated by the first intelligent agent indicates that an assisting intelligent agent should be invoked, the first intelligent agent verifies whether the assisting intelligent agent belongs to the scope of the target intelligent agents that are allowed to be invoked, according to the preset invocation whitelist. Step S215: When the verification is successful, the first agent sends a task request to the assisting agent specified by the decision instruction, wherein the assisting agent is another first agent, and the task request includes a task description and a global tracking identifier obtained based on physical interpretation information. Step S216: After receiving the task request, the assisting agent generates a collaborative analysis result based on the task description in its corresponding device control loop and returns the collaborative analysis result to the first agent. In step S217, the first agent updates the collaborative analysis results to the device state context and generates new decision instructions based on the updated device state context.

[0052] It should be noted that steps S215 to S217 are the execution steps corresponding to the harness intermodulation mechanism in this embodiment of the invention. In some embodiments of the invention, such as... Figure 4 As shown, the industrial control system does not deploy a single intelligent agent, but rather multiple specialized intelligent agents (such as maintenance agents, knowledge graph agents, and data analysis agents) to collaboratively execute maintenance tasks. These specialized intelligent agents (such as maintenance agents, knowledge graph agents, and data analysis agents) can dynamically invoke other agents to assist in completing analysis tasks beyond their own capabilities during their own reasoning process, based on task requirements.

[0053] Specifically, in the Think phase of the device control loop, the decision instructions generated by the large language model may include action types that call other intelligent agents. At this time, the decision instructions also include the identifier of the target assisting intelligent agent and a description of the task requiring assistance. Before formally initiating the call, the first intelligent agent queries a preset call whitelist dictionary to verify whether the target assisting intelligent agent is within the allowed call range; this dictionary uses the caller's intelligent agent name as the key and a list of allowed target intelligent agent names as the value. Once the verification is successful, the first intelligent agent constructs a task request, which includes a task description derived from the physical interpretation information in the current device state context (e.g., "The device has error code D410=88, please help diagnose possible causes of the fault"), the current session identifier, the caller's intelligent agent identifier, and a globally unique tracking identifier. This tracking identifier is automatically generated by the system when not passed from upstream, using a format of a universally unique identifier concatenated with a hexadecimal string. Simultaneously, the first intelligent agent obtains the current session's state storage object and appends the call information (including the caller identifier, target intelligent agent identifier, task description, and timestamp) to the session's call stack for subsequent call chain tracing and auditing.

[0054] Furthermore, after receiving a task request, the assisting agent operates in an independent session within its own device control loop. Similar to the loop logic of the first agent executing device maintenance tasks, the assisting agent also executes a complete device control loop: in the decision generation phase, the assisting agent uses the received task description as its user input instruction and combines it with its own device state context to generate decision instructions; in the execution phase, it executes relevant skills from its pre-configured skill function set (such as the graph query skill of the knowledge graph agent: matching abnormal phenomenon nodes based on symptom information and obtaining associated fault cause nodes, sorting them in descending order of probability weight, and outputting the fault diagnosis results); in the state update phase, it updates its context with the analysis results and forms a collaborative analysis result. After loop convergence, the assisting agent returns a structured response containing diagnostic conclusions, analysis results, and global tracking identifiers to the first agent. Upon receiving this collaborative analysis result, the first agent updates it in its current device state context. In the next round of decision generation, the large language model can perceive the analysis conclusions provided by the assisting agent and adjust subsequent diagnostic paths and skill selection strategies accordingly.

[0055] Additionally, refer to Figure 5 Prior to step S210 in the above-described embodiments, the following steps are included, but are not limited to: Step S201: The first intelligent agent matches the corresponding abnormal phenomenon node in the preset knowledge graph based on the physical interpretation information in the input command or device state context, and obtains at least one fault cause node connected to the matched abnormal phenomenon node; wherein, the knowledge graph includes multiple abnormal phenomenon nodes and multiple fault cause nodes, and the abnormal phenomenon nodes and fault cause nodes are connected by association edges, and each association edge has a corresponding probability weight. In step S202, the first intelligent agent obtains the fault cause nodes based on the probability weight in descending order, forms a fault diagnosis result, and updates it to the device state context.

[0056] It should be noted that steps S201 to S202 constitute a knowledge graph-assisted diagnostic process, which can be executed before each round of generating decision instructions, providing the first intelligent agent with candidate fault reasoning capabilities based on domain knowledge. Figure 5 This is an example of a knowledge graph. The description of the anomaly originates from the device state context. It can be physical explanation information updated to the context in the previous cycle (e.g., "robotic arm failed to grasp"), or it can be an error code or fault phenomenon directly carried in the user's input command (e.g., "D410=88"). The knowledge graph is a pre-constructed graph structure containing anomaly nodes and fault cause nodes, connected by directed edges. The value on each edge represents the probability weight of the anomaly caused by the corresponding fault cause. When the first agent executes step S201, it takes the anomaly description as input, matches the corresponding anomaly node in the knowledge graph, and obtains all directly connected fault cause nodes along the associated edges. Subsequently, in step S202, the first agent sorts the obtained fault cause nodes in descending order according to the probability weight of each associated edge, forming a fault diagnosis result list sorted from high to low probability, and updates this list to the device state context. This diagnostic result enables subsequent decision-making instructions to prioritize and systematically investigate candidate fault causes. If the problem remains unresolved after investigating the highest probability factor, the system automatically switches to the next highest probability factor in the next round, achieving a structured fault reasoning and troubleshooting strategy and reducing ineffective trial-and-error rounds. In some embodiments of this invention, the first intelligent agent can query the knowledge graph through skill functions during the device control loop, and the knowledge graph can also be specifically assigned to a first intelligent agent, such as the knowledge graph intelligent agent in the above-mentioned embodiments.

[0057] Reference Figure 2 , Figure 4 According to an embodiment of the second aspect of the present invention, an industrial control system includes a first intelligent agent and several system devices, the system further including: The input module is used to acquire input commands that contain maintenance intentions; The intelligent agent maintenance module is used to iteratively execute the equipment control loop through a first intelligent agent, wherein each round of the equipment control loop includes: The first intelligent agent invokes a large language model to generate structured decision instructions based on the input instructions and the current device state context. The decision instructions include the function identifier of the skill function and the control parameters corresponding to the skill function. The first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform the device action, and / or is obtained after transforming the state parameters of the system device obtained by the skill function; The first intelligent agent updates the execution result generated in this round to the device state context. The execution result is obtained based on the decision instructions and physical interpretation information. When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

[0058] It should be noted that the industrial control system provided in this embodiment generates structured decision instructions by calling a large language model through a first intelligent agent. Based on the function identifier and control parameters in the instructions, it schedules the corresponding skill functions, combining the reasoning capabilities of the large language model with the real-time control capabilities of industrial equipment. The skill functions encapsulate the control operations or state acquisition capabilities of the system equipment. Through conversion rules, the original state parameters of the equipment are transformed into physical interpretation information that the large language model can directly understand. This allows the intelligent agent to dynamically adjust subsequent decision instructions based on the state feedback of the equipment after each round of operation, thus forming a closed-loop control of "generating decision instructions—executing equipment operations—acquiring and converting state feedback—updating the context and making new decisions." This system achieves autonomous diagnosis and repair of simple equipment faults, completing the entire maintenance process from fault identification and operation execution to repair verification without human intervention.

[0059] like Figure 6 As shown, Figure 6 This is a structural diagram of an electronic device provided in one embodiment of the present invention. The present invention also provides an electronic device, comprising: The processor 801 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 802 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and called and executed by the processor 801 using the agent-based device maintenance method of the embodiments of this application. The 803 input / output interface is used to implement information input and output. The communication interface 804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 805 transmits information between various components of the device (e.g., processor 801, memory 802, input / output interface 803, and communication interface 804); The processor 801, memory 802, input / output interface 803, and communication interface 804 are connected to each other within the device via bus 805.

[0060] It should be noted that the electronic device executing the agent-based device repair method in the embodiments of the present invention, as well as any other electronic device that can be used to execute the method, are not specifically limited in the present invention.

[0061] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate, and may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0062] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0063] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.

Claims

1. A device maintenance method based on intelligent agents, characterized in that, Applied to an industrial control system, the system comprising a first intelligent agent and several system devices; the method includes: Obtain input commands containing maintenance intent; The first intelligent agent iteratively executes a device control loop, wherein each round of the device control loop includes: The first intelligent agent invokes a large language model to generate structured decision instructions based on the input instructions and the current device state context, wherein the decision instructions include the function identifier of the skill function and the control parameters corresponding to the skill function; The first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform device actions, and / or is obtained after transforming the state parameters of the system device obtained by the skill function; The first intelligent agent updates the execution result generated in this round to the device state context, wherein the execution result is obtained based on the decision instruction and the physical interpretation information; When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

2. The device maintenance method based on intelligent agents according to claim 1, characterized in that, The step of the first intelligent agent invoking a large language model to generate structured decision instructions based on the input instructions and the current device state context includes: The first intelligent agent performs keyword matching on the input instruction based on a preset keyword set, and determines the intent type corresponding to the input instruction based on the matching result; When the input instruction does not match any of the keywords in the preset keyword set, the first agent inputs the input instruction into the large language model and determines the intent type corresponding to the input instruction based on the analysis results of the large language model. The first intelligent agent retrieves supplementary diagnostic information associated with the intent type from a preset experience base according to the intent type, and generates an enhanced instruction based on the supplementary diagnostic information and the input instruction; wherein, the supplementary diagnostic information includes successful policy records and failed policy records; The first intelligent agent generates the decision instruction based on the enhanced instruction and the current device state context.

3. The device maintenance method based on intelligent agents according to claim 2, characterized in that, After the first intelligent agent calls the corresponding skill function to obtain physical interpretation information based on the function identifier and control parameters in the decision instruction, the method further includes: The first intelligent agent obtains the execution result and generates an execution score based on the execution result; When the execution result is characterized as successful execution, the first agent generates the successful strategy record based on the skill function successfully invoked in this round and the physical interpretation information, and saves the successful strategy record and the execution score together in the experience base. When the execution result indicates execution failure, the first agent generates the failure strategy record based on the error information obtained in the current round of the device control loop, and saves the failure strategy record and the execution score together in the experience base.

4. The device maintenance method based on intelligent agents according to claim 3, characterized in that, When the execution result indicates execution failure, the method further includes: The first intelligent agent inputs the error information into the large language model, determines the cause of failure based on the feedback result of the large language model, and updates the cause of failure into the device state context; In the next round of the device control cycle, the first agent generates the control parameters based on the failure reason in the device state context, and generates the decision instruction according to the control parameters.

5. The device maintenance method based on intelligent agents according to claim 3, characterized in that, After the first intelligent agent calls the corresponding skill function to obtain physical interpretation information based on the function identifier and control parameters in the decision instruction, the method further includes: The first agent obtains at least one failed strategy record in the experience base whose execution score is lower than a preset threshold, and inputs the failed strategy record into the large language model to obtain an optimization scheme; The optimization scheme is written into the configuration file of the first agent in a hot-update manner, so that the subsequent device control loop is executed based on the updated configuration file.

6. The device maintenance method based on intelligent agents according to claim 1, characterized in that, The system includes multiple first intelligent agents that can call each other, and each first intelligent agent executes its corresponding device control loop. The step of the first intelligent agent invoking a large language model to generate structured decision instructions based on the input instructions and the current device state context further includes: When the decision instruction generated by the first intelligent agent indicates that an assisting intelligent agent should be invoked, the first intelligent agent verifies whether the assisting intelligent agent belongs to the scope of target intelligent agents that are allowed to be invoked, according to a preset invocation whitelist. When the verification passes, the first agent sends a task request to the assisting agent specified by the decision instruction, wherein the assisting agent is another first agent, and the task request includes a task description and a global tracking identifier obtained based on the physical interpretation information. After receiving the task request, the assisting agent generates a collaborative analysis result based on the task description in its corresponding device control loop, and returns the collaborative analysis result to the first agent. The first intelligent agent updates the collaborative analysis results to the device state context and generates a new decision instruction based on the updated device state context.

7. The device maintenance method based on intelligent agents according to any one of claims 2 to 6, characterized in that, Before the step of the first agent invoking a large language model to generate structured decision instructions based on the input instructions and the current device state context, the method further includes: The first intelligent agent matches the corresponding abnormal phenomenon node in a preset knowledge graph based on the input instruction or the physical explanation information in the device state context, and obtains at least one fault cause node connected to the matched abnormal phenomenon node; wherein, the knowledge graph includes multiple abnormal phenomenon nodes and multiple fault cause nodes, and the abnormal phenomenon nodes and the fault cause nodes are connected by association edges, each of the association edges having a corresponding probability weight. The first intelligent agent obtains the fault cause nodes based on the probability weights in descending order, forms a fault diagnosis result, and updates it to the device state context.

8. An industrial control system, characterized in that, The system includes a first intelligent agent and several system devices, the system further including: The input module is used to acquire input commands that contain maintenance intentions; The intelligent agent maintenance module is used to iteratively execute a device control loop through the first intelligent agent, wherein each round of the device control loop includes: The first intelligent agent invokes a large language model to generate structured decision instructions based on the input instructions and the current device state context, wherein the decision instructions include the function identifier of the skill function and the control parameters corresponding to the skill function; The first intelligent agent calls the corresponding skill function according to the function identifier and control parameters in the decision instruction to obtain physical interpretation information; wherein, the physical interpretation information is obtained based on the feedback information obtained after the skill function drives the system device to perform device actions, and / or is obtained after transforming the state parameters of the system device obtained by the skill function; The first intelligent agent updates the execution result generated in this round to the device state context, wherein the execution result is obtained based on the decision instruction and the physical interpretation information; When the execution result meets the preset termination condition, the first intelligent agent exits the device control loop.

9. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store at least one program, and the processor being used to load the at least one program to execute the agent-based device maintenance method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the agent-based device maintenance method as described in any one of claims 1 to 7.