A microservice visual deployment method and system based on virtual machine environment
By adopting a visual deployment method in the virtual machine environment of the power industry, using web console, registry warehouse and agent programs, the problems of low efficiency of microservice management and difficult monitoring are solved, and efficient and reliable microservice deployment and operation and maintenance are achieved.
Patent Information
- Application Number
- CN202310337825.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-03-31
AI Technical Summary
In the power industry, there are many microservices and distributed on multiple servers. The traditional command line management efficiency is low, making it difficult to achieve consistency of multi-node microservice package versions, and monitoring is difficult, and the system large version upgrade takes too long.
The microservice visual deployment method based on the virtual machine environment is adopted, and the unified management, rapid deployment and real-time monitoring of microservice packages are realized through visualization of the web console, registry product warehouse and agent programs, including defining shell scripts, maven project object model packaging plug-in, health checking strategies, etc.
It improves the efficiency of microservice deployment, reduces manual operation workload, ensures the consistency of microservice versions between multiple servers, simplifies operation and maintenance work, and realizes real-time monitoring of the health status of microservices.
Smart Images

Figure CN116302837B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microservice deployment in a virtual machine environment, and in particular to a microservice visual deployment method and system based on a virtual machine environment. Background Art
[0002] As power business continues to expand, the functions and architectures of specialized systems are becoming increasingly complex, and the system size is gradually expanding. To address the slow iteration of large, monolithic programs and their inability to quickly respond to business needs, the power industry is gradually introducing the concept of microservices architecture. This brings with it the following new challenges for microservice deployment:
[0003] 1. There are many microservices. Using traditional command line methods to manage microservice clusters is labor-intensive and repetitive, with low manual operation efficiency and long system upgrade times.
[0004] 2. There are many server nodes, and the traditional command line management method is inefficient. It does not support the simultaneous upgrade of microservice programs on multiple nodes, and it is difficult to ensure the consistency of the microservice program package versions on multiple nodes.
[0005] 3. The operating status and deployment information of microservices span multiple servers, making monitoring difficult.
[0006] In order to solve the above deployment problems and improve the efficiency of microservice deployment in the virtual machine environment of the power industry, it is urgent to invent a microservice management method, and then provide an efficient and reliable microservice deployment system to realize the visual management of microservices. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for visually deploying microservices based on a virtual machine environment, which can standardize the management of microservice program packages in a virtual machine environment, simplify the microservice deployment process, and improve the efficiency of microservice program management.
[0008] The present invention adopts the following technical solutions:
[0009] A microservice visual deployment method based on a virtual machine environment includes the following steps:
[0010] A: Define the shell script of the microservice in Linux system;
[0011] B: Define the Maven project object model packaging plug-in, compile the code to form a microservice program, and then package and compress the microservice program, the shell script obtained in step A, and the description information file to make a microservice deployment package;
[0012] C: Upload the microservice deployment package obtained in step B to the registry artifact warehouse for management through the visual web console; parse the microservice deployment package and write the descriptive information file in the microservice deployment package into the database; at the same time, display the information of the uploaded microservice deployment package through the visual interface;
[0013] D: The user selects the name, version, and server node of the microservice to be deployed through the visual web console. The user also enters the port number value parameter, environment variable parameters, startup parameters, and health check policy information through the visual web console, and then submits the input data to the server-side backend program for processing.
[0014] E: The server asynchronously splits the microservice deployment tasks, generates specific deployment tasks corresponding to each server node, and pushes them to the agent program on the corresponding server through websocket messages;
[0015] F: The agent program executes the specific deployment tasks issued by the server, and after the microservice is started, it sends the runtime status changes of the microservice back to the server in real time for display;
[0016] G: After the microservice is started, the agent program sets up a scheduled check mechanism to perform regular checks on the health status of the microservice according to the health check policy information defined in step D, and pushes the results of the health status check to the server through websocket messages to achieve real-time monitoring of the health status of the microservice.
[0017] In step A, the shell script includes a startup command, a port number name definition, an environment variable definition, and a startup parameter definition.
[0018] In the step B, the description information file includes the name of the microservice, the version of the microservice, and the packaging time of the microservice.
[0019] In the step C, when parsing the microservice deployment package, the name of the microservice, the version of the microservice, and the packaging time of the microservice are obtained by parsing the description information file in the microservice deployment package, and the data is written to the database.
[0020] In the step C, a search function based on the name, version and packaging time of the microservice is provided through a visual interface.
[0021] In step D, the name and version of the microservice are obtained by calling the management function provided by the registry artifact repository after the user uploads the deployment package in step C.
[0022] In step D, the health check policy information is used to determine the health status of the microservice; it is a user-defined condition for determining whether the microservice is healthy, and is implemented through port check policy, interface check policy and process check policy.
[0023] In step E, the server verifies the validity of the microservice name, version, port number value parameters, environment variable parameters, startup parameters and health check policy information submitted by the user, as well as the selected deployed server node, and assembles the data into specific deployment tasks according to the server node and pushes them to the agent program on the corresponding server through websocket messages.
[0024] In step F, the agent program pulls the microservice deployment package from the registry artifact repository to the local computer for decompression based on the specific deployment task information issued by the server, and verifies the deployment package information after decompression. After verification, the port number value parameters, environment variable parameters, startup parameters, and health check policy information in the deployment package information are assembled and transferred to the shell script, which is executed to start or stop the microservice.
[0025] A microservice visualization deployment system based on a virtual machine environment, characterized in that: it includes a visualization web console, a server, a registry product warehouse, and an agent program, and the visualization web console, the server, the registry product warehouse, and the agent program perform information exchange according to the microservice visualization deployment method based on a virtual machine environment according to any one of claims 1 to 9;
[0026] Among them, the visual web console is used to realize the selection of microservice deployment information and task submission, and provide query services; the server is used to realize the scheduling of microservice deployment tasks and accept the data reported by each node agent; the registry product warehouse is used to realize the storage and download functions of microservice deployment package files, as well as the management of microservice versions; the agent program is used to realize the execution of corresponding tasks and regular data reporting.
[0027] This invention uses a registry artifact repository to store microservice deployment package files and deployment package information, standardizing the unified management of microservice deployment packages and ensuring consistency of microservice versions across multiple servers. Through a visual web console and defined shell scripts, it supports rapid deployment of microservice projects, reduces manual operations, and improves microservice deployment efficiency. By defining health check strategies, it effectively monitors microservice deployment status and operational information, improving microservice operation and maintenance efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0029] The present invention is described in detail below with reference to the accompanying drawings and embodiments:
[0030] like Figure 1 As shown, the microservice visualization deployment method based on a virtual machine environment of the present invention includes the following steps:
[0031] A: Define the shell script of the microservice in the Linux system; the shell script includes the startup command, port number name definition, environment variable definition and startup parameter definition;
[0032] In step A, the shell script is used to obtain user-entered commands and parameters to start or stop the microservice. The shell script includes the port number name definition, which receives the port number value parameter entered by the user in step D; the environment variable definition, which receives the environment variable parameters entered by the user in step D; and the startup parameter definition, which receives the startup parameters entered by the user in step D.
[0033] B: Define the Maven project object model packaging plug-in, compile the code to form a microservice program, and then package and compress the microservice program, the shell script obtained in step A, and the description information file to make a microservice deployment package;
[0034] Maven is an automated build tool for the Java platform. The Maven Project Object Model Packaging Plugin allows users to assemble project outputs along with their dependencies, modules, site documentation, and other files into a distributable archive file. When using the Maven Project Object Model Packaging Plugin for packaging, the present invention introduces the Assembly plugin's descriptor file and configures the Assembly plugin's descriptor file information, which includes information such as the packaging format, packaging directory, and file name. The descriptive information file contains the microservice name, microservice version, and packaging time of the microservice.
[0035] C: Upload the microservice deployment package obtained in step B to the registry artifact repository for management through the visual web console; parse the microservice deployment package, obtain the microservice name, microservice version, and microservice packaging time by parsing the description information file in the microservice deployment package, and write the data to the database; at the same time, display the information of the uploaded microservice deployment package through a visual interface, and provide a search function based on the microservice name, microservice version, and packaging time;
[0036] In the present invention, the registry artifact warehouse is used to implement the storage and download functions of microservice deployment package files, as well as the management of microservice versions, which facilitates the unified management of microservice versions by implementation personnel.
[0037] D: The user selects the name, version, and server node of the microservice to be deployed through the visual web console, and enters the port number value parameter, environment variable parameters, startup parameters, and health check policy information through the visual web console. The input data is then submitted to the server-side backend program for processing;
[0038] In the present invention, the name and version of the microservice can be obtained by calling the management function provided by the registry artifact repository after the user uploads the deployment package in step C.
[0039] In the present invention, the health check policy information is used to determine the health status of the microservice in step G. The health check policy information is a user-defined condition for determining whether the microservice is healthy, which can be implemented through port check policy, interface check policy and process check policy.
[0040] The port check strategy is to periodically access the port defined by the microservice and determine whether the microservice is healthy based on whether the port is accessible. The interface check strategy is to make a request based on the HTTP interface provided by the microservice and determine whether the microservice is healthy based on whether the microservice interface returns a status code of 200. The process check strategy is to check whether the process number assigned by the Linux operating system after the microservice is started exists and determine whether the microservice is healthy.
[0041] In the present invention, the web console can manage microservice deployment packages, microservice deployment tasks, maintenance of server node information, and the health status of microservice instances, making it easier for implementation personnel to manage microservices and reduce the difficulty of operation and maintenance work.
[0042] E: The server asynchronously splits the microservice deployment tasks, generates specific deployment tasks corresponding to each server node, and pushes them to the agent program on the corresponding server through websocket messages;
[0043] In the present invention, the server verifies the validity of the name, version, port number value parameters, environment variable parameters, startup parameters and health check policy information of the microservice submitted by the user in step D, as well as the selected deployed server node, and assembles the data into specific deployment tasks according to the server node and pushes them to the agent program on the corresponding server through websocket messages.
[0044] In the present invention, WebSocket is a protocol for full-duplex communication over a single TCP connection. The two communicating parties have completely equal status. After the connection is established, both parties can send data to each other at any time. The server program is responsible for microservice deployment task scheduling and receiving data reports from each node agent.
[0045] F: The agent program executes the specific deployment tasks issued by the server, and after the microservice is started, it sends the runtime status changes of the microservice back to the server in real time for display;
[0046] In the present invention, the agent program pulls the microservice deployment package from the registry artifact warehouse to the local server for decompression based on the specific deployment task information issued by the server in step E, and verifies the deployment package information after decompression. After the verification, the port number value parameters, environment variable parameters, startup parameters, and health check policy information in the deployment package information are assembled and transferred to the shell script, and the shell script is executed to start or stop the microservice. After the microservice is started, the agent program feeds back the state changes of the microservice during runtime to the server in real time for display.
[0047] In the present invention, the agent program is used to realize the execution of corresponding tasks and regular data reporting;
[0048] G: After the microservice is started, the agent program sets up a scheduled check mechanism to perform regular checks on the health status of the microservice according to the health check policy information defined in step D, and pushes the results of the health status check to the server through websocket messages to achieve real-time monitoring of the health status of the microservice.
[0049] In the present invention, the storage of microservice deployment package files and deployment package information is realized through the registry product warehouse, which can standardize the unified management of microservice deployment packages and ensure the consistency of microservice versions among multiple servers. It effectively solves the defects of the existing technology in managing microservice clusters, which is heavy and repetitive, has low manual operation efficiency, and takes too long to upgrade major system versions.
[0050] The application of the agent program can solve the defects of the existing technology, such as the large number of server nodes, low management efficiency of the traditional command line method, support for simultaneous upgrade of microservice programs of multiple nodes, and difficulty in ensuring the consistency of multi-node microservice program package versions.
[0051] Through the visual web console and defined shell scripts, it can support the rapid deployment of microservice projects, reduce manual operation workload, and improve the efficiency of microservice deployment.
[0052] By defining health check strategies, we can effectively monitor the deployment and operation information of microservices, improve the efficiency of microservice operation and maintenance, and effectively solve the defect of existing technologies that the monitoring is difficult due to the fact that microservice deployment information spans multiple servers.
[0053] In the present invention, the visual web console can also be expressed as a visual deployment server front-end console, the server can also be expressed as a visual deployment back-end management module, the registry product warehouse can also be expressed as a unified program file management program module, and the agent program can also be expressed as a server client management program.
[0054] The microservice visualization deployment system based on a virtual machine environment described in the present invention includes a visualization web console, a server, a registry product warehouse, and an agent program;
[0055] Among them, the visual web console is used to select microservice deployment information and submit tasks, and provides query services;
[0056] Server, used to schedule microservice deployment tasks and receive data reports from agents on each node;
[0057] The registry product repository is used to store and download microservice deployment package files and manage microservice versions.
[0058] Agent program, used to implement the execution of corresponding tasks and regular data reporting;
[0059] The visual web console, server, registry artifact warehouse and agent program perform information interaction according to the microservice visual deployment method based on the virtual machine environment described in claims 1 to 9.
Claims
1. A microservice visualization deployment method based on a virtual machine environment, characterized in that: The following steps are involved: A: Define the shell script of the microservice in Linux system; B: Define the Maven project object model packaging plug-in, compile the code to form a microservice program, and then package and compress the microservice program, the shell script obtained in step A, and the description information file to make a microservice deployment package; C: Upload the microservice deployment package obtained in step B to the registry artifact repository for management through the visual web console; The microservice deployment package is parsed and the description information file in the microservice deployment package is written into the database. At the same time, the information of the uploaded microservice deployment package is displayed through a visual interface. D: The user selects the name, version, and server node of the microservice to be deployed through the visual web console. The user also enters the port number value parameter, environment variable parameters, startup parameters, and health check policy information through the visual web console, and then submits the input data to the server-side backend program for processing. E: The server asynchronously splits the microservice deployment tasks, generates specific deployment tasks corresponding to each server node, and pushes them to the agent program on the corresponding server through websocket messages; F: The agent program executes the specific deployment tasks issued by the server, and after the microservice is started, it sends the runtime status changes of the microservice back to the server in real time for display; G: After the microservice is started, the agent program sets up a scheduled check mechanism to perform regular checks on the health status of the microservice according to the health check policy information defined in step D, and pushes the results of the health status check to the server through websocket messages to achieve real-time monitoring of the health status of the microservice.
2. The method for visually deploying microservices based on a virtual machine environment according to claim 1, characterized in that: In step A, the shell script includes a startup command, a port number name definition, an environment variable definition, and a startup parameter definition.
3. The method for visually deploying microservices based on a virtual machine environment according to claim 1, wherein: In the step B, the description information file includes the name of the microservice, the version of the microservice, and the packaging time of the microservice.
4. The method for visually deploying microservices based on a virtual machine environment according to claim 1, wherein: In the step C, when parsing the microservice deployment package, the name of the microservice, the version of the microservice, and the packaging time of the microservice are obtained by parsing the description information file in the microservice deployment package, and the data is written to the database.
5. The method for visual deployment of microservices based on a virtual machine environment according to claim 1, characterized in that: In the step C, a search function based on the name, version and packaging time of the microservice is provided through a visual interface.
6. The method for visually deploying microservices based on a virtual machine environment according to claim 1, characterized in that: In step D, the name and version of the microservice are obtained by calling the management function provided by the registry artifact repository after the user uploads the deployment package in step C.
7. The method for visual deployment of microservices based on a virtual machine environment according to claim 1, characterized in that: In step D, the health check policy information is used to determine the health status of the microservice; it is a user-defined condition for determining whether the microservice is healthy, and is implemented through port check policy, interface check policy and process check policy.
8. The method for visual deployment of microservices based on a virtual machine environment according to claim 1, characterized in that: In step E, the server verifies the validity of the microservice name, version, port number value parameters, environment variable parameters, startup parameters and health check policy information submitted by the user, as well as the selected deployed server node, and assembles the data into specific deployment tasks according to the server node and pushes them to the agent program on the corresponding server through websocket messages.
9. The method for visual deployment of microservices based on a virtual machine environment according to claim 1, characterized in that: In step F, the agent program pulls the microservice deployment package from the registry artifact repository to the local computer for decompression based on the specific deployment task information issued by the server, and verifies the deployment package information after decompression. After verification, the port number value parameters, environment variable parameters, startup parameters, and health check policy information in the deployment package information are assembled and transferred to the shell script, which is executed to start or stop the microservice.
10. A microservice visual deployment system based on a virtual machine environment, characterized by: The system comprises a visual web console, a server, a registry product warehouse and an agent program, wherein the visual web console, the server, the registry product warehouse and the agent program perform information interaction according to the microservice visual deployment method based on a virtual machine environment according to any one of claims 1 to 9; Among them, the visual web console is used to select microservice deployment information and submit tasks, and provides query services; Server, used to implement microservice deployment task scheduling and receive data reports from agents on each node; The registry product repository is used to store and download microservice deployment package files and manage microservice versions. The agent program is used to execute corresponding tasks and report data regularly.
Citation Information
Patent Citations
Micro-service unified management method and device for multiple registration centers, equipment and medium
CN112286503A
Operation and maintenance monitoring management system
CN114389937A