Service load balancing path calculation method, system, device and storage medium

Through the service load balancing path calculation method based on call link analysis, the problem of failure to effectively consider network load and call link in the prior art is solved, and a more stable and efficient service load balancing decision is achieved, ensuring that The call link between microservices is successful.

CN114024975BActive Publication Date: 2024-11-15CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111426044.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2024-11-15
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

The existing service load balancing policy fails to effectively consider the network load and call link situation, resulting in the load call links that may be long and unstable, and local optimal decisions may lead to the failure of the entire call link.

Method used

The service load balancing path calculation method based on call link analysis is used, and the optimal service load balancing path is calculated through node annotation, link pruning and cost calculation, and the network load situation of the entire call link is comprehensively considered. The specific steps include identity annotation of the network nodes, tracking the function to calculate the calling link, cutting out nodes that do not conform to the calling logic, and reversely calculating the link costs based on the service load, with the goal of the minimum total cost.

Benefits of technology

It improves the effect of load balancing decisions, ensures that the most appropriate path is selected in the global network view, avoids the local optimal situation that does not conform to the entire calling link, and improves the call success rate between microservice loads.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114024975B_ABST
    Figure CN114024975B_ABST
Patent Text Reader

Abstract

The present invention provides a service load balancing path calculation method, system, device and storage medium, the method comprising: node marking the identity of the service load of the network node; based on the service load with the marked identity, calculating the call link of the entire service load in series through a tracking function, and pruning the network nodes that do not conform to the call logic according to the time consumption of the tracking function calculation, and obtaining the call link after link pruning; based on the call link after link pruning, calculating the cost of each link based on the service load, and taking the minimum total cost of the call link as the goal, obtaining the optimal service load balancing path of the entire call link. When calculating the microservice load balancing path, the present invention comprehensively considers the load conditions of all network nodes involved in the entire call link to calculate a more suitable path.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of microservice technology, and in particular relates to a service load balancing path calculation method, system, device and storage medium. Background Art

[0002] With the diversification of business needs and the continuous expansion of the scale of cloud systems, service load calls are usually accompanied by calls to downstream dependencies, resulting in a relatively long link for a service load call. The load balancing strategy of the current service load architecture is mainly controlled by the caller, relying on random calls or Round Robin methods, without considering network load and call link conditions. Summary of the invention

[0003] In order to solve the problems existing in the prior art, the present invention proposes a service load balancing path calculation method, system, device and storage medium based on call link analysis. In the load balancing decision, path decision is made for the global network view. At the same time, call link analysis is performed according to the characteristics of the microservice load. It is not limited to the network communication between two hosts, but comprehensively considers the network load of the entire call link to improve the effect of load balancing decision.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] A service load balancing path calculation method includes the following steps:

[0006] Node labeling for the identity of the service load of the network node;

[0007] Based on the service load with annotated identity, the call link of the entire service load is calculated through the tracking function. The network nodes that do not conform to the call logic are pruned according to the time consumption of the tracking function to obtain the call link after link pruning.

[0008] Based on the call link after link pruning, the cost of each link is calculated based on the service load, and the goal is to minimize the total cost of the call link to obtain the optimal service load balancing path for the entire call link.

[0009] As a further improvement of the present invention, the calling link of the entire service load is calculated in series by tracing the function, specifically including:

[0010] Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads:

[0011] If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context;

[0012] Connect downstream service loads in series:

[0013] The tracking function calculation passes the link context into the Context parameter of the tracking function, and the tracking function calls the link internally.

[0014] As a further improvement of the present invention, the network nodes that do not conform to the calling logic are specifically cut off as follows:

[0015] Cut off network nodes that have no calling relationship between service loads.

[0016] As a further improvement of the present invention, the cost of each link calculated based on the service load is specifically:

[0017] The cost is calculated in reverse order along the call link starting from the last service load until the source of the call link.

[0018] A service load balancing path calculation system, comprising:

[0019] A node labeling module is used to label the identities of service loads of network nodes;

[0020] The link pruning module is used to calculate the call link of the entire service load in series based on the service load with annotated identity, and prune the network nodes that do not conform to the call logic according to the time consumption of the tracking function calculation to obtain the call link after link pruning;

[0021] The cost calculation module is used to calculate the cost of each link based on the call link after link pruning and the service load, with the goal of minimizing the total cost of the call link, and calculate the optimal service load balancing path for the entire call link.

[0022] As a further improvement of the present invention, the link pruning module calculates the call link of the entire service load in series by tracking the function, specifically including:

[0023] Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads:

[0024] If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context;

[0025] Connect downstream service loads in series:

[0026] The tracking function calculation passes the link context into the Context parameter of the tracking function, and the tracking function calls the link internally.

[0027] As a further improvement of the present invention, the link pruning module prunes the network nodes that do not conform to the call logic specifically as follows:

[0028] Cut off network nodes that have no calling relationship between service loads.

[0029] As a further improvement of the present invention, the cost of each link calculated based on the service load in the cost calculation module is specifically:

[0030] The cost is calculated in reverse order along the call link starting from the last service load until the source of the call link.

[0031] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the service load balancing path calculation method when executing the computer program.

[0032] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the service load balancing path calculation method are implemented.

[0033] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0034] The load balancing algorithm based on call link analysis of the present invention comprehensively considers the network load conditions involved in the entire service load call link, and makes comprehensive path selection considerations. When processing flow table requests, the dependencies between applications are analyzed, and the call links between microservice loads are gradually maintained. When calculating the microservice load balancing path, the load conditions of all network nodes involved in the entire call link are comprehensively considered to calculate a more suitable path. In the load balancing decision, the path decision is made for the global network view, and the call link analysis is performed according to the characteristics of the microservice load. It is not limited to the network communication between the two hosts, but comprehensively considers the network load conditions of the entire call link to improve the effect of the load balancing decision. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Schematic diagram of the service load call link caused by the service load call (A→B);

[0036] Figure 2 Schematic diagram of distributed nodes called by microservice load;

[0037] Figure 3 Schematic diagram of microservice load balancing based on call link analysis;

[0038] Figure 4 A schematic diagram of a service load balancing path calculation method according to the present invention;

[0039] Figure 5 A schematic diagram of a service load balancing path calculation method system of the present invention;

[0040] Figure 6 The figure is a schematic diagram of the structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0041] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0042] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise specified, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention.

[0043] Figure 1 The service load call link caused by the service load call (A→B); Figure 1 The call link of a typical microservice load call is shown. When service load A calls service load B, service load B calls service load C, and service load C calls service loads D and E. There are disadvantages in only load balancing the link between service load A and service load B.

[0044] Figure 2 A distributed node network diagram showing the microservice load. i |X∈(A,B,C,D…),i∈(1,2,3,4…)} represent the service load nodes of microservice load X respectively. The connecting line indicates that a service load can communicate with another service load through the network. When service load A calls service load B, there are multiple links to choose from. If only the link from A to B is considered, the link load may not be the best choice. It is also possible that the selected link cannot complete the subsequent call, resulting in a call failure (network failure between C1 and D1 makes the call unsuccessful).

[0045] Microservice load calls have the following characteristics:

[0046] (1) The service load is deployed in a distributed manner. The service load call does not have a clear destination host. The network path selection is between service loads, not between hosts.

[0047] (2) Local optimality does not necessarily mean that the entire call chain is optimal;

[0048] (3) If a network link is interrupted, such as C1→D1, the path A→B1→C1 cannot be called. If call link analysis is not performed, the path A→B1 may be selected when A calls the service load B, causing the subsequent call of the service load B to fail.

[0049] In view of the fact that network load and call link conditions are not taken into consideration, the present invention studies a load balancing algorithm based on call link analysis. In the load balancing decision, path decisions are made based on the global network view. At the same time, call link analysis is performed according to the characteristics of the microservice load. It is not limited to the network communication between two hosts, but comprehensively considers the network load conditions of the entire call link to improve the effect of load balancing decisions.

[0050] Among them, the load balancing algorithm based on call link analysis comprehensively considers the network load conditions involved in the entire service load call link and makes comprehensive path selection considerations. When processing flow table requests, the dependencies between applications are analyzed, and the call links between microservice loads are gradually maintained. When calculating the microservice load balancing path, the load conditions of all network nodes involved in the entire call link are comprehensively considered to calculate a more appropriate path.

[0051] like Figure 4 As shown, the present invention provides a service load balancing path calculation method, comprising the following steps:

[0052] Node labeling for the identity of the service load of the network node;

[0053] Based on the service load with annotated identity, the call link of the entire service load is calculated through the tracking function. The network nodes that do not conform to the call logic are pruned according to the time consumption of the tracking function to obtain the call link after link pruning.

[0054] Based on the call link after link pruning, the cost of each link is calculated based on the service load, and the goal is to minimize the total cost of the call link to obtain the optimal service load balancing path for the entire call link.

[0055] The load balancing algorithm based on call link analysis of the present invention comprehensively considers the network load conditions involved in the entire service load call link and makes comprehensive path selection considerations. When processing flow table requests, the dependencies between applications are analyzed, and the call links between microservice loads are gradually maintained. When calculating the microservice load balancing path, the load conditions of all network nodes involved in the entire call link are comprehensively considered to calculate a more suitable path.

[0056] by Figure 3 Taking the example of service load balancing path calculation based on call link analysis, the main steps can be briefly described as follows:

[0057] (1) Node labeling:

[0058] When calculating the path, it is no longer abstracted into undifferentiated network nodes, but the identities of network nodes are clarified: switch, service load A, service load B...

[0059] (2) Integration of Function Compute and Link Tracking:

[0060] The calling link of the entire service load is calculated in series by tracing functions, specifically including:

[0061] Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads:

[0062] If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context;

[0063] Connect downstream service loads in series:

[0064] The tracking function calculation passes the link context into the Context parameter of the tracking function, and the tracking function calls the link internally.

[0065] For example, the link tracking function of Function Compute can be used to connect the entire call chain, including: automatically recording the time taken by key steps in Function Compute, connecting upstream service loads: if the request header contains link context information, Function Compute will create a sub-link based on the context. Connecting downstream service loads: Function Compute will pass the link context into the function context parameter to track the internal call chain of the function.

[0066] (3) Link pruning:

[0067] The network nodes that do not conform to the call logic are specifically cut off as follows:

[0068] Cut off network nodes that have no calling relationship between service loads.

[0069] According to the function calculation time consumption, nodes that do not conform to the call logic are cut off, such as A→F (service load A does not call service load F) and B2→E1 (service load B does not call service load C);

[0070] (4) Fees are calculated based on service load.

[0071] The cost of each link calculated based on the service load is specifically:

[0072] Starting from the last service load, calculate the cost in reverse order along the call link until the source of the call link. Starting from the last service load, mark the cost required for a machine to call the service load; calculate the cost in reverse order along the call link until the source of the call.

[0073] like Figure 5 As shown, the present invention also provides a service load balancing path calculation system, including:

[0074] A node labeling module is used to label the identities of service loads of network nodes;

[0075] The link pruning module is used to calculate the call link of the entire service load in series based on the service load with annotated identity, and prune the network nodes that do not conform to the call logic according to the time consumption of the tracking function calculation to obtain the call link after link pruning;

[0076] The cost calculation module is used to calculate the cost of each link based on the call link after link pruning and the service load, with the goal of minimizing the total cost of the call link, and calculate the optimal service load balancing path for the entire call link.

[0077] Specifically, the link pruning module calculates the call link of the entire service load in series by tracking the function, which specifically includes:

[0078] Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads:

[0079] If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context;

[0080] Connect downstream service loads in series:

[0081] The tracking function calculation passes the link context into the Context parameter of the tracking function, and the tracking function calls the link internally.

[0082] The link pruning module prunes the network nodes that do not conform to the call logic specifically as follows:

[0083] Cut off network nodes that have no calling relationship between service loads.

[0084] The cost calculation module calculates the cost of each link based on the service load, specifically:

[0085] The cost is calculated in reverse order along the call link starting from the last service load until the source of the call link.

[0086] like Figure 6 As shown, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the service load balancing path calculation method when executing the computer program.

[0087] A fourth object of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the service load balancing path calculation method are implemented.

[0088] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0089] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0090] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0091] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A service load balancing path calculation method, characterized in that: The following steps are involved: Node labeling for the identity of the service load of the network node; Based on the service load with annotated identity, the identity of the network node is clarified as a switch or service load; The call link of the entire service load is connected in series by tracing function calculation, and the network nodes that do not conform to the call logic are pruned according to the time consumption of tracing function calculation to obtain the call link after link pruning. Based on the call link after link pruning, the cost of each link is calculated based on the service load, and the goal is to minimize the total cost of the call link to obtain the optimal service load balancing path for the entire call link; The calling link of the entire service load is calculated in series by tracing functions, specifically including: Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads: If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context; Connect downstream service loads in series: Tracing Function Compute passes the link context to the Context parameter of the tracing function and traces the internal call link of the function. The link tracing function of tracing Function Compute connects the entire call chain, including: automatically recording the time taken by key steps in Function Compute, connecting upstream service loads: if the request Header contains link context information, Function Compute creates a sub-link based on the context; connecting downstream service loads: Function Compute passes the link context to the Context parameter of the function and traces the internal call link of the function. The network nodes that do not conform to the call logic are specifically cut off as follows: Cut off network nodes that have no call relationship between service loads; The cost of each link calculated based on the service load is specifically: The cost is calculated in reverse order along the call link starting from the last service load until the source of the call link.

2. A service load balancing path calculation system, characterized in that: include: A node labeling module is used to label the identities of service loads of network nodes; The link pruning module is used to calculate the call link of the entire service load in series based on the service load with annotated identity, and prune the network nodes that do not conform to the call logic according to the time consumption of the tracking function calculation to obtain the call link after link pruning; Clearly identify the network node as a switch or service load; The cost calculation module is used to calculate the cost of each link based on the call link after link pruning and the service load, and to calculate the optimal service load balancing path for the entire call link with the goal of minimizing the total cost of the call link; The link pruning module calculates the call link of the entire service load in series by tracking the function, which specifically includes: Automatically record and track functions to calculate the time taken by key internal steps and connect upstream service loads: If the request header contains call link context information, the tracing function calculation will create a sub-link based on the context; Connect downstream service loads in series: Tracing Function Compute passes the link context to the Context parameter of the tracing function and traces the internal call link of the function. The link tracing function of tracing Function Compute connects the entire call chain, including: automatically recording the time taken by key steps in Function Compute, connecting upstream service loads: if the request Header contains link context information, Function Compute creates a sub-link based on the context; connecting downstream service loads: Function Compute passes the link context to the Context parameter of the function and traces the internal call link of the function. The network nodes that do not conform to the call logic are pruned in the link pruning module specifically: Cut off network nodes that have no call relationship between service loads; The cost calculation module calculates the cost of each link based on the service load, specifically: The cost is calculated in reverse order along the call link starting from the last service load until the source of the call link.

3. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the service load balancing path calculation method according to claim 1 when executing the computer program.

4. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the service load balancing path calculation method according to claim 1.