CN-122022725-A - Heterogeneous interface instant-to-MCP service system and method based on large language model
Abstract
The invention discloses a heterogeneous interface instant-to-MCP service system and method based on a large language model, which relates to the technical field of artificial intelligence, and comprises a service code generation module, a container resource management module, a multi-layer execution observation module and a self-healing execution module, wherein the invention automatically converts a heterogeneous API interface document into a standardized MCP service code through the large language model, realizes millisecond-level deployment by utilizing a preheating container pool and a hot mounting technology, ensuring safety, observability and self-healing capability, enabling the agents to call each other like calling an API through an MCP protocol, greatly expanding the processing boundary of a single agent, constructing a skill grid in an enterprise, realizing decoupling and free combination of the capabilities of the agents, solving the problem of feedback black boxes in the conversation, namely in the execution process, enabling a user to master each step of dynamic state of an AI operation enterprise-level core system in real time, and ensuring observability of the process.
Inventors
- SHAO JUN
Assignees
- 深圳市真实智元科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260129
Claims (10)
- 1. The heterogeneous interface instant-to-MCP service system based on the large language model is characterized by comprising a service code generation module, a container resource management module, a multi-layer execution observation module and a self-healing repair execution module; The service code generation module comprises a three-stage sequential constraint generation unit, a progressive authentication inference and proxy management unit, an authentication life cycle proxy and minimum authority verification unit, a dynamic parameter Schema adaptation unit for multi-signal fusion, and a runtime parameter cleaning and JSON standardization repair unit; the container resource management module comprises a construction and management unit for pre-starting a container resource pool, a construction-free high-performance service logic injection unit and an automatic resource management and multi-tenant isolation recovery unit; The multi-layer execution observation module comprises an explicit progress reporting interface unit, an AST-based implicit conservative pile inserting unit, an intelligent progress deducing unit based on historical data and a dual-channel event distributing and auditing storage unit; The self-healing repair execution module comprises a runtime error capturing and stack analyzing unit, an abstract syntax node level error tracing unit, a controlled local patch generating unit, a hierarchical repair and spam unit and a hot reload and closed loop execution unit.
- 2. The heterogeneous interface instant-to-MCP service system based on a large language model of claim 1, wherein said three-phase sequential constraint generation unit uses three-phase generation flow of first authentication alignment, second parameter mapping and second logic check; The progressive authentication inference and agent management unit determines an interface authentication scheme through a progressive engine with rule priority and model spam; The authentication lifecycle agent and the minimum authority verification unit forcedly generate independent authentication agent logic when recognizing that a Token acquisition flow exists in the interface; the dynamic parameter Schema adaptation unit for multi-signal fusion comprehensively judges the stability of an interface parameter structure through multi-dimensional signals, dynamically determines the expression mode of the parameter Schema, wherein the multi-dimensional signals comprise path signals, request body signals and response body signals, and when the signals meet preset conditions, the parameters are defined as a general mapping structure; The runtime parameter cleaning and JSON standardization repair unit introduces a parameter repair operator before the request is sent, and performs automatic standardization processing on the quotation mark format, the Boolean value representation and the key name integrity.
- 3. The heterogeneous interface instant-to-MCP service system based on a large language model of claim 1, wherein said pre-boot container resource pool construction and management unit comprises a parallel initialization mechanism, a running environment pre-alignment and state machine and scheduling management; The construction-free high-performance business logic injection unit adopts a dynamic logic injection mode of a container in operation to realize quick execution, and comprises a double-layer fingerprint verification and execution cache, a file stream injection mode and a sub-second level activation effect; The automatic resource management and multi-tenant isolation recovery unit comprises an asynchronous context binding mechanism, a closed loop cleaning strategy, leakage grading and automatic reconstruction.
- 4. The heterogeneous interface instant-to-MCP service system based on a large language model of claim 1, wherein said explicit progress tracking interface unit allows active reporting of execution status at traffic critical nodes by providing a standardized progress tracking interface; The implicit conservative instrumentation unit based on AST performs automatic instrumentation through AST analysis when a progress interface is not explicitly called in the code; The intelligent progress deducing unit based on the historical data predicts the execution progress by combining the historical audit data in the scene of lacking an explicit execution boundary; the dual-channel event distribution and audit storage unit pushes progress events in the execution process to the front-end display through a real-time message channel, and meanwhile, the progress events are persisted to an audit log system for post analysis and model behavior backtracking.
- 5. The heterogeneous interface instant-to-MCP service system based on a large language model as claimed in claim 1, wherein said runtime error capturing and stack parsing unit captures standard error output in real time, and extracts exception types and corresponding source code line number information through rule parsing; The abstract syntax node level error tracing unit maps error positions to the abstract syntax nodes of the innermost layer by using an abstract syntax tree traversing mechanism based on the line number information; the controlled local patch generation unit extracts abnormal nodes and necessary context codes thereof as repair inputs and drives the large language model to generate local repair patches; The hierarchical repair and spam unit automatically switches to full-quantity code reconstruction to be used as a spam scheme when partial repair fails continuously or the structural integrity of the code is detected to be damaged by preferentially attempting partial patch repair; And the hot reloading and closed-loop executing unit loads the repaired codes to the preheating container in a construction-free injection mode, and retriggers the execution flow to form a second-level self-healing closed loop without restarting the system.
- 6. A heterogeneous interface instant-to-MCP service method based on a large language model is characterized by comprising the following steps: step one, acquiring and analyzing a heterogeneous document; step two, performing three-stage sequential synthesis; Step three, logic compliance verification; Fourthly, executing grammar tree conservation stake-inserting; Fifthly, checking and mounting the fingerprint of the container pool; step six, activating and distributing standard MCP service.
- 7. The heterogeneous interface instant-to-MCP service method based on large language model of claim 6, wherein said step I, receiving heterogeneous API document provided by user; in the analysis process, identifying an endpoint URL, a request method, a parameter list, an authentication mode and a response format of an interface through a system; Meanwhile, the key characteristics of the document are primarily analyzed by using a rule engine, and input is provided for the follow-up three-stage synthesis through context semantic analysis.
- 8. The heterogeneous interface instant-to-MCP service method based on large language model as claimed in claim 6, wherein said step two performs three-phase sequential constraint of authentication identification, parameter mapping and logic verification by using large language model and generates standardized MCP service code.
- 9. The heterogeneous interface instant-to-MCP service method based on large language model of claim 6, wherein said third step is to execute logical compliance verification after code generation, specifically including structure consistency verification, runtime pre-verification and security boundary check; step four, automatically injecting an observation hook based on AST analysis to realize progress visualization; In the specific implementation process, AST traversal and node identification, conservative pile-inserting strategy and multi-level progress reporting are included.
- 10. The heterogeneous interface instant-to-MCP service method based on large language model of claim 6, wherein the step five is realized by preheating container pool, 20-50 preheating containers are asynchronously created when the container pool is pre-started and the standardized runtime and standard library of middleware supporting MCP protocol are pre-installed when the system is initialized; in the fingerprint verification and caching process, the system maintains the mapping of the container identification-service code hash value, and when a new task arrives, the code hash is preferably verified; Step six, activating and releasing the code as standard MCP service after the code is mounted, supporting the call of the intelligent agent, and when the service is activated, starting service logic in the container, exposing an interface through a MCP protocol, and allowing the external AI intelligent agent to call through natural language; in the process of error self-healing and thermal reloading, a container error report log is captured in real time during running, an AST node is positioned through stack analysis, an error context is extracted, a large model is driven to generate a local patch, and thermal reloading is carried out to a container after verification, so that second-level self-healing is realized; and registering to the platform through the MCP service for nesting and calling of other agents.
Description
Heterogeneous interface instant-to-MCP service system and method based on large language model Technical Field The invention relates to the technical field of artificial intelligence, in particular to a heterogeneous interface instant-to-MCP service system and method based on a large language model. Background The AI large language model is used for commanding and calling the existing software system, such as ERP and the like, which is a very important topic in the current intelligent agent field, and most of the current technologies mainly comprise the following classes of developers for realizing the calling of the large model to the API according to function calling mechanisms and deploying, using frames of langchain and the like for realizing the calling of the API and deploying, manually writing service codes conforming to the MCP protocol and deploying; The current deployment technology consumes a long time, writing a set of code of MCP service for each API interface is a huge project, and in order to solve the problem that batch automation converts the API interface into the MCP service, the following impossible triangles of extremely rapid deployment, safety and resource saving exist; The extremely rapid deployment, namely, the problem of second-level starting can be solved by directly deploying the dock on a host, but the cost is that if codes generated by AI contain dangerous instructions such as rm-rf or users use prompt words to inject attacks, huge potential safety hazards can be brought; security-contradiction between direct execution scheme based on host process (no isolation) and isolated execution scheme based on container image construction (high latency); Resource saving, namely starting a container for each service, if starting a container consumes 80M memory, 1000 online users consume 80G memory; In addition, the existing Agent has the problems of invisible black boxes and no error reporting and self-healing in the execution process, so that the industrial-grade stability is insufficient. Disclosure of Invention The invention provides a heterogeneous interface instant-to-MCP service system and method based on a large language model, which can effectively solve the problems that the current deployment technology is long in time consumption, a set of MCP service codes are written for each API interface, the extremely large project is impossible to deploy at high speed, safety and save resources, and in addition, the existing Agent has the problems of invisible black boxes and no self-healing of error reporting in the execution process, so that the problem of insufficient industrial-level stability is caused. In order to achieve the aim, the invention provides the technical scheme that the heterogeneous interface instant-to-MCP service system based on the large language model comprises a service code generation module, a container resource management module, a multi-layer execution observation module and a self-healing repair execution module; The service code generation module comprises a three-stage sequential constraint generation unit, a progressive authentication inference and proxy management unit, an authentication life cycle proxy and minimum authority verification unit, a dynamic parameter Schema adaptation unit for multi-signal fusion, and a runtime parameter cleaning and JSON standardization repair unit; the container resource management module comprises a construction and management unit for pre-starting a container resource pool, a construction-free high-performance service logic injection unit and an automatic resource management and multi-tenant isolation recovery unit; The multi-layer execution observation module comprises an explicit progress reporting interface unit, an AST-based implicit conservative pile inserting unit, an intelligent progress deducing unit based on historical data and a dual-channel event distributing and auditing storage unit; The self-healing repair execution module comprises a runtime error capturing and stack analyzing unit, an abstract syntax node level error tracing unit, a controlled local patch generating unit, a hierarchical repair and spam unit and a hot reload and closed loop execution unit. According to the technical scheme, the three-stage sequential constraint generation unit adopts a three-stage generation flow of authentication alignment, parameter mapping and logic check; the three-stage sequential constraint generation unit adopts a three-stage generation flow of authentication alignment, parameter mapping and logic check. To avoid semantic drift or security pollution of the generated results between different stages, the system formally models the generated process, and represents the generated process as a sequential optimization problem with stage constraint: Wherein, in particular, L i represents a phase constraint loss function corresponding to an ith generation phase for measuring the deviation degree of the current phase genera