Logic service balancing method and electronic equipment

By determining and estimating the number of master LSIs carried by the service node and adjusting the distribution of master LSIs, the problems of stability and load balancing of the logical service instance master node are solved, and the system is efficient and high availability is achieved.

CN119512747APending Publication Date: 2025-02-25SUGON INFORMATION IND +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411586790.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively solve the stability and load balancing problems of the main nodes of logical service instances, especially when the service node fails or the process exits abnormally, it is necessary to quickly adjust the distribution of the main nodes to ensure high availability of the system.

Method used

By determining the first and second number of primary LSIs carried by the service node, the estimated is made based on the working status of the service node, and the distribution of primary LSIs in each service node is adjusted based on these numbers to achieve load balancing and high availability.

Benefits of technology

The efficiency of LSI master node adjustment is improved, the efficiency of the balancing algorithm is ensured, and the high availability and load balancing of the entire service are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512747A_ABST
    Figure CN119512747A_ABST
Patent Text Reader

Abstract

The invention discloses a logic service balancing method and electronic equipment, which are used for ensuring the stability of a main node on each service node, improving the efficiency of adjusting the LSI main node and improving the high efficiency of a balancing algorithm. The method comprises: for each type of LSI in a process of a service node, determining a first number of main LSIs carried by the service node, the main LSIs representing LSIs with a main node function in one type of LSIs; estimating a second number of main LSIs borne by the service node according to the working state of the service node; and adjusting the distribution of the main LSIs in each type of LSIs in each service node according to the first quantity and the second quantity of the main LSIs borne by each service node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a logic service balancing method and electronic equipment. Background Art

[0002] Logical Service Instance (LSI) is a technology used to establish a logical connection between a terminal and a logical security element. It defines how to communicate between the terminal and the logical security element (LSE).

[0003] A cluster is a group of independent computers connected by a high-speed communication network to form a larger computer service system. The same process runs on multiple service nodes, and multiple LSIs exist on a single process.

[0004] The same LSI on multiple service nodes constitutes a logical service instance cluster. In this cluster, only one LSI is the master node (Leader) for processing business requests, and the other LSIs are slave nodes. When a service node fails, or the process on the service node exits abnormally and resumes online, the distribution of the LSI master node needs to be readjusted to ensure load balancing among the service nodes. Summary of the invention

[0005] The present invention provides a logic service balancing method and electronic equipment, which are used to ensure the stability of the master node on each service node, improve the efficiency of LSI master node adjustment, and enhance the efficiency of the balancing algorithm.

[0006] In a first aspect, an embodiment of the present invention provides a logical service balancing method, the method comprising:

[0007] For each type of LSI in the process of the service node, determine a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in one type of LSI;

[0008] estimating a second number of master LSIs carried by the service node according to the working state of the service node;

[0009] The distribution of the main LSIs of each type of LSI in each service node is adjusted according to the first number and the second number of main LSIs carried by each service node.

[0010] This embodiment determines the first number of main LSIs carried on the service node and estimates the second number of main LSIs carried on the adjusted service node according to whether the process is online. It can quickly adjust the main node according to the state of the current process and the difference between the number of main LSIs already carried by the current service node and the estimated number of main LSIs carried on the service node after the main node is adjusted. It can ensure the efficiency of the balancing algorithm, perform efficient load adjustment as much as possible, and ensure high availability of the entire service.

[0011] As an optional implementation, the method further includes:

[0012] determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI;

[0013] The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

[0014] When adjusting the distribution of the main LSI, this embodiment evenly distributes the main LSI of each type of LSI to each service node based on the principle of even distribution. Subsequent adjustments are also based on the principle of even distribution. Even distribution ensures that the number of main LSIs carried by each service node is consistent, and balance is ensured as much as possible between each controller to fully utilize system resources.

[0015] As an optional implementation manner, the determining the first number of master LSIs currently carried by the service node includes:

[0016] Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node;

[0017] Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0018] This embodiment determines the distribution of the main LSIs currently carried by the service node and estimates the distribution of the main LSIs carried by the service node after adjustment, and then adjusts the distribution of the main LSIs based on the comparison of the two distribution situations. The main LSIs of the same type of LSIs can be adjusted through one adjustment, thereby improving the efficiency of the adjustment.

[0019] As an optional implementation manner, estimating the second number of master LSIs carried by the service node according to the working state of the service node includes:

[0020] If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or,

[0021] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0022] This embodiment estimates the distribution of the main LSI carried by each service node based on the working status of the service node. The process being offline will result in the service node of the process being offline being unable to carry the main LSI. Therefore, the main LSI on the service node of the process being offline will be allocated to other service nodes with online processes. When the process is online, it will decide whether to distribute the main LSI on the current online service node to other service nodes based on the working status of other service nodes. By considering the working status of the source service node, the stability of the source service node is guaranteed as much as possible.

[0023] As an optional implementation, if the process of the i-th service node is online and j=i, the method further includes:

[0024] The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0025] This embodiment decides whether to distribute the main LSI on the current service node to other service nodes by considering the working status of the current service node. That is, if the process of the current service node is online, the main LSI whose source service node is the current service node is still distributed on the current service node to ensure the stability of the source service node of the main LSI.

[0026] As an optional implementation manner, if the process of the i-th service node is online and j≠i, then according to the i-th service node carried by the source service node being the working state of the j-th service node, estimating the second number of master LSIs carried by the service node includes:

[0027] If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or,

[0028] If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

[0029] This embodiment considers the working status of the current service node and the working status of other service nodes, distributes the main LSI of other service nodes whose source service node is an online process to other service nodes, and distributes the main LSI of other service nodes whose source service node is an offline process to the service node currently online. The distribution of the main LSI on each service node is adjusted according to the status of the process, ensuring the balance of each service node and making full use of system resources.

[0030] As an optional implementation manner, the adjusting the distribution of the main LSIs in each type of LSI in each service node according to the first number and the second number of main LSIs carried by each service node includes:

[0031] Traverse each LSI of each type in each service node;

[0032] Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node;

[0033] According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

[0034] In the process of adjusting the main LSI, this embodiment takes into account the current distribution of the main LSI, estimates the distribution of the main LSI in combination with the working status of each service node, and adjusts the distribution of the main LSI of each service node based on the two distribution conditions. When a service node fails or a process goes offline, the distribution of the main LSI can be adjusted immediately, providing a more efficient adjustment method.

[0035] As an optional implementation manner, the distribution of the main LSIs in each type of LSI in each service node is adjusted according to the judgment result and the first number and the second number of main LSIs carried by each service node, including:

[0036] If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or,

[0037] If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

[0038] When adjusting the distribution of the main LSI, this embodiment can adjust the distribution of the main LSI in each current service node according to whether the current LSI has a main LSI, distribute the main LSI on the service node with excessive load to other service nodes with less load, and distribute the main LSI on the service nodes with less load to ensure load balance of each service node.

[0039] In a second aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and perform the following steps:

[0040] For each type of LSI in the process of the service node, determine a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in one type of LSI;

[0041] estimating a second number of master LSIs carried by the service node according to the working state of the service node;

[0042] The distribution of the main LSIs of each type of LSI in each service node is adjusted according to the first number and the second number of main LSIs carried by each service node.

[0043] As an optional implementation, the processor is further configured to execute:

[0044] determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI;

[0045] The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

[0046] As an optional implementation, the processor is specifically configured to execute:

[0047] Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node;

[0048] Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0049] As an optional implementation, the processor is specifically configured to execute:

[0050] If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or,

[0051] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0052] As an optional implementation, if the process of the i-th service node is online and j=i, the processor is further configured to execute:

[0053] The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0054] As an optional implementation, if the process of the i-th service node is online and j≠i, the processor is specifically configured to execute:

[0055] If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or,

[0056] If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

[0057] As an optional implementation, the processor is specifically configured to execute:

[0058] Traverse each LSI of each type in each service node;

[0059] Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node;

[0060] According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

[0061] As an optional implementation, the processor is specifically configured to execute:

[0062] If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or,

[0063] If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

[0064] In a third aspect, an embodiment of the present invention further provides a logical service balancing device, the device comprising:

[0065] A current distribution module, configured to determine, for each type of LSI in a process of the service node, a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in one type of LSI;

[0066] An estimation distribution module, configured to estimate a second number of master LSIs carried by the service node according to a working state of the service node;

[0067] The distribution adjustment module is used to adjust the distribution of the main LSIs in each type of LSI in each service node according to the first number and the second number of main LSIs carried by each service node.

[0068] As an optional implementation, the device further includes a uniform adjustment module specifically used for:

[0069] determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI;

[0070] The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

[0071] As an optional implementation manner, the current distribution module is specifically used to:

[0072] Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node;

[0073] Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0074] As an optional implementation manner, the estimated distribution module is specifically used for:

[0075] If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or,

[0076] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0077] As an optional implementation, if the process of the i-th service node is online and j=i, the estimated distribution module is further configured to:

[0078] The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0079] As an optional implementation, if the process of the i-th service node is online and j≠i, the estimated distribution module is specifically used to:

[0080] If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or,

[0081] If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

[0082] As an optional implementation manner, the distribution adjustment module is specifically used to:

[0083] Traverse each LSI of each type in each service node;

[0084] Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node;

[0085] According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

[0086] As an optional implementation manner, the distribution adjustment module is specifically used to:

[0087] If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or,

[0088] If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

[0089] In a fourth aspect, an embodiment of the present invention further provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, it is used to implement the steps of any one of the methods described in the first aspect above.

[0090] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0091] These and other aspects of the present application will be more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 paying creative labor.

[0093] Figure 1 A specific implementation flow chart of a logical service balancing method provided by an embodiment of the present invention;

[0094] Figure 2 A schematic diagram of a process for determining a second quantity provided by an embodiment of the present invention;

[0095] Figure 3A-3B A schematic diagram of main LSI distribution in an initial state provided by an embodiment of the present invention;

[0096] Figure 4A-4B A schematic diagram of a main LSI distribution adjustment provided by an embodiment of the present invention;

[0097] Figure 5 A flowchart of a method for implementing LSI equalization adjustment provided by an embodiment of the present invention;

[0098] Figure 6 A schematic diagram of an electronic device provided by an embodiment of the present invention;

[0099] Figure 7 A schematic diagram of a logical service balancing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0100] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0101] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0102] The application scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the present invention are also applicable to similar technical problems. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0103] Before introducing a logical service balancing method provided by an embodiment of the present application, in order to facilitate understanding, the technical background of the embodiment of the present application is first introduced in detail below.

[0104] Logical Service Instance (LSI) is a technology used to establish a logical connection between a terminal and a logical security element. It defines how to communicate between the terminal and the logical security element. There are multiple logical service instances in a single process. A cluster refers to a group of independent computers connected by a high-speed communication network to form a larger computer service system. The cluster includes multiple service nodes, and the same process runs in multiple service nodes. For example, all service nodes run process A, process B, and process C. There are one or more types of LSIs on each process, and each type of LSI includes one or more LSIs. Different types of LSIs provide different logical services, and different types of LSIs perform different operations for the same request.

[0105] The same LSI on multiple service nodes constitutes a logical service instance cluster, in which only one LSI is the master node (Leader) for processing service requests, and the other LSIs are slave nodes. When a service node fails, or the process on the service node exits abnormally and resumes online, the distribution of the LSI master nodes needs to be readjusted to ensure load balancing among the service nodes. When the LSI at the master node exits abnormally, the LSIManager (LSI manager, which is used to provide a mechanism and framework for the master-slave assignment of service instances based on the working status of the logical service) needs to select an LSI from the remaining normal LSIs according to a certain strategy, and assign the selected LSI to switch to the master node. When the master node is successfully switched, the switched master node becomes the new master node for processing service requests, thereby achieving high availability of the entire service. When the failed service node is restored, the LSI distribution needs to be readjusted to achieve load balancing among the service nodes. At any time, the same LSI on multiple service nodes has at most one LSI as the master LSI (i.e., the master node). Therefore, when LSIManager adjusts the LSI view, it needs to ensure the stability of the existing master LSI as much as possible, ensure the efficiency of the balancing algorithm as much as possible, ensure the efficiency of the master node adjustment, ensure the balance between each service node as much as possible, and make full use of system resources; it must be ensured that at any time, for the same LSI, there is at most one master LSI on all service nodes, and the other LSIs are slave nodes.

[0106] The core idea of ​​a logical service balancing method provided in this embodiment is to determine the first number of main LSIs carried on the service node and estimate the second number of main LSIs carried on the adjusted service node according to whether the process is online. The main node can be quickly adjusted according to the state of the current process through the difference between the number of main LSIs already carried by the current service node and the estimated number of main LSIs carried on the service node after the main node is adjusted. The efficiency of the balancing algorithm can be guaranteed, and efficient load adjustment can be performed as much as possible to ensure the high availability of the entire service.

[0107] like Figure 1 As shown, the specific implementation process of a logical service balancing method provided in this embodiment is as follows:

[0108] Step 100: for each type of LSI in the process of the service node, determine the first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in a type of LSI;

[0109] In implementation, the logical service balancing method in this embodiment is applied to a cluster, which includes multiple service nodes. The same process runs in the multiple service nodes, such as process A, process B, and process C running in all service nodes. There are one or more types of LSIs on each process, and each type of LSI includes one or more LSIs. Different types of LSIs provide different logical services, and different types of LSIs perform different operations for the same request. The same LSI on multiple service nodes constitutes a logical service instance cluster, in which only one LSI is a master node for processing service requests, and the other LSIs are slave nodes.

[0110] In this embodiment, one type of LSI has only one LSI with the master node function, and there may be multiple LSIs without the master node function, that is, with the slave node function. That is, in this embodiment, one type of LSI includes one master LSI and one or more slave LSIs (LSIs with the slave node function). The master node function is used to process service requests.

[0111] It should be noted that each adjustment of the main node distribution in this embodiment is not an adjustment of the distribution of a certain main LSI, but an adjustment of the distribution of the main LSI in a certain type of LSI, such as the adjustment of the main LSI in the type A LSI, where the main LSI in the type A LSI includes but is not limited to: LSI-A1, LSI-A2, LSI-A3, LSI-A4.

[0112] In some embodiments, a third number of service nodes with online processes and a fourth number of master LSIs under each type of LSI are determined; based on the third number and the fourth number, the master LSIs under each type of LSI are evenly distributed to each service node.

[0113] In implementation, when the processes of each service node are online, in order to ensure that the number of master LSIs carried by each service node is consistent and to ensure load balancing, the master LSIs under each type of LSI are evenly distributed to each service node according to the number of service nodes with online processes and the number of master LSIs under each type of LSI. Optionally, the number of each type of LSI distributed to each online service node is determined by using the ratio of the fourth number to the third number.

[0114] Based on this, this embodiment introduces the concept of source service node, which means the service node where the master LSI corresponding to each process is located when the processes of each service node are online. That is, when the processes of all service nodes in the cluster are online (that is, all service nodes are normal in an ideal state), at this time, the service node where each master LSI is located is the source service node of the master LSI, that is, in an ideal state, the service node where each master LSI is located is the source service node of the master LSI.

[0115] The source service node in this embodiment can solve the problem that when the processes on some service nodes exit abnormally and then resume, the adjusted main LSI can be restored to the source service node to ensure the stability of the main node. If the process of the source service node of the main LSI is online, then after the adjustment is completed and stabilized, the main LSI will be assigned to the source service node.

[0116] In some embodiments, this embodiment determines the first number of master LSIs currently carried by the service node in the following manner:

[0117] Determine the first number of master LSIs carried by the i-th service node whose source service node is the j-th service node; wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online.

[0118] In implementation, when i=j, the first number of main LSIs whose source service node is the i-th service node among the main LSIs carried by the i-th service node is determined, that is, the number of main LSIs whose source service node is the i-th service node itself is determined. When j≠i, the first number of main LSIs whose source service node is the j-th service node among the main LSIs carried by the i-th service node is determined, that is, the number of main LSIs whose source service node is other service nodes is determined on the i-th service node. Therefore, the first number in this embodiment includes two quantity representations, one quantity representation of the number of main LSIs on the service node whose source service node is itself, and the other quantity representation of the number of main LSIs on the service node whose source service node is other service nodes except its own service node.

[0119] During implementation, the distribution of each master LSI in each type of LSI on each service node is calculated, that is, the first number of master LSIs on each service node can be expressed as curLayout[i][j], which indicates that the source service node of the master LSI on the i-th service node is the j-th service node.

[0120] In this embodiment, the first number of master LSIs on each current service node can be calculated in the following manner:

[0121] Step a, traverse each LSI of each type of LSI on each service node;

[0122] Step b: If the current LSI has a master LSI, curLayout[curLeader][orgLeader]+=1; wherein curLayout[i][j] indicates the number of source service nodes of the master LSI on the i-th service node, which is the j-th service node. curLeader indicates the ID of the service node where the current master LSI is located, that is, the number of the service node. orgLeader indicates the ID of the source service node of the current master LSI.

[0123] Step 101: Estimate the second number of master LSIs carried by the service node according to the working status of the service node;

[0124] During implementation, after calculating the number of master LSIs on each current service node and the number of master LSIs on each service node whose source service node is other service nodes, the master LSIs in each type of LSI can be simulated and adjusted according to the working status of the service node, and the second number of master LSIs on each service node can be estimated based on the distribution of the adjusted master nodes.

[0125] The main LSIs under each type of LSI are evenly distributed to each service node according to the working status of the service node, the third number of service nodes with online processes, and the fourth number of main LSIs under each type of LSI.

[0126] Optionally, the working status in this embodiment includes but is not limited to: process online, process offline, node failure, node failure recovery, etc. This embodiment does not impose too many restrictions on this. The implementation principle of estimating the second quantity when the process is online is the same as the implementation principle of estimating the second quantity when the node failure is recovered; the implementation principle of estimating the second quantity when the process is offline is the same as the implementation principle of estimating the second quantity when the node failure occurs. This embodiment illustrates the principle of estimation with the process online and the process offline. When the node fails or the node failure is recovered, the implementation method of estimating the second quantity when the process is online and the process is offline can be referred to, and this embodiment will not be repeated.

[0127] During implementation, the distribution of the main LSIs after simulated adjustment of the main LSIs in each type of LSI on each service node is calculated, wherein the second number of main LSIs carried by the service node can be expressed as tgtLayout[i][j], specifically the number of main LSIs whose source service node is the jth service node among the main LSIs carried by the i-th service node after adjustment.

[0128] In some embodiments, this embodiment estimates the second number of master LSIs carried by the service node according to the working status of the service node in the following manner:

[0129] (1) Process offline situation;

[0130] If the process of the i-th service node is offline, the second number of the main LSI carried by the i-th service node and whose source service node is the j-th service node is 0, where i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0131] In implementation, when i=j, the process of the i-th service node is offline, then among the master LSIs carried by the i-th service node, the second number of master LSIs whose source service node is the i-th service node is 0, that is, when the process of the i-th service node is offline, the i-th service node itself will not carry the master LSI, and the second number is 0. When j≠i, the process of the i-th service node is offline, then among the master LSIs carried by the i-th service node, the second number of master LSIs whose source service node is the j-th service node is 0, that is, when the process of the i-th service node is offline, the i-th service node itself will not carry the master LSI, and thus will not carry the master LSI whose source service node is other service nodes, and therefore the second number is 0.

[0132] (2) Process online status;

[0133] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0134] In some embodiments, depending on whether i and j are equal, the manner of determining the second number is mainly divided into the following cases:

[0135] Case 1: The process of the i-th service node is online, and j=i;

[0136] In this case, the second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0137] During implementation, when the process of the i-th service node is online, the number of main LSIs carried by the i-th service node and whose source service node is itself is taken as the second number, that is, the second number of main LSIs carried by the i-th service node and whose source service node is itself is determined.

[0138] Case 2: The process of the i-th service node is online and j≠i, and the process of the j-th service node is online;

[0139] In this case, the second number of master LSIs carried by the i-th service node whose source service node is the j-th service node is 0.

[0140] During implementation, when the process of the i-th service node is online and the process of the j-th service node is online, and j≠i, since the process of the j-th service node is online, the j-th service node is capable of carrying the main LSI, and the main LSI whose source service node is the j-th service node can be allocated to the j-th service node. At this time, the number of main LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, that is, the number of main LSIs carried by the i-th service node and whose source service node is the j-th service node is determined to be the second number, and the second number is 0 at this time.

[0141] Case 3: The process of the i-th service node is online and j≠i, and the process of the j-th service node is offline;

[0142] In this case, the second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the j-th service node, and the number of online processes.

[0143] In implementation, when the process of the i-th service node is online, the process of the j-th service node is offline, and j ≠ i, since the process of the j-th service node is offline, the j-th service node has no ability to carry the main LSI. At this time, it is necessary to evenly distribute the main LSI with the source service node being the j-th service node carried by the i-th service node to each service node with an online process (including the i-th service node). Specifically, the number of the main LSI with the source service node being the j-th service node carried by the i-th service node can be divided by the number of online processes to obtain the number of the main LSI distributed on each service node with an online process, and this number is determined as the second quantity, that is, the second quantity of the main LSI with the source service node being the j-th service node carried by the i-th service node is obtained.

[0144] As Figure 2 shown, this embodiment provides a schematic flow chart for determining the second quantity, calculates the distribution of the main LSI after simulation adjustment of the main LSI in each type of LSI on each service node. Taking the second quantity of the main LSI carried by the service node and represented as tgtLayout[i][j] as an example, the distribution of the main LSI on each service node after simulation adjustment in this implementation is described as follows, where tgtLayout[i][j] represents the number of the main LSI with the source service node being the j-th service node among the main LSI carried by the i-th service node assuming adjustment.

[0145] Step 200: Determine the number of online processes onProc according to the working status of the service node;

[0146] Step 201: Traverse service node i;

[0147] where 0 ≤ i < N, N represents the total number of service nodes, and i is an integer;

[0148] Step 202: Judge the process status on service node i. If the process on service node i is offline, execute Step 203; if the process on service node i is online, execute Step 204;

[0149] Step 203: tgtLayout[i][j] = 0, that is, no main LSI is assigned to this offline process;

[0150] Step 204: Judge whether i is equal to j. If so, execute Step 205; otherwise, execute Step 206;

[0151] Step 205: tgtLayout[i][j] = the number of the main LSI with the source service node being the i-th service node carried by the i-th service node;

[0152] Wherein, tgtLayout[i][j]=the number of all LSIs with orgLeader (source service node identifier) ​​being i, that is, the master LSI with orgLeader being i is assigned to the corresponding business process on the i-th service node by default;

[0153] Step 206: Determine the process status of the j-th service node. If the process is online, execute step 207; if the process is offline, execute step 208;

[0154] Step 207, tgtLayout[i][j]=0;

[0155] Among them, if the corresponding process on service node j (j!=i) is online, the number of master LSIs carried by the i-th service node whose source service node is the j-th service node is 0, that is, the master LSI whose orgLeader (source service node identifier) ​​is j is assigned to the corresponding business process on the j-th service node by default. At this time, the i-th service node will not carry the master LSI whose orgLeader is j on the j-th service node.

[0156] Step 208, tgtLayout[i][j]=the number of all LSIs with orgLeader j divided by onProc;

[0157] Among them, if the corresponding process on service node j (j!=i) is offline, then the second number tgtLayout[i][j] is determined according to the ratio of the number of main LSIs carried by the i-th service node and whose source service node is the j-th service node, and the number of online processes onProc, that is, the main LSIs with orgLeader j are evenly distributed to each online service node.

[0158] Optionally, in this embodiment, the service node identifier of the i-th service node is i, and the service node identifier of the j-th service node is j. It should be noted that the service node identifier can also be defined as other types of information, and this embodiment does not make too many restrictions on this. The service node identifier and the source service node identifier are used to mark different service nodes and to distinguish the source service node of each main LSI.

[0159] Step 102: Adjust the distribution of the main LSIs of each type of LSI in each service node according to the first number and the second number of main LSIs carried by each service node.

[0160] In implementation, this embodiment adjusts the distribution of the master LSIs in each type of LSI in each service node according to the first number and the second number of master LSIs carried by each service node.

[0161] In some embodiments, in the following manner, according to the first quantity and the second quantity of the primary LSIs borne by each service node, the distribution of the primary LSIs in each type of LSI among the service nodes is adjusted:

[0162] Step a: Traverse each LSI in each type of LSI in each service node;

[0163] Step b: Determine whether there is a primary LSI corresponding to the current LSI among the primary LSIs borne by each service node;

[0164] Step c: According to the determination result, and the first quantity and the second quantity of the primary LSIs borne by each service node, adjust the distribution of the primary LSIs in each type of LSI among the service nodes.

[0165] In some embodiments, according to the determination result, the primary LSI is adjusted in the following manner:

[0166] Method c1: Among the primary LSIs borne by each service node, there is no primary LSI corresponding to the current LSI;

[0167] In this method, find out the target service nodes that meet the condition that the first quantity of the primary LSIs is less than the second quantity from each service node, and distribute the primary LSI corresponding to the current LSI to the target service nodes;

[0168] In implementation, traverse each LSI in each service node, determine whether there is a primary LSI for each LSI. If there is no primary LSI for the current LSI, then find out the target service nodes that meet curLayout[i][orgLeader]<tgtLayout[i][orgLeader] from each service node, where curLayout[i][orgLeader] represents the first quantity of the primary LSIs with the source service node being orgLeader on the i-th service node, and tgtLayout[i][orgLeader] represents the second quantity of the primary LSIs with the source service node being orgLeader on the i-th service node after simulated adjustment. At this time, assign the LSI on one of the target service nodes to perform the operation of promoting to the primary, that is, assign the primary LSI to one of the target service nodes.

[0169] Method c2: Among the primary LSIs borne by each service node, there is a primary LSI corresponding to the current LSI, and the first quantity of the primary LSIs borne by the current service node where the primary LSI corresponding to the current LSI is located is greater than the second quantity;

[0170] In this method, adjust the primary LSI corresponding to the current LSI borne by the current service node to other service nodes except the current service node.

[0171] During implementation, each LSI in each service node is traversed to determine whether each LSI has a master LSI of the LSI. If the current LSI has a master LSI, and curLayout[curLeader][orgLeader]>tgtLayout[curLeader][orgLeader], curLayout[curLeader][orgLeader] represents the first number of master LSIs on the curLeader-th service node (current service node) whose source service node is orgLeader, and tgtLayout[curLeader][orgLeader] represents the second number of master LSIs on the curLeader-th service node (current service node) whose source service node is orgLeader. At this time, the master LSI of the curLeader-th service node (current service node) is assigned to be downgraded to a standby, that is, the master LSI is downgraded to a slave LSI, and the master LSI is distributed to other service nodes, that is, the LSI is promoted to the master on other service nodes; when some service nodes recover abnormally, the master LSIs previously distributed to other service nodes need to be downgraded to a standby first, and then assigned to other service nodes for promotion to the master, that is, some master LSIs on the service node are migrated to other service nodes to achieve new load balancing.

[0172] Optionally, when performing the distribution adjustment of the master LSI in this embodiment, it is necessary to first downgrade the master LSI on the current service node, and then perform the upgrade operation on other service nodes. Each LSI adjustment needs to first downgrade and then upgrade to ensure that a single logical service instance of the LSI has at most one master node (master LSI) at the same time. If the current LSI has a master LSI, but it needs to be migrated to other service nodes due to some reasons (process recovery of the failed service node, process recovery corresponding to the source service node, etc.), then the master LSI needs to be downgraded first and become a slave LSI. After the downgrade is successful, it will be upgraded to the master in other controllers and become the master LSI. In addition, when performing the adjustment of the master LSI in this embodiment, the next adjustment will be performed only after the LSI downgrade and upgrade process in the previous adjustment process is successful.

[0173] In this embodiment, when adjusting the main LSI, the principle of adjustment is to distribute all the main LSIs to each service node as evenly as possible, such as Figure 3A-3B As shown, this embodiment provides a schematic diagram of the main LSI distribution in the initial state, wherein the cluster includes 4 service nodes, namely: service node 1, service node 2, service node 3, and service node 4; see Figure 3A, the same processes running in the four service nodes include process A and process B. The same process on different service nodes contains the same LSI, that is, process A of the four service nodes includes: LSI-A1, LSI-A2, LSI-A3, LSI-A4; process B includes LSI-B1, LSI-B2, LSI-B3, LSI-B4. Among them, the main LSI of LSI-A1 is distributed on service node 1, the main LSI of LSI-A2 is distributed on service node 2, the main LSI of LSI-A3 is distributed on service node 3, and the main LSI of LSI-A4 is distributed on service node 4; the main LSI of LSI-B1 is distributed on service node 1, the main LSI of LSI-B2 is distributed on service node 2, the main LSI of LSI-B3 is distributed on service node 3, and the main LSI of LSI-B4 is distributed on service node 4. See Figure 3B ,In the initial state, it is assumed that all service nodes are ,operating normally, that is, the processes on the service nodes are ,online. At this time, all main LSIs are evenly distributed on all ,service nodes.

[0174] When the processes on some service nodes exit abnormally and resume online, it is necessary to readjust the distribution of the main LSI, assign the LSI on the corresponding service node to perform the main or standby operation, and rebalance the load of each service node to avoid some main LSIs being concentrated on some service nodes, such as Figure 4A-4B As shown, this embodiment provides a schematic diagram of main LSI distribution adjustment, wherein, see Figure 4A In the initial state, all main LSIs are evenly distributed to each service node, see Figure 4B , when service node 2 and service node 3 fail, the main LSIs on service node 2 and service node 3 are evenly distributed to service node 1 and service node 4.

[0175] The principles for adjusting the main LSI in this embodiment are as follows:

[0176] a) Each adjustment is not made to the distribution of a certain main LSI (main node), but to the distribution of the main LSIs of a certain type of LSI, such as the main LSIs of type LSI-A, including LSI-A1, LSI-A2, LSI-A3, LSI-A4, ...

[0177] b) If the process of the service node corresponding to the orgLeader (source service node) of the master LSI is online, then after the adjustment is completed and stabilized, the master LSI will be assigned to the service node corresponding to the orgLeader (source service node);

[0178] c) If a process on a service node is offline, the adjusted orgLeader (source service node) of the main LSI on the service node will be evenly distributed to other service nodes where the process is online;

[0179] d) If the current LSI has a master LSI, but needs to be migrated to other service nodes due to some reasons (such as process recovery of a failed service node, process recovery corresponding to orgLeader (source service node)), then the master LSI needs to be downgraded to a slave LSI (Follower) first. After the downgrade is successful, it will be promoted to the master on other service nodes to ensure that a single instance of LSI has at most one master LSI at the same time.

[0180] e) The next LSI adjustment will be performed only after the tasks of upgrading to the primary or downgrading to the backup are completed in the previous LSI adjustment process.

[0181] like Figure 5 As shown, this embodiment also provides a method for LSI equalization adjustment, and the specific implementation process is as follows:

[0182] Step 500, determine whether the master LSI upgrade and standby down tasks of the current type of LSI are completed, if yes, proceed to step 501, otherwise end;

[0183] Step 501, calculate the distribution of the main LSI of each service node, that is, calculate the first quantity curLayout[i][j];

[0184] Wherein, curLayout[i][j] indicates the number of source service nodes of the master LSI on the i-th service node that is the j-th service node. i may be equal to j or may not be equal to j.

[0185] Step 502: Calculate the distribution of the main LSI after the simulation adjustment of each service node according to the working status of the current service node, that is, calculate the second quantity tgtLayout[i][j];

[0186] Among them, tgtLayout[i][j] represents the number of master LSIs whose source service node is the jth service node in the master LSIs carried by the i-th service node after adjustment. i may be equal to j or may not be equal to j. In implementation, according to the working status of the current service node and based on the principle of uniform distribution of master LSIs, the current master LSIs are evenly distributed on the service nodes where each process is online, so as to simulate the adjustment of the master LSIs and obtain the distribution of the master LSIs after the simulated adjustment.

[0187] Step 503, traverse each LSI;

[0188] Step 504, determine whether the current LSI has a master LSI, if so, execute step 505, otherwise execute step 507;

[0189] Step 505, determine whether the current curLayout[curLeader][orgLeader]>tgtLayout[curLeader][orgLeader] is established, if so, execute step 506, otherwise end;

[0190] Among them, curLayout[curLeader][orgLeader] indicates the first number of main LSIs whose source service node is orgLeader on the current service node (curLeader); tgtLayout[curLeader][orgLeader] indicates the second number of main LSIs whose source service node is orgLeader on the current service node (curLeader) after simulation adjustment.

[0191] Step 506: Downgrade the current master LSI;

[0192] When the first number is greater than the second number, the current main LSI on the current service node (curLeader) is downgraded.

[0193] Step 507: Find the LSI on the current service node curLeader corresponding to curLayout[curLeader][orgLeader]>tgtLayout[curLeader][orgLeader] and perform master upgrade processing.

[0194] If the current LSI does not have a master LSI and the second number is greater than the first number, the LSI on the current service node (curLeader) is promoted to master.

[0195] The logical service balancing method provided in this embodiment realizes the rapid and stable assignment of logical service main nodes to multiple service nodes. When some logical services are abnormal, new main LSIs can be quickly assigned to take over the business. When a new business process is abnormal and goes online, the stability of the original logical service main LSI is maintained as much as possible, and a certain load balancing is achieved, so that the logical service main LSIs on each service node are relatively balanced, thereby achieving load balancing between service nodes.

[0196] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device. Since the electronic device is the electronic device in the method in the embodiment of the present invention, and the principle of solving the problem by the electronic device is similar to that of the method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0197] like Figure 6 As shown, the electronic device includes a processor 600 and a memory 601, wherein the memory 601 is used to store a program executable by the processor 600, and the processor 600 is used to read the program in the memory 601 and perform the following steps:

[0198] For each type of LSI in the process of the service node, determine a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in one type of LSI;

[0199] estimating a second number of master LSIs carried by the service node according to the working state of the service node;

[0200] The distribution of the main LSIs of each type of LSI in each service node is adjusted according to the first number and the second number of main LSIs carried by each service node.

[0201] As an optional implementation manner, the processor 600 is further configured to execute:

[0202] determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI;

[0203] The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

[0204] As an optional implementation manner, the processor 600 is specifically configured to execute:

[0205] Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node;

[0206] Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0207] As an optional implementation manner, the processor 600 is specifically configured to execute:

[0208] If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or,

[0209] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0210] As an optional implementation, if the process of the i-th service node is online and j=i, the processor 600 is further configured to execute:

[0211] The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0212] As an optional implementation manner, if the process of the i-th service node is online and j≠i, the processor 600 is specifically configured to execute:

[0213] If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or,

[0214] If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

[0215] As an optional implementation manner, the processor 600 is specifically configured to execute:

[0216] Traverse each LSI of each type in each service node;

[0217] Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node;

[0218] According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

[0219] As an optional implementation manner, the processor 600 is specifically configured to execute:

[0220] If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or,

[0221] If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

[0222] Based on the same inventive concept, an embodiment of the present invention also provides a logical service balancing device. Since the device is the device in the method in the embodiment of the present invention, and the principle of solving the problem by the device is similar to that of the method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0223] like Figure 7 As shown, the device comprises:

[0224] The current distribution module 700 is used to determine, for each type of LSI in the process of the service node, a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in a type of LSI;

[0225] An estimation distribution module 701 is used to estimate the second number of master LSIs carried by the service node according to the working state of the service node;

[0226] The distribution adjustment module 702 is used to adjust the distribution of the main LSIs in each type of LSI in each service node according to the first number and the second number of main LSIs carried by each service node.

[0227] As an optional implementation, the device further includes a uniform adjustment module specifically used for:

[0228] determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI;

[0229] The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

[0230] As an optional implementation manner, the current distribution module 700 is specifically configured to:

[0231] Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node;

[0232] Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0233] As an optional implementation manner, the estimated distribution module 701 is specifically used for:

[0234] If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or,

[0235] If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

[0236] As an optional implementation, if the process of the i-th service node is online and j=i, the estimated distribution module 701 is further configured to:

[0237] The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

[0238] As an optional implementation, if the process of the i-th service node is online and j≠i, the estimated distribution module 701 is specifically used for:

[0239] If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or,

[0240] If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

[0241] As an optional implementation manner, the distribution adjustment module 702 is specifically configured to:

[0242] Traverse each LSI of each type in each service node;

[0243] Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node;

[0244] According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

[0245] As an optional implementation manner, the distribution adjustment module 702 is specifically configured to:

[0246] If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or,

[0247] If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

[0248] Based on the same inventive concept, an embodiment of the present disclosure provides a computer storage medium, the computer storage medium includes: a computer program code, when the computer program code is executed on a computer, the computer executes any of the logical service balancing methods discussed above. Since the principle of solving the problem by the above computer storage medium is similar to that of the logical service balancing method, the implementation of the above computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0249] In the specific implementation process, the computer storage medium may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.

[0250] Based on the same inventive concept, the embodiment of the present disclosure also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the logical service balancing methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the logical service balancing method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0251] The computer program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0252] 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 and optical storage, etc.) containing computer-usable program codes.

[0253] 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 has the functions specified in one or more boxes.

[0254] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including 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.

[0255] 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.

[0256] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A logical service balancing method, characterized in that: The method includes: For each type of LSI in the process of the service node, determine a first number of master LSIs carried by the service node, wherein the master LSI refers to an LSI with a master node function in one type of LSI; estimating a second number of master LSIs carried by the service node according to the working state of the service node; The distribution of the main LSIs of each type of LSI in each service node is adjusted according to the first number and the second number of main LSIs carried by each service node.

2. The method according to claim 1, characterized in that: The method further includes: determining a third number of service nodes in which the process is online, and a fourth number of master LSIs under each type of LSI; The main LSIs under each type of LSI are evenly distributed to each service node according to the third number and the fourth number.

3. The method according to claim 1, characterized in that: The determining a first number of master LSIs currently carried by the service node includes: Determine a first number of master LSIs whose source service node is the jth service node among the master LSIs carried by the i-th service node; Wherein, i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

4. The method according to claim 1, characterized in that: The estimating, according to the working state of the service node, a second number of master LSIs carried by the service node includes: If the process of the i-th service node is offline, the second number of the master LSIs carried by the i-th service node and whose source service node is the j-th service node is 0, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the master LSI corresponding to each process is located when the processes of each service node are online; or, If the process of the i-th service node is online, then based on the i-th service node and the working status of the source service node being the j-th service node, the second number of main LSIs carried by the service node is estimated, wherein i is an integer greater than zero, j is an integer greater than zero, and the source service node represents the service node where the main LSI corresponding to each process is located when the processes of each service node are online.

5. The method according to claim 4, characterized in that If the process of the i-th service node is online and j=i, the method further includes: The second number is determined according to the number of master LSIs carried by the i-th service node and whose source service node is the i-th service node.

6. The method according to claim 4, characterized in that If the process of the i-th service node is online and j≠i, then according to the i-th service node, the source service node is the working state of the j-th service node, estimating the second number of master LSIs carried by the service node, including: If the process of the jth service node is online, the second number of the master LSI carried by the i-th service node and whose source service node is the j-th service node is 0; or, If the process of the jth service node is offline, the second number is determined according to the number of master LSIs carried by the ith service node and whose source service node is the jth service node, and the number of online processes.

7. The method according to claim 1, characterized in that The adjusting the distribution of the main LSIs in each type of LSI in each service node according to the first number and the second number of main LSIs carried by each service node includes: Traverse each LSI of each type in each service node; Determine whether there is a master LSI corresponding to the current LSI among the master LSIs carried by each service node; According to the determination result, and the first number and the second number of master LSIs carried by each service node, the distribution of the master LSIs in each type of LSI in each service node is adjusted.

8. The method according to claim 7, characterized in that The adjusting, according to the judgment result and the first number and the second number of the main LSIs carried by each service node, the distribution of the main LSIs in each type of LSI in each service node includes: If the main LSIs carried by each service node do not contain the main LSI corresponding to the current LSI, then find a target service node from each service node that satisfies the requirement that the first number of main LSIs is less than the second number, and distribute the main LSIs corresponding to the current LSI to the target service node; or, If the main LSIs carried by each service node include a main LSI corresponding to the current LSI, and the current service node where the main LSI corresponding to the current LSI is located carries a first number of main LSIs that is greater than a second number, then the main LSI corresponding to the current LSI carried by the current service node is adjusted to other service nodes except the current service node.

9. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the memory is used to store a program executable by the processor, and the processor is used to read the program in the memory and execute the steps of any one of the methods of claims 1 to 8.

10. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.