A method and device for automatic deployment based on microservices

By designing a unified automated deployment process in the microservice architecture, the problem of low efficiency caused by manual intervention in the development, testing, and deployment processes of the microservice architecture is solved, the stability and efficiency of automated deployment are achieved, and rapid iteration is supported.

CN114297073BActive Publication Date: 2024-09-03四川启睿克科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111643861.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2024-09-03
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In the microservice architecture, the lack of a reliable automated delivery mechanism requires human intervention during development, testing, and deployment, resulting in high communication costs and low efficiency, making it difficult to achieve rapid iteration.

Method used

By designing unified interface specifications, the automated deployment process is provided, including merging business code, designing automated deployment models, calling automated deployment interfaces for packaging, testing, and deployment, and generating reports through automated test scripts, eliminating manual intervention and realizing business information interaction.

Benefits of technology

It achieves the stability and efficiency of the automated deployment process, reduces communication costs for the development team, improves development efficiency, reduces human errors, and supports efficient iterations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297073B
    Figure CN114297073B
Patent Text Reader

Abstract

The present invention discloses a method and device for automatic deployment based on microservices, the method comprising merging business codes and providing an automatic configuration file for the required microservices; designing an automatic deployment microservice model and providing a standardized interface for code packaging and calling; creating an automatic deployment task by calling the automatic deployment interface, and completing the packaging, testing, and deployment of the application by calling; pushing execution tasks to complete the opening of the microservice business interface and realize business information interaction; writing business-based automatic test scripts, running the scripts, and generating test reports. The present invention combines automation and continuous integration ideas, which is different from existing isolated and unrelated scripts. Instead, it is an automatic deployment under microservices, which makes it easier to add and optimize component functions, making the deployment operation more stable and efficient. Through a standardized encapsulation model, basic public functions such as packaging, testing, and deployment can be encapsulated into common services to achieve efficient iteration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, and in particular to a method and device for automatic deployment based on microservices. Background Art

[0002] Microservice is an architectural pattern that advocates dividing a single application into a group of small services. These small services run independently in the process and collaborate with each other using lightweight communication mechanisms. Each service is built around a specific business and can be independently deployed to the production environment. When designing a microservice architecture, dividing it according to business lines can effectively reduce the internal friction caused by internal modifications to the service and reduce the cost of later changes. When facing actual development work, the R&D team needs faster and more frequent iterations. The lack of a reliable automated delivery mechanism makes it impossible to effectively control the accuracy and speed of iterations, making the communication costs in development, testing, and deployment very high. Human intervention is often required for reliable deployment of the business. In actual work, scattered script files are used to perform automated work, which is not only difficult to maintain and manage, but also greatly reduces the team's development efficiency and is not conducive to rapid product iteration. Summary of the invention

[0003] The present invention provides a method and device for automatic deployment based on microservices, which can implement unified interface specifications through the microservice architecture to formulate a business automation deployment process, eliminate manual intervention in the face of rapid and frequent iterations, and solve the problem of inefficient development and delivery processes.

[0004] The technical solution adopted by the present invention is to provide a method for automatic deployment based on microservices, comprising the following steps:

[0005] Merge business codes and provide automation configuration files for required microservices;

[0006] Design an automated deployment microservice model and provide standardized interfaces for code packaging and calling;

[0007] By calling the automated deployment interface, you can create automated deployment tasks and complete the packaging, testing, and deployment of the application.

[0008] Push execution tasks, complete the opening of microservice business interfaces, and realize business information interaction;

[0009] Write business-based automated test scripts, run scripts, and generate test reports.

[0010] Preferably, the creating an automated deployment task includes: defining a code repository and building a branch.

[0011] Preferably, when the automated deployment interface is called, code is pulled through the code repository source address.

[0012] Preferably, the automated deployment microservice model includes a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module, and an automated deployment module;

[0013] The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description;

[0014] The service building module is used to create automated packaging tasks by calling the service configuration module interface;

[0015] The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates;

[0016] The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration;

[0017] The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface;

[0018] The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.

[0019] The present invention also provides a device for automatic deployment based on microservices, including a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module, and an automated deployment module;

[0020] The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description;

[0021] The service building module is used to create automated packaging tasks by calling the service configuration module interface;

[0022] The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates;

[0023] The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration;

[0024] The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface;

[0025] The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.

[0026] The beneficial effects of the present invention are:

[0027] (1) The present invention combines automation and continuous integration. Compared with the prior art, it does not use isolated scripts that are not related to each other, but rather uses automated deployment under microservices, which makes it easier to add and optimize component functions, making deployment operations more stable and efficient.

[0028] (2) Through a standardized encapsulation model, the present invention can encapsulate basic common functions such as packaging, testing, and deployment into common services to achieve efficient iteration.

[0029] (3) Through this method, massive business applications are automatically packaged, solving the defects of human error and low efficiency faced by script automation, and establishing a set of automated deployment processes to ensure reliability while improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention is a flowchart of a method for automatic deployment based on microservices disclosed in the present invention.

[0031] Figure 2 This is a structural block diagram of the device for automatic deployment based on microservices disclosed in the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0033] Embodiment 1:

[0034] See also Figure 1 This embodiment discloses a method for automatic deployment based on microservices, including the following steps:

[0035] S1. Merge business codes and provide automation configuration files for required microservices;

[0036] S2. Design an automated deployment microservice model and provide standardized interfaces for code packaging and calling;

[0037] S3. Create an automated deployment task by calling the automated deployment interface, and complete the packaging, testing, and deployment of the application through the call;

[0038] S4: Push execution tasks, complete the opening of microservice business interfaces, and realize business information interaction;

[0039] S5. Write business-based automated testing scripts, run the scripts, and generate test reports.

[0040] Specifically, the creation of the automated deployment task includes: defining a code repository and building a branch.

[0041] When the automated deployment interface is called, code is pulled through the code repository source address.

[0042] The automated deployment microservice model includes a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module, and an automated deployment module;

[0043] The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description;

[0044] The service building module is used to create automated packaging tasks by calling the service configuration module interface;

[0045] The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates;

[0046] The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration;

[0047] The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface;

[0048] The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.

[0049] This embodiment uses the automated build tool Jenkins, the version control tool Gitee, the microservice architecture to define a complete automated deployment process, and the orchestration script that can run on Jenkins to complete the final delivery iteration. Jenkins configures ant and maven build tasks, can uniformly upload and manage customized scripts, and automatically triggers build tasks by pushing modules, which can avoid repetitive work and is a powerful productivity tool in development work.

[0050] Example 2

[0051] This embodiment discloses a device for automatic deployment based on microservices, including a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module, and an automated deployment module.

[0052] The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description;

[0053] The service building module is used to create automated packaging tasks by calling the service configuration module interface;

[0054] The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates;

[0055] The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration;

[0056] The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface;

[0057] The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.

[0058] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for automatic deployment based on microservices, characterized in that: The steps include: Merge business codes and provide automation configuration files for required microservices; Design an automated deployment microservice model and provide standardized interfaces for code packaging and calling; By calling the automated deployment interface, you can create automated deployment tasks and complete the packaging, testing, and deployment of the application through the call; Push execution tasks, complete the opening of microservice business interfaces, and realize business information interaction; Write business-based automated test scripts, run scripts, and generate test reports; The automated deployment microservice model includes a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module and an automated deployment module; The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description; The service building module is used to create automated packaging tasks by calling the service configuration module interface; The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates; The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration; The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface; The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.

2. The method for automatic deployment based on microservices according to claim 1, characterized in that: The creation of the automated deployment task includes: defining a code repository and building a branch.

3. The method for automatic deployment based on microservices according to claim 2, characterized in that: When the automated deployment interface is called, code is pulled through the code repository source address.

4. A device for automatic deployment based on microservices, characterized in that: Used to implement the method described in any one of claims 1 to 3, comprising a service configuration module, a construction module, a service packaging and publishing module, a push module, an automated testing module, and an automated deployment module; The service configuration module is used to configure the static configuration information related to the microservice and the common basic environment, including the name of the microservice, the running IP address and port, the developer, and the functional description; The service building module is used to create automated packaging tasks by calling the service configuration module interface; The service packaging and publishing module is used to register, monitor, schedule, and exchange messages of microservices through various interfaces, as well as to perform standardized packaging and publishing through configuration templates; The push module is used to create deployment tasks through automated deployment services and push them to the packaging and publishing module for registration; The automated testing module provides a testing interface, executes testing tasks and generates test reports by calling the automated testing interface; The automated deployment module enables developers to complete an iteration by submitting business code or merging business code and calling the automated deployment tasks defined in the microservices.