A dynamic load balancing method based on long connection
By constructing a set of load balancing strategies and a strategy decision maker in long-connection scenarios, and dynamically allocating clients and servers, the problem of insufficient consideration of dimensions in existing load balancing strategies is solved, thereby improving the utilization of server resources and the load balancing effect.
Patent Information
- Application Number
- CN202410492581.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-04-23
AI Technical Summary
In existing technologies, load balancing strategies in long-connection scenarios consider fewer dimensions, resulting in weak flexibility in server allocation and low resource utilization.
By pre-building a set of load balancing strategies and a strategy decision maker, which are integrated into the coordinator, the system periodically receives machine operation metrics from the server. Based on the multi-dimensional strategy decision maker, it dynamically allocates client servers, analyzes and compares target load balancing strategies, determines the target server, and returns the connection address. The client then makes RPC calls based on a long connection.
It implements client connection server allocation based on a multi-dimensional load balancing strategy, which improves the utilization of server resources and optimizes the load balancing of the server cluster.
Smart Images

Figure CN118488061B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microservices technology, and more specifically to a dynamic load balancing method based on long-lived connections. Background Technology
[0002] Currently, most load balancing algorithm implementations focus on short connections. However, in long-connection scenarios, the need for both the server and client to maintain connection validity makes load balancing less than ideal, especially after horizontal scaling of the server cluster, where redistributing long connections to new nodes remains a challenge. Furthermore, existing load balancing strategies only consider the number of connections, lacking flexibility.
[0003] In summary, existing technologies suffer from the problem that the load balancing strategy considers too few dimensions when allocating client servers, resulting in weak flexibility in server allocation and low utilization of server resources. Summary of the Invention
[0004] This application provides a dynamic load balancing method based on long connections, which addresses the technical problem in existing technologies where the load balancing strategy has few considerations when allocating client and server resources, resulting in weak server allocation flexibility and low server resource utilization.
[0005] In view of the above problems, this application provides a dynamic load balancing method based on long-lived connections.
[0006] The first aspect of this application provides a dynamic load balancing method based on long-lived connections. The method includes: pre-constructing a load balancing strategy set and a strategy decision-maker, pre-integrating the load balancing strategy set into a coordinator, and pre-deploying the strategy decision-maker in the coordinator; pre-setting a running metric receiving period; the coordinator periodically receiving a set of machine running metrics uploaded by a server cluster according to the running metric receiving period, wherein the server cluster includes K servers, the set of machine running metrics includes K sets of machine running metrics, and the K sets of machine running metrics are associated with the K servers, where K is a positive integer; the coordinator receiving a server address request from a client and activating the strategy decision-maker in the coordinator according to the server connection request; obtaining a target load balancing strategy from the load balancing strategy set based on the strategy decision-maker; analyzing and comparing the K sets of machine running metrics in the set of machine running metrics using the target load balancing strategy to determine a target server; obtaining a connection server address based on the target server and returning the connection server address to the client; and the client performing an RPC call with the target server based on the connection server address and a long-lived connection network protocol.
[0007] A second aspect of this application provides a dynamic load balancing system based on long connections. The system includes: a tool integration execution unit for pre-building a load balancing strategy set and a strategy decision maker, pre-integrating the load balancing strategy set into a coordinator, and pre-deploying the strategy decision maker in the coordinator; a receiving period setting unit for presetting a running indicator receiving period; a running indicator receiving unit for the coordinator to periodically receive a set of machine running indicators uploaded by a server cluster according to the running indicator receiving period, wherein the server cluster includes K servers, the set of machine running indicators includes K sets of machine running indicators, and the K sets of machine running indicators are associated with the K servers, where K is a positive integer; and a strategy decision activation unit for... The coordinator receives a server address request from a client and activates the policy decision-maker in the coordinator according to the server connection request; a target policy invocation unit is used to obtain a target load balancing policy from the load balancing policy set based on the policy decision-maker; a target port determination unit is used to analyze and compare the operating indicators of K groups of machines in the machine operating indicator set using the target load balancing policy to determine the target server; an address invocation sending unit is used to obtain the connection server address according to the target server invocation and return the connection server address to the client; and a connection processing execution unit is used for the client to perform RPC calls with the target server based on a long-connection network protocol according to the connection server address.
[0008] One or more technical solutions provided in this application have at least the following technical effects or advantages:
[0009] The method provided in this application pre-constructs a load balancing strategy set and a strategy decision-maker, and pre-integrates the load balancing strategy set into the coordinator and pre-deploys the strategy decision-maker in the coordinator; a preset operating indicator receiving period is established; the coordinator periodically receives the machine operating indicator set uploaded by the server cluster according to the operating indicator receiving period, wherein the server cluster includes K servers, the machine operating indicator set includes K sets of machine operating indicators, and the K sets of machine operating indicators are associated and mapped with the K servers, where K is a positive integer; the coordinator receives the server address request from the client and activates the strategy decision-maker in the coordinator according to the server connection request; based on the strategy decision-maker, a target load balancing strategy is obtained by calling the load balancing strategy set; the target load balancing strategy is used to analyze and compare the K sets of machine operating indicators in the machine operating indicator set to determine the target server; the connection server address is obtained by calling the target server and returned to the client; the client performs an RPC call with the target server based on the connection server address and a long-connection network protocol. This technology achieves client connection server allocation based on a multi-dimensional load balancing strategy, which improves server resource utilization while balancing the server cluster load. Attached Figure Description
[0010] Figure 1 A flowchart illustrating a dynamic load balancing method based on long connections is provided for this application.
[0011] Figure 2 A flowchart illustrating the process of server-side heavy load balancing in a dynamic load balancing method based on long connections provided in this application;
[0012] Figure 3 This application provides a schematic diagram of the structure of a dynamic load balancing system based on long connections.
[0013] Explanation of reference numerals in the attached diagram: Tool integration execution unit 1, receiving cycle setting unit 2, running indicator receiving unit 3, strategy decision activation unit 4, target strategy invocation unit 5, target port determination unit 6, address invocation sending unit 7, connection processing execution unit 8. Detailed Implementation
[0014] This application provides a dynamic load balancing method based on long-lived connections to address the technical problem in existing technologies where load balancing strategies for client-server allocation have limited dimensions, resulting in weak server allocation flexibility and low server resource utilization. It achieves client-server allocation based on a multi-dimensional load balancing strategy, effectively improving server resource utilization while simultaneously handling server cluster load balancing.
[0015] The acquisition, storage, use, and processing of data in the technical solution of this invention all comply with relevant regulations.
[0016] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. It should be understood that the present invention is not limited to the exemplary embodiments described herein. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, not all of them.
[0017] Example 1
[0018] like Figure 1 As shown, this application provides a dynamic load balancing method based on long connections. The method is applied to a dynamic load balancing system based on long connections, the system including a coordinator, a server cluster, and clients. The method includes:
[0019] A100: Pre-build a set of load balancing strategies and a strategy decision-maker, and pre-integrate the set of load balancing strategies into the coordinator, and pre-deploy the strategy decision-maker into the coordinator;
[0020] Specifically, in this embodiment, the load balancing strategy set includes, but is not limited to, link-count balancing strategy, application-priority strategy, CPU load strategy, and memory load balancing strategy. Each load balancing strategy is used to serialize a metric data for each server in the server cluster, so as to make a call to the server with the minimum metric data. The application of the load balancing strategies in the load balancing strategy set will be described in detail in the following description. In this embodiment, the load balancing strategy set is pre-integrated into the coordinator.
[0021] Meanwhile, the coordinator also includes a policy decision maker for determining which load balancing strategy to use for server-side calls to client connections within the server cluster.
[0022] The coordinator can monitor the operating status of the server cluster. At the same time, based on the policy decision-maker, the coordinator can perform server-side analysis and selection by adopting different load balancing strategies for different business scenarios.
[0023] A200: Preset operating indicator receiving cycle;
[0024] A300: The coordinator periodically receives the set of machine operation metrics uploaded by the server cluster according to the operation metric receiving period. The server cluster includes K servers, the set of machine operation metrics includes K sets of machine operation metrics, and the K sets of machine operation metrics are associated and mapped with the K servers, where K is a positive integer.
[0025] In one embodiment, method step A300 provided in this application further includes;
[0026] Among the K groups of machine performance metrics, each group of machine performance metrics includes, but is not limited to, the number of real-time connected clients, CPU utilization, real-time connected application list, and memory utilization.
[0027] Specifically, in this embodiment, the coordinator can monitor the operating status of the server cluster. The specific method for obtaining the operating status is that the coordinator periodically receives the set of machine operating metrics uploaded by the server cluster according to the operating metric receiving period. The server cluster includes K servers, the set of machine operating metrics includes K sets of machine operating metrics, and the K sets of machine operating metrics are associated and mapped with the K servers, where K is a positive integer.
[0028] Among the K groups of machine performance metrics, each group of machine performance metrics includes, but is not limited to, the number of real-time connected clients, CPU utilization, real-time connected application list, and memory utilization.
[0029] A400: The coordinator receives the server address request from the client and activates the policy decision-maker in the coordinator according to the server connection request;
[0030] Specifically, in this embodiment, after the client sends a request to connect to the server address, the coordinator selects a load balancing strategy based on the policy decision-maker, and analyzes the received machine operation index set according to the selected load balancing strategy to determine the server address suitable for the client connection.
[0031] Based on this, in this embodiment, the coordinator receives the server address request from the client and activates the policy decision-maker in the coordinator according to the server connection request. The policy decision-maker is used to select an appropriate load balancing strategy.
[0032] A500: Based on the strategy decision-maker, the target load balancing strategy is obtained by calling from the load balancing strategy set;
[0033] In one embodiment, based on the policy decision-maker invoking the load balancing policy set to obtain the target load balancing policy, the method step A500 provided in this application further includes:
[0034] A510: The set of load balancing strategies specifically includes link number balancing strategies and same-application priority strategies;
[0035] A520: Request the real-time connection client count for the K groups of machine operation indicators to obtain the K real-time connection client counts;
[0036] A530: Serialize the number of the K real-time connected clients to obtain the extreme value of real-time connected clients;
[0037] A540: Preset the maximum profit judgment threshold, and determine whether the extreme value of the real-time connected client exceeds the maximum profit judgment threshold;
[0038] A550: If the extreme value of the real-time connected client exceeds the maximum revenue judgment threshold, then the target load balancing strategy is the link number balancing strategy;
[0039] A560: If the extreme value of the real-time connected clients does not exceed the maximum revenue judgment threshold, then the target load balancing strategy is the same application priority strategy.
[0040] Specifically, this embodiment takes the load balancing strategy set, which specifically includes the link number balancing strategy and the same application priority strategy, as an example to illustrate in detail the specific process by which the strategy decision-maker calls the target load balancing strategy from the load balancing strategy set.
[0041] The link number balancing strategy evaluates the number of clients connected to the server. Based on the number of client connections from multiple servers, it returns the node with the fewest connections to the current client's real-time registration center node, thus ensuring that the number of client connections on each node of the registration center is approximately the same.
[0042] The evaluation object of the same application priority strategy is the number of identical applications connected to the server. The strategy tends to allow identical applications to connect to the same server as much as possible (data queried by the same application will be stored in the registry cache). This can effectively reduce the space for the registry node to maintain the cache and improve the cache hit rate.
[0043] The evaluation object based on the link balancing strategy calls the real-time connection client count of the K groups of machine operation indicators of K servers to obtain the K real-time connection client counts. Then, the K real-time connection client counts are serialized in ascending order to obtain the extreme value of the real-time connection client that represents the minimum number of real-time connection clients.
[0044] A maximum benefit threshold is preset, and it is determined whether the extreme value of the real-time connected client exceeds the maximum benefit threshold. If the extreme value of the real-time connected client exceeds the maximum benefit threshold, it proves that the link balancing strategy is more profitable. Based on this, the target load balancing strategy selected by the strategy decision-maker is the link number balancing strategy.
[0045] Conversely, if the extreme value of the real-time connected clients does not exceed the maximum revenue judgment threshold, then the target load balancing strategy selected by the strategy decision-maker is the same-application priority strategy.
[0046] A600: The target load balancing strategy is used to analyze and compare the operating indicators of K groups of machines in the machine operating indicator set to determine the target server.
[0047] A700: Obtain the connection server address according to the target server call, and return the connection server address to the client;
[0048] A800: The client makes an RPC call to the target server based on a long-connection network protocol according to the address of the linked server.
[0049] Furthermore, in this embodiment, the target load balancing strategy is used to determine the comparison metrics selected by the server. Then, based on the comparison metrics, corresponding metrics are called for K groups of machine operation metrics in the machine operation metric set to obtain K comparison operation metrics. The K comparison operation metrics are serialized using ascending order sorting, and the server corresponding to the minimum value is selected as the target server.
[0050] The client obtains the address of the linked server by calling the target server and returns the address of the linked server to the client; the client then makes an RPC call to the target server based on a long-connection network protocol using the address of the linked server.
[0051] This embodiment enables different load balancing strategies to be adopted for different business scenarios through configuration, thereby achieving the technical effect of improving the utilization rate of server resources while undertaking the load balancing of the server cluster.
[0052] In one embodiment, such as Figure 2 As shown, the method steps provided in this application further include:
[0053] A810: The coordinator periodically receives the load metric set uploaded by the server cluster according to the operation metric receiving cycle, wherein the load metric set includes K server load metrics.
[0054] A820: Calculate the average of the K server load metrics to obtain connection balance constraints;
[0055] A830: Using the connection number balancing constraint, traverse the K server load indicators to obtain N overloaded servers and M underloaded servers, where N+M=K;
[0056] A840: Based on the coordinator, perform heavy load on the N overloaded servers and M underloaded servers.
[0057] In one embodiment, based on the coordinator to perform heavy load on the N overloaded servers and M underloaded servers, the method step A840 provided in this application further includes:
[0058] A841: The N overloaded servers receive N connection release instructions pushed by the coordinator, and release the connection based on the N connection release instructions to obtain several disconnected connections;
[0059] A842: Interact with the M underloaded servers to obtain M real-time connection data;
[0060] A843: Based on the M real-time connection data, reconnect the several disconnected connections to the M underloaded servers.
[0061] In one embodiment, the method step A841 of this application further includes reconnecting the plurality of disconnected connections to the M underloaded servers based on the M real-time connection data:
[0062] A8411: Sort the M real-time connection data in ascending order to obtain a real-time connection sequence;
[0063] A8412: Based on the real-time connection sequence and the connection number balancing constraint, perform the partitioning process of the several disconnected connections to obtain a first partitioning result, wherein the first partitioning result includes M connection partitioning data;
[0064] A8413: Based on the first distribution result, reconnect the several disconnected connections with the M underloaded servers.
[0065] Specifically, in this embodiment, the coordinator periodically receives the load metric set uploaded by the server cluster according to the operation metric receiving cycle. The load metric set includes K server load metrics, which are essentially the number of clients connected to the server in real time.
[0066] The average value of the K server load indicators is calculated to obtain the connection number balancing constraint; the connection number balancing constraint is used to traverse the K server load indicators to obtain N overloaded servers and M underloaded servers, where N+M=K.
[0067] The overloaded server is the server whose number of connected clients is greater than the connection balance constraint, and conversely, the underloaded server is the server whose number of connected clients is less than the connection balance constraint.
[0068] The N overloaded servers receive N connection release commands pushed by the coordinator, and release the connected clients based on the N connection release commands, thereby obtaining several disconnected connections.
[0069] Interact with the M underloaded servers to obtain M real-time connection data points representing the number of clients connected to the underloaded servers in real time. Sort the M real-time connection data points in ascending order to obtain a real-time connection sequence;
[0070] Based on the real-time connection sequence and the connection balance constraint, the several disconnected connections are allocated to each server, starting with the server with the fewest client connections, to reach the connection balance constraint. The number of clients allocated to each underloaded server is then used as the first allocation result, which includes M connection allocation data. Based on the first allocation result, the several disconnected connections are reconnected to the M underloaded servers.
[0071] This embodiment implements a heavy load balancing method for both the server and client. Compared to traditional heavy load balancing algorithms, it does not require periodic disconnection and reconnection. Instead, the coordinator makes the decision when needed, effectively reducing unnecessary resource consumption and improving resource utilization. At the same time, it avoids the waste of resources caused by repeated connection establishment due to periodic disconnection in traditional methods, making the load balancing effect more controllable.
[0072] Example 2
[0073] Based on the same inventive concept as the dynamic load balancing method based on long connections in the foregoing embodiments, such as Figure 3 As shown, this application provides a dynamic load balancing system based on long-lived connections, wherein the system includes:
[0074] The tool integration execution unit 1 is used to pre-build a set of load balancing strategies and a strategy decision-maker, and to pre-integrate the set of load balancing strategies into the coordinator and pre-deploy the strategy decision-maker in the coordinator;
[0075] The receiving period setting unit 2 is used to preset the receiving period of the operating indicators;
[0076] The operation indicator receiving unit 3 is used for the coordinator to periodically receive the set of machine operation indicators uploaded by the server cluster according to the operation indicator receiving period, wherein the server cluster includes K servers, the set of machine operation indicators includes K sets of machine operation indicators, and the K sets of machine operation indicators are associated and mapped with the K servers, where K is a positive integer.
[0077] The strategy decision activation unit 4 is used for the coordinator to receive the server address request from the client and activate the strategy decision-maker in the coordinator according to the server connection request.
[0078] The target policy invocation unit 5 is used to obtain a target load balancing policy by invoking the load balancing policy set based on the policy decision-maker.
[0079] The target port determination unit 6 is used to analyze and compare the machine operation indicators of K groups of machines in the machine operation indicator set using the target load balancing strategy to determine the target server.
[0080] Address call sending unit 7 is used to obtain the link server address according to the target server call, and return the link server address to the client;
[0081] The connection processing execution unit 8 is used by the client to make RPC calls to the target server based on the long-connection network protocol according to the address of the linked server.
[0082] In one embodiment, the performance indicator receiving unit 3 further includes:
[0083] Among the K groups of machine performance metrics, each group of machine performance metrics includes, but is not limited to, the number of real-time connected clients, CPU utilization, real-time connected application list, and memory utilization.
[0084] In one embodiment, the target policy invocation unit 5 further includes:
[0085] The set of load balancing strategies specifically includes link number balancing strategies and same-application priority strategies;
[0086] The real-time connection client count is retrieved from the K groups of machine operation metrics to obtain the K real-time connection client counts.
[0087] Serialize the number of the K real-time connected clients to obtain the extreme value of real-time connected clients;
[0088] A maximum profit judgment threshold is preset, and it is determined whether the extreme value of the real-time connected client exceeds the maximum profit judgment threshold;
[0089] If the extreme value of the real-time connected clients exceeds the maximum revenue judgment threshold, then the target load balancing strategy is the link number balancing strategy.
[0090] If the extreme value of the real-time connected clients does not exceed the maximum revenue judgment threshold, then the target load balancing strategy is the same-application priority strategy.
[0091] In one embodiment, the connection processing execution unit 8 further includes:
[0092] The coordinator periodically receives the load metric set uploaded by the server cluster according to the operation metric receiving period, wherein the load metric set includes K server load metrics.
[0093] The average value of the K server load metrics is calculated to obtain the connection balance constraint;
[0094] The connection number balancing constraint is used to traverse the K server load indicators to obtain N overloaded servers and M underloaded servers, where N+M=K;
[0095] The coordinator is used to perform heavy load testing on the N overloaded servers and the M underloaded servers.
[0096] In one embodiment, the connection processing execution unit 8 further includes:
[0097] The N overloaded servers receive N connection release instructions pushed by the coordinator, and release the connections based on the N connection release instructions to obtain several disconnected connections;
[0098] Interact with the M underloaded servers to obtain M real-time connection data;
[0099] Based on the M real-time connection data, the plurality of disconnected connections are reconnected to the M underloaded servers.
[0100] In one embodiment, the connection processing execution unit 8 further includes:
[0101] The M real-time connection data are sorted in ascending order to obtain a real-time connection sequence;
[0102] Based on the real-time connection sequence and the connection number balancing constraint, the several disconnected connections are divided to obtain a first division result, wherein the first division result includes M connection division data;
[0103] Based on the first distribution result, the several disconnected connections are reconnected to the M underloaded servers.
[0104] In summary, any of the methods or steps described above can be stored as computer instructions or programs in various types of computer memory, and the computer instructions or programs can be recognized by various types of computer processors to implement any of the above methods or steps.
[0105] Based on the above specific embodiments of the present invention, any improvements and modifications made to the present invention by those skilled in the art without departing from the principle of the present invention shall fall within the patent protection scope of the present invention.
Claims
1. A method for dynamic load balancing based on long connections, characterized in that, The method is applied to a dynamic load balancing system based on long connection, the system comprising a coordinator, a server cluster and a client, and the method comprising: pre-building a load balancing strategy set and a strategy decision maker, and pre-integrating the load balancing strategy set in the coordinator and pre-disposing the strategy decision maker in the coordinator; presetting a running index receiving period; the coordinator periodically receiving a machine running index set uploaded by the server cluster according to the running index receiving period, wherein the server cluster comprises K servers, the machine running index set comprises K groups of machine running indexes, the K groups of machine running indexes are associated with the K servers, and K is a positive integer; the coordinator receiving a server address request of the client and activating the strategy decision maker in the coordinator according to the server connection request; obtaining a target load balancing strategy based on the strategy decision maker in the load balancing strategy set; analyzing and comparing the K groups of machine running indexes in the machine running index set by using the target load balancing strategy to determine a target server; obtaining a link server address according to the target server and returning the link server address to the client; the client performing RPC calling based on a long connection network protocol with the target server according to the link server address; each group of machine running indexes in the K groups of machine running indexes comprises but is not limited to a real-time connection client number, a CPU usage, a real-time connection application list and a memory usage; obtaining a target load balancing strategy based on the strategy decision maker in the load balancing strategy set, and the method further comprising: the load balancing strategy set specifically comprising a link number balancing strategy and a same application priority strategy; obtaining K real-time connection client numbers by calling the real-time connection client number of the K groups of machine running indexes; serializing the K real-time connection client numbers to obtain a real-time connection client extreme value; presetting a maximum benefit judgment threshold and judging whether the real-time connection client extreme value exceeds the maximum benefit judgment threshold; if the real-time connection client extreme value exceeds the maximum benefit judgment threshold, the target load balancing strategy is the link number balancing strategy; if the real-time connection client extreme value does not exceed the maximum benefit judgment threshold, the target load balancing strategy is the same application priority strategy.
2. The method of claim 1, wherein, the method further comprising: the coordinator periodically receiving a load index set uploaded by the server cluster according to the running index receiving period, wherein the load index set comprises K server load indexes; performing mean value calculation on the K server load indexes to obtain a connection number balancing constraint; traversing the K server load indexes by using the connection number balancing constraint to obtain N overloaded servers and M underloaded servers, wherein N+M=K; reloading the N overloaded servers and the M underloaded servers based on the coordinator.
3. The method of claim 2, wherein, reloading the N overloaded servers and the M underloaded servers based on the coordinator, and the method further comprising: The N overloaded servers receive N connection release instructions pushed by the coordinator, and release the connections based on the N connection release instructions to obtain several disconnected connections; Interact with the M underloaded servers to obtain M real-time connection data; Based on the M real-time connection data, the plurality of disconnected connections are reconnected to the M underloaded servers.
4. The method of claim 3, wherein, The method further includes reconnecting the plurality of disconnected connections to the M underloaded servers based on the M real-time connection data. The M real-time connection data are sorted in ascending order to obtain a real-time connection sequence; Based on the real-time connection sequence and the connection number balancing constraint, the several disconnected connections are divided to obtain a first division result, wherein the first division result includes M connection division data; Based on the first distribution result, the several disconnected connections are reconnected to the M underloaded servers.
5. A dynamic load balancing system based on long connections, characterized in that, The system includes: The tool integrates an execution unit for pre-building a set of load balancing strategies and a strategy decision-maker, and pre-integrates the set of load balancing strategies into the coordinator and pre-deploys the strategy decision-maker in the coordinator; The receiving period setting unit is used to preset the receiving period of the operating indicators; The operation indicator receiving unit is used by the coordinator to periodically receive the set of machine operation indicators uploaded by the server cluster according to the operation indicator receiving period, wherein the server cluster includes K servers, the set of machine operation indicators includes K sets of machine operation indicators, and the K sets of machine operation indicators are associated and mapped with the K servers, where K is a positive integer. A strategy decision activation unit is used for the coordinator to receive a server address request from a client and activate the strategy decision-maker in the coordinator according to the server connection request. The target policy invocation unit is used to obtain a target load balancing policy by invoking the load balancing policy set based on the policy decision-maker. The target port determination unit is used to analyze and compare the machine operation indicators of K groups of machines in the machine operation indicator set using the target load balancing strategy to determine the target server. The address call sending unit is used to obtain the link server address according to the target server call, and return the link server address to the client; A connection processing execution unit is used for the client to make RPC calls to the target server based on a long-connection network protocol according to the address of the linked server; The operational indicator receiving unit further includes: Among the K groups of machine operating metrics, each group of machine operating metrics includes, but is not limited to, the number of real-time connected clients, CPU utilization, real-time connected application list, and memory utilization. The target policy invocation unit also includes: The set of load balancing strategies specifically includes link number balancing strategies and same-application priority strategies; The real-time connection client count is retrieved from the K groups of machine operation metrics to obtain the K real-time connection client counts. Serialize the number of the K real-time connected clients to obtain the extreme value of real-time connected clients; A maximum profit judgment threshold is preset, and it is determined whether the extreme value of the real-time connected client exceeds the maximum profit judgment threshold; If the real-time connection client extreme value exceeds the maximum benefit judgment threshold, the target load balancing strategy is the link number balancing strategy. If the real-time connection client extreme value does not exceed the maximum benefit judgment threshold, the target load balancing strategy is the same application priority strategy.
Citation Information
Patent Citations
Self-adaptive load balance scheduling mechanism for internet-of-things device access processing platform
CN104270322A