Cloud environment intelligent operation and maintenance method and system based on MCP protocol
Through the cloud environment intelligent operation and maintenance method based on the MCP protocol, manual modification and confirmation links are introduced, and incremental context management is adopted to solve the problems of the model forgetting core tasks and security risks in the existing intelligent operation and maintenance methods, and realize efficient and safe operation and maintenance task execution.
Patent Information
- Application Number
- CN202510777950.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-12
AI Technical Summary
Existing intelligent operation and maintenance methods can easily cause the model to forget its original core tasks in long-term task scenarios, pose safety risks, have poor flexibility, and have a low degree of automation.
An intelligent operation and maintenance method for cloud environments based on the MCP protocol is adopted. By generating structured operation instructions, introducing manual modification and confirmation links, and using incremental context management, it combines large models for correlation analysis, reduces irrelevant context, and improves the security and accuracy of model output.
It effectively alleviates the problem of model amnesia in long tasks, improves the flexibility and automation level in operation and maintenance scenarios, ensures that large models focus on core tasks, and improves the security and accuracy of output results.
Smart Images

Figure CN120639769A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large model applications, and in particular to a cloud environment intelligent operation and maintenance method and system based on the MCP protocol. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Existing intelligent operations and maintenance (AOM) use large models to make step-by-step task decisions and execute tasks based on human feedback. However, this approach suffers from a single historical session management model. Error correction through dialogue in long task chains can lead to excessively long model contexts. This is particularly true for O&M scenarios that require extensive environmental information (for example, simply obtaining the PID of a process requires the model to first retrieve all operating system processes before analyzing them, resulting in a large amount of useless data that is retained in the context). This can easily lead to forgetting the original core task and results in poor performance when using smaller models. This simple interaction architecture is unsuitable for O&M scenarios that require extensive input and contain a large amount of redundant and invalid information. Furthermore, it only supports custom, non-standard protocols for unstructured parsing, resulting in high error rates for small models. Furthermore, the associated task tools require custom development. This simple interaction with a large model is suitable for short tasks with high information density, but is not suitable for O&M interactions with long tasks and significant information redundancy (debug logs, file attribute information, etc.).
[0004] Another type of intelligent O&M involves pre-orchestrating existing functions and integrating them with large-scale model analysis and solutions. This approach, firstly, requires pre-orchestrating fixed tasks, which is inflexible and can only execute specific types of tasks based on specific data. It is typically used to remediate environments after specific metrics become abnormal, and cannot proactively identify new issues for intelligent O&M. Secondly, pre-orchestrated tasks are executed en masse, without manual secondary confirmation. Large models may perform dangerous operations, posing security and compliance risks. For example, to address excessive storage usage, large models might execute high-risk commands, leading to the accidental deletion of critical databases.
[0005] In addition, existing intelligent operations and maintenance also supplement human knowledge through command completion and large-scale model knowledge question and answer, using large models as a means of knowledge retrieval. This type of operation and maintenance has a high degree of human intervention and requires the operations and maintenance personnel to have some knowledge of this aspect. In addition, it only uses large models for data query and still relies on humans to make major decisions and input and execute actual commands, resulting in a low degree of automation. Summary of the Invention
[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a cloud environment intelligent operation and maintenance method and system based on the MCP protocol. The present invention can not only significantly reduce the context length, but also alleviate the model's amnesia problem in long tasks. Even under small models with limited context length, it can have relatively good performance, alleviate the model amnesia problem caused by large amounts of data input in the previous large model interaction structure (after the model inputs too much content, it forgets the original core task), and meet the needs of large amounts of environmental data input in operation and maintenance scenarios.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions: A first aspect of the present invention provides a cloud environment intelligent operation and maintenance method based on the MCP protocol.
[0008] A cloud environment intelligent operation and maintenance method based on the MCP protocol, comprising: In response to the natural language task instructions input by the user, a structured operation instruction is generated based on the accessed large model; The structured operation instruction is sent to the user end for confirmation. If the user end modifies historical information or content to be confirmed, the difference is marked, and an incremental context is generated, which is then sent to the server end to perform the specific operation. After the user submits the modified information or makes a new request, it connects to the big model for correlation analysis, retains only relevant conclusions or summarizes the intermediate key results, submits them to the big model, generates the next decision, and directly executes the natural language task instructions and returns to the user end.
[0009] Furthermore, the method generates structured operation instructions in response to the natural language task instructions input by the user according to the connected big model; the method includes: for the big model that supports Function Calling, directly calling the big model interface to generate structured operation instructions.
[0010] Furthermore, in response to the natural language task instructions input by the user, structured operation instructions are generated according to the connected big model; the method also includes: for the big model that does not support Function Calling, a prompt word template library is selected through the prompt word project, and the big model generates a natural language instruction template through the prompt word template library, combines the regular expression to parse the key parameters, and obtains the structured operation instruction; if the parsing fails, the big model optimizes the prompt word template library according to the failure result and retries.
[0011] Furthermore, the incremental context is a context that only retains key modification records.
[0012] Furthermore, the user terminal supports direct modification of erroneous steps in historical conversations.
[0013] Furthermore, the client supports comparing the corrected content of the user end with the original erroneous content, using a built-in template to perform error correction analysis on the modification points, and generating a correction result of the enhanced prompt word.
[0014] Furthermore, the server adopts a hierarchical storage strategy to store historical sessions, and archives original natural language instructions, structured instructions, execution results, and user correction records according to task chain IDs.
[0015] Furthermore, the server supports rapid backtracking of the entire process during auditing.
[0016] A second aspect of the present invention provides a cloud environment intelligent operation and maintenance system based on the MCP protocol.
[0017] An intelligent operation and maintenance system for cloud environments based on the MCP protocol, comprising: The user side is used to input natural language task instructions; The server is used to convert natural language task instructions into structured operation instructions based on the connected large model and send them to the user for confirmation; The user side is used to confirm structured operation instructions. When modifying historical information or content to be confirmed, it marks the difference points, generates incremental context, and then sends it to the server to perform specific operations; The server is used to connect to the big model for correlation analysis after the user submits modified information or makes a new request, retaining only relevant conclusions or summarizing intermediate key results, submitting them to the big model, generating the next decision, and directly executing the natural language task instructions and returning to the user.
[0018] The third aspect of the present invention provides a cloud environment intelligent operation and maintenance system based on the MCP protocol. An intelligent operation and maintenance system for cloud environments based on the MCP protocol, comprising: The user interaction module is configured to: generate structured operation instructions based on the connected big model in response to the natural language task instructions input by the user; send the structured operation instructions to the user end for confirmation; if the user end modifies historical information or content to be confirmed, mark the difference points, generate incremental context, and then send it to the server end to perform specific operations; after the user end submits the modified information or makes a new request, connect to the big model for correlation analysis, retain only relevant conclusions or summarize intermediate key results, submit them to the big model, generate the next decision, and directly execute the natural language task instructions and return to the user end; The model processing module is configured as follows: for large models that support Function Calling, directly call the large model interface to generate structured operation instructions; for large models that do not support Function Calling, through the prompt word project, select the prompt word template library, and the large model generates a natural language instruction template through the prompt word template library, combines the regular expression to parse the key parameters, and obtains structured operation instructions; if the parsing fails, the large model optimizes the prompt word template library according to the failure result and retries.
[0019] Compared with the prior art, the present invention has the following beneficial effects: This invention can not only significantly reduce the context length, but also alleviate the model's amnesia problem in long tasks. It can also perform relatively well under small models with limited context length, alleviating the model amnesia problem caused by large amounts of data input in previous large model interaction structures (after the model inputs too much content, it forgets the original core task), and meeting the needs of large amounts of environmental data input in operation and maintenance scenarios.
[0020] The present invention introduces manual modification and confirmation steps after the large model is generated, which can improve the security and accuracy of the large model output results.
[0021] The present invention does not require pre-arranged fixed tasks and can execute relevant instructions according to different input data, thereby improving the flexibility of implementation and enabling intelligent operation and maintenance after new problems are discovered.
[0022] The present invention can summarize the context through the large model, extract the context related to the input instruction, focus more on intent analysis, reduce the length of irrelevant context, let the large model focus on the core task, and improve the accuracy and correctness of the large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0024] Figure 1 This is a flow chart of a cloud environment intelligent operation and maintenance method based on the MCP protocol according to an embodiment of the present invention; Figure 2 This is a logical block diagram of a cloud environment intelligent operation and maintenance method based on the MCP protocol according to an embodiment of the present invention; Figure 3 This is a structural diagram of a cloud environment intelligent operation and maintenance system based on the MCP protocol shown in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0026] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0027] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0028] In order to facilitate understanding of the technical solution of the present invention, some technical terms involved in the present invention are introduced below.
[0029] Figure 1 This is a flow chart of the cloud environment intelligent operation and maintenance method based on the MCP protocol shown in an embodiment of the present invention; Figure 1 , the method comprising: In response to the natural language task instructions input by the user, a structured operation instruction is generated based on the accessed large model; The structured operation instruction is sent to the user end for confirmation. If the user end modifies historical information or content to be confirmed, the difference is marked, and an incremental context is generated, which is then sent to the server end to perform the specific operation. After the user submits the modified information or makes a new request, it connects to the big model for correlation analysis, retains only relevant conclusions or summarizes the intermediate key results, submits them to the big model, generates the next decision, and directly executes the natural language task instructions and returns to the user end.
[0030] This invention can not only significantly reduce the context length, but also alleviate the model's amnesia problem in long tasks. It can also perform relatively well under small models with limited context length, alleviating the model amnesia problem caused by large amounts of data input in previous large model interaction structures (after the model inputs too much content, it forgets the original core task), and meeting the needs of large amounts of environmental data input in operation and maintenance scenarios.
[0031] Figure 2 This is a logical block diagram of the cloud environment intelligent operation and maintenance method based on the MCP protocol shown in an embodiment of the present invention; Figure 2 , the method comprising: Step 1: The user enters a natural language task instruction through a visual interface, such as "repair the database master-slave delay."
[0032] Step 2: The system first determines whether the connected large language model supports Function Calling: for supported native models (such as GPT-4), directly call its interface to generate structured operation instructions; for unsupported open source models (such as DeepSeekR1), generate natural language instruction templates through the dynamic prompt word template library, and use regular expressions to extract key parameters and convert them into structured instructions.
[0033] Step 3: The system presents the generated instructions to the user's visual interface, where the user can review and correct them. At this point, the user can continue to communicate with the system using natural language, requesting the system to correct the commands on its own, or edit and correct errors in historical questions and answers.
[0034] Step 4: After user confirmation, the system MCP client encapsulates the instruction into a standard protocol request and routes it to the corresponding MCP server (SSH, K8S, or custom tool) to perform specific operations.
[0035] Step 5: The server returns standardized results (status code, log, output, etc.) to the system core, which is recorded uniformly by the compliance audit layer. The compliance tag engine marks the risk level (the system has a default classification and grading standard, which is obtained using relevant algorithms (regularization, similarity, large models, etc.)) and then issues a confirmation strategy (simple confirmation, confirmation after authentication, etc.). The confirmation information and decision information are submitted to the user for confirmation and execution.
[0036] Step 6: When the user submits a modification or context, the historical conversation management module intelligently marks errors, highlights the modification, and generates incremental context. It retains only the core task context and submits it to the model to generate the next decision. The historical conversation management module records the complete conversation and modification points. This module is used to reinforce user modifications and, based on user questions or modifications, collapses irrelevant historical conversations to reduce context.
[0037] This invention enhances management through intelligent conversation context, focuses on core tasks, significantly reduces the length of model context, and alleviates problems such as model amnesia in long tasks.
[0038] Step 7: Repeat the above dialogue and confirmation steps until the model determines that all tasks entered by the user are completed, and then the model analysis output results are returned to the user.
[0039] The entire process, through a closed loop of "natural language input → historical conversation processing → model decision → manual confirmation → protocol-based execution → result feedback → compliance audit," balances automation efficiency with manual control. This approach meets the operational and maintenance requirements of highly sensitive, heterogeneous environments, and long-term big data input tasks in government affairs and cloud-native environments. Furthermore, third-party tool developers can dynamically register new servers (if the cloud platform already has an API) through the MCP protocol, expanding the automation ecosystem.
[0040] In another embodiment, the present invention can use plug-ins such as Cline to interact with large models, but it can only support function calling models, and does not support operations such as editing conversations and correcting commands. It cannot trace long-term conversations and operation behaviors, nor does it support intelligent screening of useless context information.
[0041] In another embodiment, the present invention can use a cursor as a substitute for connecting to an external MCP tool, but does not support private deployment and can only interact with the local MCP server without the ability to access a remote server.
[0042] Combination of the above Figure 1 The cloud environment intelligent operation and maintenance method based on the MCP protocol provided by the embodiment of the present invention is introduced in detail. Next, the cloud environment intelligent operation and maintenance system based on the MCP protocol provided by the embodiment of the present invention will be introduced with reference to the accompanying drawings.
[0043] Figure 3 This is a structural diagram of the cloud environment intelligent operation and maintenance system based on the MCP protocol shown in an embodiment of the present invention; Figure 3 , the system comprises: The user side is used to input natural language task instructions; The server is used to convert natural language task instructions into structured operation instructions based on the connected large model and send them to the user for confirmation; The user side is used to confirm structured operation instructions. When modifying historical information or content to be confirmed, it marks the difference points, generates incremental context, and then sends it to the server to perform specific operations; The server is used to connect to the big model for correlation analysis after the user submits modified information or makes a new request, retaining only relevant conclusions or summarizing intermediate key results, submitting them to the big model, generating the next decision, and directly executing the natural language task instructions and returning to the user.
[0044] In the present invention, native MCP protocol support is provided, the tool interface is unified, and it can be directly connected to the existing standard ecosystem and is easy to expand.
[0045] The present invention adopts a dual-path adaptation architecture layered architecture, and adopts different methods for large models that do not support function calling and large models that support it. Compatibility processing is performed on large models that do not support function calling to adapt to more models and achieve model independence.
[0046] The present invention supports differentiated confirmation based on risks and realizes a closed loop of decision-making for human-machine collaboration.
[0047] According to an embodiment of the present invention, the cloud environment intelligent operation and maintenance system based on the MCP protocol can correspond to the method described in the embodiment of the present invention, and the above and other operations and / or functions of each module of the cloud environment intelligent operation and maintenance system based on the MCP protocol are respectively to achieve Figure 1 For the sake of brevity, the corresponding processes of each method in are not repeated here.
[0048] As another embodiment, the cloud environment intelligent operation and maintenance system based on the MCP protocol described in the present invention further includes: a user interaction module, a model processing module, a distributed MCP service module and a compliance audit module.
[0049] Distributed MCP service module: This module uses the MCP (Model Context Protocol) to define tool interfaces, abstracting operations such as remote SSH commands and Kubernetes APIs into standardized services. It supports dynamic tool registration via configuration files, eliminating the need for invasive code modifications. This design, similar to the "plug and play" concept in the industrial field, enables third-party tool developers to quickly integrate into the ecosystem and promotes the modular development of intelligent operations and maintenance tools.
[0050] The model processing module directly calls native APIs for models that support function calling (such as GPT-4). For models that don't (some open-source LLMs, such as DeepSeekR1), a semantic parsing adaptation layer is introduced. Through prompt word engineering, it dynamically selects appropriate prompt word templates, allowing the model to generate formatted call instructions. Combined with regular expression parsing, the returned results achieve compatibility with multiple large models. If parsing fails, the model processing layer reanalyzes the failed result, optimizes the prompt word template, and then retries.
[0051] Historical session management module: To meet the needs of operation and maintenance scenarios, in addition to supporting traditional continuous context, this system also features the following technical and system design points: Context editing and compression: Users can directly modify incorrect steps (such as incorrect commands and incorrect messages) in historical conversations. The system automatically marks the differences and generates enhanced incremental context (retaining only key modification records rather than the full context for modification and comparison), which can significantly avoid the accumulation of redundant information.
[0052] Reinforced learning of error points: The system compares the user's corrected content with the original erroneous content, uses the system's built-in templates to perform error correction analysis on the modified points, and generates reinforced prompt word correction results, making it easier for large models to grasp the corrected content and subsequent analysis key points.
[0053] Intelligent context filtering: By connecting to the large model for correlation analysis, irrelevant data in the intermediate execution results (such as debugging information and irrelevant file information in the log) is automatically filtered out, retaining only relevant conclusions or summarizing key intermediate results (such as retaining key status codes, exception summaries, and information required to complete core tasks). The interface also automatically collapses irrelevant intermediate conversation data to ensure that the context focuses on the core tasks and alleviate the forgetfulness phenomenon of the large model.
[0054] The relevance analysis process involves first analyzing new questions using semantic similarity analysis (based on vocabulary set statistics, word embeddings, etc.). If there are similarities with existing questions, they are marked as retained. Then, a large model is used to analyze the intent of new conversations or modifications, collapsing intermediate data or conversations that are not relevant to the intent. For example, if a user wants to query the logs of server A, the data from server B and other data from server A in the historical conversation will be marked as useless data. This is mainly achieved through the entity tagging function. The intermediate data obtained from the user's historical conversations will be tagged with multiple tags, such as server A data, log data, statistical data, application A data, and so on.
[0055] The above solution not only significantly reduces the context length but also alleviates the model's amnesia problem in long tasks. It can also achieve relatively good performance in small models with limited context length, alleviating the model amnesia problem caused by large amounts of data input in the previous large model interaction structure (after the model inputs too much content, it forgets the original core task), and meeting the needs of large amounts of environmental data input in operation and maintenance scenarios.
[0056] User Interaction Module: In terms of the interaction mechanism, users select tools and enter task objectives through a visual interface. After the large model generates a tool call chain, manual confirmation is required for execution. The results are returned to the model for analysis and iteration, and all operation processes are automatically recorded for backtracking. In terms of scenario value, in highly sensitive fields such as finance and data security, this mechanism not only retains the final decision-making power of humans over key operations, but also uses AI to improve efficiency, in line with the risk control requirements of the "Generative Artificial Intelligence Service Management Measures". In terms of the audit tracking mechanism, user confirmation logs are recorded, and historical sessions adopt a hierarchical storage strategy. The original natural language instructions, structured instructions, execution results, and user correction records are all archived according to the task chain ID, supporting rapid backtracking of the entire process during audits to meet industry regulatory requirements.
[0057] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A cloud environment intelligent operation and maintenance method based on the MCP protocol, characterized in that: include: In response to the natural language task instructions input by the user, a structured operation instruction is generated based on the accessed large model; The structured operation instruction is sent to the user end for confirmation. If the user end modifies historical information or content to be confirmed, the difference is marked, and an incremental context is generated, which is then sent to the server end to perform the specific operation. After the user submits the modified information or makes a new request, it connects to the big model for correlation analysis, retains only relevant conclusions or summarizes the intermediate key results, submits them to the big model, generates the next decision, and directly executes the natural language task instructions and returns to the user end.
2. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The method generates structured operation instructions in response to the natural language task instructions input by the user according to the connected big model; the method includes: for the big model that supports Function Calling, directly calling the big model interface to generate structured operation instructions.
3. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The method generates structured operation instructions in response to the natural language task instructions input by the user according to the connected big model; the method also includes: for the big model that does not support Function Calling, through the prompt word project, a prompt word template library is selected, the big model generates a natural language instruction template through the prompt word template library, combines the regular expression to parse the key parameters, and obtains the structured operation instruction; if the parsing fails, the big model optimizes the prompt word template library according to the failure result and retries.
4. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The enhanced incremental context is a context that only retains key modification records.
5. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The user terminal supports direct modification of erroneous steps in historical conversations.
6. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The client supports comparing the corrected content of the user end with the original erroneous content, using a built-in template to perform error correction analysis on the modification points, and generating a correction result of the enhanced prompt word.
7. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The server adopts a hierarchical storage strategy to store historical sessions, and archives original natural language instructions, structured instructions, execution results, and user correction records according to task chain IDs.
8. The cloud environment intelligent operation and maintenance method based on the MCP protocol according to claim 1 is characterized in that: The server supports rapid backtracking of the entire process during auditing.
9. A cloud environment intelligent operation and maintenance system based on the MCP protocol, characterized in that: include: The user side is used to input natural language task instructions; The server is used to convert natural language task instructions into structured operation instructions based on the connected large model and send them to the user for confirmation; The user side is used to confirm structured operation instructions. When modifying historical information or content to be confirmed, it marks the difference points, generates incremental context, and then sends it to the server to perform specific operations; The server is used to connect to the big model for correlation analysis after the user submits modified information or makes a new request, retaining only relevant conclusions or summarizing intermediate key results, submitting them to the big model, generating the next decision, and directly executing the natural language task instructions and returning to the user.
10. A cloud environment intelligent operation and maintenance system based on the MCP protocol, characterized in that: include: The user interaction module is configured to: generate structured operation instructions according to the accessed large model in response to the natural language task instructions input by the user; The structured operation instructions are sent to the user for confirmation. If the user modifies historical information or content to be confirmed, the differences are marked, and an incremental context is generated. This context is then sent to the server to execute the specific operation. After the user submits the modified information or makes a new request, the server connects to the big model for correlation analysis, retaining only relevant conclusions or summarizing intermediate key results. These are submitted to the big model to generate the next decision, execute the natural language task instructions directly, and return to the user. The model processing module is configured to: directly call the large model interface to generate structured operation instructions for large models that support Function Calling; and select a prompt word template library through prompt word engineering. The large model generates natural language instruction templates from the prompt word template library and uses regular expressions to parse key parameters to obtain structured operation instructions for large models that do not support Function Calling. If the parsing fails, the large model optimizes the prompt word template library based on the failure result and tries again.
Citation Information
Cited By
Intelligent DevOps task arrangement and execution method and system based on MCP
CN121434401A
Memory operation processing method and system based on natural language instruction
CN121684013A