Agent-based efficient dynamic deployment system and method
Through a dynamic deployment system based on Agent, Java Agent technology is used to achieve smooth deployment and exception recovery of code without restarting the application, which solves the problem of service interruption in automated deployment tools and improves deployment efficiency and system stability.
Patent Information
- Application Number
- CN202510627100.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
AI Technical Summary
Existing automated deployment tools must restart the application when upgrading code, resulting in service interruptions, affecting customer experience and potentially causing losses, and complex version management can easily cause system crashes.
It adopts an efficient and dynamic deployment system based on Agent, including hot deployment management module, code update module, service monitoring module and error recovery module, and uses Java Agent technology to achieve smooth code deployment and exception recovery without restarting the application.
It realizes code updates without interrupting services, improves deployment efficiency and system stability, reduces losses caused by restarts, simplifies the deployment process and improves error handling capabilities.
Smart Images

Figure CN120492009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software deployment tools, and in particular to an efficient dynamic deployment system and method based on Agent. Background Art
[0002] Software deployment is a crucial step in current software development and operations. Traditional software deployment methods typically involve manual configuration, file uploads, and service restarts. These processes are often complex, tedious, and error-prone due to version management. In recent years, with the continuous advancement of technology, automated deployment tools have gradually become mainstream, streamlining the deployment process and improving efficiency.
[0003] However, existing automated deployment tools still have a drawback. Upgrading code requires restarting the application. While partial restarts can be addressed by rotating upgrades across multiple nodes, interrupting programs currently executing on the restarted nodes could potentially cause losses to key customers. Therefore, ensuring that service nodes can perform emergency bug updates without restarting them presents a challenge. Furthermore, system upgrades typically require complex version management, slowing down response times. Multiple versions can easily lead to upgrade failures and system crashes.
[0004] In summary, existing automated deployment tools still have shortcomings in flexibility, performance, and error handling. Summary of the Invention
[0005] In response to the above technical problems, the present invention provides an efficient dynamic deployment system and method based on Agent, which can greatly improve the system bug repair process and provide availability.
[0006] The present invention is achieved by adopting the following technical solutions: In a first aspect, an efficient dynamic deployment system based on an agent includes: Hot deployment management module: receives new code or update patches submitted by developers, and verifies and integrates the updates; Code update module: This module preloads agent packages through program startup parameters to add functionality, allowing for smooth deployment of verified new code or patches to running systems without service interruption. Service monitoring module: set up on the platform base to detect the code hot deployment process; Error recovery module: When the service monitoring module detects an anomaly or performance degradation in a deployed service, the error recovery mechanism is immediately activated.
[0007] Specifically, the hot deployment management module completes function addition through front-end and back-end code deployment, and also sets a log function to record each update in detail to facilitate rollback and error tracking.
[0008] Specifically, the error recovery mechanism rolls back to the previous stable version with one click after startup, ensuring the continuity and stability of the service.
[0009] On the other hand, an efficient dynamic deployment method based on Agent, based on an efficient dynamic deployment system based on Agent, comprising the following steps; Step S1: The user selects the Class file that needs to be hot-upgraded and deployed on the front-end interface, and the front-end sends the user's request to the back-end server; Step S2: After receiving the request, the backend server verifies and processes it; Step S3: The backend server communicates with the Java Agent and sends a request to the Java Agent to perform code replacement; Step S4: After receiving the request, the Java Agent calls the virtual machine to perform code replacement and returns the replacement result to the backend server; Step S5: The backend server notifies the frontend of the replacement result. After receiving the replacement result, the frontend displays it to the user.
[0010] Specifically, the user's request in step S1 includes information related to the class name and version number of the Class file that needs to be upgraded.
[0011] Specifically, in step S2, the backend server verifies the request, including checking the legitimacy of the request and the user's authority.
[0012] Specifically, in step S2, the backend server processes the request by backing up the original code and preparing new Class bytecode.
[0013] Specifically, in step S4, the virtual machine provides a calling API for the Java Agent, allowing the bytecode of the class to be dynamically replaced at runtime.
[0014] The beneficial effects of the present invention are as follows: the present invention realizes an efficient, stable and automated hot deployment method by integrating multiple components such as a hot deployment manager, a code update module, a service monitor and an error recovery mechanism, which significantly improves the operational efficiency and system stability of the DevOps pipeline; solves the problem that automated deployment tools must restart applications when upgrading codes, thereby reducing or avoiding losses to customers caused by service interruptions and improving deployment efficiency; realizes the function of emergency upgrade of service nodes for BUGs without restarting, simplifies the deployment process, and improves deployment flexibility and error handling capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying any creative work.
[0016] Figure 1 This is a flow chart of the efficient dynamic deployment method based on Agent in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0018] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0019] The following is combined with Figure 1 , some embodiments of the present invention are described in detail. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0020] The present invention proposes an efficient dynamic deployment system based on Agent, comprising: Hot deployment management module: receives new code or update patches submitted by developers, and verifies and integrates the updates; Code update module: This module preloads agent packages through program startup parameters to add functionality, allowing for smooth deployment of verified new code or patches to running systems without service interruption. Service monitoring module: set up on the platform base to detect the code hot deployment process; Error recovery module: When the service monitoring module detects an anomaly or performance degradation in a deployed service, the error recovery mechanism is immediately activated.
[0021] In this embodiment, the hot deployment management module completes function addition through front-end and back-end code deployment, and also sets a log function to record each update in detail to facilitate rollback and error tracking; the error recovery mechanism rolls back to the previous stable version with one click after startup to ensure the continuity and stability of the service.
[0022] In a specific embodiment, the efficient dynamic deployment system based on Agent is aimed at application systems that can be dynamically updated and require continuous services. The system mainly consists of several key parts: a hot deployment manager and a code update module.
[0023] The hot deployment manager is a core component of this system. It receives new code or patch updates submitted by developers and verifies and integrates these updates. It also provides logging, ensuring a detailed record of every update, facilitating rollbacks and error tracking. The manager adds functionality by deploying front-end and back-end code.
[0024] Secondly, the code update module is responsible for smoothly deploying verified new code or patches to the running system without interrupting services. The update module pre-loads the agent package through program startup parameters to add functions. During hot code deployment, the platform's service monitor, in conjunction with the platform's underlying service monitoring, immediately activates an error recovery mechanism if a deployed service anomaly or performance degradation is detected. This mechanism enables a one-click rollback to the previous stable version, ensuring service continuity and stability.
[0025] Finally, this system hot deployment solution integrates multiple components such as hot deployment manager, code update module, service monitor and error recovery mechanism to achieve an efficient, stable and automated hot deployment solution, which significantly improves the operational efficiency and system stability of the DevOps pipeline.
[0026] The present invention also proposes an efficient dynamic deployment method based on Agent. In a specific embodiment, Figure 1 As shown, this method involves multiple components such as users, front-end, back-end, Java Agent, and JVM. The following is a detailed description of the process: 1. The user needs to select the class to be upgraded: The user selects the class file to be hot-upgraded on the front-end interface. This step usually involves the user specifying the class to be updated through the front-end management interface.
[0027] 2. The front-end sends an upgrade request: The front-end sends the user's request to the back-end server. The request contains relevant information about the class that needs to be upgraded, such as the class name and version number.
[0028] 3. Backend verification and request processing: After receiving the request, the backend server verifies and processes it. The verification process may include checking the legitimacy of the request and user permissions. The processing process involves backing up the original code and preparing new class bytecode.
[0029] 4. The backend requests the Agent to perform code replacement: The backend server sends a request to the Java Agent to perform code replacement. This step usually involves communication between the backend and the Java Agent.
[0030] 5. The Java Agent calls redefineClasses(): After receiving the request, the Java Agent calls the redefineClasses() method provided by the JVM to perform code replacement. redefineClasses() is a JVM API that allows class bytecode to be dynamically replaced at runtime.
[0031] 6. The Java Agent returns the replacement result: The Java Agent returns the replacement result to the backend server. The result may include information such as whether the replacement was successful and whether any exceptions occurred.
[0032] 7. Backend Notification of Replacement Results: The backend server notifies the frontend of the replacement results. This step typically involves communication between the backend and frontend. If an exception occurs, the backup is restored to ensure system availability and that users are unaware of the upgrade.
[0033] 8. The front-end displays the upgrade results: After receiving the replacement results, the front-end displays them to the user. The user can see whether the upgrade is successful, as well as any possible error messages.
[0034] In this embodiment, the Java Agent is a mechanism provided by the Java Virtual Machine (JVM) that allows developers to dynamically modify or monitor classes loaded into the JVM during program execution. This technology provides developers with a flexible and powerful way to enhance or modify application behavior without modifying the source code. The Java Agent uses the functionality provided by the Instrumentation API to transform the bytecode of a class before or after it is loaded by the class loader. This allows developers to dynamically modify and enhance class behavior during class loading. By implementing the ClassFileTransformer interface, the Java Agent can define a class transformer that performs transformations on loaded classes. This interface allows the Java Agent to inspect and transform the bytecode of class files, thereby modifying and enhancing class methods and fields. The Java Agent can use the Instrumentation API to transform loaded classes at JVM startup or during application execution, including modifying the class bytecode to change class behavior. In addition to modifying class behavior, the Java Agent can also be used to monitor application runtime status, perform performance analysis, and debug code. This helps developers better understand application performance and implement optimizations accordingly.
[0035] Leveraging Java's Agent mechanism, this solution can dynamically modify class behavior at JVM startup or runtime. By implementing a premain or agentmain method and packaging it into an Agent JAR, it can operate on the class before or after the JVM loads it.
[0036] This solution implements an efficient dynamic deployment tool by introducing Java Agent technology, which brings significant benefits: By leveraging Java Agent technology, we can replace specific classes online without restarting the application, effectively enabling hot code deployment. This significantly improves the flexibility and efficiency of software deployment, reduces service interruptions caused by application restarts, and ultimately enhances system availability and stability.
[0037] Reduces the cost of traditional software deployment and maintenance. Traditional software deployment often requires tedious steps such as manual configuration, file uploading, and restarting services, which is not only time-consuming and labor-intensive, but also prone to errors. This solution simplifies these processes through automation, reduces human resource investment, and also reduces the risks caused by human operational errors. The currently popular DevOps pipeline usually requires a process of downtime, deployment, and restart when deploying new code or fixing bugs, which will cause temporary service interruptions. The hot deployment solution allows code updates without interrupting services, which also significantly improves deployment efficiency and reduces downtime during the deployment process.
[0038] This solution has a positive impact on improving user experience and satisfaction. By enabling emergency bug upgrades without restarting service nodes, we can minimize user impact and avoid losses caused by service interruptions. This is particularly important in critical business scenarios, such as production lines and logistics, where a vehicle rolls off the line every few seconds and materials need to be delivered to the line promptly. Any brief service interruption can cause a production line halt, resulting in serious consequences.
[0039] In summary, the introduction of Java Agent technology addresses the issue of existing automated deployment tools requiring application restarts for code upgrades, achieving significant technical, economic, and social benefits. Java Agent technology is used to manipulate loaded program code; the front-end selects classes to be upgraded and sends them to the back-end for processing; the back-end service uses the Agent interface to redefine and replace code already loaded into the JVM; and a detailed error handling mechanism is incorporated to ensure application stability.
[0040] For the sake of simplicity, the aforementioned embodiments are described as a series of actions. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are preferred embodiments, and the actions involved are not necessarily required by this application.
[0041] The above embodiments describe the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions are merely illustrative of the principles of the present invention. Without departing from the spirit and scope of the present invention, modifications and variations made by those skilled in the art without departing from the spirit and scope of the present invention should be within the scope of protection of the appended claims.
Claims
1. An efficient dynamic deployment system based on Agent, characterized by: include: Hot deployment management module: receives new code or update patches submitted by developers, and verifies and integrates the updates; Code update module: This module preloads agent packages through program startup parameters to add functionality, allowing for smooth deployment of verified new code or patches to running systems without service interruption. Service monitoring module: set up on the platform base to detect the code hot deployment process; Error recovery module: When the service monitoring module detects an anomaly or performance degradation in a deployed service, the error recovery mechanism is immediately activated.
2. The efficient dynamic deployment system based on Agent according to claim 1, characterized in that: The hot deployment management module completes function addition through front-end and back-end code deployment, and also sets a log function to record each update in detail to facilitate rollback and error tracking.
3. The efficient dynamic deployment system based on Agent according to claim 1, characterized in that: The error recovery mechanism rolls back to the previous stable version with one click after startup, ensuring the continuity and stability of the service.
4. An efficient dynamic deployment method based on an agent, implemented based on an efficient dynamic deployment system based on an agent according to any one of claims 1 to 3, characterized in that: The following steps are included; Step S1: The user selects the Class file that needs to be hot-upgraded and deployed on the front-end interface, and the front-end sends the user's request to the back-end server; Step S2: After receiving the request, the backend server verifies and processes it; Step S3: The backend server communicates with the Java Agent and sends a request to the Java Agent to perform code replacement; Step S4: After receiving the request, the Java Agent calls the virtual machine to perform code replacement and returns the replacement result to the backend server; Step S5: The backend server notifies the frontend of the replacement result. After receiving the replacement result, the frontend displays it to the user.
5. The efficient dynamic deployment method based on Agent according to claim 4, characterized in that: The user's request in step S1 includes the class name and version number information of the Class file that needs to be upgraded.
6. The efficient dynamic deployment method based on Agent according to claim 4, characterized in that: In step S2, the backend server verifies the request, including checking the legitimacy of the request and the user's authority.
7. An efficient dynamic deployment method based on Agent according to claim 6, characterized in that: In step S2, the backend server processes the request by backing up the original code and preparing new Class bytecode.
8. The efficient dynamic deployment method based on Agent according to claim 4, characterized in that: In step S4, the virtual machine provides a calling API for the Java Agent, allowing the bytecode of the class to be dynamically replaced at runtime.