A software application management method based on microservice architecture

Through automated service registration and discovery, dynamic load balancing and expansion and reduction strategies, the problem of configuration errors in the application management of micro -service architecture, low resource utilization rate, and unsatisfactory response speed have been solved. Essence

CN118672638BActive Publication Date: 2025-01-24CHENGKE DIGITAL (SHENZHEN) TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410893537.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2025-01-24
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

The software application management method of the existing microservice architecture has problems such as misconfiguration, low resource utilization, poor response speed, and inflexible expansion reduction operations in service instance registration and discovery, load balancing and scaling reduction strategies.

Method used

By obtaining the start information of microservices, the registration information package is generated and uploaded to the service registration center and the configuration management center to achieve automated service registration and configuration management. According to real -time running status data, the number of microservice instances dynamically adjusts, and adopts a load balancing strategy based on the request attribute parameter, and assigns the micro -service instance with the highest scoring request to the highest score.

Benefits of technology

Automatic service registration and discovery are realized, which improves the rationality and efficiency of request distribution. Dynamic load balancing and expansion and reduction strategies ensure the stability and response speed of the system during high concurrent access, while saving resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118672638B_ABST
    Figure CN118672638B_ABST
Patent Text Reader

Abstract

The present invention discloses a software application management method based on microservice architecture, which relates to the technical field of software application management, including obtaining the startup information of a microservice instance, sending it to a service registration center, generating a registration information package, uploading it to a configuration management center, verifying the upload node according to a preset authentication algorithm, parsing the registration information package and distributing configuration information after the authentication is passed, and registering the microservice instance; after the service instance is successfully registered, updating the service discovery list, and allocating requests according to a load balancing strategy; monitoring the running status of the microservice instance in real time, triggering expansion or reduction operations according to real-time running status data, and dynamically adjusting the number of microservice instances. By monitoring the running data of the service instance in real time, when the system load increases, the service instance is automatically expanded; when the load decreases, the service instance is automatically reduced. The stability and response speed of the system during high concurrent access are guaranteed, while saving resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software application management, and in particular to a software application management method based on a microservice architecture. Background Art

[0002] With the continuous development of cloud computing technology, microservice architecture has gradually become one of the mainstream architectures of modern software systems. Microservice architecture makes the system more scalable and flexible by splitting a single application into multiple small, independent service units. These service units can be independently developed, deployed, and expanded, thereby improving the maintainability and fault isolation capabilities of the system.

[0003] Although existing technologies have made significant progress in application management of microservice architectures, there are still some shortcomings and challenges: existing methods rely on a lot of manual configuration and management during service instance registration and discovery, which are prone to configuration errors and poor management, affecting the overall efficiency and reliability of the system. At the same time, existing load balancers are usually based on static configuration and cannot be dynamically adjusted according to real-time operating status and load conditions, resulting in low resource utilization and less than ideal system response speed. In addition, existing expansion and reduction strategies are usually based on static thresholds and fixed rules, and cannot be intelligently adjusted according to actual operating conditions, resulting in expansion and reduction operations being inflexible and inefficient in some scenarios. Summary of the invention

[0004] Based on the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a software application management method based on a microservice architecture to solve the above-mentioned technical problems.

[0005] To achieve the above object, the present invention provides the following technical solution: a software application management method based on microservice architecture, comprising:

[0006] Obtain the startup information of the microservice instance, send the startup information to the service registration center, and generate a registration information package;

[0007] The registration information package is uploaded to the configuration management center, and the upload node is verified according to a preset authentication algorithm. After the authentication is passed, the registration information package is parsed and the configuration information is distributed to register the microservice instance. The registration information package is uploaded to the configuration management center, and the upload node is verified according to the preset authentication algorithm, including: when uploading the registration information package to the configuration management center, a one-time password is generated using a time-based one-time password algorithm, and the registration information package, the upload timestamp and the one-time password are uploaded to the configuration management center; the configuration management center verifies the upload timestamp and the one-time password, and after the verification is passed, the trust score of the upload node is obtained. When the trust score is greater than or equal to the preset trust score threshold, the configuration management center receives the registration information package and the authentication is passed; when the trust score is less than the preset trust score threshold, the configuration management center generates a manual review signal and forwards the registration information package to manual review;

[0008] After the service instance is successfully registered, the service discovery list is updated and requests are allocated according to the load balancing strategy. The allocation of requests according to the load balancing strategy includes: when there are multiple microservice instances of the request, the empty microservice instances are allocated first; when all microservice instances have request connections, the attribute parameters of the request are obtained, the request scores of all microservice instances are calculated according to the attribute parameters of the request, and the request is allocated to the microservice instance with the highest request score according to the request score;

[0009] Monitor the running status of microservice instances in real time, trigger expansion or reduction operations based on real-time running status data, and dynamically adjust the number of microservice instances.

[0010] The present invention is further configured to obtain startup information of a microservice instance, send the startup information to a service registration center, and generate a registration information package, including:

[0011] When the microservice instance is started, the startup information is obtained, a unique identifier is generated according to the startup information, and the startup information and the unique identifier are packaged according to a preset data structure to obtain a startup information package, wherein the startup information includes the IP address, port number, service name, version number and startup time of the microservice instance;

[0012] Establish a secure connection with the service registration center through the HTTPS protocol, and send the startup information package to the receiving interface of the service registration center through an HTTP POST request;

[0013] The receiving interface of the service registration center receives the startup information packet and performs legality and integrity verification;

[0014] After the verification is passed, a registration information package is generated according to the startup information package, wherein the registration information package includes the startup information and health check information of the microservice instance.

[0015] The present invention is further configured such that the calculation logic of the trust score is: ,in, Provide a trust score for the current evaluation cycle. The trust score for the previous evaluation cycle, is the upload success rate in the current cycle, is the upload failure rate in the current cycle, and are the weight coefficients of the upload success rate and upload failure rate in the current cycle, respectively, and , .

[0016] The present invention is further configured to parse the registration information package and distribute configuration information to register the microservice instance, including:

[0017] The configuration management center parses the registration information package to obtain the startup information of the microservice instance;

[0018] The configuration management center generates configuration information and configuration update events based on the startup information of the microservice instance, uses the configuration information as event data, and publishes the configuration update events using the event bus, wherein the configuration information includes database connection information, API key, and load balancing strategy;

[0019] The configuration management center sends the configuration information to the microservice instance through the message queue to register the microservice instance.

[0020] The present invention is further configured to calculate the request scores of all microservice instances according to the attribute parameters of the request, and the calculation logic of the request score is: ,in, Rate the request, Score the priority of the request, Score the type of request, Score the geographic proximity of the request to the microservice instance. The number of requests queued for the microservice instance.

[0021] The present invention is further configured such that the real-time operation status data includes the load factor of the microservice instance, the response time of the request and the utilization rate of the database connection pool.

[0022] The present invention is further configured such that the calculation logic of the load factor is: , is the load factor, is the number of microservice instances, For the The CPU usage of each microservice instance. For the Memory usage of each microservice instance, For the The network I / O usage of each microservice instance; the calculation logic of the request response time is: , is the response time of the request, For the The response time of requests to a microservice instance, The calculation logic is: , For the The number of requests for each microservice instance, For the The first microservice instance The response time of a request; the calculation logic of the database connection pool usage is: , is the database connection pool usage, is the number of database connections of the currently active microservice instance. The total number of microservice instance connections in the database connection pool.

[0023] The present invention is further configured to trigger expansion or reduction operations according to real-time operation status data to dynamically adjust the number of microservice instances, including:

[0024] The microservice instance status index is calculated based on the load factor of the microservice instance, the response time of the request, and the usage rate of the database connection pool. The calculation logic of the microservice instance status index is: , is the microservice instance status index, , and The weight coefficients of the load factor of the microservice instance, the response time of the request, and the utilization rate of the database connection pool;

[0025] When the microservice instance status index is greater than the first microservice instance status index threshold, the number of microservice instances is expanded;

[0026] When the microservice instance state index is less than the second microservice instance state index threshold, the number of microservice instances is reduced.

[0027] The present invention provides a software application management method based on a microservice architecture. The method obtains startup information of a microservice instance, sends the startup information to a service registration center, and generates a registration information package; uploads the registration information package to a configuration management center, verifies the upload node according to a preset authentication algorithm, and after the authentication is passed, parses the registration information package and distributes configuration information to register the microservice instance; after the service instance is successfully registered, updates the service discovery list, and distributes requests according to a load balancing strategy; monitors the running status of the microservice instance in real time, triggers expansion or reduction operations according to the real-time running status data, and dynamically adjusts the number of microservice instances. The beneficial effects produced include:

[0028] 1. Automated service registration and discovery: By obtaining the startup information of the microservice instance, automatically generating an identifier and sending the startup information to the service registration center, the automatic registration of the service instance is realized. This avoids the tedious steps of manual configuration and improves the accuracy and efficiency of service registration;

[0029] 2. Improved request evaluation mechanism: By introducing the request evaluation and weight distribution mechanism, all microservice instance requests are scored according to the attribute parameters of the service request, and the request is allocated to the service instance with the highest score according to the score. This ensures the rationality and efficiency of request allocation and improves the system's responsiveness;

[0030] 3. Dynamic load balancing and expansion: Dynamically adjust the number of instances according to the running status and load of the microservice instances. By real-time monitoring of the running data of the service instances, when the system load increases, the service instances are automatically expanded; when the load decreases, the service instances are automatically reduced. This ensures the stability and response speed of the system during high concurrent access, while saving resources.

[0031] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. 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 these drawings without creative work. In the drawings:

[0033] Figure 1 The present invention is a flowchart of a software application management method based on a microservice architecture, showing an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0034] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0035] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0036] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0037] A software application management method based on microservice architecture, such as Figure 1 As shown, including:

[0038] Obtain the startup information of the microservice instance, send the startup information to the service registration center, and generate a registration information package;

[0039] Upload the registration information package to the configuration management center, verify the uploading node according to the preset authentication algorithm, and after the authentication is passed, parse the registration information package and distribute the configuration information to register the microservice instance;

[0040] After the service instance is successfully registered, the service discovery list is updated and requests are allocated according to the load balancing strategy;

[0041] Monitor the running status of microservice instances in real time, trigger expansion or reduction operations based on real-time running status data, and dynamically adjust the number of microservice instances.

[0042] Specifically, the present invention is further configured to obtain startup information of a microservice instance, send the startup information to a service registration center, and generate a registration information package, including:

[0043] When the microservice instance is started, the startup information is obtained, a unique identifier is generated according to the startup information, and the startup information and the unique identifier are packaged according to a preset data structure to obtain a startup information package, wherein the startup information includes the IP address, port number, service name, version number and startup time of the microservice instance; the IP address and port number of the microservice instance are obtained by reading the network configuration of the operating system or the configuration file of the application program, the name and version number of the microservice are obtained by reading the configuration file or environment variable of the application program, the startup time of the microservice instance is obtained through the system call or the log of the application program, and a unique identifier is generated using the UUID library to ensure that each microservice instance has a unique identifier, and the UUID is used to track and manage the microservice instance; in a feasible embodiment of the present invention, the preset data structure includes:

[0044] {

[0045] "uuid": "123e4567-e89b-12d3-a456-426614174000",

[0046] "ip": "192.168.1.1",

[0047] "port": 8080,

[0048] "serviceName": "example-service",

[0049] "version": "1.0.0",

[0050] "startTime": "2023-06-07T12:00:00Z"

[0051] }, the data here is only displayed as a format, and the specific content of the data has no actual meaning;

[0052] Establish a secure connection with the service registration center through the HTTPS protocol, and send the startup information package to the receiving interface of the service registration center through an HTTP POST request;

[0053] The receiving interface of the service registration center receives the startup information packet and performs legality and integrity verification;

[0054] After the verification is passed, a registration information package is generated according to the startup information package, wherein the registration information package includes the startup information and health check information of the microservice instance. Specifically, the health check information is used to evaluate the running status and stability of the microservice instance to ensure that the instance is healthy during registration and use. Health checks are generally divided into two categories: active health checks and passive health checks. Active health checks include regular Ping checks, HTTP health checks, and TCP health checks; passive health checks include log analysis and monitoring data analysis, which are existing technologies and will not be elaborated here.

[0055] The present invention is further configured to upload the registration information package to the configuration management center and verify the uploading node according to a preset authentication algorithm, including:

[0056] When uploading the registration information package to the configuration management center, a one-time password is generated using a time-based one-time password algorithm, and the registration information package, upload timestamp and one-time password are uploaded to the configuration management center; specifically, the time-based one-time password algorithm (TOTP) is a time-based dynamic password generation algorithm used for multi-factor authentication. The password generated by TOTP is valid within a short time window, usually 30 seconds. The algorithm relies on a shared key and the current time to generate a one-time password (OTP), which is a prior art and will not be described in detail here.

[0057] The configuration management center verifies the upload timestamp and the one-time password, and after the verification is passed, obtains the trust score of the uploading node; the present invention is further configured such that the calculation logic of the trust score is: ,in, Provide a trust score for the current evaluation cycle. The trust score for the previous evaluation cycle, is the upload success rate in the current cycle, is the upload failure rate in the current cycle, and are the weight coefficients of the upload success rate and upload failure rate in the current cycle, respectively, and , Specifically, each time a node uploads a registration information package and passes the authentication, the configuration management center obtains the trust score of the uploading node. According to the trust score of the uploading node, the configuration management center dynamically adjusts the authentication strategy and sets the trust score threshold to determine the authentication steps that the node needs to perform. Furthermore, when the trust score is greater than or equal to the preset trust score threshold, the configuration management center receives the registration information package and the authentication is passed; when the trust score is less than the preset trust score threshold, the configuration management center generates a manual review signal and forwards the registration information package to manual review. Through the above logic, a dynamic authentication strategy adjustment mechanism based on trust score is provided, which can adjust the authentication strategy in real time according to the actual performance of the node, thereby improving security and authentication efficiency. At the same time, by combining automatic authentication and manual review, the ability to cope with complex environments is enhanced.

[0058] The present invention is further configured to parse the registration information package and distribute configuration information to register the microservice instance, including:

[0059] The configuration management center parses the registration information package to obtain the startup information of the microservice instance;

[0060] The configuration management center generates configuration information and configuration update events based on the startup information of the microservice instance, uses the configuration information as event data, and publishes the configuration update events using the event bus, wherein the configuration information includes database connection information, API key, and load balancing strategy;

[0061] The configuration management center sends the configuration information to the microservice instance through the message queue to register the microservice instance. Through the above steps, the configuration management center can parse the registration information package, generate and distribute the configuration information. After receiving the configuration information, the microservice instance registers in the service registration center to complete the entire registration process. This process ensures the dynamic registration and management of microservice instances and improves the flexibility and reliability of the system.

[0062] The present invention is further configured to allocate requests according to a load balancing strategy, including:

[0063] When there are multiple requested microservice instances, empty microservice instances are allocated first;

[0064] When all microservice instances have request connections, the attribute parameters of the request are obtained, the request scores of all microservice instances are calculated according to the attribute parameters of the request, and the request is assigned to the microservice instance with the highest request score according to the request score. The present invention is further configured to calculate the request scores of all microservice instances according to the attribute parameters of the request, and the calculation logic of the request score is: ,in, Rate the request, Score the priority of the request, Score the type of request, Score the geographic proximity of the request to the microservice instance. is the number of requests in the microservice instance request queue. Specifically, the priority score of the request defines the priority of the request. In a feasible embodiment of the present invention, the priorities include low, medium and high. The higher the priority, the higher the score. Low priority = 1, medium priority = 2, high priority = 3. The type score of the request is scored according to the request type. In a feasible embodiment of the present invention, the request types include read requests, write requests and management requests. Read request = 1, write request = 2, management request = 3. The geographical location of the request and the geographical location of the microservice instance are scored according to the geographical location of the request and the geographical location of the microservice instance. The higher the proximity, the higher the score. Same area = 3, adjacent area = 2, different area = 1. The division of regions can be set according to specific needs, and can be districts, cities and provinces. There is no limitation on this here. The request score comprehensively considers multiple factors such as the priority, type and geographical location of the request, ensures the comprehensiveness and accuracy of the score, and helps to achieve more reasonable resource allocation.

[0065] The present invention is further configured such that the real-time operation status data includes the load factor of the microservice instance, the response time of the request, and the utilization rate of the database connection pool. The present invention is further configured such that the calculation logic of the load factor is: , is the load factor, which is used to measure the current load of the microservice instance. is the number of microservice instances, For the The CPU usage of each microservice instance. For the Memory usage of each microservice instance, For the The network I / O usage of each microservice instance. The calculation of the load factor comprehensively considers the CPU, memory, and I / O usage. By calculating the load factor, the load of the microservice instance can be dynamically monitored to achieve load balancing and improve the resource utilization and performance of the system. The calculation logic of the request response time is: , The response time of the request is used to measure the speed at which the microservice instance processes the request. It monitors the time from when the request arrives at the microservice instance to when the response is returned. For the The response time of requests to a microservice instance, The calculation logic is: , For the The number of requests for each microservice instance, For the The first microservice instance The response time of each request can be calculated by the response time calculation method. The response time of each request can be accurately monitored. By summarizing the response time of each microservice instance, the response performance of the system can be fully understood, and optimization and adjustment can be made for performance bottlenecks to improve user experience. The calculation logic of the database connection pool usage rate is: , It is the utilization rate of the database connection pool, which is used to measure the utilization of the database connection pool. is the number of database connections of the currently active microservice instance. The total number of connections of microservice instances in the database connection pool. Specifically, a database connection pool is configured to manage database connections. The monitoring function is enabled in the configuration so that the usage of the connection pool can be obtained. The API provided by the connection pool management tool is used to obtain the current number of active database connections and the total number of connections of microservice instances in the database connection pool. A method is defined to obtain the current number of active database connections and the total number of connections of microservice instances in the database connection pool. The method can be called periodically to monitor the number of connections in real time. The method is integrated into the monitoring system of the microservice so that the connection number data can be collected and analyzed periodically. The method for calculating the utilization rate of the database connection pool can monitor the usage of the database connection pool in real time. By analyzing the ratio of the current number of active connections to the total number of connections, the allocation of database connection resources can be optimized to prevent resource waste or overload, thereby improving the stability and efficiency of the system.

[0066] The present invention is further configured to trigger expansion or reduction operations according to real-time operation status data to dynamically adjust the number of microservice instances, including:

[0067] The microservice instance status index is calculated based on the load factor of the microservice instance, the response time of the request, and the usage rate of the database connection pool. The calculation logic of the microservice instance status index is: , It is the microservice instance status index, which is used to evaluate the running status of the current microservice instance. , and is the weight coefficient of the load factor of the microservice instance, the response time of the request, and the utilization rate of the database connection pool; using an exponential function to convert the deviation of the load factor, response time, and utilization rate of the database connection pool into an exponential growth can more sensitively reflect the change of the load. The above logic provides a monitoring and adjustment method based on the microservice instance status index. By comprehensively considering multiple key performance indicators, it realizes comprehensive monitoring and dynamic adjustment of the system operation status. This method not only improves the stability and reliability of the system, but also finds the best balance between load and performance, improving the overall performance of the system and user experience.

[0068] When the microservice instance status index is greater than the first microservice instance status index threshold, the number of microservice instances is expanded; the first microservice instance status index threshold is used to determine whether the instance needs to be expanded. If the status index exceeds the threshold, it means that the system load is too high and the instance needs to be expanded to share the load.

[0069] When the microservice instance state index is less than the second microservice instance state index threshold, the number of microservice instances is reduced. The second microservice instance state index threshold is used to determine whether to reduce the instance. If the state index is lower than the threshold, it means that the system load is low and the instance can be reduced to save resources.

[0070] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0071] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0072] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0073] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0074] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0075] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0076] In the several embodiments provided in the present application, it should be understood that the disclosed system can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0077] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0078] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0079] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.

[0080] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A software application management method based on microservice architecture, characterized in that: include: Obtain the startup information of the microservice instance, send the startup information to the service registration center, and generate a registration information package; The registration information package is uploaded to the configuration management center, and the upload node is verified according to a preset authentication algorithm. After the authentication is passed, the registration information package is parsed and the configuration information is distributed to register the microservice instance. The registration information package is uploaded to the configuration management center, and the upload node is verified according to the preset authentication algorithm, including: when uploading the registration information package to the configuration management center, a one-time password is generated using a time-based one-time password algorithm, and the registration information package, the upload timestamp and the one-time password are uploaded to the configuration management center; the configuration management center verifies the upload timestamp and the one-time password, and after the verification is passed, the trust score of the upload node is obtained. When the trust score is greater than or equal to the preset trust score threshold, the configuration management center receives the registration information package and the authentication is passed; when the trust score is less than the preset trust score threshold, the configuration management center generates a manual review signal and forwards the registration information package to manual review; After the service instance is successfully registered, the service discovery list is updated and requests are allocated according to the load balancing strategy. The allocation of requests according to the load balancing strategy includes: when there are multiple microservice instances of the request, the empty microservice instances are allocated first; when all microservice instances have request connections, the attribute parameters of the request are obtained, the request scores of all microservice instances are calculated according to the attribute parameters of the request, and the request is allocated to the microservice instance with the highest request score according to the request score; Monitor the running status of microservice instances in real time, trigger expansion or reduction operations based on real-time running status data, and dynamically adjust the number of microservice instances.

2. According to the software application management method based on microservice architecture according to claim 1, it is characterized in that: Get the startup information of the microservice instance, send the startup information to the service registration center, and generate a registration information package, including: When the microservice instance is started, the startup information is obtained, a unique identifier is generated according to the startup information, and the startup information and the unique identifier are packaged according to a preset data structure to obtain a startup information package, wherein the startup information includes the IP address, port number, service name, version number and startup time of the microservice instance; Establish a secure connection with the service registration center through the HTTPS protocol, and send the startup information package to the receiving interface of the service registration center through an HTTP POST request; The receiving interface of the service registration center receives the startup information packet and performs legality and integrity verification; After the verification is passed, a registration information package is generated according to the startup information package, wherein the registration information package includes the startup information and health check information of the microservice instance.

3. According to the software application management method based on microservice architecture as described in claim 1, it is characterized in that: The calculation logic of the trust score is: ,in, Provide a trust score for the current evaluation cycle. The trust score for the previous evaluation cycle, is the upload success rate in the current cycle, is the upload failure rate in the current cycle, and are the weight coefficients of the upload success rate and upload failure rate in the current cycle, respectively, and , .

4. The software application management method based on microservice architecture according to claim 1, characterized in that: Parse the registration information package and distribute configuration information to register microservice instances, including: The configuration management center parses the registration information package to obtain the startup information of the microservice instance; The configuration management center generates configuration information and configuration update events based on the startup information of the microservice instance, uses the configuration information as event data, and publishes the configuration update events using the event bus, wherein the configuration information includes database connection information, API key, and load balancing strategy; The configuration management center sends the configuration information to the microservice instance through the message queue to register the microservice instance.

5. The software application management method based on microservice architecture according to claim 1, characterized in that: The request scores of all microservice instances are calculated based on the attribute parameters of the request. The calculation logic of the request score is: ,in, Rate the request. Score the priority of the request, Score the type of request, Score the geographic proximity of the request to the microservice instance. The number of requests queued for the microservice instance.

6. The software application management method based on microservice architecture according to claim 1, characterized in that: Real-time operation status data includes the load factor of the microservice instance, the response time of the request, and the utilization rate of the database connection pool.

7. A software application management method based on microservice architecture according to claim 6, characterized in that: The calculation logic of the load factor is: , is the load factor, is the number of microservice instances, For the The CPU usage of each microservice instance. For the Memory usage of each microservice instance, For the The network I / O usage of each microservice instance; the calculation logic of the request response time is: , is the response time of the request, For the The response time of requests to a microservice instance, The calculation logic is: , For the The number of requests for each microservice instance, For the The first microservice instance The response time of a request; the calculation logic of the database connection pool usage is: , is the database connection pool usage, is the number of database connections of the currently active microservice instance. The total number of microservice instance connections in the database connection pool.

8. The software application management method based on microservice architecture according to claim 7, characterized in that: Trigger expansion or reduction operations based on real-time operating status data to dynamically adjust the number of microservice instances, including: The microservice instance status index is calculated based on the load factor of the microservice instance, the response time of the request, and the usage rate of the database connection pool. The calculation logic of the microservice instance status index is: , is the microservice instance status index, , and The weight coefficients of the load factor of the microservice instance, the response time of the request, and the utilization rate of the database connection pool; When the microservice instance status index is greater than the first microservice instance status index threshold, the number of microservice instances is expanded; When the microservice instance state index is less than the second microservice instance state index threshold, the number of microservice instances is reduced.

Citation Information

Patent Citations

  • Internet of Things platform construction method based on micro-service architecture

    CN110149396A

  • Service request processing method and device, equipment and storage medium

    CN110191063A