A microservice system progressive update device and method based on batch upgrade

By introducing a gradual update method of batch upgrade in the microservice system, analyzing the service dependencies and generating update strategies, the stability problems caused by the dependencies not considered during the upgrade process of the microservice system are solved, and seamless connection and smooth transition of the system are achieved.

CN115344286BActive Publication Date: 2025-04-29SHAANXI JUSHU INTELLIGENT TECH RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211000826.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-04-29
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

In microservice systems, the lack of consideration of service dependencies leads to data errors and service provision delays during the upgrade and update process, affecting system stability.

Method used

A progressive update device and method for microservice system based on batch upgrade is proposed, including service relationship management module, system status acquisition module, update decision module and update control module. This method analyzes the functional and data dependencies between services, generates a service constraint dependency description file and a system operation status description file, determines the upgrade path of the service node to be upgraded, and generates a progressive update strategy to achieve seamless connection and smooth transition of the system.

Benefits of technology

Effectively guide the division of upgraded service batches, ensure the low interruption time between new versions of services, ensure the stability of system services through gradual updates, and achieve seamless connection and smooth transition before and after upgrading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115344286B_ABST
    Figure CN115344286B_ABST
Patent Text Reader

Abstract

The present invention discloses a microservice system progressive update device and method based on batch upgrade, wherein the microservice system progressive update device includes a service relationship management module, a system status acquisition module, an update decision module and an update control module. The device can fully consider the factors affecting the system service upgrade in the system, can effectively guide the division of the upgrade service batches, ensure that the interruption time between the new version services is low, and effectively ensure the stability of the system service in a progressive update manner; the method is suitable for efficient and high-quality update and iteration tasks, formulates service upgrade constraints through the dependency relationship between services, guides the division of the upgrade service batches, ensures that the interruption time between the new version services is low, and effectively ensures the stability of the system service in a progressive update manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of system update, and in particular relates to a device and method for gradually updating a microservice system based on batch upgrades. Background Art

[0002] As the scale of systems based on microservice architecture grows larger and more complex, the interaction between services in the system, the transmission of some parameters and data structures, etc. will become more complex and intertwined. For example, there is a certain timing relationship between some services, and the execution of a service depends on the running results of its predecessor service. This interactive coupling relationship between system services is ultimately manifested as a dependency relationship between services. If the various services in the system lack consideration of such dependencies during the upgrade and update process, such as if the dependent service is upgraded before the dependent service, but the new version of the dependent service will not be available, and the service that depends on the service may also have abnormalities, which will inevitably lead to system problems such as data errors and delays in service provision.

[0003] Therefore, how to effectively guide the service upgrade process according to the actual situation of system service dependencies and achieve seamless connection and smooth transition of system updates is an urgent problem to be solved. Summary of the invention

[0004] In order to solve the problem that various services in a microservice system lack consideration of dependencies during the upgrade and update process, the present invention proposes a microservice system progressive update device and method based on batch upgrade.

[0005] The technical solution of the present invention is: a microservice system progressive update device based on batch upgrade includes a service relationship management module, a system status acquisition module, an update decision module and an update control module;

[0006] The service relationship management module is used to analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependencies between each service node, analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependencies between each service node, and generate a service constraint dependency description file based on the functional constraint dependencies and data constraint dependencies between each service node;

[0007] The system status acquisition module is used to analyze the operation status of each service node in the microservice system, obtain the real-time operation status of each service node, and generate a system operation status description file based on the real-time operation status of each service node;

[0008] The update decision module is used to determine the service nodes to be upgraded, determine the upgrade path of the service nodes to be upgraded according to the service constraint dependency description file and the system operation status description file, and generate a progressive update strategy according to the upgrade path;

[0009] The update control module is used to receive and parse the progressive update strategy and perform progressive updates on the microservice system.

[0010] The beneficial effects of the present invention are as follows: the service relationship management module and the system status acquisition module in the present invention can analyze and acquire the functional constraint dependency and data dependency constraint relationship between all services in the microservice system and the operation status of each service. The device can fully consider the factors affecting the system service upgrade in the system, and can effectively guide the division of upgrade service batches, ensuring that the interruption time between new version services is low, and effectively ensuring the stability of system services in a progressive update manner.

[0011] Based on the above system, the present invention also proposes a microservice system gradual update method based on batch upgrade, comprising the following steps:

[0012] S1: Obtain the service constraint dependency description file of the microservice system;

[0013] S2: Obtain the system operation status description file of the microservice system;

[0014] S3: Determine the upgrade scope and upgrade path of the service nodes to be upgraded in the microservice system according to the service constraint dependency description file and the system operation status description file of the microservice system;

[0015] S4: within the upgrade range of the service node to be upgraded, calculating the timeliness value and stability value of each upgrade path in the service node to be upgraded;

[0016] S5: Calculate the update cost and stability evaluation value of each upgrade path, and generate a progressive update strategy according to the update cost, stability evaluation value, timeliness value and stability value of each upgrade path;

[0017] S6: Analyze the incremental update strategy and perform incremental updates on the microservice system.

[0018] Furthermore, step S1 includes the following sub-steps:

[0019] S11: Analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependency relationship between each service node;

[0020] S12: Analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependency relationship between each service node;

[0021] S13: Generate a service constraint dependency description file according to the function constraint dependency and data constraint dependency between each service node.

[0022] Furthermore, in step S2, the specific method for obtaining the system operation status description file of the microservice system is: analyzing the operation status of each service node in the microservice system, obtaining the real-time operation status of each service node, and generating the system operation status description file according to the real-time operation status of each service node.

[0023] Furthermore, step S3 includes the following sub-steps:

[0024] S31: According to the real-time running status of each service node in the system running status description file, traverse each service node of the microservice system to determine the service node to be upgraded;

[0025] S32: Acquire function constraint dependencies and data constraint dependencies of the service node to be upgraded according to the service constraint dependency description file;

[0026] S33: taking the service nodes to be upgraded as the starting point of topological sorting, performing topological sorting according to the function constraint dependency and data constraint dependency of the service nodes to be upgraded, and generating a topological sequence of the service nodes to be upgraded;

[0027] S34: Determine the upgrade scope and upgrade path of the service nodes to be upgraded according to the topological sequence of the service nodes to be upgraded.

[0028] Furthermore, in step S4, the calculation formula of the timeliness value T of each upgrade path is:

[0029]

[0030] Where N represents the number of service nodes to be upgraded, H i represents the upgrade sequence position of service node i, and H represents the upgrade sequence position of the service node;

[0031] In step S4, the calculation formula of the stability value S of each upgrade path is:

[0032]

[0033]

[0034]

[0035]

[0036] Where ω1 represents the first weight, ω2 represents the second weight, sc represents the total number of services that need to be upgraded, sh represents the number of upgrade levels, and us m Indicates the number of services upgraded at level m, us n It represents the number of services upgraded at level n, and w1 represents the stable value of the upgrade scheme.

[0037] Furthermore, in step S5, the update cost of each upgrade path is p The calculation formula is:

[0038]

[0039]

[0040]

[0041]

[0042] in, represents the resource consumption of upgrade path p, represents the time consumption of upgrade path p, represents the impact range of the upgrade path p, α represents the resource impact factor, c p Indicates CPU weight, CPU need represents the CPU demand during the update process of upgrade path p, m p Indicates memory weight, Memory need represents the memory requirement during the update process of the upgrade path p, d p Indicates disk weight, Disk need represents the disk demand during the update process of the upgrade path p, β represents the time impact factor, InitializeTime represents the time overhead required for reconstruction, γ represents the scope impact factor, and e in represents the in-degree of the communication node related to the strategy, e out Represents the out-degree of the communication node related to the strategy;

[0043] In step S5, the stability evaluation value of each upgrade path is p The calculation formula is:

[0044]

[0045]

[0046] in, represents the mean time before failure, Indicates the average failure recovery time of the node, recover p represents the node repair capability, kp represents the node self-repair capability, ω p Indicates the intensity of the attack on the node.

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

[0048] (1) The microservice system progressive update method of the present invention can realize the upgrade topology sorting, use the timeliness and stability objective functions to realize the evaluation of the upgrade path, and realize the selection of the progressive update path by the multi-index evaluation sorting method. According to the generated service constraint relationship and the system status information, the optimal upgrade path is determined, so as to guide the progressive upgrade process of the system service and realize the seamless connection and smooth transition before and after the upgrade;

[0049] (2) The microservice system progressive update method of the present invention is suitable for efficient and high-quality update iteration tasks. It formulates service upgrade constraints through the dependency relationship between services, guides the division of upgraded service batches, ensures that the interruption time between new version services is low, and effectively guarantees the stability of system services in a progressive update manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A diagram of the structure of the progressive update device for the microservice system;

[0051] Figure 2 Flowchart of the incremental update approach for a microservice system. DETAILED DESCRIPTION

[0052] The embodiments of the present invention will be further described below in conjunction with the accompanying drawings.

[0053] Before describing the specific embodiments of the present invention, in order to make the scheme of the present invention clearer and more complete, the abbreviations and key terms used in the present invention are first defined as follows:

[0054] Topological sorting: The operation of obtaining a total order on a set from a partial order on the set is called topological sorting.

[0055] like Figure 1 As shown, the present invention provides a microservice system progressive update device based on batch upgrade, including a service relationship management module, a system status acquisition module, an update decision module and an update control module;

[0056] The service relationship management module is used to analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependencies between each service node, analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependencies between each service node, and generate a service constraint dependency description file based on the functional constraint dependencies and data constraint dependencies between each service node;

[0057] The system status acquisition module is used to analyze the operation status of each service node in the microservice system, obtain the real-time operation status of each service node, and generate a system operation status description file based on the real-time operation status of each service node;

[0058] The update decision module is used to determine the service nodes to be upgraded, determine the upgrade path of the service nodes to be upgraded according to the service constraint dependency description file and the system operation status description file, and generate a progressive update strategy according to the upgrade path;

[0059] The update decision module is used to traverse the services in the system service cluster and determine the service nodes to be upgraded; read the generated service constraint dependency description file to obtain the constraint dependency of the service nodes to be upgraded; take the determined service nodes to be upgraded as the starting point, perform topological sorting based on constraint dependencies, and generate a topological sequence of the service nodes to be upgraded; determine the software upgrade scope and upgrade path of the service nodes to be upgraded based on the generated topological sequence; use the timeliness objective function to evaluate the timeliness of each upgrade path to obtain the timeliness value of each upgrade path; use the stability objective function to evaluate the number of services, stability performance and the number of services that can be supported for parallel upgrades at each level of the upgrade path to obtain the stability value of each upgrade path; evaluate the update overhead of each upgrade path based on the resource consumption, time consumption and impact scope that may be required during the update process; evaluate the update stability of each upgrade path by calculating the reliability and security of each upgrade path-related service node; based on the evaluation results, make a decision search with the obtained failure value and stability value of the upgrade path as the target to generate a progressive update strategy;

[0060] The update control module is used to receive and analyze the gradual update strategy and perform gradual updates on the microservice system. The update control module generates an executable upgrade implementation plan; the services to be upgraded in the control system are gradually updated and smoothly transitioned according to the executable upgrade implementation plan.

[0061] Based on the above system, the present invention also proposes a microservice system gradual update method based on batch upgrades. Aiming at the complex and changeable operating environment, the service function is updated frequently, and the high-performance new version service should be applied to the system as soon as possible. With the timeliness of the upgrade and the stability of the system as the goal, the service upgrade constraints are formulated based on the dependency relationship between services, and the timeliness objective function and the stability objective function are constructed. On this basis, the performance of each upgrade path in each objective function is searched to evaluate each upgrade path, and then a multi-index evaluation and sorting method is used to select the gradual update path and issue it for execution, so as to complete the gradual upgrade process of the system service and realize seamless connection and smooth transition before and after the upgrade; such as Figure 2 As shown, the following steps are included:

[0062] S1: Obtain the service constraint dependency description file of the microservice system;

[0063] S2: Obtain the system operation status description file of the microservice system;

[0064] S3: Determine the upgrade scope and upgrade path of the service nodes to be upgraded in the microservice system according to the service constraint dependency description file and the system operation status description file of the microservice system;

[0065] S4: within the upgrade range of the service node to be upgraded, calculating the timeliness value and stability value of each upgrade path in the service node to be upgraded;

[0066] S5: Calculate the update cost and stability evaluation value of each upgrade path, and generate a progressive update strategy according to the update cost, stability evaluation value, timeliness value and stability value of each upgrade path;

[0067] S6: Analyze the incremental update strategy and perform incremental updates on the microservice system.

[0068] In this embodiment of the present invention, step S1 includes the following sub-steps:

[0069] S11: Analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependency relationship between each service node;

[0070] S12: Analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependency relationship between each service node;

[0071] S13: Generate a service constraint dependency description file according to the function constraint dependency and data constraint dependency between each service node.

[0072] In an embodiment of the present invention, in step S2, the specific method for obtaining the system operation status description file of the microservice system is: analyzing the operation status of each service node in the microservice system, obtaining the real-time operation status of each service node, and generating the system operation status description file according to the real-time operation status of each service node.

[0073] In this embodiment of the present invention, step S3 includes the following sub-steps:

[0074] S31: According to the real-time running status of each service node in the system running status description file, traverse each service node of the microservice system to determine the service node to be upgraded;

[0075] S32: Acquire function constraint dependencies and data constraint dependencies of the service node to be upgraded according to the service constraint dependency description file;

[0076] S33: taking the service nodes to be upgraded as the starting point of topological sorting, performing topological sorting according to the function constraint dependency and data constraint dependency of the service nodes to be upgraded, and generating a topological sequence of the service nodes to be upgraded;

[0077] S34: Determine the upgrade scope and upgrade path of the service nodes to be upgraded according to the topological sequence of the service nodes to be upgraded.

[0078] In the embodiment of the present invention, in step S4, the calculation formula of the timeliness value T of each upgrade path is:

[0079]

[0080] Where N represents the number of service nodes to be upgraded, H i Indicates the upgrade sequence position of service node i, H indicates the upgrade sequence position of the service node; if there are many upgrade levels, then H i The cumulative sum will be larger, and when the total number of upgraded services N is constant, T will be smaller.

[0081] In step S4, the calculation formula of the stability value S of each upgrade path is:

[0082]

[0083]

[0084]

[0085]

[0086] Where ω1 represents the first weight, ω2 represents the second weight, sc represents the total number of services that need to be upgraded, sh represents the number of upgrade levels, and us m Indicates the number of services upgraded at level m, us n Indicates the number of services upgraded at the nth level, and w1 indicates the stable value of the upgrade plan. w1 mainly reflects the stability of the upgrade plan, that is, whether the number of upgrades each time is reasonable. It is mainly calculated based on the range value of the number of services upgraded in a single time. ω1 and ω2 are calculated and normalized by w1.

[0087] In the embodiment of the present invention, in step S5, the update cost of each upgrade path is p The calculation formula is:

[0088]

[0089]

[0090]

[0091]

[0092] in, represents the resource consumption of upgrade path p, represents the time consumption of upgrade path p, represents the impact range of the upgrade path p, α represents the resource impact factor, c p Indicates CPU weight, CPU need represents the CPU demand during the update process of upgrade path p, m p Indicates memory weight, Memory need represents the memory requirement during the update process of the upgrade path p, d p Indicates disk weight, Disk need represents the disk demand during the update process of the upgrade path p, β represents the time impact factor, InitializeTime represents the time overhead required for reconstruction, γ represents the scope impact factor, and e in represents the in-degree of the communication node related to the strategy, e out Represents the out-degree of the communication node related to the strategy;

[0093] In step S5, the stability evaluation value of each upgrade path is p The calculation formula is:

[0094]

[0095]

[0096] in, represents the mean time before failure, Indicates the average failure recovery time of the node, recover p represents the node repair capability, k p Represents the node's self-repair capability, which is related to the node type. p Indicates the intensity of the attack on the node.

[0097] The working principle and process of the present invention are as follows: On the one hand, the present invention divides the dependency relationship between services into two categories: functional dependency and data dependency, and processes them separately, namely: for the functional dependency between services, the dependent service must be upgraded in batches before the dependent service or upgraded at the same time, so as to ensure that the dependent service can start running quickly after starting a new service instance; for the data dependency between services, when a dependent service is upgraded in the current batch, if the dependent service of the service is not upgraded in the current batch, then the dependent service of the service is required to be upgraded in the next layer, so as to ensure that the new version service instances can interact quickly and minimize the interruption time between the new version service instances. On the other hand, the upgrade path selection problem is mapped into a multi-objective planning problem. According to the generated service constraint relationship and the system status information, with the timeliness of the upgrade and the stability of the system as the goal, the optimal upgrade path is decided, and the service upgrade sequence is output to guide the gradual upgrade process of the system service and realize seamless connection and smooth transition before and after the upgrade.

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

[0099] (1) The service relationship management module and system status acquisition module in the present invention can analyze and acquire the functional constraint dependency and data dependency constraint relationship between all services in the microservice system and the operation status of each service. The device can fully consider the factors affecting the system service upgrade in the system, effectively guide the division of the upgrade service batches, ensure that the interruption time between new version services is low, and effectively ensure the stability of the system service in a gradual update manner;

[0100] (2) The microservice system progressive update method of the present invention can realize the upgrade topology sorting, use the timeliness and stability objective functions to realize the evaluation of the upgrade path, and realize the selection of the progressive update path by the multi-index evaluation sorting method. According to the generated service constraint relationship and the system status information, the optimal upgrade path is determined, so as to guide the progressive upgrade process of the system service and realize the seamless connection and smooth transition before and after the upgrade;

[0101] (3) The microservice system progressive update method of the present invention is suitable for efficient and high-quality update iteration tasks. It formulates service upgrade constraints through the dependency relationship between services, guides the division of upgraded service batches, ensures that the interruption time between new version services is low, and effectively guarantees the stability of system services in a progressive update manner.

[0102] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for incrementally updating a microservice system based on batch upgrades, characterized in that: The following steps are involved: S1: Get the service constraint dependency description file of the microservice system, which is as follows: S11: Analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependency relationship between each service node; S12: Analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependency relationship between each service node; S13: Generate a service constraint dependency description file according to the function constraint dependency and data constraint dependency between each service node; S2: Obtain the system operation status description file of the microservice system; S3: According to the service constraint dependency description file and the system operation status description file of the microservice system, determine the upgrade scope and upgrade path of the service node to be upgraded in the microservice system, which is specifically: S31: According to the real-time running status of each service node in the system running status description file, traverse each service node of the microservice system to determine the service node to be upgraded; S32: Acquire function constraint dependencies and data constraint dependencies of the service node to be upgraded according to the service constraint dependency description file; S33: taking the service nodes to be upgraded as the starting point of topological sorting, performing topological sorting according to the function constraint dependency and data constraint dependency of the service nodes to be upgraded, and generating a topological sequence of the service nodes to be upgraded; S34: Determine the upgrade scope and upgrade path of the service nodes to be upgraded according to the topological sequence of the service nodes to be upgraded; S4: within the upgrade range of the service node to be upgraded, calculating the timeliness value and stability value of each upgrade path in the service node to be upgraded; S5: Calculate the update cost and stability evaluation value of each upgrade path, and generate a progressive update strategy according to the update cost, stability evaluation value, timeliness value and stability value of each upgrade path; S6: Analyze the incremental update strategy and perform incremental updates on the microservice system.

2. The method for gradually updating a microservice system based on batch upgrade according to claim 1 is characterized in that: In step S2, the specific method for obtaining the system operation status description file of the microservice system is: analyzing the operation status of each service node in the microservice system, obtaining the real-time operation status of each service node, and generating the system operation status description file according to the real-time operation status of each service node.

3. The microservice system gradual update method based on batch upgrade according to claim 1 is characterized in that: In step S4, the timeliness value of each upgrade path T The calculation formula is: in, N Indicates the number of service nodes to be upgraded. H i Represents a service node i The position in the upgrade sequence. H Indicates the upgrade sequence position of the service node; In step S4, the stable value of each upgrade path S The calculation formula is: in, ω 1 represents the first weight, ω 2 represents the second weight, sc Indicates the total number of services that need to be upgraded. sh Indicates the number of upgrade levels. us m Indicates m The number of services that are upgraded to a certain level, us n Indicates n The number of services that are upgraded to a certain level, w 1 represents the stable value of the upgrade scheme.

4. The method for gradually updating a microservice system based on batch upgrade according to claim 1 is characterized in that: In step S5, the update cost of each upgrade path cost p The calculation formula is: in, Indicates the upgrade path p resource consumption, Indicates the upgrade path p time consumption, Indicates the upgrade path p The scope of influence, α represents the resource impact factor, c p Indicates CPU weight, CPU need Indicates the upgrade path p During update CPU Demand, m p represents the memory weight, Memory need Indicates the upgrade path p The memory required during the update process, d p Indicates the disk weight, Disk need Indicates the upgrade path p The disk requirements during the update process, β represents the time impact factor, InitializeTime Indicates the time required for reconstruction, γ represents the range impact factor, e in represents the in-degree of the communication node related to the strategy, e out Represents the out-degree of the communication node related to the strategy; In step S5, the stability evaluation value of each upgrade path stability p The calculation formula is: in, represents the mean time before failure, It represents the average failure recovery time of a node. recover p Indicates the node repair capability, k p Indicates the node's self-repair capability, ω p Indicates the intensity of the attack on the node.

5. A microservice system progressive update device based on batch upgrade, characterized in that: The microservice system progressive update device is used to execute the microservice system progressive update method described in any one of claims 1 to 4, including a service relationship management module, a system status acquisition module, an update decision module and an update control module; The service relationship management module is used to analyze the functional dependencies of each service node in the microservice system to obtain the functional constraint dependencies between each service node, analyze the data dependencies of each service node in the microservice system to obtain the data constraint dependencies between each service node, and generate a service constraint dependency description file according to the functional constraint dependencies and data constraint dependencies between each service node; The system status acquisition module is used to analyze the operation status of each service node in the microservice system, obtain the real-time operation status of each service node, and generate a system operation status description file according to the real-time operation status of each service node; The update decision module is used to determine the service node to be upgraded, determine the upgrade path of the service node to be upgraded according to the service constraint dependency description file and the system operation status description file, and generate a progressive update strategy according to the upgrade path; The update control module is used to receive and parse the progressive update strategy to perform a progressive update of the microservice system.

Citation Information

Patent Citations

  • Micro service version management method and device, medium and electronic device

    CN108153547A

  • Method and device for searching abnormal root cause nodes of micro-service system

    CN110888755A