Method and device for obtaining a repair solution based on a large language model and a mcp tool
By combining large language models and MCP tools, the system automatically identifies equipment fault information and calls the maintenance process vector library, solving the problem of low efficiency in consulting maintenance manuals in existing technologies and achieving fast and accurate acquisition of maintenance solutions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HAIER DIGITAL TECHNOLOGY (QINGDAO) CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-02
Smart Images

Figure CN122132452A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and device for obtaining maintenance solutions based on a large language model and Model Context Protocol (MCP) tool. Background Technology
[0002] In industrial production, the proper functioning of equipment is crucial for a company's operations. To ensure this, operation manuals and troubleshooting guides are typically provided. Currently, these manuals are mostly available in paper or electronic form. When equipment malfunctions, maintenance personnel usually need to manually consult the paper manual or search for corresponding repair solutions in the electronic document using keywords.
[0003] Both methods have obvious shortcomings: paper manuals are inefficient to consult and information is easily missed; although electronic documents support retrieval, they often return too many irrelevant results due to the complexity of the content, and still require a lot of manual time for secondary screening and verification. Summary of the Invention
[0004] This invention provides a method and device for obtaining repair solutions based on large language models and MCP tools, in order to solve the problem of difficulty in quickly determining repair solutions for faults.
[0005] According to one aspect of the present invention, a method for obtaining maintenance solutions based on large language models and MCP tools is provided, comprising: User input information and tool information of the Model Context Protocol (MCP) tool are input into the large language model so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information. The target tool is a fault repair process vector library. The tool invocation command is determined based on the tool invocation parameters; The tool call command is sent to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
[0006] Furthermore, the process by which the large language model determines whether the user input information is the fault information includes: By parsing the user input information, the characteristic information of the user input information is determined; By comparing the feature information with preset features, it is determined that the user input information is fault information or other information.
[0007] Furthermore, the process by which the large language model determines whether the user input information is fault information or other information by comparing the feature information with preset features includes: Determine the similarity between the feature information and the preset feature; If the similarity is greater than a similarity threshold, the user input information is determined to be the fault information; otherwise, the user input information is determined to be other information.
[0008] Furthermore, the large language model determines the target tool and the corresponding tool invocation parameters based on the fault information and the tool information, including: Based on the fault information and the tool information, the target tool is determined to be a fault repair process vector library; Based on the fault information, determine the tool call parameters required for the MCP tool to call the fault repair process vector library.
[0009] Further, based on the fault information, the tool invocation parameters required for the MCP tool to invoke the fault repair process vector library are determined, including: Determine the fault feature vector based on the fault information; The fault feature vector is processed based on the parameter format when the MCP tool is invoked, and the tool invocation parameters required by the MCP tool to invoke the fault repair process vector library are obtained.
[0010] Further, determining the tool invocation instruction based on the tool invocation parameters includes: The tool invocation instruction is obtained by packaging the tool invocation parameters into instructions.
[0011] Furthermore, the MCP tool invokes the corresponding fault repair process vector library based on the tool invocation command, and the process of searching for the corresponding repair solution in the fault repair process vector library includes: The tool call command is sent to the fault repair process vector library to determine the repair plan corresponding to the fault information corresponding to the tool call command in the fault repair process vector library.
[0012] Furthermore, after searching for the corresponding repair solution in the fault repair process vector library, the process also includes: Based on the aforementioned repair plan, construct a complete set of prompts; The complete solution prompt is input into the large language model, and the complete solution output by the large language model is determined as the fault repair solution corresponding to the fault information.
[0013] Furthermore, based on the aforementioned maintenance plan, the prompt words are improved and refined, including: The repair plan is filled into the preset prompt template to obtain the complete prompt for the plan.
[0014] According to another aspect of the present invention, a repair scheme acquisition device based on a large language model and MCP tool is provided, comprising: The first determining module is used to input user input information and tool information of the Model Context Protocol (MCP) tool into the large language model, so that after determining that the user input information is fault information, the large language model determines the target tool and the tool calling parameters corresponding to the target tool based on the fault information and the tool information, wherein the target tool is a fault repair process vector library; The second determining module is used to determine the tool calling instruction based on the tool calling parameters; The execution module is used to send the tool call instruction to the MCP tool, so that the MCP tool can call the fault repair process vector library based on the tool call instruction and search for the corresponding repair solution in the fault repair process vector library.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to execute the maintenance scheme acquisition method based on the large language model and MCP tool according to any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the maintenance scheme acquisition method based on a large language model and MCP tool as described in any embodiment of the present invention.
[0017] The technical solution of this invention involves an intelligent agent inputting user input information and the tool information of an MCP tool into a large language model. The large language model can determine whether the user input information is fault information or ordinary dialogue information. After determining that the user input information is fault information, it determines the target tool corresponding to the fault information and the tool call parameters required to determine the corresponding repair solution within the target tool, based on the fault information and the tool information of the MCP tool. This achieves automated and convenient calling of the corresponding target tool. After the large language model determines the tool call parameters for the target tool based on the fault information, it sends these parameters to the intelligent agent. The intelligent agent can then package the tool call parameters into a tool call instruction recognizable by the MCP tool and send the tool call instruction to the MCP tool. Based on the MCP tool, the target tool is called, and the repair solution corresponding to the fault information is determined within the target tool. By calling the MCP tool through the intelligent agent, the retrieval of the target tool is achieved, thereby realizing the accurate retrieval of the repair solution corresponding to the fault information.
[0018] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This embodiment provides a flowchart of a method for obtaining maintenance solutions based on a large language model and MCP tools. Figure 2 This is a flowchart illustrating a method for obtaining a maintenance plan based on a large language model and MCP tool, as provided in Embodiment 2. Figure 3 This is a schematic diagram of a maintenance solution acquisition device based on a large language model and MCP tool provided in this embodiment three; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] Example 1 Figure 1 This embodiment provides a flowchart of a repair solution acquisition method based on a large language model and MCP tool. This embodiment is applicable to situations requiring improved fault repair efficiency. The method can be executed by a repair solution acquisition device based on a large language model and MCP tool. This device can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes: Step 110: Input the user input information and the tool information of the Model Context Protocol (MCP) tool into the large language model, so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information.
[0024] An intelligent agent is an intelligent system or entity in the field of artificial intelligence that can autonomously perceive its environment, make decisions and plans, and use tools to perform actions in order to achieve specific goals. Its core is to complete a closed-loop task around the goal.
[0025] User input can be dialogue information entered by the user through a dialog box on the intelligent agent. After receiving the user input, the intelligent agent forwards it to the large language model. The large language model analyzes the user input to determine whether it is fault information. Here, fault information can be understood as equipment fault description information. The equipment can be home appliances, industrial production equipment, etc. The large model first performs preliminary screening of the user input based on preset fault information filtering rules. If the user input includes fault words contained in the preset fault information filtering rules, it is determined to be candidate fault information; otherwise, it is determined to be ordinary dialogue information. Secondly, the candidate fault information can be binary classified. Specifically, the feature information of the candidate fault information can be determined, and binary classification can be performed based on the feature information to determine whether the candidate fault information is fault information or ordinary dialogue information.
[0026] It should be noted that while inputting user information into the agent's dialog box, users can also input tool information for the MCP tool. The tool information for the MCP tool can be understood as the name, type, and attributes of the tools that the agent can call. For example, when the tool is a vector library, the name can be the vector library name, the type can be the domain to which the vector library belongs, and the attribute can be the purpose of the vector library. The target tool is the fault repair process vector library corresponding to the fault information.
[0027] After determining that the user input information is fault information, the large language model can identify the target tool based on the fault information and tool information. First, the domain corresponding to the fault information can be determined. Then, a corresponding fault repair process vector library can be identified based on the domain, and this fault repair process vector library is identified as the target tool. To determine the repair solution corresponding to the fault information in the fault repair process vector library, a repair solution search needs to be performed within the library. This search requires search parameters; therefore, the search parameters for searching the fault repair vector library corresponding to the fault information can be determined, and these search parameters are identified as the tool invocation parameters for the target tool.
[0028] In practical applications, after the large language model determines the tool call parameters of the target tool for the fault information, it can send the fault information to the intelligent agent.
[0029] In this embodiment of the invention, the large language model can determine whether the user input information is fault information or ordinary dialogue information. After determining that the user input information is fault information, it determines the target tool corresponding to the fault information and the tool calling parameters required for the repair plan corresponding to the fault information in the target tool based on the fault information and the tool information of the MCP tool, thereby realizing the automated and convenient calling of the target tool.
[0030] Step 120: Determine the tool invocation command based on the tool invocation parameters.
[0031] Specifically, after receiving the fault information and the tool invocation parameters for the target tool, the agent needs to invoke the target tool based on these parameters. Since the agent cannot directly invoke the target tool, it needs to do so using the MCP tool. The MCP tool can only recognize data in a specific format; therefore, the tool invocation parameters required to invoke the target tool need to be converted into a format recognizable by the MCP tool. This can be achieved using a preset format conversion tool to convert the tool invocation parameters into tool invocation instructions recognizable by the MCP tool.
[0032] In this embodiment of the invention, tool call parameters are packaged into tool call instructions that can be recognized by the MCP tool.
[0033] Step 130: Send the tool call command to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
[0034] Specifically, the intelligent agent can send tool call instructions to the MCP tool, which can then call the corresponding target tool based on the tool call instructions. This means it can call the corresponding fault repair process vector library, and then search for the corresponding repair solution in the fault repair process vector library according to the tool call instructions, thereby determining the repair solution corresponding to the fault information.
[0035] In this embodiment of the invention, by sending a tool call command to the MCP tool, the target tool is called based on the MCP tool, thereby determining the repair plan corresponding to the fault information in the target tool. The target tool is retrieved by calling the MCP tool through an intelligent agent, so as to achieve accurate retrieval of the repair plan corresponding to the fault information.
[0036] The method for obtaining a repair solution based on a large language model and an MCP tool provided in this embodiment includes: inputting user input information and tool information of the Model Context Protocol (MCP) tool into a large language model, so that after determining that the user input information is fault information, the large language model determines a target tool and the tool invocation parameters corresponding to the target tool based on the fault information and the tool information, wherein the target tool is a fault repair process vector library; determining a tool invocation instruction based on the tool invocation parameters; and sending the tool invocation instruction to the MCP tool, so that the MCP tool invokes the fault repair process vector library based on the tool invocation instruction and searches for a corresponding repair solution in the fault repair process vector library. In the above technical solution, after the intelligent agent inputs user input information and the tool information of the MCP tool into the large language model, the large language model can determine whether the user input information is fault information or ordinary dialogue information. After determining that the user input information is fault information, it determines the target tool corresponding to the fault information and the tool call parameters required to determine the corresponding repair solution in the target tool based on the fault information and the tool call parameters of the target tool. This realizes the automated and convenient calling of the corresponding target tool. After the large language model determines the tool call parameters of the fault information for the target tool, it sends the tool call parameters of the fault information for the target tool to the intelligent agent. The intelligent agent can then package the tool call parameters into a tool call instruction that the MCP tool can recognize, and can also send the tool call instruction to the MCP tool. Based on the MCP tool, the target tool is called, and the repair solution corresponding to the fault information is determined in the target tool. By calling the MCP tool through the intelligent agent, the retrieval of the target tool is realized, thereby achieving the accurate retrieval of the repair solution corresponding to the fault information.
[0037] Example 2 Figure 2 This is a flowchart illustrating a method for obtaining maintenance solutions based on a large language model and MCP tool, provided in Embodiment 2. This embodiment is a specific implementation based on the above embodiments. Figure 2 As shown, the method includes: Step 210: Input the user input information and the tool information of the Model Context Protocol (MCP) tool into the large language model, so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information.
[0038] Specifically, after receiving user input via a dialog box, the intelligent agent can send the user input to a large language model. The large language model can then analyze and process the user input to determine whether it represents a fault.
[0039] In one implementation, the process by which the large language model determines whether the user input information is the fault information includes: By parsing the user input information, the feature information of the user input information is determined; by comparing the feature information with preset features, the user input information is determined to be fault information or other information.
[0040] Preset features can be understood as features unique to fault information. If the feature information corresponding to the information has a high degree of similarity with the preset features, the information can be identified as fault information.
[0041] Specifically, the user input information can be parsed first to determine its corresponding feature information. Secondly, the feature information can be compared with preset features, and the comparison result can be used to determine whether the user input information is fault information or other information.
[0042] Furthermore, the process by which the large language model determines whether the user input information is fault information or other information by comparing the feature information with preset features includes: Determine the similarity between the feature information and the preset feature; if the similarity is greater than a similarity threshold, determine that the user input information is the fault information; otherwise, determine that the user input information is other information.
[0043] Specifically, the similarity between feature information and preset features can be calculated, and the similarity can be compared with a similarity threshold. If the similarity is greater than the similarity threshold, the user input information is determined to be fault information; otherwise, the user input information is determined to be other information. This enables precise filtering of the fault information entered by the user, so as to facilitate timely feedback on fault information.
[0044] While inputting user information into the agent's dialog box, the user can also input tool information from the MCP tool into the agent's dialog box. After determining that the user input information is fault information, the large language model can determine the target tool based on the fault information and the tool information.
[0045] In one implementation, the large language model determines the target tool and the corresponding tool invocation parameters based on the fault information and the tool information, including: Based on the fault information and the tool information, the target tool is determined to be a fault repair process vector library; based on the fault information, the tool calling parameters required for the MCP tool to call the fault repair process vector library are determined.
[0046] Specifically, first, the domain corresponding to the fault information can be determined. For example, if the fault information describes a washing machine malfunction, the domain corresponding to the fault information can be determined as the home appliance domain. Then, based on the domain corresponding to the fault information, a corresponding fault repair process vector library can be determined, and this fault repair process vector library can be identified as the target tool. Furthermore, the retrieval parameters for searching the fault repair vector library corresponding to the fault information can be determined, and these retrieval parameters can be identified as the tool invocation parameters for the target tool. For example, if the fault information is "washing machine beeps for a long time and cannot operate normally," the tool invocation parameters can be determined as "washing machine, beeping, cannot operate normally."
[0047] Further, based on the fault information, the tool invocation parameters required for the MCP tool to invoke the fault repair process vector library are determined, including: The fault feature vector is determined based on the fault information; the fault feature vector is processed based on the parameter format when the MCP tool is called, to obtain the tool call parameters required by the MCP tool to call the fault repair process vector library.
[0048] The fault repair process vector library stores fault repair-related knowledge, including fault cases, repair manuals, component information, and solutions to common problems. This library provides a fast retrieval function, quickly matching corresponding repair solutions to fault feature vectors and providing knowledge support for the large language model. Furthermore, the fault repair process vector library is obtained by inputting equipment operation manuals and troubleshooting manuals into the large language model, organizing or extracting them into multiple repair processes, and then vectorizing them.
[0049] Therefore, the fault feature vector corresponding to the fault information can be determined. That is, the feature information corresponding to the fault information can be vectorized to obtain the fault feature vector. Since the MCP tool requires specific parameters to call the fault repair process vector library, the parameter format when calling the tool based on the MCP tool needs to be processed into the fault feature vector to obtain the tool call parameters required by the MCP tool to call the fault repair process vector library.
[0050] In this embodiment of the invention, after determining that the user input information is fault information, the large language model determines the target tool corresponding to the fault information and the tool calling parameters required for the repair plan corresponding to the fault information in the target tool based on the fault information and the tool information of the MCP tool, thereby realizing the automated and convenient calling of the target tool.
[0051] Step 220: Obtain the tool invocation instruction by packaging the tool invocation parameters into instructions.
[0052] Specifically, after receiving the fault information regarding the tool call parameters of the target tool, the intelligent agent can package the tool call parameters into instructions, converting them into tool call instructions that the MCP tool can recognize.
[0053] In this embodiment of the invention, tool call parameters are packaged into tool call instructions that can be recognized by the MCP tool.
[0054] Step 230: Send the tool call command to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
[0055] In one implementation, the MCP tool invokes the corresponding fault repair process vector library based on the tool invocation command, and the process of searching for the corresponding repair solution in the fault repair process vector library includes: The tool call command is sent to the fault repair process vector library to determine the repair plan corresponding to the fault information corresponding to the tool call command in the fault repair process vector library.
[0056] Specifically, the intelligent agent can send tool call instructions to the MCP tool, and the MCP tool can call the corresponding target tool based on the tool call instructions. That is, the tool call instructions can be sent to the fault repair process vector library to determine the repair plan corresponding to the fault information corresponding to the tool call instructions in the fault repair process vector library, thereby realizing the determination of the repair plan corresponding to the fault information.
[0057] In this embodiment of the invention, by sending a tool call command to the MCP tool, the target tool is called based on the MCP tool, thereby determining the repair plan corresponding to the fault information in the target tool. The target tool is retrieved by calling the MCP tool through an intelligent agent, so as to achieve accurate retrieval of the repair plan corresponding to the fault information.
[0058] Step 240: Construct a solution and improve the prompt words based on the repair solution.
[0059] Specifically, after determining the maintenance plan corresponding to the fault information in the fault maintenance process vector library, the maintenance plan can be improved based on the large model. First, it is necessary to construct the plan improvement prompt words based on the maintenance plan.
[0060] In one implementation, step 240 may specifically include: The repair plan is filled into the preset prompt template to obtain the complete prompt for the plan.
[0061] The preset prompt template can be something like, "You are an equipment maintenance expert. Please improve the XX (maintenance plan) corresponding to XX (fault information) so that the maintenance plan is more suitable for the fault information."
[0062] Specifically, fault information and repair solutions can be filled into a preset prompt template to obtain prompts for perfecting the solution.
[0063] In this embodiment of the invention, corresponding solution improvement prompts are generated based on fault information and repair plans.
[0064] Step 250: Input the solution completion prompt words into the large language model, and determine the complete solution output by the large language model as the fault repair solution corresponding to the fault information.
[0065] Specifically, by inputting the solution completion prompts into the large language model, the large language model can determine the complete solution corresponding to the fault information based on the maintenance plan. Furthermore, the complete solution output by the large language model can be identified as the fault maintenance plan corresponding to the fault information. Through the logical reasoning, step decomposition, and standard adaptation capabilities of the large language model, a fault maintenance plan that fits the on-site maintenance needs and conforms to industry standards is generated, which typically consists of standardized maintenance steps.
[0066] In practical applications, after the large language model outputs a fault repair solution, the fault repair solution can be fed back to the dialog box as a reply message, and users can follow the fault repair solution to troubleshoot and repair the fault.
[0067] In this embodiment of the invention, the repair solutions corresponding to the fault information retrieved from the fault repair process vector library are summarized and improved by the large language model, resulting in more accurate fault repair solutions and improving the accuracy and success rate of fault information repair.
[0068] The method for obtaining a repair solution based on a large language model and an MCP tool provided in this embodiment includes: inputting user input information and tool information of the Model Context Protocol (MCP) tool into a large language model, so that after determining that the user input information is fault information, the large language model determines a target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information; obtaining a tool call instruction by packaging the tool call parameters into instructions; sending the tool call instruction to the MCP tool, so that the MCP tool calls the fault repair process vector library based on the tool call instruction, and searches for a corresponding repair solution in the fault repair process vector library; constructing a solution completion prompt based on the repair solution; inputting the solution completion prompt into the large language model, and determining the complete solution output by the large language model as the fault repair solution corresponding to the fault information. In the above technical solution, after the intelligent agent inputs user input information and the tool information of the MCP tool into the large language model, the large language model can determine whether the user input information is fault information or ordinary dialogue information. After determining that the user input information is fault information, it determines the target tool corresponding to the fault information and the tool call parameters required to determine the corresponding repair solution in the target tool based on the fault information and the tool call parameters of the target tool. This realizes the automated and convenient calling of the corresponding target tool. After the large language model determines the tool call parameters of the fault information for the target tool, it sends the tool call parameters of the fault information for the target tool to the intelligent agent. The intelligent agent can then package the tool call parameters into a tool call instruction that the MCP tool can recognize, and can also send the tool call instruction to the MCP tool. Based on the MCP tool, the target tool is called, and the repair solution corresponding to the fault information is determined in the target tool. By calling the MCP tool through the intelligent agent, the retrieval of the target tool is realized, thereby achieving the accurate retrieval of the repair solution corresponding to the fault information.
[0069] Of course, after determining the maintenance plan corresponding to the fault information, corresponding improvement prompts can be constructed based on the fault information and maintenance plan. The improvement prompts are then input into the large language model, and the complete plan output by the large language model is determined as the fault maintenance plan corresponding to the fault information. The maintenance plans corresponding to the fault information retrieved in the fault maintenance process vector library are summarized and improved by the large language model to obtain more accurate fault maintenance plans, thereby improving the accuracy and success rate of fault information maintenance and reducing the maintenance time of equipment failure.
[0070] Example 3 Figure 3 This is a schematic diagram of a maintenance solution acquisition device based on a large language model and MCP tool provided in Embodiment 3. Figure 3 As shown, the device includes: The first determining module 310 is used to input user input information and tool information of the Model Context Protocol (MCP) tool into the large language model, so that after determining that the user input information is fault information, the large language model determines the target tool and the tool calling parameters corresponding to the target tool based on the fault information and the tool information, wherein the target tool is a fault repair process vector library; The second determining module 320 is used to determine the tool calling instruction based on the tool calling parameters; The execution module 330 is used to send the tool call instruction to the MCP tool, so that the MCP tool can call the fault repair process vector library based on the tool call instruction and search for the corresponding repair solution in the fault repair process vector library.
[0071] The maintenance solution acquisition device based on a large language model and an MCP tool provided in this embodiment inputs user input information and tool information of the Model Context Protocol (MCP) tool into the large language model. After determining that the user input information is fault information, the large language model determines the target tool and the corresponding tool call parameters based on the fault information and the tool information. The target tool is a fault maintenance process vector library. The device then determines a tool call instruction based on the tool call parameters and sends the tool call instruction to the MCP tool. This allows the MCP tool to call the fault maintenance process vector library based on the tool call instruction and search for the corresponding maintenance solution in the fault maintenance process vector library. In the above technical solution, after the intelligent agent inputs user input information and the tool information of the MCP tool into the large language model, the large language model can determine whether the user input information is fault information or ordinary dialogue information. After determining that the user input information is fault information, it determines the target tool corresponding to the fault information and the tool call parameters required to determine the corresponding repair solution in the target tool based on the fault information and the tool call parameters of the target tool. This realizes the automated and convenient calling of the corresponding target tool. After the large language model determines the tool call parameters of the fault information for the target tool, it sends the tool call parameters of the fault information for the target tool to the intelligent agent. The intelligent agent can then package the tool call parameters into a tool call instruction that the MCP tool can recognize, and can also send the tool call instruction to the MCP tool. Based on the MCP tool, the target tool is called, and the repair solution corresponding to the fault information is determined in the target tool. By calling the MCP tool through the intelligent agent, the retrieval of the target tool is realized, thereby achieving the accurate retrieval of the repair solution corresponding to the fault information.
[0072] Based on the above embodiments, the process by which the large language model in the first determining module 310 determines whether the user input information is the fault information includes: By parsing the user input information, the feature information of the user input information is determined; by comparing the feature information with preset features, the user input information is determined to be fault information or other information.
[0073] Based on the above embodiments, the process by which the large language model in the first determining module 310 determines whether the user input information is fault information or other information by comparing the feature information with preset features includes: Determine the similarity between the feature information and the preset feature; if the similarity is greater than a similarity threshold, determine that the user input information is the fault information; otherwise, determine that the user input information is other information.
[0074] Based on the above embodiments, the first determining module 310 determines the target tool and the tool calling parameters corresponding to the target tool according to the fault information and the tool information, including: Based on the fault information and the tool information, the target tool is determined to be a fault repair process vector library; based on the fault information, the tool calling parameters required for the MCP tool to call the fault repair process vector library are determined.
[0075] Based on the above embodiments, the first determining module 310 determines the tool calling parameters required for the MCP tool to call the fault repair process vector library according to the fault information, including: The fault feature vector is determined based on the fault information; the fault feature vector is processed based on the parameter format when the MCP tool is called, to obtain the tool call parameters required by the MCP tool to call the fault repair process vector library.
[0076] Based on the above embodiments, the second determining module 320 is specifically used for: The tool invocation instruction is obtained by packaging the tool invocation parameters into instructions.
[0077] Based on the above embodiments, the MCP tool in execution module 330 calls the corresponding fault repair process vector library based on the tool call instruction, and the process of searching for the corresponding repair solution in the fault repair process vector library includes: The tool call command is sent to the fault repair process vector library to determine the repair plan corresponding to the fault information corresponding to the tool call command in the fault repair process vector library.
[0078] Based on the above embodiments, the device further includes: The improvement module is used to search for the corresponding repair solution in the fault repair process vector library, construct solution improvement prompts based on the repair solution, input the solution improvement prompts into the large language model, and determine the complete solution output by the large language model as the fault repair solution corresponding to the fault information. In one implementation, constructing solution improvement prompts based on the maintenance plan includes: The repair plan is filled into the preset prompt template to obtain the complete prompt for the plan.
[0079] The maintenance solution acquisition device based on large language model and MCP tool provided in this embodiment can execute the maintenance solution acquisition method based on large language model and MCP tool provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the maintenance solution acquisition method based on large language model and MCP tool.
[0080] It is worth noting that in the above embodiments of the maintenance solution acquisition device based on large language model and MCP tool, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0081] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 4 A block diagram of an exemplary electronic device 4 suitable for implementing embodiments of the present invention is shown. Figure 4 The electronic device 4 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0082] like Figure 4 As shown, electronic device 4 is represented in the form of a general-purpose computing electronic device. The components of electronic device 4 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0083] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0084] Electronic device 4 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 4, including volatile and non-volatile media, removable and non-removable media.
[0085] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 4 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 As not shown, disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disc drives for reading and writing to removable non-volatile optical discs (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0086] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0087] Electronic device 4 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 4, and / or with any device that enables electronic device 4 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, electronic device 4 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. Figure 4 As shown, network adapter 20 communicates with other modules of electronic device 4 via bus 18. It should be understood that, although... Figure 4Not shown, it can be combined with electronic device 4 to use other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0088] Processing unit 16 executes various functional applications and page displays by running programs stored in system memory 28, such as implementing the maintenance solution acquisition method based on large language model and MCP tool provided in this embodiment of the invention, which includes: User input information and tool information of the Model Context Protocol (MCP) tool are input into the large language model so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information. The target tool is a fault repair process vector library. The tool invocation command is determined based on the tool invocation parameters; The tool call command is sent to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
[0089] Of course, those skilled in the art will understand that the processor can also implement the technical solution of the maintenance scheme acquisition method based on large language model and MCP tool provided in any embodiment of the present invention.
[0090] This invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements, for example, the maintenance solution acquisition method based on a large language model and MCP tool provided in this invention. The method includes: User input information and tool information of the Model Context Protocol (MCP) tool are input into the large language model so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information. The target tool is a fault repair process vector library. The tool invocation command is determined based on the tool invocation parameters; The tool call command is sent to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
[0091] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0092] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0093] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0094] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0095] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0096] Furthermore, the acquisition, storage, use, and processing of data in the technical solution of this invention all comply with relevant laws and regulations.
[0097] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A method for obtaining maintenance solutions based on large language models and MCP tools, characterized in that, include: User input information and tool information of the Model Context Protocol (MCP) tool are input into the large language model so that after determining that the user input information is fault information, the large language model determines the target tool and the tool call parameters corresponding to the target tool based on the fault information and the tool information. The target tool is a fault repair process vector library. The tool invocation command is determined based on the tool invocation parameters; The tool call command is sent to the MCP tool so that the MCP tool can call the fault repair process vector library based on the tool call command and search for the corresponding repair solution in the fault repair process vector library.
2. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 1, characterized in that, The process by which the large language model determines whether the user input information is the fault information includes: By parsing the user input information, the characteristic information of the user input information is determined; By comparing the feature information with preset features, it is determined that the user input information is fault information or other information.
3. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 2, characterized in that, The process by which the large language model determines whether the user input information is fault information or other information by comparing the feature information with preset features includes: Determine the similarity between the feature information and the preset feature; If the similarity is greater than a similarity threshold, the user input information is determined to be the fault information; otherwise, the user input information is determined to be other information.
4. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 1, characterized in that, The large language model determines the target tool and the corresponding tool invocation parameters based on the fault information and the tool information, including: Based on the fault information and the tool information, the target tool is determined to be a fault repair process vector library; Based on the fault information, determine the tool call parameters required for the MCP tool to call the fault repair process vector library.
5. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 4, characterized in that, Based on the fault information, the tool invocation parameters required for the MCP tool to invoke the fault repair process vector library are determined, including: Determine the fault feature vector based on the fault information; The fault feature vector is processed based on the parameter format when the MCP tool is invoked, and the tool invocation parameters required by the MCP tool to invoke the fault repair process vector library are obtained.
6. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 1, characterized in that, Determining the tool invocation instruction based on the tool invocation parameters includes: The tool invocation instruction is obtained by packaging the tool invocation parameters into instructions.
7. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 1, characterized in that, The MCP tool invokes the corresponding fault repair process vector library based on the tool invocation command, and the process of searching for the corresponding repair solution in the fault repair process vector library includes: The tool call command is sent to the fault repair process vector library to determine the repair plan corresponding to the fault information corresponding to the tool call command in the fault repair process vector library.
8. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 1, characterized in that, After searching for the corresponding repair solution in the fault repair process vector library, the process also includes: Based on the aforementioned repair plan, construct a complete set of prompts; The complete solution prompt is input into the large language model, and the complete solution output by the large language model is determined as the fault repair solution corresponding to the fault information.
9. The method for obtaining maintenance solutions based on large language models and MCP tools according to claim 8, characterized in that, Based on the aforementioned repair plan, construct and refine the prompts, including: The repair plan is filled into the preset prompt template to obtain the complete prompt for the plan.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the maintenance scheme acquisition method based on the large language model and MCP tool as described in any one of claims 1-9.