gRPC dynamic load balancing communication method and system based on greedy strategy

By deploying a load balancer in the gRPC communication system, multiple batches of tasks are divided according to the load information of the server and distributed to the instances with the smallest load, which solves the problem of requests being concentrated on a single server, achieves dynamic load balancing and efficient resource utilization, and improves improve system performance.

CN117857562BActive Publication Date: 2024-09-13HUIZHIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311743465.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-18
Publication Date
2024-09-13
Estimated Expiration
2043-12-18

AI Technical Summary

Technical Problem

In gRPC communication, when the same client sends a large number of requests, the requests are all transferred to the same server instance, resulting in the inability to distribute the load to other idle server instances, causing load imbalance.

Method used

Adopting a dynamic load balancing method based on greedy strategy, by deploying a load balancer in the communication system, collecting the load information of the server, formulating a multi-batch task division strategy, dividing the data to be transmitted into multiple data transmission tasks, and based on the real-time load information Distributed to the server instance with the least load for processing.

Benefits of technology

It achieves dynamic load balancing for a large number of requests, improves the efficiency of gRPC calls, ensures that each server makes full use of resources, reduces the pressure on overloaded servers, and improves system performance and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117857562B
    Figure CN117857562B
Patent Text Reader

Abstract

The present invention proposes a gRPC dynamic load balancing communication method and system based on a greedy strategy. The gRPC dynamic load balancing communication method based on a greedy strategy includes: deploying a load balancer in a communication system; collecting load information at the corresponding server end of the communication system, and controlling the load balancer to formulate a multi-batch task division strategy for the data transmission of the server end according to the load information; when the communication channel receives the data to be transmitted sent by the server end, the data to be transmitted is divided into multiple batches of tasks according to the multi-batch task division strategy, and multiple data transmission tasks are generated. The system includes modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention proposes a gRPC dynamic load balancing communication method and system based on a greedy strategy, belonging to the technical field of load balancing communication. Background Art

[0002] In gRPC, the client application can directly call the method of the server application on another machine just like calling a local object, by defining a service, specifying the method to be called remotely, implementing this interface on the server, and running a gRPC server to handle client calls. The client has a stub that can call the same method as the server. When using gRPC calls to connect from the client to the server, the same call request is established on a TCP connection, so that a TCP connection will be used for many gRPC call requests as long as possible, thus avoiding the need to repeatedly establish a TCP connection each time the service is called. When the same client sends a large number of requests, they will all go to the same server instance without the opportunity to distribute the load to other idle server instances. Summary of the invention

[0003] The present invention provides a gRPC dynamic load balancing communication method and system based on a greedy strategy to solve the problem that when a large number of requests are sent by the same client, they will all go to the same server instance without the opportunity to distribute the load to other idle server instances:

[0004] The gRPC dynamic load balancing communication method based on the greedy strategy includes:

[0005] Deploy load balancers in the communication system;

[0006] Collecting load information at the corresponding server end of the communication system, and controlling the load balancer to formulate a multi-batch task division strategy for data transmission at the server end according to the load information;

[0007] When the communication channel receives the data to be transmitted sent by the server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batches of task division strategy to generate multiple data transmission tasks.

[0008] Furthermore, a load balancer is arranged in the communication system, including:

[0009] Extracting communication requirements of the communication system, wherein the communication requirements include load balancing requirement information, request batch processing requirement information and load maximum load information;

[0010] According to the communication demand of the communication system, a load balancer corresponding to the communication demand is called;

[0011] The load balancer corresponding to the obtained communication demand is deployed in the communication system.

[0012] Furthermore, the load information is collected at the corresponding server of the communication system, and the load balancer is controlled according to the load information to formulate a multi-batch task division strategy for the data transmission of the server, including:

[0013] Collecting load information at each of the servers;

[0014] The load information collected by the server is exposed to the load balancer, and the load balancer uniquely identifies each server in turn;

[0015] Determine the maximum and minimum data volumes for data partitioning in the data partitioning process according to the data generated by the server per unit time and the data volume information of the data to be transmitted;

[0016] Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data volume of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data volume of a single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

[0017] Furthermore, the maximum amount of divided data in the data division process is obtained by the following formula:

[0018] C max =(1+C p / C tmax )×C0

[0019] Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume;

[0020] The minimum amount of data to be divided in the data division process is obtained by the following formula:

[0021] C min =(1-C p / C tmax )×C0

[0022] Among them, C min Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmaxIt represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

[0023] Further, when the communication channel receives the data to be transmitted sent by the server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batches of task division strategy to generate multiple data transmission tasks, including:

[0024] When the communication channel receives the data to be transmitted sent by the server, the maximum partition data amount and the minimum partition data amount included in the multi-batch task partitioning strategy corresponding to the server are extracted;

[0025] Divide the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generate multiple data transmission tasks;

[0026] The data transmission tasks are completed in sequence according to the order from small to large in terms of the number of individual tasks.

[0027] The gRPC dynamic load balancing communication system based on the greedy strategy includes:

[0028] A load balancer deployment module, used for deploying a load balancer in a communication system;

[0029] A planning strategy formulation module is used to collect load information at the corresponding server end of the communication system, and control the load balancer to formulate multiple batch task division strategies for data transmission at the server end according to the load information;

[0030] The task division module is used to divide the data to be transmitted into multiple batches of tasks according to the multiple batches of task division strategies when the communication channel receives the data to be transmitted sent by the server, so as to generate multiple data transmission tasks.

[0031] Furthermore, the equalizer arrangement module includes:

[0032] A communication demand extraction module, used to extract the communication demand of the communication system, wherein the communication demand includes load balancing requirement information, request batch processing requirement information and load maximum load information;

[0033] A load balancer calling module, used to call a load balancer corresponding to the communication demand according to the communication demand of the communication system;

[0034] The balancer deployment execution module is used to deploy the load balancer corresponding to the communication demand obtained by calling into the communication system.

[0035] Furthermore, the planning strategy formulation module includes:

[0036] A load information collection module, used to collect load information on each of the servers;

[0037] An information exposure control module, in which the user exposes the load information collected by the server to the load balancer, and the load balancer uniquely identifies each server in turn;

[0038] A data partitioning module is used to determine the maximum partitioning data volume and the minimum partitioning data volume in the data partitioning process according to the data generated by the server per unit time and the data volume information of the data to be transmitted;

[0039] Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data volume of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data volume of a single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

[0040] Furthermore, the maximum amount of divided data in the data division process is obtained by the following formula:

[0041] C max =(1+C p / C tmax )×C0

[0042] Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume;

[0043] The minimum amount of data to be divided in the data division process is obtained by the following formula:

[0044] C min =(1-C p / C tmax )×C0

[0045] Among them, C min Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax It represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

[0046] Furthermore, the task division module includes:

[0047] The task division execution module is used to extract the maximum division data amount and the minimum division data amount contained in the multiple batch task division strategies corresponding to the server when the communication channel receives the data to be transmitted sent by the server;

[0048] A task generation module, used for dividing the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generating multiple data transmission tasks;

[0049] The data transmission module is used to complete the data transmission of the multiple data transmission tasks in order from small to large in terms of the number of individual tasks.

[0050] Beneficial effects of the present invention:

[0051] The gRPC dynamic load balancing communication method and system based on the greedy strategy proposed by the present invention divides the requests into multiple batches for batch processing when facing a large number of requests, and distributes the batch requests from the client to the server instance with the smallest current load value. Each time a batch request arrives at the load balancer, it is necessary to obtain the load information on each server node on the server in real time, so as to select the server node with the smallest current load value to act as the server instance. Using this strategy to implement calls can realize multiple calls established on a TCP connection, and at the same time, the call requests can be shared through the load information updated in real time, so that the batch requests are distributed to the server instance with the smallest current load value, so as to further improve the efficiency of gRPC calls. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 is a flow chart of the method of the present invention;

[0053] Figure 2 The system block diagram of the system of the present invention. DETAILED DESCRIPTION

[0054] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0055] The gRPC dynamic load balancing communication method based on the greedy strategy, such as Figure 1 As shown, the gRPC dynamic load balancing communication method based on the greedy strategy includes:

[0056] S1. Deploy a load balancer in the communication system;

[0057] S2, collecting load information at the corresponding server end of the communication system, and controlling the load balancer to formulate a multi-batch task division strategy for data transmission at the server end according to the load information;

[0058] S3. When the communication channel receives the data to be transmitted sent by the server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batches of task division strategy to generate multiple data transmission tasks.

[0059] The working principle of the above technical solution is as follows: Deployment of load balancer (S1): In the communication system, a load balancer is deployed. The main task of this load balancer is to assist in distributing incoming requests to the backend server to balance the load and improve system performance.

[0060] Load information collection and task division strategy (S2): The server in the communication system collects information about its current load, such as request processing time, resource utilization, etc. Based on this load information, the system formulates a multi-batch task division strategy. The purpose of this strategy is to divide subsequent requests into multiple batches according to the current load situation so that they can be processed more efficiently.

[0061] Data transmission task division (S3): When the communication channel receives the data to be transmitted from the server, the system will divide the data to be transmitted into multiple data transmission tasks according to the multi-batch task division strategy. These tasks may be executed at different times or between different backend servers to reduce the system load pressure.

[0062] The effects of the above technical solution are: Dynamic load balancing: By dynamically adjusting the task division strategy according to the load information of the server, the technical solution of this embodiment can better distribute the load, ensure that each server can fully utilize its resources, and reduce the pressure on overloaded servers.

[0063] Performance optimization: By dividing the data to be transmitted into multiple batches, large amounts of data can be processed more efficiently, improving the performance and responsiveness of the communication system.

[0064] Adaptability: The technical solution of this embodiment is adaptive and can flexibly adjust the task division strategy according to the real-time load conditions to meet the changes in system requirements.

[0065] In general, the technical solution of this embodiment can improve the performance and load balancing capability of the system by adopting load balancing and dynamic task division strategies in the communication system to better meet user needs.

[0066] In one embodiment of the present invention, a load balancer is arranged in a communication system, including:

[0067] S101, extracting communication requirements of a communication system, wherein the communication requirements include load balancing requirement information, request batch processing requirement information, and load maximum load information;

[0068] S102, calling a load balancer corresponding to the communication demand according to the communication demand of the communication system;

[0069] S103: deploying the load balancer corresponding to the communication demand obtained in the communication system.

[0070] The working principle of the above technical solution is as follows: Extract communication requirements (S101): First, the system collects the communication requirements of the communication system, including load balancing requirement information, request batch processing requirement information and load maximum load information. These requirement information describes the communication system's expectations and requirements for load balancing.

[0071] Retrieving a load balancer (S102): Based on the extracted communication requirement information, the system will select or retrieve an appropriate load balancer. This load balancer may be a hardware device or an implementation of a load balancing algorithm, and the most appropriate load balancing method is selected according to the communication requirements.

[0072] Deployment of load balancer (S103): Finally, the selected load balancer will be deployed or deployed to the communication system. This load balancer will monitor and manage incoming requests in the communication system and execute load balancing strategies according to communication requirements to meet the requirements of the communication system.

[0073] The effect of the above technical solution is: meeting communication requirements: by selecting a suitable load balancer according to communication requirement information, the technical solution of this embodiment can ensure that the performance and strategy of the load balancer meet the requirements of the communication system, thereby achieving more effective load balancing.

[0074] Optimizing system performance: Using an appropriate load balancer can improve the performance of communication systems, ensuring that requests are distributed to available resources, improving response times, and maximizing resource utilization.

[0075] Flexibility: By selecting the appropriate load balancer, the system can adapt to different communication requirements and changing loads to meet different scenarios of the communication system.

[0076] In summary, the technical solution of this embodiment can better meet the performance and load balancing requirements of the communication system by selecting and deploying a load balancer according to communication requirements, thereby improving the efficiency and performance of the overall system.

[0077] In one embodiment of the present invention, load information is collected at a corresponding server end of a communication system, and a load balancer is controlled according to the load information to formulate a multi-batch task division strategy for data transmission at the server end, including:

[0078] S201, collecting load information at each of the servers;

[0079] S202, exposing the load information collected by the server to the load balancer, and the load balancer uniquely identifies each server in turn;

[0080] S203, determining the maximum and minimum data volumes for data partitioning in the data partitioning process according to the data generated by the server per unit time and the data volume information of the data to be transmitted;

[0081] Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data volume of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data volume of a single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

[0082] The maximum amount of data to be divided in the data division process is obtained by the following formula:

[0083] C max =(1+C p / C tmax )×C0

[0084] Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume;

[0085] The minimum amount of data to be divided in the data division process is obtained by the following formula:

[0086] C min =(1-C p / C tmax )×C0

[0087] Among them, C min Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax It represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

[0088] The working principle of the above technical solution is as follows: Collecting load information at each server (S201): Each server collects information about its current load in real time, which may include the amount of data generated per unit time and the amount of data that needs to be transmitted.

[0089] Exposing load information to the load balancer (S202): The load information of these servers will be provided to the load balancer. Each server will have a unique identifier.

[0090] Determine the data partitioning strategy (S203): The load balancer uses the load information provided by the server to determine the multi-batch task partitioning strategy. This strategy will limit the size of a single batch of data based on the maximum partition data amount and the minimum partition data amount to ensure that the load of the transmitted data on the communication channel does not exceed the maximum data transmission amount allowed, and at the same time it will not be too small to improve the transmission efficiency.

[0091] Maximum partitioned data volume (Cmax): To ensure that the communication channel is not overloaded, the load balancer uses a formula to calculate the maximum partitioned data volume, where Cp represents the average amount of data that needs to be transmitted per unit time generated by the server, Ctmax represents the maximum transmission capacity of the communication channel, and C0 represents the preset partitioned reference data volume. This value ensures that the capacity of the communication channel is not exceeded.

[0092] Minimum partition size (Cmin): Contrary to the maximum partition size, the minimum partition size ensures that the partition is not too small to avoid excessive partitioning tasks and resource waste. This value is also calculated through a formula that takes into account similar parameters as the maximum partition size.

[0093] The effects of the above technical solution are: Load balancing: By formulating multiple batch task division strategies based on the load information of the server, the load balancer can better distribute tasks to adapt to the load conditions of different servers. This helps to avoid overloaded servers and improve the overall performance of the system.

[0094] Data transmission efficiency: By reasonably dividing the data, the data transmission volume is ensured to be within the allowable range of the communication channel without wasting resources. This improves the efficiency of data transmission.

[0095] Adaptability: The technical solution of this embodiment is adaptive and can be dynamically adjusted according to actual load conditions to cope with changing load demands, thereby improving the stability and flexibility of the system.

[0096] In summary, the technical solution of this embodiment helps to achieve load balancing and improve the efficiency of data transmission by formulating multiple batch task division strategies according to the load information of the server. This is very useful for handling load management in large-scale communication systems.

[0097] In one embodiment of the present invention, when a communication channel receives data to be transmitted sent by a server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batches of task division strategy to generate multiple data transmission tasks, including:

[0098] S301, when the communication channel receives the data to be transmitted sent by the server, extract the maximum partition data amount and the minimum partition data amount contained in the multi-batch task partition strategy corresponding to the server;

[0099] S302, dividing the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generating multiple data transmission tasks;

[0100] S303: Complete the data transmission of the multiple data transmission tasks in order from small to large in terms of the number of individual tasks.

[0101] The working principle of the above technical solution is: extract the maximum and minimum divided data amounts in the multi-batch task division strategy corresponding to the server (S301): when the communication channel receives the data to be transmitted sent by the server, it will check the multi-batch task division strategy associated with these data to find out the specified maximum and minimum divided data amounts.

[0102] Multi-batch task division (S302): The data to be transmitted on the server is divided into multiple batches of tasks according to the maximum and minimum divided data amounts extracted from the multi-batch task division strategy. The data will be divided into multiple data transmission tasks, where the data amount of each task is between the maximum and minimum divided data amounts.

[0103] Completing data transmission tasks in order (S303): Multiple data transmission tasks will be transmitted in order from small to large data volume in the tasks. This means that small batches of data will be transmitted first, and then gradually increased to larger batches to ensure the efficiency and fairness of data transmission.

[0104] The effects of the above technical solution are: Task optimization: By reasonably dividing the data to be transmitted according to the maximum and minimum data amounts in the multi-batch task division strategy, task optimization can be achieved. This ensures that the data amount of the task is moderate and does not cause excessive load or waste of resources.

[0105] Data transfer efficiency: Completing data transfer tasks sequentially, from small batches to larger batches, helps improve data transfer efficiency. Small batches of data usually transfer faster, so transferring them first can reduce transmission latency.

[0106] Task fairness: By completing tasks in order, fairness between tasks is achieved. Small batches of tasks will not be completely overwhelmed by large batches of tasks, thus ensuring fair competition between different tasks.

[0107] The technical solution of this embodiment helps to achieve reasonable division and orderly execution of data transmission tasks, thereby improving the efficiency and fairness of data transmission.

[0108] The gRPC dynamic load balancing communication system based on the greedy strategy proposed in the embodiment of the present invention is as follows: Figure 2 As shown, the gRPC dynamic load balancing communication system based on the greedy strategy includes:

[0109] A load balancer deployment module, used for deploying a load balancer in a communication system;

[0110] A planning strategy formulation module is used to collect load information at the corresponding server end of the communication system, and control the load balancer to formulate multiple batch task division strategies for data transmission at the server end according to the load information;

[0111] The task division module is used to divide the data to be transmitted into multiple batches of tasks according to the multiple batches of task division strategies when the communication channel receives the data to be transmitted sent by the server, so as to generate multiple data transmission tasks.

[0112] The working principle of the above technical solution is as follows: In the communication system, a load balancer is deployed. The main task of this load balancer is to assist in distributing incoming requests to the backend servers to balance the load and improve system performance. The servers in the communication system collect information about their current load, such as request processing time, resource utilization, etc. Based on this load information, the system will formulate a multi-batch task division strategy. The purpose of this strategy is to divide subsequent requests into multiple batches according to the current load situation so that they can be processed more efficiently. When the communication channel receives the data to be transmitted sent by the server, the system will divide the data to be transmitted into multiple data transmission tasks according to the multi-batch task division strategy. These tasks may be executed at different times or between different backend servers to reduce the load pressure of the system.

[0113] The effect of the above technical solution is that by dynamically adjusting the task division strategy according to the load information of the server, the technical solution of this embodiment can better distribute the load, ensure that each server can fully utilize its resources, and reduce the pressure of overloaded servers. By dividing the data to be transmitted into multiple batches of tasks, a large amount of data can be processed more efficiently, and the performance and response speed of the communication system can be improved. The technical solution of this embodiment is adaptive and can flexibly adjust the task division strategy according to the real-time load situation to meet the changes in system requirements.

[0114] In general, the technical solution of this embodiment can improve the performance and load balancing capability of the system by adopting load balancing and dynamic task division strategies in the communication system to better meet user needs.

[0115] In one embodiment of the present invention, the equalizer arrangement module includes:

[0116] A communication demand extraction module, used to extract the communication demand of the communication system, wherein the communication demand includes load balancing requirement information, request batch processing requirement information and load maximum load information;

[0117] A load balancer calling module, used to call a load balancer corresponding to the communication demand according to the communication demand of the communication system;

[0118] The balancer deployment execution module is used to deploy the load balancer corresponding to the communication demand obtained by calling into the communication system.

[0119] The working principle of the above technical solution is as follows: First, the system collects the communication requirements of the communication system, including load balancing requirement information, request batching requirement information, and load maximum load information. These requirement information describe the expectations and requirements of the communication system for load balancing. Based on the extracted communication requirement information, the system selects or calls an appropriate load balancer. This load balancer may be a hardware device or an implementation of a load balancing algorithm, and the most appropriate load balancing method is selected according to the communication requirements. Finally, the selected load balancer will be deployed or deployed to the communication system. This load balancer will monitor and manage incoming requests in the communication system, and execute load balancing strategies according to the communication requirements to meet the requirements of the communication system.

[0120] The effect of the above technical solution is: by selecting a suitable load balancer according to the communication demand information, the technical solution of this embodiment can ensure that the performance and strategy of the load balancer meet the needs of the communication system, thereby achieving more effective load balancing. Using an appropriate load balancer can improve the performance of the communication system, ensure that requests are distributed to available resources, improve response speed, and maximize resource utilization. By selecting a suitable load balancer, the system can adapt to different communication needs and changing loads to meet different scenarios of the communication system.

[0121] In summary, the technical solution of this embodiment can better meet the performance and load balancing requirements of the communication system by selecting and deploying a load balancer according to communication requirements, thereby improving the efficiency and performance of the overall system.

[0122] In one embodiment of the present invention, the planning strategy formulation module includes:

[0123] A load information collection module, used to collect load information on each of the servers;

[0124] An information exposure control module, in which the user exposes the load information collected by the server to the load balancer, and the load balancer uniquely identifies each server in turn;

[0125] A data partitioning module is used to determine the maximum partitioning data volume and the minimum partitioning data volume in the data partitioning process according to the data generated by the server per unit time and the data volume information of the data to be transmitted;

[0126] Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data volume of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data volume of a single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

[0127] The maximum amount of data to be divided in the data division process is obtained by the following formula:

[0128] C max =(1+C p / C tmax )×C0

[0129] Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume;

[0130] The minimum amount of data to be divided in the data division process is obtained by the following formula:

[0131] C min =(1-C p / C tmax )×C0

[0132] Among them, C min Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax It represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

[0133] The working principle of the above technical solution is as follows: each server collects information about its current load in real time. This information may include the amount of data generated per unit time and the amount of data that needs to be transmitted. The load information of these servers will be provided to the load balancer. Each server will have a unique identifier. The load balancer uses the load information provided by the server to determine the multi-batch task division strategy. This strategy will limit the size of a single batch of data based on the maximum and minimum data amounts to ensure that the load of the transmitted data on the communication channel does not exceed the maximum data transmission amount allowed, and at the same time it will not be too small to improve the transmission efficiency. Since it is necessary to ensure that the communication channel is not overloaded, the load balancer uses a formula to calculate the maximum data amount of the division, where Cp represents the average amount of data that needs to be transmitted per unit time generated by the server, Ctmax represents the maximum transmission capacity of the communication channel, and C0 represents the preset division reference data amount. This value ensures that the capacity of the communication channel will not be exceeded. In contrast to the maximum data amount of the division, the minimum data amount of the division ensures that it will not be divided too small to avoid too many division tasks and waste of resources. This value is also calculated by a formula, taking into account parameters similar to the maximum data amount of the division.

[0134] The effect of the above technical solution is: by formulating a multi-batch task division strategy according to the load information of the server, the load balancer can better distribute tasks to adapt to the load conditions of different servers. This helps to avoid overloaded servers and improve the overall performance of the system. By reasonably dividing the data, it is ensured that the amount of data transmission is within the allowable range of the communication channel without wasting resources. This improves the efficiency of data transmission. The technical solution of this embodiment is adaptive and can be dynamically adjusted according to the actual load situation to cope with the changing load requirements, thereby improving the stability and flexibility of the system.

[0135] In summary, the technical solution of this embodiment helps to achieve load balancing and improve the efficiency of data transmission by formulating multiple batch task division strategies according to the load information of the server. This is very useful for handling load management in large-scale communication systems.

[0136] In one embodiment of the present invention, the task division module includes:

[0137] The task division execution module is used to extract the maximum division data amount and the minimum division data amount contained in the multiple batch task division strategies corresponding to the server when the communication channel receives the data to be transmitted sent by the server;

[0138] A task generation module, used for dividing the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generating multiple data transmission tasks;

[0139] The data transmission module is used to complete the data transmission of the multiple data transmission tasks in order from small to large in terms of the number of individual tasks.

[0140] The working principle of the above technical solution is: extract the maximum and minimum divided data amounts in the multi-batch task division strategy corresponding to the server: when the communication channel receives the data to be transmitted sent by the server, it will check the multi-batch task division strategy associated with these data to find out the specified maximum and minimum divided data amounts.

[0141] Multi-batch task division: The server-side data to be transmitted is divided into multiple batches of tasks according to the maximum and minimum data amounts extracted from the multi-batch task division strategy. These data will be divided into multiple data transmission tasks, where the data amount of each task is between the maximum and minimum data amounts.

[0142] Complete data transmission tasks in order: Multiple data transmission tasks will be transmitted in order from small to large in terms of the amount of data in the task. This means that small batches of data will be transmitted first, and then gradually increased to larger batches to ensure the efficiency and fairness of data transmission.

[0143] The effect of the above technical solution is: by reasonably dividing the data to be transmitted according to the maximum and minimum data amounts in the multi-batch task division strategy, the task optimization can be achieved. This ensures that the data amount of the task is moderate and does not cause excessive load or waste of resources. Completing data transmission tasks in sequence, gradually increasing from small batches to larger batches, helps to improve the efficiency of data transmission. Small batches of data can usually be transmitted faster, so transmitting this data first can reduce transmission delays. By completing tasks in sequence, fairness between tasks is achieved. Small batch tasks will not be completely overwhelmed by large batch tasks, thereby ensuring fair competition between different tasks.

[0144] The technical solution of this embodiment helps to achieve reasonable division and orderly execution of data transmission tasks, thereby improving the efficiency and fairness of data transmission.

[0145] 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 gRPC dynamic load balancing communication method based on a greedy strategy, characterized in that: The gRPC dynamic load balancing communication method based on the greedy strategy includes: Deploy load balancers in the communication system; Collecting load information at the corresponding server end of the communication system, and controlling the load balancer to formulate a multi-batch task division strategy for data transmission at the server end according to the load information; When the communication channel receives the data to be transmitted sent by the server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batches of task division strategy to generate multiple data transmission tasks; Wherein, the load information is collected at the corresponding server end of the communication system, and the load balancer is controlled according to the load information to formulate a multi-batch task division strategy for the data transmission of the server end, including: Collecting load information at each of the servers; The load information collected by the server is exposed to the load balancer, and the load balancer uniquely identifies each server in turn; Determine the maximum and minimum data volumes for data partitioning in the data partitioning process according to the data generated per unit time at the server end and the data volume information of the data to be transmitted; Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data amount of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data amount of the single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

2. According to the gRPC dynamic load balancing communication method based on the greedy strategy of claim 1, it is characterized in that: Deploy a load balancer in the communication system, including: Extracting communication requirements of the communication system, wherein the communication requirements include load balancing requirement information, request batch processing requirement information and load maximum load information; According to the communication demand of the communication system, a load balancer corresponding to the communication demand is called; The load balancer corresponding to the obtained communication demand is deployed in the communication system.

3. According to the gRPC dynamic load balancing communication method based on the greedy strategy of claim 1, it is characterized in that: The maximum amount of data divided in the data division process is obtained by the following formula: C max =(1+C p / C tmax )×C0 Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume; The minimum amount of data to be divided in the data division process is obtained by the following formula: C min =(1-C p / C tmax )×C0 Among them, C min Indicates the minimum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax It represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

4. According to the gRPC dynamic load balancing communication method based on the greedy strategy of claim 1, it is characterized in that: When the communication channel receives the data to be transmitted sent by the server, the data to be transmitted is divided into multiple batches of tasks according to the multiple batch task division strategy to generate multiple data transmission tasks, including: When the communication channel receives the data to be transmitted sent by the server, the maximum partition data amount and the minimum partition data amount included in the multi-batch task partitioning strategy corresponding to the server are extracted; Divide the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generate multiple data transmission tasks; The data transmission tasks are completed in sequence according to the order from small to large in terms of the number of individual tasks.

5. The gRPC dynamic load balancing communication system based on the greedy strategy is characterized by: The gRPC dynamic load balancing communication system based on the greedy strategy includes: A load balancer deployment module, used for deploying a load balancer in a communication system; A planning strategy formulation module is used to collect load information at the corresponding server end of the communication system, and control the load balancer to formulate multiple batch task division strategies for data transmission at the server end according to the load information; A task division module is used to divide the data to be transmitted into multiple batches of tasks according to the multiple batches of task division strategies when the communication channel receives the data to be transmitted sent by the server, so as to generate multiple data transmission tasks; Wherein, the planning strategy formulation module includes: A load information collection module, used to collect load information on each of the servers; An information exposure control module, in which the user exposes the load information collected by the server to the load balancer, and the load balancer uniquely identifies each server in turn; A data partitioning module is used to determine the maximum partitioning data volume and the minimum partitioning data volume in the data partitioning process according to the data generated per unit time by the server and the data volume information of the data to be transmitted; Among them, the maximum divided data amount and the minimum divided data amount are used to limit the data amount of a single batch of data after the data to be transmitted generated by the server is divided into multiple batches. At the same time, the data amount of the single batch of data after division shall not exceed the maximum divided data amount and shall not be less than the minimum divided data amount.

6. According to the gRPC dynamic load balancing communication system based on the greedy strategy of claim 5, it is characterized in that: The equalizer layout module includes: A communication demand extraction module, used to extract the communication demand of the communication system, wherein the communication demand includes load balancing requirement information, request batch processing requirement information and load maximum load information; A load balancer calling module, used to call a load balancer corresponding to the communication demand according to the communication demand of the communication system; The balancer deployment execution module is used to deploy the load balancer corresponding to the communication demand obtained by calling into the communication system.

7. The gRPC dynamic load balancing communication system based on the greedy strategy according to claim 5 is characterized in that: The maximum amount of data divided in the data division process is obtained by the following formula: C max =(1+C p / C tmax )×C0 Among them, C max Indicates the maximum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax Indicates the maximum data transmission volume allowed by the communication channel per unit time; C0 indicates the preset division reference data volume; The minimum amount of data to be divided in the data division process is obtained by the following formula: C min =(1-C p / C tmax )×C0 Among them, C min Indicates the minimum amount of partitioned data; C p Indicates the average amount of data that needs to be transmitted per unit time generated by the server, and the unit time is 1s; C tmax It represents the maximum data transmission volume allowed by the communication channel per unit time; C0 represents the preset division benchmark data volume.

8. According to the gRPC dynamic load balancing communication system based on the greedy strategy of claim 5, it is characterized in that: The task division module includes: The task division execution module is used to extract the maximum division data amount and the minimum division data amount contained in the multiple batch task division strategies corresponding to the server when the communication channel receives the data to be transmitted sent by the server; A task generation module, used for dividing the data to be transmitted corresponding to the server into multiple batches of tasks according to the maximum divided data amount and the minimum divided data amount, and generating multiple data transmission tasks; The data transmission module is used to complete the data transmission of the multiple data transmission tasks in order from small to large in terms of the number of individual tasks.