A method and system for remote deployment and management of distributed AI agents that supports automatic snapshot rollback

Through a hierarchical deployment architecture of a central management platform and runtime management plugins, the fragmented lifecycle management of distributed AI agents is resolved, enabling automatic rollback and unified resource management, improving deployment efficiency and resource utilization, and providing health check data.

CN123067883APending Publication Date: 2026-11-10TIANJIANG BAIZE (CHENGDU) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611244392.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, the lifecycle management of distributed AI agents is fragmented, lacking unified version snapshots and automatic rollback capabilities. This results in fault recovery relying on manual intervention, a lack of automatic linkage between business subscription processes and technology deployment processes, insufficient ability to collect operational metrics, and the potential for idle connection configurations to remain after an agent is deleted, leading to resource waste.

Method used

A hierarchical deployment architecture is formed by a central management platform and runtime management plugins, which enables unified management and automatic rollback of agent resources, collects runtime data, cleans up idle connection configurations, and uses a file snapshot mechanism to save and restore agent resources, reducing manual operations.

Benefits of technology

It enables unified management and automatic rollback of intelligent agent resources, improves the consistency of deployment results, reduces fault recovery time, reduces resource waste, and provides data basis for health checks and operation and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123067883A_ABST
    Figure CN123067883A_ABST
Patent Text Reader

Abstract

This invention relates to the field of artificial intelligence application deployment management technology, and discloses a method and system for remote deployment management of distributed AI agents that supports automatic snapshot rollback. The method includes: upon detecting a deployment trigger event, determining the target runtime node and template data; sending a deployment instruction to the runtime management plugin of the target runtime node, causing the runtime management plugin to establish a target agent workspace and write agent resources; generating a file snapshot based on the deployment result and associating it with deployment records; obtaining the running status of the target agent according to a preset check cycle and determining whether preset rollback conditions are met; and when the preset rollback conditions are met, sending the file snapshot to the runtime management plugin, causing the runtime management plugin to clean up the workspace and restore agent resources. This application enables unified remote deployment and automatic anomaly recovery of distributed AI agents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence application deployment and management technology, and in particular to a method and system for remote deployment and management of distributed AI agents that supports automatic snapshot rollback. Background Technology

[0002] In related technologies, distributed AI agents typically run on different physical or virtual nodes. Operations personnel need to log into each runtime node separately to create the agent's workspace, write its identity file, modify runtime configurations, and check process status. While container orchestration systems can distribute program images, their management objects are mainly program images and general runtime parameters, making it difficult to uniformly manage agent-specific identity files, skill definitions, and tool configurations.

[0003] Furthermore, existing deployment methods typically lack complete snapshots of agent resources and automatic recovery mechanisms. When an agent experiences deployment timeouts, abnormal exits, or stops running, operations personnel need to rewrite the files or redeploy the instance, resulting in lengthy recovery times. After an agent is deleted, the runtime global configuration may still retain connection configurations that do not correspond to the actual agent, leading to invalid connections and wasted runtime resources.

[0004] Specifically, existing technologies have at least the following problems: (1) Distributed intelligent agent lifecycle fragmentation. Multiple AI intelligent agents are deployed on different physical or virtual nodes during runtime, lacking a control plane that can uniformly manage creation, update, deletion, monitoring and rollback operations. Operation and maintenance personnel need to operate each runtime node one by one.

[0005] (2) Multidimensional intelligent agent resources lack version snapshot and atomic rollback capabilities. Existing deployment solutions are mainly oriented towards program code or container images, making it difficult to save and restore multiple types of resources such as personality definitions, workspace configurations, skill definitions, tool registration and authentication configurations as a unified version.

[0006] (3) Fault recovery relies on manual intervention. When an agent exits abnormally, enters an error state, or stops responding, existing methods usually cannot automatically detect and perform recovery based on a valid version, resulting in a long fault recovery time.

[0007] (4) There is a lack of automatic linkage between the business subscription process and the technology deployment process. The order approval, solution analysis, node selection, resource writing and runtime registration processes need to be manually linked, which can easily lead to deployment delays and operational errors.

[0008] (5) Insufficient ability to collect fine-grained operational metrics. Existing methods are unable to continuously obtain operational data such as session status, model call time, token consumption, and tool call results, which cannot provide sufficient basis for health checks, pay-as-you-go billing, and refined operation and maintenance.

[0009] (6) Idle connection configurations may remain after an agent is deleted. The model provisioning service configuration and external tool service connection configuration in the runtime global configuration are not cleared synchronously with the deletion of the last agent, which may result in invalid connection requests and unnecessary resource consumption. Summary of the Invention

[0010] The main purpose of this application is to provide a method and system for remote deployment and management of distributed AI agents that supports automatic snapshot rollback, aiming to solve at least one of the above-mentioned technical problems.

[0011] To achieve the above objectives, the present invention provides a method for remote deployment and management of distributed AI agents that supports automatic snapshot rollback, the method comprising the following steps: Upon detecting a deployment trigger event, determine the target runtime node and template data corresponding to the target agent; Send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources, thereby obtaining the deployment result; The intelligent agent resources are configured as a set of files and configurations used to drive the target intelligent agent to run; Based on the deployment results, a file snapshot of the target agent is generated, and the association between the file snapshot and the deployment record is established; The running status of the target intelligent agent is obtained according to a preset inspection cycle, and the preset rollback conditions are determined based on the deployment record and the running status. When the preset rollback conditions are met, the file snapshot is sent to the runtime management plugin so that the runtime management plugin can clean up the workspace, restore the agent resources based on the file snapshot, and update the deployment record.

[0012] To achieve the above objectives, the present invention also provides a distributed AI agent remote deployment and management system that supports automatic snapshot rollback, comprising: The event detection module is used to determine the target runtime node and template data corresponding to the target intelligent agent when a deployment trigger event is detected. The instruction sending module is used to send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources to obtain the deployment result; The intelligent agent resources are configured as a set of files and configurations used to drive the target intelligent agent to run; The relationship establishment module is used to generate a file snapshot of the target agent based on the deployment results, and establish the association between the file snapshot and the deployment record; The condition judgment module is used to obtain the running status of the target intelligent agent according to a preset inspection cycle, and to determine whether the preset rollback conditions are met based on the deployment record and the running status. The rollback execution module is used to send the file snapshot to the runtime management plugin when the preset rollback conditions are met, so that the runtime management plugin can clean up the workspace, restore the agent resources according to the file snapshot, and update the deployment record.

[0013] One or more technical solutions proposed in this application have at least the following technical effects: A hierarchical deployment architecture is formed by a central management platform and runtime management plugins. The central management platform can drive the runtime management plugins to complete the establishment of the agent workspace, resource writing and runtime registration without directly manipulating the file system of remote nodes, thereby reducing manual operation on each node and improving the consistency of deployment results across different nodes.

[0014] The target agent's workspace resources and runtime registration information are saved as a snapshot of the same file, limiting the recovery scope to the target agent. When a deployment timeout, a retries reaching a threshold, or an abnormal running state is detected, the target agent's resources can be automatically restored without redeploying the entire AI agent runtime.

[0015] By collecting runtime data corresponding to sessions, model calls, and tool calls through runtime event interfaces, the running status and performance indicators of the target intelligent agent can be obtained without modifying the runtime code of the AI ​​intelligent agent, providing data support for health checks and operational management.

[0016] After deleting the last agent, idle connection configurations are removed synchronously to ensure that the runtime global configuration corresponds to the actual deployed agents, thereby reducing invalid connection requests and unnecessary resource consumption. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating the remote deployment and management method for distributed AI agents provided in this application embodiment; Figure 2 A schematic diagram illustrating the principle of remote deployment of a target intelligent agent as provided in an embodiment of this application; Figure 3 A schematic diagram illustrating the principle of file snapshot generation and storage provided in the embodiments of this application; Figure 4 A schematic diagram illustrating the principle of health check and automatic rollback judgment provided in the embodiments of this application; Figure 5 This is a schematic diagram of the digital identity file structure of an intelligent agent provided in an embodiment of this application; Figure 6 A schematic diagram illustrating the principle of file snapshot recovery provided in this application embodiment; Figure 7 This is a schematic diagram of the module structure and execution entity distribution of the distributed AI intelligent agent remote deployment management system provided in the embodiments of this application.

[0020] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0021] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0023] The central management platform can be deployed on a central server, while runtime management plugins are deployed on the runtime nodes of each AI agent. The central management platform sends management requests to the runtime management plugins via a network communication interface. The network communication interface can be an HTTP interface or a communication interface capable of transmitting the same requests.

[0024] In this embodiment, agent resources refer to a set of files and configurations that drive an AI agent and characterize its identity and operating mode. For unified management, agent resources can be divided into an identity resource group, a capability resource group, and an operating configuration group. The identity resource group records the agent's identity description, behavior rules, work instructions, and user context; the capability resource group records skill dependencies and tool invocation methods; and the operating configuration group records model invocation parameters, authentication configurations, and agent registration information.

[0025] Reference Figure 5 The intelligent agent resources can be organized in the target intelligent agent workspace according to the directory hierarchy. The root directory of the workspace includes an identity resource directory, a capability resource directory, and a runtime configuration directory. Each directory stores identity descriptions, behavior rules, work instructions, user context, tool registration, skill list, model call configuration, authentication configuration, and basic intelligent agent configuration.

[0026] It should be noted that a file snapshot is a collection of resources that the target agent needs to restore in a deployment version. A file snapshot records at least the relative position and content of each resource item, as well as the registration information of the target agent in its runtime global configuration. Therefore, if temporary files are generated in the workspace or the runtime configuration is incorrectly modified, the runtime management plugin can rebuild the resource environment required by the target agent based on the file snapshot.

[0027] Specifically, the file snapshot includes a copy of all resource file contents written during deployment and the registration information of the target agent in the runtime global configuration.

[0028] The deployment record is used to document the execution status of a target agent deployment operation. The deployment record can include the target agent identifier, target runtime node identifier, subscription record identifier, start time, current status, number of retries, reason for exception, and associated file snapshot. Fields in the deployment record can be added or removed according to actual business needs, as long as they support deployment status judgment and file snapshot querying.

[0029] It should be noted that the execution entity in this embodiment can be a distributed AI agent remote deployment and management system consisting of a central management platform, a runtime management plugin, and an AI agent runtime. The central management platform is responsible for unified orchestration and status judgment, the runtime management plugin is responsible for local file operations on the target runtime node, and the AI ​​agent runtime is used to actually execute the target agent.

[0030] Based on this, refer to Figure 1 This application provides a method for remote deployment and management of distributed AI agents that supports automatic snapshot rollback, including steps S100 to S500.

[0031] Step S100: When a deployment trigger event is detected, determine the target runtime node and template data corresponding to the target intelligent agent.

[0032] This step is used to complete runtime node discovery, deployment condition verification, and agent template parsing before remote deployment begins. The central management platform first obtains manageable online runtime nodes, and then determines the target runtime node and template data based on subscription records or manual deployment requests. If any necessary data is missing, the central management platform terminates the deployment to avoid sending deployment requests to unknown nodes or nodes lacking template resources. Step S100 includes the following sub-steps: Step S110: The runtime management plugin registers with the central management platform execution node.

[0033] In this embodiment, the runtime management plugin reads the local plugin configuration upon startup to obtain node registration information. Node registration information may include plugin identifier, node communication address, service port, AI agent runtime version, and authentication information. The runtime management plugin sends the node registration information to the registration interface of the central management platform. The central management platform verifies the integrity of the fields and the authentication information, and establishes the corresponding node record upon successful verification.

[0034] Specifically, the node communication address is used by the central management platform to locate the runtime management plugin, the service port is used to establish a management request connection, and the runtime version is used to determine whether the runtime management plugin is compatible with the target AI agent's runtime. Authentication information is used to restrict the runtime management plugin to only process requests authorized by the central management platform. Authentication information can be pre-configured in the central management platform and the runtime management plugin, or it can be generated by an existing key management service and written into the configurations of both parties respectively.

[0035] In one executable implementation, after receiving node registration information, the central management platform first checks whether the same node identifier already exists. If the node record already exists, it updates the node's communication address, runtime version, and most recent registration time; if the node record does not exist, it creates a new node record. This process avoids the generation of multiple identical node records when the runtime management plugin is repeatedly started.

[0036] It's easy to understand that node registration can also be done manually. Administrators can enter the node's communication address, service port, and authentication information on the central management platform. At runtime, the management plugin only starts external services and waits for the central management platform to connect. Both manual and automatic registration methods are used to create node records that can be accessed by the central management platform.

[0037] Step S120: The central management platform determines the online status of the nodes.

[0038] The central management platform sends status query requests to the runtime management plugins corresponding to each node record according to a preset node check cycle. If a valid response is received within the preset response time, the corresponding node record is marked as online; if no valid response is received consecutively, the corresponding node record is marked as offline. After the node resumes communication, the central management platform re-marks the node record as online in subsequent checks.

[0039] In practical applications, the preset node check cycle and preset response time can be set according to the number of nodes and the network environment. For example, the node check cycle can be set to 30 seconds, and the single response wait time can be set to 5 seconds. The above values ​​are only used to illustrate one executable setting and do not constitute a limitation of this application.

[0040] Step S130: The central management platform verifies the deployment trigger event and determines the target runtime node.

[0041] Deployment trigger events can be subscription approval events or manual deployment requests initiated by users or administrators. When a deployment trigger event is a subscription approval event, the central management platform queries the subscription record corresponding to the event and confirms that the subscription record is valid; when a deployment trigger event is a manual deployment request, the central management platform reads the subscription record identifier or the target agent template identifier from the request.

[0042] Furthermore, the central management platform checks whether a deployment record in the "Deploying" state already exists under the same subscription record and runtime node combination. If it does, no new deployment operation is created, and a "Deploying in Progress" message is returned; if it does not exist, the target runtime node is determined from the online node records associated with the user or subscription record. This process avoids the same target agent being repeatedly deployed due to multiple concurrent requests.

[0043] In one executable implementation, when a subscription record is associated with only one online runtime node, that online runtime node is identified as the target runtime node; when a deployment request explicitly specifies a runtime node, the specified node is verified from the online node record, and if the verification passes, it is identified as the target runtime node.

[0044] Step S140: The central management platform parses the intelligent agent template.

[0045] The central management platform queries the service plan based on the service plan identifier associated with the subscription record and reads the intelligent agent template associated with that service plan. The intelligent agent template is used to provide the resource content required to establish the target intelligent agent, and the template data may include basic intelligent agent information, identity resource group, capability resource group, and operation configuration group.

[0046] If the service plan is not associated with an agent template, the central management platform continues to query the subscription records for an independent template identifier. If an independent template identifier exists, the platform queries the agent template based on that identifier. If no agent template is found through the above methods, the deployment is terminated and the reason for the template's non-existence is recorded.

[0047] It should be noted that a service solution can be associated with one or more agent templates. When a service solution is associated with multiple agent templates, the central management platform generates deployment tasks for the target agents one by one according to the template set. Each target agent has its own independent deployment record and file snapshot to prevent the resource recovery of one target agent from affecting other target agents on the same runtime node.

[0048] Step S150: Establish deployment records on the central management platform.

[0049] After determining the target runtime node and template data, the central management platform establishes a corresponding deployment record and sets the initial status of the deployment record to "Deploying". The deployment record is associated with the subscription record, the target runtime node, and the target agent identifier, and is used to save deployment results, retries, and file snapshots in subsequent steps.

[0050] For example, if an enterprise user subscribes to a service plan that includes two agent templates, the central management platform, after identifying an online runtime node, can create deployment records for both target agents. Each deployment record records its own target agent identifier, so the failure of one agent's deployment will not overwrite the deployment status of the other agent.

[0051] Step S200: Send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources, thereby obtaining the deployment result.

[0052] like Figure 2 As shown, this step converts the template data stored on the central management platform into a deployment request executable by the target runtime node, and the runtime management plugin directly manipulates the local file system and runtime global configuration. The central management platform does not need to log in to the target runtime node, nor does it need to remotely execute operating system commands; the local deployment process of the target agent is completed by the runtime management plugin. Step S200 includes the following sub-steps: Step S210: The central management platform generates a deployment request.

[0053] The central management platform reads the target agent identifier and agent resources from the template data, and generates a deployment request according to the interface format provided by the runtime management plugin. The deployment request may include the target agent identifier, the target agent name, and resource content organized by resource type, and carries the authentication information corresponding to the target runtime node.

[0054] To reduce resource consumption from repeatedly establishing network connections, the central management platform can establish and cache a communication client for each online runtime node. This communication client is reused when sending subsequent status queries, updates, or rollback requests to the same runtime node. The communication client automatically attaches authentication information corresponding to the target runtime node.

[0055] In one feasible implementation, the central management platform sends a deployment request to the runtime management plugin via an HTTP request. The message body of the deployment request uses a structured data format, with resource content organized according to identity resource groups, capability resource groups, and runtime configuration groups. This step can also be achieved using other communication methods capable of transmitting the same field content.

[0056] Step S220: The runtime management plugin performs request verification and duplicate registration checks.

[0057] Upon receiving a deployment request, the runtime management plugin first reads the authentication information carried in the request and compares it with the locally preset authentication information. If the authentication information does not match, the runtime management plugin refuses to perform file operations and returns an authentication failure result to the central management platform. The central management platform marks the deployment record as failed based on the returned result and saves the reason for the exception.

[0058] After successful authentication, the runtime management plugin reads the target agent identifier from the deployment request and checks if registration information for the same target agent identifier already exists in the runtime global configuration. If it already exists, the workspace and registration information are not created again; instead, the existing deployment result is returned. If it does not exist, the local creation operation of the target agent continues.

[0059] The duplicate registration check ensures that multiple calls to the creation operation do not result in multiple identical registration entries. Even if the central management platform resends the same deployment request due to network timeout, the runtime management plugin can still identify the completed creation operation based on the target agent identifier.

[0060] Step S230: The runtime management plugin establishes a local directory for the target agent.

[0061] The runtime management plugin generates the target agent's workspace location based on the preset workspace root location and the target agent's identifier, and checks whether the target location already exists. If the target location does not exist, the runtime management plugin creates the workspace and its corresponding subdirectories; if the target location exists but registration is incomplete, it can first clean up any incomplete content in the target location and then recreate the directory.

[0062] In this embodiment, an identity resource directory, a capability resource directory, and a runtime configuration directory can be set in the workspace. The identity resource directory is used to store the identity description, behavior rules, and work instructions of the target intelligent agent; the capability resource directory is used to store skill definitions and tool call instructions; and the runtime configuration directory is used to store model call configuration, authentication configuration, and basic intelligent agent configuration.

[0063] For example, in one specific implementation, identity resource files can use filenames such as SOUL.md, AGENTS.md, and USER.md; capability resource files can use filenames such as TOOLS.md and skills.json; and runtime configuration files can use filenames such as model-config.json, auth-config.json, and config.json. Filenames and directory names can be adjusted according to the interface specifications of the AI ​​agent runtime and are not limited to the examples above.

[0064] Step S240: The runtime management plugin writes the agent resources and completes runtime registration.

[0065] The runtime management plugin writes the contents of each resource to the corresponding file according to the mapping between resource fields in the deployment request and the local location. During the writing process, the runtime management plugin records the relative position of each resource item and the writing result. If the writing of a resource item fails, the runtime management plugin stops subsequent registration operations and writes the failed resource type and local location to the deployment result.

[0066] After all necessary resources are successfully written, the runtime management plugin generates registration information based on the target agent identifier, workspace location, and runtime configuration, and adds the registration information to the runtime global configuration. The runtime global configuration is used to enable the AI ​​agent to discover and load the target agent at runtime, and the registration information must at least correspond the target agent identifier to the workspace location.

[0067] Furthermore, the runtime management plugin updates the local state record, marking the target agent as created or waiting to run. This local state record can be stored in the runtime management plugin's process memory for quick querying by the central management platform; in implementations requiring improved state persistence, the same state can also be saved to the runtime node's local data storage.

[0068] In step S250, the runtime management plugin returns the deployment result.

[0069] The deployment results are used to inform the central management platform whether the local deployment operation has been completed. Deployment results may include the target agent identifier, workspace location, resource write results, and runtime registration results. Upon receiving the deployment results, the central management platform writes them to the deployment record for subsequent file snapshot generation and health checks.

[0070] If the runtime management plugin does not return a deployment result within the preset interface response time, the central management platform will record this request as a communication timeout. If the runtime management plugin returns a file system operation failure result, the central management platform will record the corresponding file location and the reason for the failure. For example, when the runtime node's disk space is insufficient or the root location of the working area does not have write permissions, the runtime management plugin can return the corresponding file system exception information.

[0071] When a service solution includes multiple target agents, the central management platform saves the deployment results of each target agent separately. If the deployment of any target agent fails, the overall operation status of the service solution can be set to partial failure, while retaining the details of both the target agents that have been deployed and those that failed.

[0072] Step S300: Based on the deployment results, generate a file snapshot of the target agent and establish an association between the file snapshot and the deployment record.

[0073] like Figure 3 As shown, this step is used to save the agent resources and runtime registration information actually written by the runtime management plugin as a recoverable file snapshot. The file snapshot is managed by the target agent and is separate from the resources of other agents on the same runtime node; in case of an anomaly, only the resources corresponding to the target agent are restored. Step S300 includes the following sub-steps: Step S310: Determine the snapshot resource item.

[0074] Based on the resource write results in the deployment outcome, the central management platform determines the resource items actually written in this deployment and sends the resource item list to the runtime management plugin. The runtime management plugin locates the resource files in the workspace based on the resource item list, and simultaneously locates the registration information in the runtime global configuration based on the target agent identifier.

[0075] Snapshot resource items are recorded using relative positions, allowing snapshots of the same file to be restored after being recreated at the root location of the working area. The relative position starts from the target agent's working area and does not depend on the absolute disk location of the runtime node. Registration information in the runtime global configuration is stored as an independent snapshot resource item.

[0076] Step S320: Read the resource content and generate a file snapshot.

[0077] The runtime management plugin reads each snapshot resource item sequentially, obtaining the relative position and content of each resource item, and establishes a correspondence between resource items according to their relative positions. For identity resources and runtime configurations in text format, the file snapshot saves their complete content; for runtime global configurations, only the registration information corresponding to the target agent is saved, and the registration information of other agents is not saved.

[0078] It should be noted that session records, cached data, and temporary files generated during runtime are not part of the agent resources written during deployment, and therefore are not considered necessary snapshot resource items. Clearing this type of runtime data during rollback can prevent data generated by abnormal operation from continuing to affect the recovered target agent.

[0079] Once the file snapshot is generated, the runtime management plugin returns the file snapshot and snapshot generation result to the central management platform. The central management platform can assign snapshot versions and generation times to the file snapshots to differentiate the resource states formed by the target agent at different deployment or update stages.

[0080] Step S330: Verify the integrity of the file snapshot.

[0081] The central management platform compares the number of resource items in the file snapshot with the number of resource items successfully written in the deployment results, and checks whether each resource item has a locatable relative position and readable resource content. Simultaneously, the central management platform checks whether the file snapshot contains runtime registration information for the target agent.

[0082] If all the above checks pass, the file snapshot is marked as valid. If any necessary resource item is missing or runtime registration information is missing, the file snapshot is marked as invalid, and the missing resource item is saved in the deployment record. Invalid file snapshots are not used for subsequent automatic rollback.

[0083] Step S340: Persistently store file snapshots.

[0084] The central management platform stores valid file snapshots in a central database and establishes a relationship using the target agent identifier, deployment record identifier, and snapshot version. When a health check determines that a rollback is necessary, the corresponding valid file snapshot can be directly queried based on the deployment record, without needing to read the workspace content again under abnormal conditions.

[0085] In this embodiment, the lifecycle of the file snapshot can be consistent with the lifecycle of the deployment record. While the target agent is providing effective service, its valid file snapshot is retained; when the target agent is permanently deleted and no longer needs to be recovered, the corresponding file snapshot can be cleaned up according to preset data retention rules.

[0086] Step S350: After the incremental update, a new file snapshot is generated.

[0087] Once the target agent is deployed, the central management platform can receive incremental update requests for that agent. These requests only carry the changed resource fields, and the runtime management plugin, based on the mapping between resource fields and local locations, only overwrites the corresponding resource files.

[0088] For structured runtime configurations, the runtime management plugin reads the existing configuration, writes the configuration fields specified in the incremental update request into the existing configuration, and retains the configuration fields not specified in the incremental update request. If the incremental update involves the registration information of the target agent, the corresponding registration items in the runtime global configuration are updated synchronously.

[0089] After the incremental update is completed, the runtime management plugin rereads the complete agent resources of the target agent and generates a new file snapshot. The central management platform sets the new file snapshot as the current snapshot and retains the valid file snapshot before the update, so that subsequent rollbacks can restore the resource state before the update.

[0090] For example, if a user only modifies the identity description file of the target agent, the incremental update request can include only that identity description field. The runtime management plugin overwrites the corresponding file without modifying the model invocation configuration and skill definitions; after the update is complete, a new file snapshot is generated based on all updated agent resources.

[0091] Step S400: Obtain the running status of the target intelligent agent according to the preset inspection cycle, and determine whether the preset rollback conditions are met based on the deployment record and the running status.

[0092] like Figure 4 As shown, this step continuously checks whether the target agent under deployment is running normally, and automatically determines whether file snapshot restoration needs to be performed when the deployment process exceeds the allowed time, the number of query retries is too high, or the target agent enters an abnormal state. The running status can be obtained through active status query or through runtime event interface collection. It should be noted that listening to the runtime event interface is the primary method for collecting running status, while the central management platform queries the local status records of the runtime management plugin according to a preset check cycle as a secondary method for confirming the running status. Step S400 includes the following sub-steps: Step S410: The health check scheduler scans the deployment records.

[0093] The central management platform is equipped with a health check scheduler, which queries deployment records with a status of "deployment in progress" according to a preset check cycle. For each deployment record, the health check scheduler reads the deployment start time, current time, and number of retries, and locates the corresponding target runtime node and target agent identifier.

[0094] In one executable implementation, the preset check interval can be set to 5 seconds. The health check scheduler scans the deployment records every 5 seconds. The preset check interval can be adjusted based on the normal startup time of the target agent; a longer check interval can be set when the startup time is long.

[0095] Step S420: Determine the deployment time and number of retries.

[0096] The health check scheduler determines the deployment time based on the deployment start time and the current time, and compares the deployment time with the preset deployment timeout threshold; at the same time, it compares the number of retries in the deployment record with the preset maximum retry threshold.

[0097] When the deployment time reaches the preset deployment timeout threshold, it indicates that the target agent has not completed the operation confirmation within the allowed time, and the health check scheduler determines that the preset rollback conditions are met. When the number of retries reaches the preset maximum retry threshold, it indicates that the central management platform has been unable to confirm the valid operating status multiple times, and the preset rollback conditions are also determined to be met.

[0098] For example, the preset deployment timeout threshold can be set to 60 seconds, and the preset maximum retry threshold can be set to 12 times. With a preset check cycle of 5 seconds, if the target agent fails to return to a valid running state within multiple check cycles, it can enter an automatic recovery process within approximately 60 seconds. These values ​​can be set according to the actual operating environment.

[0099] Step S430: Query the running status of the target intelligent agent.

[0100] If neither the deployment time nor the number of retries reaches the corresponding threshold, the central management platform sends a status query request to the runtime management plugin of the target runtime node. The runtime management plugin queries its local status record based on the target agent identifier and returns the current running status to the central management platform.

[0101] When the running status is normal, the central management platform confirms that the target intelligent agent has been deployed and updates the deployment record from "Deployment in Progress" to "Deployment Completed". When the running status is error status or unexpected stop status, the central management platform determines that the preset rollback conditions are met.

[0102] When the runtime management plugin fails to return a status within the preset response time, or the returned status is insufficient to confirm that the target agent is operating normally, the central management platform increases the retry count in the deployment record and waits for the next preset check cycle. The change in the retry count is saved to the deployment record for further judgment in step S420.

[0103] Step S440: Collect runtime status through runtime event interface.

[0104] The runtime management plugin can register listener functions through the event interface provided by the AI ​​agent runtime. When the target agent starts, terminates, calls a model, or executes a tool, the AI ​​agent runtime will pass the corresponding runtime events to the listener functions. The runtime management plugin can receive runtime events generated by the target agent without modifying the main program of the AI ​​agent runtime.

[0105] For session initiation events, the runtime management plugin updates the target agent's local running status to running and establishes a session status record; for session termination events, it records whether the session ended normally and the running time; for model invocation events, it records the model name, invocation start time, invocation time, invocation result, and model input / output metrics; for tool invocation events, it records the tool name, execution time, and execution result.

[0106] To keep the data structure concise, the above data can be uniformly represented as operational metrics. These operational metrics are stored in the local state record of the runtime management plugin, based on the target agent identifier and session identifier. When querying the operational status, the central management platform can simultaneously read the target agent's operational metrics to determine whether the target agent has generated normal operational activities.

[0107] Step S450: Determine the rollback target.

[0108] Once the central management platform determines that the preset rollback conditions are met, it updates the deployment record to a pending rollback state and locates the target agent and target runtime node based on the deployment record. For multiple target agents in the same service solution, only those that meet the preset rollback conditions are identified as rollback targets, while other target agents in normal operation continue to run.

[0109] When an anomaly occurs after the target agent undergoes an incremental update, the central management platform prioritizes selecting the most recently generated valid file snapshot before the incremental update; when an anomaly occurs after the target agent is first created, a valid file snapshot formed during the creation process is selected to reconstruct the complete resource state of the target agent.

[0110] Step S500: When the preset rollback conditions are met, the file snapshot is sent to the runtime management plugin so that the runtime management plugin cleans up the workspace and restores the agent resources according to the file snapshot, and updates the deployment record.

[0111] like Figure 6 As shown, this step is used to reconstruct the target agent's workspace and runtime registration information based on a valid file snapshot saved by the central management platform. The recovery operation is limited to the target agent's workspace and registration items, and does not delete other agent resources on the same runtime node. Step S500 includes the following sub-steps: In step S510, the central management platform generates a rollback request.

[0112] The central management platform queries the deployment records for valid file snapshots associated with the target agent, selects the target file snapshot from the valid snapshots, and checks whether the target file snapshot contains all necessary resource items and the runtime registration information of the target agent. If the check passes, a rollback request is generated based on the target agent identifier and the target file snapshot.

[0113] The rollback request includes the target agent identifier and a snapshot of the target file. The central management platform sends the rollback request to the runtime management plugin of the target runtime node through the same communication client as the deployment request, enabling the rollback request to use the existing node communication address and authentication information.

[0114] Step S520: The runtime management plugin verifies the target file snapshot.

[0115] Upon receiving a rollback request, the runtime management plugin verifies the authentication information in the request and checks whether each resource item in the target file snapshot has its relative position and resource content. If the target file snapshot is incomplete, the runtime management plugin stops the recovery operation and returns an invalid snapshot result to the central management platform, avoiding the deletion of the existing workspace due to a lack of necessary resources.

[0116] After the integrity verification is passed, the runtime management plugin locates the work area and the registered items in the runtime global configuration based on the target agent identifier, and determines them as the processing scope of this recovery operation.

[0117] Step S530: Clean up and rebuild the workspace.

[0118] The runtime management plugin recursively deletes existing content in the target agent's workspace. This includes existing agent resources, as well as session records, cached data, and temporary files generated during runtime, but does not process directories outside the target agent's workspace.

[0119] After the workspace is cleaned up, the runtime management plugin recreates the workspace and necessary subdirectories based on the relative positions recorded in the target file snapshot. Creating directories before restoring files ensures that each resource item in the target file snapshot has a writable location.

[0120] It should be noted that when the workspace does not exist, the runtime management plugin directly creates the workspace; when the workspace has been partially deleted, it is still rebuilt according to the same directory creation process. Therefore, executing the same rollback request multiple times can result in a consistent workspace resource state.

[0121] Step S540: Restore the agent resources according to the target file snapshot.

[0122] The runtime management plugin iterates through the resource items in the target file snapshot, establishes the target file location based on the relative position of the resource items, and writes the corresponding resource content to the target file. After each resource item is written, the recovery result for that resource item is recorded; if the recovery of a resource item fails, subsequent runtime registration for recovery is stopped, and the corresponding failure location is returned.

[0123] After all workspace resources are successfully restored, the runtime management plugin reads the runtime registration information from the target file snapshot and writes this registration information into the runtime global configuration. If the target agent's registration information already exists in the runtime global configuration, the registration information from the target file snapshot is used to replace the original registration information; otherwise, new registration information is added.

[0124] Step S550: Verify the recovery result and update the deployment record.

[0125] The runtime management plugin reads each resource item after recovery and confirms that the number of resource items matches the target file snapshot. It also checks if the target agent's registration information exists in the runtime global configuration. If the check passes, it returns a successful rollback result to the central management platform; if the check fails, it returns a rollback failure result and the resource items that failed the check.

[0126] After receiving a successful rollback result, the central management platform updates the target agent's availability status to "deployed" and saves the rollback completion time and the reason for the exception that triggered the rollback in the deployment record. When rollback is used to handle a failed deployment or update operation, the result of the operation can be recorded as a failure, while simultaneously recording that the target agent has been restored to an available version, to distinguish between the operation result and the target agent's current availability status.

[0127] Upon receiving a rollback failure result, the central management platform updates the deployment record to a rollback failure status and saves the failed resource items for further processing by the administrator. A rollback failure will not trigger the deletion or redeployment of other target agents on the same runtime node.

[0128] Step S560: Execute the target agent deletion and idle connection configuration cleanup.

[0129] When a user unsubscribes or an administrator initiates a deletion request, the central management platform sends a deletion command to the runtime management plugin. The runtime management plugin locates the workspace and configuration directory based on the target agent's identifier, recursively deletes the corresponding directories, and removes the target agent's registration information from the runtime global configuration.

[0130] After deleting the target agent, the runtime management plugin counts the remaining agent registrations in the runtime global configuration. When the number of agent registrations is greater than zero, the public connection configuration is not processed; when the number of agent registrations is zero, the model provisioning service configuration and external tool service connection configuration are deleted, and the cleanup results are returned to the central management platform.

[0131] For example, when two target agents are deployed on the same runtime node, deleting the first target agent retains its public connection configuration; deleting the second target agent reduces the agent registration count to zero, and the runtime management plugin synchronously clears the public connection configuration. This process prevents the runtime node from attempting to connect to external services when no target agent exists.

[0132] Step S570: Merge runtime restart requests.

[0133] When deployment, update, rollback, or deletion operations require the AI ​​agent runtime to reload its configuration, the runtime management plugin can initiate a preset wait timer. Multiple restart requests received within the preset wait time are merged into a single restart operation. After the preset wait time expires, the runtime management plugin sends a restart command to the AI ​​agent runtime.

[0134] After the restart command is sent, the runtime management plugin checks whether the AI ​​agent runtime has resumed service according to a preset readiness check cycle, until it is confirmed to be ready or the preset waiting time is reached. The central management platform records the most recent restart time of the target runtime node and does not send restart requests repeatedly within a preset cooldown period to reduce the impact of continuous restarts in a short period on the running service.

[0135] In one specific application scenario, the central management platform is deployed on a first server, while the target AI agent runtime is deployed on a second server. The runtime management plugin listens on the management service port on the second server. After the enterprise user's AI agent service subscription is approved, the central management platform queries the corresponding node record on the second server to confirm its online status and parses it to obtain two AI agent templates.

[0136] The central management platform establishes deployment records for the two target agents and sends deployment requests to the runtime management plugin sequentially. The runtime management plugin creates workspaces on the second server, writes agent resources, adds runtime registration information, and then returns the deployment results. The central management platform generates file snapshots based on each deployment result and associates these snapshots with their respective deployment records.

[0137] The health check scheduler queries the operational status of the two target agents during subsequent checks. If the first target agent returns a normal operational status, the corresponding deployment record is updated to deployment complete. If the second target agent fails to return a valid status within the preset check period, the number of retries gradually increases, and the preset rollback condition is met after reaching the preset maximum retry threshold.

[0138] The central management platform reads the valid file snapshot corresponding to the second target agent, generates a rollback request, and sends it to the runtime management plugin. The runtime management plugin cleans up the workspace of the second target agent and restores its identity resources, capability resources, runtime configuration, and runtime registration information according to the file snapshot. After the restoration is complete, the workspace and running state of the first target agent remain unchanged.

[0139] It should be noted that the server address, service port, check cycle, response time, and number of retries in the above embodiments can all be set according to the deployment environment. The technical solution of this application does not limit the programming language used by the central management platform and runtime management plugin, nor does it limit the specific product type of the AI ​​agent runtime. As long as the runtime node can provide local file read / write capabilities and runtime status acquisition capabilities, the method described in this application can be applied.

[0140] This application also provides a distributed AI agent remote deployment and management system that supports automatic snapshot rollback. Please refer to [link / reference]. Figure 7 The distributed AI agent remote deployment and management system that supports automatic snapshot rollback includes: The event detection module 10 is used to determine the target runtime node and template data corresponding to the target intelligent agent when a deployment trigger event is detected; The instruction sending module 20 is used to send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources to obtain the deployment result; The intelligent agent resources are configured as a set of files and configurations used to drive the target intelligent agent to run; The relationship establishment module 30 is used to generate a file snapshot of the target intelligent agent based on the deployment results, and to establish an association between the file snapshot and the deployment record; The condition judgment module 40 is used to obtain the running status of the target intelligent agent according to a preset inspection cycle, and to determine whether the preset rollback conditions are met based on the deployment record and the running status. The rollback execution module 50 is used to send the file snapshot to the runtime management plugin when the preset rollback conditions are met, so that the runtime management plugin can clean up the workspace, restore the agent resources according to the file snapshot, and update the deployment record.

[0141] It should be noted that the functions of the above modules can be completed through distributed collaboration between the central management platform and the runtime management plugin. Specifically, the event detection module 10, relationship establishment module 30, and condition judgment module 40 are deployed on the central management platform; the instruction sending module 20 and rollback execution module 50 are executed locally on the target runtime node through the runtime management plugin. The central management platform interacts with the runtime management plugin through a network communication interface to form a cross-node distributed collaborative processing link.

[0142] The distributed AI agent remote deployment management system supporting automatic snapshot rollback provided in this application adopts the distributed AI agent remote deployment management method supporting automatic snapshot rollback in the above embodiments. Compared with the prior art, the beneficial effects of the distributed AI agent remote deployment management system supporting automatic snapshot rollback provided in this application are the same as the beneficial effects of the distributed AI agent remote deployment management method supporting automatic snapshot rollback provided in the above embodiments, and other technical features in the distributed AI agent remote deployment management system supporting automatic snapshot rollback are the same as the features disclosed in the methods of the above embodiments, and will not be repeated here.

[0143] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0144] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct or indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for remote deployment and management of distributed AI agents supporting automatic snapshot rollback, characterized in that, The method includes the following steps: Upon detecting a deployment trigger event, determine the target runtime node and template data corresponding to the target agent; Send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources, thereby obtaining the deployment result; The intelligent agent resources are configured as a set of files and configurations used to drive the target intelligent agent to run; Based on the deployment results, a file snapshot of the target agent is generated, and the association between the file snapshot and the deployment record is established; The running status of the target intelligent agent is obtained according to a preset inspection cycle, and the preset rollback conditions are determined based on the deployment record and the running status. When the preset rollback conditions are met, the file snapshot is sent to the runtime management plugin so that the runtime management plugin can clean up the workspace, restore the agent resources based on the file snapshot, and update the deployment record.

2. The distributed AI agent remote deployment and management method supporting automatic snapshot rollback as described in claim 1, characterized in that, When a deployment trigger event is detected, the steps for determining the target runtime node and template data corresponding to the target agent include: Receive node registration information sent by the runtime management plugin; wherein, the node registration information includes node communication address, runtime version and authentication information; The node registration information is validated for legality. Node records are established based on the validated node registration information, and node records with normal communication are marked as online. In response to a subscription approval event or a manual deployment request, the target runtime node is determined from the node records in the online state, and the subscription record corresponding to the target agent is obtained; The intelligent agent template is queried according to the service plan associated with the subscription record. If the service plan is not associated with an intelligent agent template, the intelligent agent template is queried according to the independent template identifier associated with the subscription record to obtain the template data. Based on the subscription record and the target runtime node, query whether there is a deployment record with a status of "installing"; If a deployment record in the "Installation" state already exists, stop creating new deployment records and return a message indicating that deployment is in progress. If no deployment record in the state of installation exists, a new deployment record is created, and the step of generating deployment instructions based on the template data is executed.

3. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 2, characterized in that, The steps of sending deployment instructions generated based on the template data to the runtime management plugin of the target runtime node include: Based on the node communication address and authentication information of the target runtime node, a deployment request containing the target agent identifier and the agent resources is generated; The deployment request is sent to the runtime management plugin through the central management platform, so that the runtime management plugin can verify the authentication information and query whether there is registration information in the runtime global configuration that is the same as the target intelligent agent identifier; When no identical registration information exists, the work area is established, the agent resource is written to the local location corresponding to the resource type, and the registration information of the target agent is added to the runtime global configuration. Update the local state record of the runtime management plugin and return the deployment results, including the workspace location and resource write results, to the central management platform.

4. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 3, characterized in that, The method further includes: Obtain the incremental update request for the target agent, and extract the changed resource set from the incremental update request; The corresponding local location is determined based on the resource fields in the changed resource set, and only the resource content corresponding to the changed resource set is covered; The configuration fields in the changed resource set are merged with the existing configuration, the configuration fields not specified in the incremental update request are retained, and the registration information in the runtime global configuration is updated. After the incremental update is completed, a new file snapshot is generated, the new file snapshot is associated with the deployment record, and the file snapshot before the update is retained.

5. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 1, characterized in that, Based on the deployment results, the steps of generating a file snapshot of the target agent and establishing the association between the file snapshot and the deployment record include: Based on the resource writing results recorded in the deployment results, determine the snapshot resource item corresponding to the target agent; The relative position and resource content of each snapshot resource item are read from the workspace and runtime global configuration to generate a file snapshot; When all the snapshot resource items are readable and the registration information of the target agent exists, the file snapshot is marked as a valid file snapshot; The valid file snapshots are persistently stored on the central management platform, and the association between the valid file snapshots and the deployment records is established according to the target agent identifier and the snapshot version.

6. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 1, characterized in that, The steps of obtaining the running status of the target intelligent agent according to a preset inspection cycle, and determining whether the preset rollback conditions are met based on the deployment record and the running status include: Scan deployment records in the deployment state according to a preset inspection cycle, and obtain the deployment time and number of retries corresponding to each deployment record; When the deployment time has not reached the preset deployment timeout threshold and the number of retries has not reached the preset maximum retry threshold, the runtime management plugin is used to query the running status of the target intelligent agent. When the deployment time reaches the preset deployment timeout threshold, the number of retries reaches the preset maximum retry threshold, or the running status is a preset abnormal state, the preset rollback condition is determined to be met; wherein, the preset abnormal state includes error state and unexpected stop state; If a valid running status is not obtained, the number of retries is increased, and when the running status is normal, the deployment record is updated to the deployment completed status.

7. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 6, characterized in that, Before the step of querying the runtime status of the target agent through the runtime management plugin, the following is also included: The runtime management plugin registers a listening function on the event interface provided by the AI ​​agent during runtime to receive runtime events generated by the target agent; wherein the runtime events include session events, model invocation events, and tool invocation events. The running status of the target agent is updated based on the start and end results in the session event, and running metrics are generated based on the model call event and the tool call event; The running status and the running metrics are stored in the local status record of the runtime management plugin for querying by the central management platform.

8. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 6, characterized in that, When preset rollback conditions are met, the step of sending the file snapshot to the runtime management plugin includes: Select a target file snapshot from the valid file snapshots associated with the deployment record, and generate a rollback request based on the target agent identifier and the target file snapshot; The rollback request is sent to the runtime management plugin so that the runtime management plugin can verify the integrity of the target file snapshot; If the integrity check passes, clear the existing content in the work area, rebuild the work area, and restore the resource content item by item according to the relative position in the target file snapshot; The registration information in the runtime global configuration is restored based on the target file snapshot, and a rollback success result is returned when all restored resource items are readable and the registration information exists. Based on the successful rollback result, the available status of the target agent is updated to the deployed status, and the deployment operation result that triggered the rollback is recorded in the deployment record.

9. The remote deployment and management method for distributed AI agents supporting automatic snapshot rollback as described in claim 1, characterized in that, The method further includes: In response to a deletion request for the target agent, a deletion command is sent to the runtime management plugin; The runtime management plugin recursively deletes the target agent's workspace and configuration directory, and removes the target agent's registration information from the runtime global configuration; Obtain the remaining number of registered agents in the runtime global configuration; When the number of registered agents is zero, delete the idle connection configuration in the runtime global configuration and update the deployment record according to the deletion result; wherein, the idle connection configuration includes model provisioning service configuration and external tool service connection configuration.

10. A distributed AI agent remote deployment and management system supporting automatic snapshot rollback, characterized in that, The system includes: The event detection module is used to determine the target runtime node and template data corresponding to the target intelligent agent when a deployment trigger event is detected. The instruction sending module is used to send a deployment instruction generated based on the template data to the runtime management plugin of the target runtime node, so that the runtime management plugin can establish the workspace of the target agent on the target runtime node and write the agent resources to obtain the deployment result; The intelligent agent resources are configured as a set of files and configurations used to drive the target intelligent agent to run; The relationship establishment module is used to generate a file snapshot of the target agent based on the deployment results, and establish the association between the file snapshot and the deployment record; The condition judgment module is used to obtain the running status of the target intelligent agent according to a preset inspection cycle, and to determine whether the preset rollback conditions are met based on the deployment record and the running status. The rollback execution module is used to send the file snapshot to the runtime management plugin when the preset rollback conditions are met, so that the runtime management plugin can clean up the workspace, restore the agent resources according to the file snapshot, and update the deployment record.