Automatic deployment method and system for micro-applications and micro-services

By querying and caching the registration information of microservices and micro-applications, dynamically configure routing information, the problem of manual configuration in microservices and micro-application deployment is solved, the deployment efficiency and reliability are improved, and automatic deployment is achieved.

CN119232787APending Publication Date: 2024-12-31XUCHANG XJ SOFTWARE TECHNOLOGIES LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310807207.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the deployment of microservices and micro-applications, reverse proxy configuration requires manual operation, resulting in cumbersome operation and maintenance work and inefficient efficiency. After configuration modification, service needs to be restarted, affecting the normal operation of the application system.

Method used

Through reverse proxy querying the registration information of micro applications and microservices, dynamically configure and update routing information, use the registration platform to obtain and cache registration information, automatically forward requests, reduce the configuration work of operation and maintenance personnel, and improve deployment efficiency.

Benefits of technology

It realizes automatic deployment without manual configuration, reduces operation and maintenance errors, and improves the deployment efficiency and reliability of the application system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232787A_ABST
    Figure CN119232787A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-application and micro-service automatic deployment method and system, and belongs to the technical field of computer application. The registration information of the micro-application and the micro-service is obtained through access query, when the registration information of the micro-application and the micro-service does not exist or expires, the registration information of the micro-application and the micro-service is read from the registration platform and cached, and when the registration information of the micro-service and the micro-application exists and does not expire, the registration information of the micro-application and the micro-service is read from the registration platform and cached. And if the registration information contains the root path of the current request, forwarding the request to the corresponding micro-service and micro-application, otherwise, prompting a user that the service is not online or the root path does not exist. According to the method, the micro-application and micro-service registration information is read and cached, the routing information is dynamically configured and updated, and the dynamic routing and forwarding of the request are completed according to the request processing and forwarding process, so that the complex and tedious configuration work of operation and maintenance personnel is avoided, the deployment efficiency of an application system is improved, and the deployment cost is reduced. And the influence of errors in the configuration and debugging process on the deployment and release of the application system is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and system for automatically deploying micro-applications and micro-services, and belongs to the technical field of computer applications. Background Art

[0002] In the microservice architecture model, traditional monolithic applications are split into multiple fine-grained microservices and micro-applications that can be independently developed, compiled, deployed, and run according to business and technical needs. Each micro-application and micro-service is independently deployed, with good fault isolation. Problems with a single micro-application or micro-service will not cause the entire business application to be unavailable. With the development of enterprise software, there are more and more requirements for high availability, high concurrency, and zero downtime of software, which also puts higher requirements on the application of microservices.

[0003] At present, the deployment of microservices and micro-applications is mainly configured through reverse proxy, which is realized by using web servers such as nginx as intermediate services between clients and micro-services. However, the configuration of reverse proxy and other operations need to be completed manually by operation and maintenance personnel. Since the system needs to integrate a large number of micro-applications and micro-services, the operation and maintenance work of operation and maintenance personnel is cumbersome and inefficient. In addition, the reverse proxy service needs to be restarted after the configuration is modified, which affects the normal operation and access of the application system. Summary of the invention

[0004] The purpose of the present invention is to provide a method and system for automatic deployment of micro-applications and micro-services to solve the problems of low efficiency and cumbersome process in the current deployment process.

[0005] In order to solve the above technical problems, the present invention provides an automatic deployment method for micro-applications and micro-services, which comprises the following steps:

[0006] 1) After receiving a request for a micro-application or micro-service, the reverse proxy queries the cached micro-application or micro-service registration information to determine whether the requested micro-application or micro-service registration information exists or has expired. The micro-application or micro-service registration information cached by the reverse proxy is obtained from the registration platform, which is used for registration of the started micro-application or micro-service. The registration information at least includes the root path.

[0007] 2) If the registration information of the microservice and microapplication exists and has not expired, determine whether the registration information contains the root path of the current request;

[0008] 3) If the registration information contains the root path of the current request, the reverse proxy forwards the request to the corresponding microservice and microapplication based on the registration information. Otherwise, the user is prompted that the microapplication and microservice are not online or the root path does not exist.

[0009] After receiving the request for micro-application and micro-service, the present invention obtains the registration information of micro-application and micro-service by accessing the registration platform. When the registration information of micro-service and micro-application exists and has not expired, if the registration information contains the root path of the current request, the request is forwarded to the corresponding micro-service and micro-application, otherwise, the user is prompted that the service is not online or the root path does not exist. The present invention reads and caches the registration information of micro-application and micro-service, dynamically configures and updates the routing information, and completes the dynamic routing and forwarding of the request according to the request processing and forwarding process, thereby eliminating the complicated and tedious configuration work of the operation and maintenance personnel, improving the deployment efficiency of the application system, and reducing the impact of the errors made by the operation and maintenance personnel in the configuration and debugging process on the deployment and release of the application system.

[0010] Furthermore, if the registration information of the microservice and microapplication does not exist or is expired, the reverse proxy reads the registration information of the microapplication and microservice from the registration platform and caches it.

[0011] When the registration information of microservices and microapplications does not exist or expires, the registration information of microapplications and microservices is read from the registration platform and cached, and the registration information in the reverse proxy is dynamically updated, thereby improving the deployment efficiency of microapplications and microservices.

[0012] Furthermore, the registration information includes: unique ID, access protocol, IP address, port, and root path of the micro-application and micro-service.

[0013] Based on the registration information, the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication can be obtained, providing a basis for forwarding the request.

[0014] Furthermore, the request is a request sent by the browser to the reverse proxy.

[0015] Furthermore, in step 3), the reverse proxy forwards the request according to the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information.

[0016] Requests are forwarded based on the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information, which improves the efficiency of request forwarding and thus improves the efficiency of application deployment.

[0017] An automatic deployment system for micro-applications and micro-services, the system comprises a reverse proxy server, the reverse proxy server comprises an Nginx module and a Lua module, the Lua module is used to access a registration platform to obtain and cache the registration information of all current micro-services and micro-applications; the Nginx module is used to receive a sent request, and query from the Lua module whether the cached micro-application and micro-service registration information exists or expires according to the request; if the registration information exists and has not expired, it is determined whether the registration information contains the root path of the current request, and when the registration information contains the root path of the current request, the reverse proxy forwards the request to the corresponding micro-service and micro-application according to the registration information; otherwise, the user is prompted that the micro-application and micro-service are not online or the root path does not exist.

[0018] After receiving the request for micro-application and micro-service, the present invention obtains the registration information of micro-application and micro-service by accessing the registration platform. When the registration information of micro-service and micro-application exists and has not expired, if the registration information contains the root path of the current request, the request is forwarded to the corresponding micro-service and micro-application, otherwise, the user is prompted that the service is not online or the root path does not exist. The present invention reads and caches the registration information of micro-application and micro-service, dynamically configures and updates the routing information, and completes the dynamic routing and forwarding of the request according to the request processing and forwarding process, thereby eliminating the complicated and tedious configuration work of the operation and maintenance personnel, improving the deployment efficiency of the application system, and reducing the impact of the errors made by the operation and maintenance personnel in the configuration and debugging process on the deployment and release of the application system.

[0019] Furthermore, if the registration information of the microservice and microapplication does not exist or is expired, the reverse proxy reads the registration information of the microapplication and microservice from the registration platform and caches it.

[0020] When the registration information of microservices and microapplications does not exist or expires, the registration information of microapplications and microservices is read from the registration platform and cached, and the registration information in the reverse proxy is dynamically updated, thereby improving the deployment efficiency of microapplications and microservices.

[0021] Furthermore, the registration information includes: unique ID, access protocol, IP address, port, and root path of the micro-application and micro-service.

[0022] Based on the registration information, the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication can be obtained, providing a basis for forwarding the request.

[0023] Furthermore, the request is a request sent by the browser to the reverse proxy.

[0024] Furthermore, the reverse proxy forwards the request according to the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information.

[0025] Requests are forwarded based on the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information, which improves the efficiency of request forwarding and thus improves the efficiency of application deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a system block diagram of the automatic deployment of micro-applications and micro-services of the present invention;

[0027] Figure 2 4 is a flowchart of request forwarding processing in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.

[0029] Embodiment of an automatic deployment system for micro-applications and micro-services

[0030] The present invention includes a reverse proxy server, which includes an Nginx module and a Lua module. The Lua module is used to access the registration platform to obtain the registration information of all current microservices and microapplications and cache it; the Nginx module is used to receive requests sent by the browser, and query the cached microapplication and microservice registration information from the Lua module to see whether it exists or is expired; if the registration information does not exist or is expired, the microapplication and microservice registration information is read from the registration platform and cached; if the registration information exists and has not expired, when the registration information contains the root path of the current request, the request is forwarded to each microservice and microapplication according to the registration information; otherwise, the user is prompted that the service is not online or the root path does not exist. The system block diagram of the present invention is as follows Figure 1 As shown, in this embodiment, the registration platform is Figure 1 The Consul shown in the figure is explained below with specific examples.

[0031] OpenResty is a high-performance Web platform based on Nginx and Lua, which integrates a large number of sophisticated Lua libraries, third-party modules, and most dependencies. It is used to easily build dynamic Web applications, Web services, and dynamic gateways that can handle ultra-high concurrency and high scalability.

[0032] Microservices and microapplications are automatically registered with Consul after startup, and the registration information includes the unique ID, access protocol, IP address, port, root path, etc. of the microapplication and microservice.

[0033] The Lua module is used to access Consul to obtain and cache the registration information of all current microservices and microapplications.

[0034] The Nginx module is used to receive requests sent by the browser, and query the cached micro-application and micro-service registration information from the Lua module to see whether it exists or has expired, and query the correspondence between the root path and the access protocol, IP address, and port of the registered micro-applications and micro-services. The format for querying the correspondence is as follows:

[0035]

[0036] If the registration information of the micro-application and micro-service does not exist or is expired, the Lua module reads the registration information of the micro-application and micro-service from Consul and caches it; if the registration information of the micro-service and micro-application exists and has not expired, it is determined whether the registration information contains the root path of the current request; if the registration information contains the root path of the current request, the request is forwarded to the corresponding micro-service and micro-application according to the access protocol, IP address, and port corresponding to the root path of the micro-service and micro-application in the registration information, otherwise, the user is prompted that the service is not online or the root path does not exist. The flowchart of request forwarding processing is as follows Figure 2 shown.

[0037] Embodiment of the automatic deployment method of micro-applications and micro-services

[0038] The present invention first obtains the registration information of micro-applications and micro-services by accessing Consul to query after the micro-services and micro-applications start to register with Consul, and then determines whether the micro-application and micro-service registration information exists or expires when receiving the request. When the micro-application and micro-service registration information does not exist or expires, the micro-application and micro-service registration information is read from Consul and cached. When the registration information of the micro-service and micro-application exists and has not expired, if the registration information contains the root path of the current request, the request is forwarded to the corresponding micro-service and micro-application, otherwise, the user is prompted that the service is not online or the root path does not exist. The specific implementation of the method has been described in detail in the embodiment of the automatic deployment system of micro-applications and micro-services, and will not be repeated here.

Claims

1. A method for automatically deploying micro-applications and micro-services, characterized in that: The assay method comprises the following steps: 1) After receiving a request for a micro-application or micro-service, the reverse proxy queries the cached micro-application or micro-service registration information to determine whether the requested micro-application or micro-service registration information exists or has expired. The micro-application or micro-service registration information cached by the reverse proxy is obtained from the registration platform, which is used for registration of the started micro-application or micro-service. The registration information at least includes the root path. 2) If the registration information of the microservice and microapplication exists and has not expired, determine whether the registration information contains the root path of the current request; 3) If the registration information contains the root path of the current request, the reverse proxy forwards the request to the corresponding microservice and microapplication based on the registration information. Otherwise, the user is prompted that the microapplication and microservice are not online or the root path does not exist.

2. The automatic deployment method of micro-applications and micro-services according to claim 1, characterized in that: If the registration information of the microservice and microapplication does not exist or is expired, the reverse proxy reads the microapplication and microservice registration information from the registration platform and caches it.

3. The automatic deployment method of micro-applications and micro-services according to claim 1 or 2, characterized in that: The registration information includes: unique ID of micro-application and micro-service, access protocol, IP address, port, and root path.

4. The automatic deployment method of micro-applications and micro-services according to claim 1, characterized in that: The request is a request sent by the browser to the reverse proxy.

5. The automatic deployment method of micro-applications and micro-services according to claim 1, characterized in that: In step 3), the reverse proxy forwards the request according to the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information.

6. An automatic deployment system for micro-applications and micro-services, the system comprising a reverse proxy server, the reverse proxy server comprising an Nginx module and a Lua module, characterized in that: The Lua module is used to access the registration platform to obtain and cache the registration information of all current microservices and microapplications; The Nginx module is used to receive the sent request and query the cached micro-application and micro-service registration information from the Lua module based on the request to see if it exists or has expired; if the registration information exists and has not expired, it is determined whether the registration information contains the root path of the current request. When the registration information contains the root path of the current request, the reverse proxy forwards the request to the corresponding micro-service and micro-application based on the registration information; otherwise, the user is prompted that the micro-application and micro-service are not online or the root path does not exist.

7. The automatic deployment system for micro-applications and micro-services according to claim 6, characterized in that: If the registration information of the microservice and microapplication does not exist or is expired, the reverse proxy reads the microapplication and microservice registration information from the registration platform and caches it.

8. The automatic deployment system for micro-applications and micro-services according to claim 6 or 7, characterized in that: The registration information includes: unique ID of micro-application and micro-service, access protocol, IP address, port, and root path.

9. The automatic deployment system for micro-applications and micro-services according to claim 6, characterized in that: The request is a request sent by the browser to the reverse proxy.

10. The automatic deployment system for micro-applications and micro-services according to claim 6, characterized in that: The reverse proxy forwards requests based on the access protocol, IP address, and port corresponding to the root path of the microservice and microapplication in the registration information.