Load balancing method and apparatus, electronic device, and storage medium

By using a client-side load balancing method, path quality scores are determined using probe packets and timestamp information, and target server nodes are selected. This solves the problems of low load balancing efficiency and robustness in distributed systems, and achieves faster response and improved stability.

CN121441918BActive Publication Date: 2026-04-10CHONGQING SATELLITE NETWORK SYSTEM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-30
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, the load balancing efficiency and robustness of distributed systems are low, making it difficult to guarantee system stability. Especially in highly dynamic and heterogeneous network environments, existing solutions are unable to quickly respond to network fluctuations or sudden traffic changes.

Method used

The load balancing method implemented on the client side obtains the identification information of candidate server nodes, sends probe packets and receives response messages, and combines the receiving timestamp, initiation timestamp and historical transmission latency to determine the target transmission latency and path quality score, and selects the target server node.

Benefits of technology

It achieves stability and accuracy in path selection during network jitter or server load fluctuations, improves load balancing efficiency, responds quickly to network changes, reduces detection overhead, and has scalability and robustness, ensuring the system's basic service capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121441918B_ABST
    Figure CN121441918B_ABST
Patent Text Reader

Abstract

The application discloses a load balancing method and device, electronic equipment and a storage medium, solves the problem of low load balancing efficiency and robustness of a distributed system, and is difficult to guarantee system stability. The identification information of the candidate server node is obtained; a probe packet is sent to the candidate server node according to the identification information of the candidate server node, the probe packet contains the initiation timestamp information of the probe packet; a response message returned by the candidate server node is received, the response message carries the receiving timestamp and the load rate information of the candidate server node; the target transmission delay between the client and the candidate server node is determined according to the receiving timestamp, the initiation timestamp and the historical transmission delay; the path quality score between the client and the candidate server node is determined according to the load rate information of the candidate server node and the target transmission delay; and the target server node is determined according to the path quality score between the client and the candidate server node.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, and in particular to a load balancing method and device, an electronic device, and a storage medium. BACKGROUND

[0002] In cloud computing, edge computing, and large-scale distributed service architecture, the business requests of a client can usually be distributed to multiple server nodes for processing to achieve high throughput, low latency, and reliability guarantee. With the rapid development of the Internet of Things and mobile Internet, the network environment between the client and the server presents high dynamics and heterogeneity, such as significant increases in network delay, jitter, packet loss rate, and server node load fluctuation. Based on this, real-time sensing of network status and intelligent selection of optimal server nodes to improve the quality of service (QoS) become core problems.

[0003] Existing solutions mainly rely on centralized load decision at the center side, which is difficult to quickly respond to network fluctuations or sudden traffic changes, reduces the load balancing efficiency and robustness, and is difficult to guarantee the stability of the distributed system.

[0004] Therefore, how to improve the load balancing efficiency and robustness of the distributed system to improve the stability of the distributed system is one of the technical problems to be solved by the existing technology. SUMMARY

[0005] To solve the problem of low load balancing efficiency and robustness of the distributed system in the prior art and difficulty in guaranteeing system stability, the embodiments of the present application provide a load balancing method, device, electronic device, and storage medium.

[0006] In a first aspect, the embodiments of the present application provide a load balancing method implemented at the client side, comprising:

[0007] obtaining identification information of a candidate server node;

[0008] sending a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing initiation timestamp information of the probe packet;

[0009] receiving a response message returned by the candidate server node, the response message carrying a receiving timestamp and load rate information of the candidate server node;

[0010] determining a target transmission delay between the client and the candidate server node according to the receiving timestamp, the initiation timestamp, and a historical transmission delay;

[0011] determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent path quality between the client and the candidate server node;

[0012] determine a target server node according to the path quality score between the client and the candidate server node, and send a service request to the target server node.

[0013] In a second aspect, an embodiment of the present application provides a load balancing device implemented on a client side, comprising:

[0014] a obtaining module, configured to obtain identification information of a candidate server node;

[0015] a sending module, configured to send a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing initiation time stamp information of the probe packet;

[0016] a first receiving module, configured to receive a response message returned by the candidate server node, the response message containing reception time stamp information and load rate information of the candidate server node;

[0017] a first determining module, configured to determine a target transmission time delay between the client and the candidate server node according to the reception time stamp, the initiation time stamp and a historical transmission time delay;

[0018] a second determining module, configured to determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent path quality between the client and the candidate server node;

[0019] a third determining module, configured to determine a target server node according to the path quality score between the client and the candidate server node, and send a service request to the target server node.

[0020] In a third aspect, an embodiment of the present application provides a load balancing method implemented on a global coordinator side, comprising:

[0021] receiving a probe scheduling request sent by a client, the probe scheduling request containing service identification information requested;

[0022] determining a candidate server node providing corresponding service according to the service identification information;

[0023] sending the identification information of the candidate server node to the client, so that the client sends a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing initiation time stamp information of the probe packet; receiving a response message returned by the candidate server node, the response message carrying a receiving time stamp and load rate information of the candidate server node; determining a target transmission time delay between the client and the candidate server node according to the receiving time stamp, the initiation time stamp and a historical transmission time delay; determining a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent path quality between the client and the candidate server node; and determining a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0024] In a fourth aspect, an embodiment of the present application provides a load balancing device implemented on a global coordinator side, comprising:

[0025] a first receiving module configured to receive a probe scheduling request sent by a client, the probe scheduling request carrying service identification information requested;

[0026] a first determining module configured to determine a candidate server node providing a corresponding service according to the service identification information;

[0027] a sending module configured to send the identification information of the candidate server node to the client, so that the client sends a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing initiation time stamp information of the probe packet; receive a response message returned by the candidate server node, the response message carrying a receiving time stamp and load rate information of the candidate server node; determine a target transmission time delay between the client and the candidate server node according to the receiving time stamp, the initiation time stamp and a historical transmission time delay; determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent path quality between the client and the candidate server node; and determine a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0028] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and capable of running on the processor, and the processor implements the load balancing method provided by the present application when executing the program.

[0029] In a sixth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of the load balancing method.

[0030] The beneficial effects of the present application are as follows:

[0031] The load balancing method, device, electronic device and storage medium provided by the embodiments of the present application, the client obtains the identification information of the candidate server node; a probe packet is sent to the candidate server node according to the identification information of the candidate server node, the probe packet contains the initiation timestamp information of the probe packet; a response message returned by the candidate server node is received, the response message carries the receiving timestamp and the load rate information of the candidate server node; the target transmission delay between the client and the candidate server node is determined according to the receiving timestamp, the initiation timestamp and the historical transmission delay; the path quality score between the client and the candidate server node is determined according to the load rate information of the candidate server node and the target transmission delay, and the path quality score is used to represent the path quality between the client and the candidate server node; and the target server node is determined according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node. In the embodiments of the present application, the client actively generates a probe packet and sends it to the candidate server node, the target transmission delay between the client and the candidate server node is determined based on the initiation timestamp of the probe packet, the receiving timestamp returned by the candidate server node and the historical transmission delay, the real-time load rate returned by the candidate server node and the target transmission delay between the client and the candidate server node are used for path quality evaluation, the stability and accuracy of path selection can be maintained when the network jitter or the load fluctuation of the candidate server node, and therefore, the real-time and multi-dimensional perception of the server node state by the client is realized. In the present application, the load balancing decision is changed from the centralized decision in the prior art to the distributed intelligent decision of the client, the decision right of path quality score calculation and target server node selection is given to each client, which forms an efficient distributed decision network. The client can complete the detection, path quality score calculation and target server node selection locally in milliseconds, can quickly respond to network jitter or server load mutation, and improves the load balancing efficiency. Moreover, the overhead of the probe packet is extremely low, and new network congestion caused by the introduction of the detection mechanism is avoided. The decision of each client is independent and parallel, and the system does not cause pressure when new clients or server nodes are added, and has strong scalability. Moreover, even if the global coordinator is temporarily disabled, each client can still perform effective load balancing based on local detection, guaranteeing the basic service ability of the system and improving the robustness.

[0032] Other features and advantages of the present application will be set forth in the following specification, and in part will be apparent from the description, or can be learned by practice of the application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS

[0033] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and together with the description serve to explain the present application. In the drawings:

[0034] Figure 1 A schematic diagram of an application scenario of the load balancing method provided by the embodiments of the present application;

[0035] Figure 2 A schematic diagram of a flow of the load balancing method provided by the embodiments of the present application;

[0036] Figure 3 A schematic diagram of a flow of setting a probe time offset for each client cluster provided by the embodiments of the present application;

[0037] Figure 4 A schematic diagram of a flow of setting a probe frequency compression coefficient for each client cluster provided by the embodiments of the present application;

[0038] Figure 5 A schematic diagram of a flow of determining a target transmission delay between a client and the candidate server node provided by the embodiments of the present application;

[0039] Figure 6 A schematic diagram of a flow of the load balancing method implemented on the client side provided by the embodiments of the present application;

[0040] Figure 7 A schematic diagram of a structure of the load balancing apparatus implemented on the client side provided by the embodiments of the present application;

[0041] Figure 8 A schematic diagram of a flow of the load balancing method implemented on the global coordinator side provided by the embodiments of the present application;

[0042] Figure 9 A schematic diagram of a structure of the load balancing apparatus implemented on the global coordinator side provided by the embodiments of the present application;

[0043] Figure 10 A schematic diagram of a structure of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0044] To solve the problems of low load balancing efficiency and robustness of a distributed system in the prior art and difficulty in guaranteeing system stability, embodiments of the present application provide a load balancing method and device, electronic equipment and a storage medium.

[0045] The preferred embodiments of the present application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application, and the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0046] Firstly, refer to Figure 1 which is a schematic diagram of an application scenario of the load balancing method provided by the embodiments of the present application, and can include a global coordinator 101, K client clusters 102: cluster 1 to cluster K, and at least one server cluster 103. Each client cluster 102 includes a plurality of clients, the server cluster 103 includes a plurality of server nodes, the K client clusters 102 are divided by the global coordinator 101 according to geographical areas, and each client cluster 102 is assigned a unique number, which can be represented by 1 to K.

[0047] The server node can be an independent physical server, or a cloud server providing basic cloud computing services such as cloud server, cloud database and cloud storage. The server, the client and the global coordinator 101 are connected through a network, and the embodiments of the present application are not limited in this regard.

[0048] Based on the above application scenario, the accompanying drawings will be referred to in the following Figures 2-9 to describe the exemplary embodiments of the present application in more detail. It should be noted that the above application scenario is only shown for the purpose of facilitating understanding of the spirit and principles of the present application, and the embodiments of the present application are not limited in this regard. On the contrary, the embodiments of the present application can be applied to any applicable scenario.

[0049] As Figure 2 shown, it is an implementation flowchart of the load balancing method provided by the embodiments of the present application. The load balancing method can include the following steps:

[0050] S21, the client sends a probe scheduling request to the global coordinator, and the probe scheduling request carries the requested service identification information.

[0051] Initially, after dividing all the clients managed by the global coordinator into K clusters according to geographical areas and assigning a unique number to each client cluster, in order to avoid network congestion caused by a large number of clients in multiple client clusters sending probe packets to the server node at the same time, improve the probe efficiency, and avoid resource waste, the global coordinator differentiates the probe scheduling of different client clusters from the time and space dimensions, and assigns different probe time offsets and probe frequency compression coefficients to each client cluster. Among them, setting different probe time offsets for different client clusters can make the clients in different client clusters probe at different peaks, avoiding network congestion caused by synchronous probing. Setting different probe frequency compression coefficients for client clusters of different sizes can compress the probe frequency, so that the clients in client clusters of different sizes can send probe packets to the server node for probing at different probe frequencies, improve the probe efficiency, and dynamically adapt to the utilization of resources.

[0052] In implementation, the probe time offsets for the client clusters can be set according to the flow as shown in Figure 3 , including the following steps:

[0053] S31, the global coordinator determines a perturbation interval based on a basic probe period.

[0054] In specific implementation, the global coordinator can set the perturbation interval as: , wherein, is the basic probe period, which can be set by the actual demand, such as 10 seconds, and the present application does not limit this.

[0055] S32, for each cluster, a random perturbation value is obtained from the perturbation interval.

[0056] In specific implementation, for the first cluster, the global coordinator can select a random perturbation value from the perturbation interval .

[0057] S33, according to the number of the cluster, the basic probe period and the random perturbation value, the probe time offset corresponding to the cluster is determined.

[0058] In specific implementation, the global coordinator can calculate the probe time offset corresponding to the first client cluster by the following formula:

[0059]

[0060] , wherein, represents the probe time offset corresponding to the first cluster, .

[0061] represents the number of the th cluster, ;

[0062] represents the basic detection period;

[0063] represents the random disturbance value corresponding to the th cluster, , is the disturbance interval.

[0064] In this way, the global coordinator can calculate the detection time offset corresponding to each client cluster.

[0065] For example, assuming that there are 4 client clusters, the numbers are 1, 2, 3, and 4 in turn, and the basic detection period is 5 seconds, then the disturbance interval is 5, and the random disturbance values are 0, 1, 2, and 3 respectively. Then, the detection time offsets corresponding to each client cluster are 9.5, 20.3, 29.2, and 40.3 seconds in turn. Therefore, the client in the client cluster 1 can initiate a detection packet at 9.5 seconds, the client in the client cluster 2 can initiate a detection packet at 20.3 seconds, the client in the client cluster 3 can initiate a detection packet at 29.2 seconds, and the client in the client cluster 4 can initiate a detection packet at 40.3 seconds.

[0066] S34, the detection time offset corresponding to each cluster is sent to each client in the corresponding cluster.

[0067] In specific implementation, the global coordinator sends the detection time offset corresponding to each client cluster to each client in the corresponding cluster, which is stored locally by each client.

[0068] In implementation, the detection frequency compression coefficient can be set for each client cluster according to the flow as shown in FIG. 8, including the following steps. Figure 4

[0069] S41, the global coordinator counts the number of clients included in each cluster.

[0070] In specific implementation, the global coordinator counts the number of clients included in each client cluster.

[0071] ​​​​​​​​​S42. For each cluster, determine the corresponding detection frequency compression factor based on the number of clients in the cluster and the base cluster size.

[0072] In practice, the global coordinator can calculate the first step using the following formula. Compression factor of the probe frequency corresponding to each client cluster:

[0073]

[0074] in, Indicates the first The compression factor of the detection frequency corresponding to each cluster;

[0075] Indicates the first The number of clients contained in a cluster;

[0076] Indicates the baseline cluster size.

[0077] The base cluster size, i.e. the number of clients included in the base cluster, can be set according to actual needs, such as 10,000 clients. This application embodiment does not limit this.

[0078] In this way, the global coordinator can determine the probe frequency compression factor for each client cluster.

[0079] For example, assuming a baseline cluster size , The number of clients in each client cluster is as follows (in seconds): (Small cluster) (Benchmark Cluster) (Medium-sized cluster) (Large cluster). The compression factor for the probe frequency corresponding to client cluster 1 is: Then its detection period is: Seconds (more frequent probes). The probe frequency compression factor for client cluster 2 is: Then its detection period is: Seconds (standard probe). The probe frequency compression factor for client cluster 3 is: Then its detection period is: Seconds (reducing the detection frequency). The detection frequency compression factor for client cluster 4 is: Then its detection period is: Seconds (lower detection frequency).

[0080] S43. Distribute the detection frequency compression coefficients corresponding to each cluster to each client in the corresponding cluster.

[0081] In implementation, the global coordinator sends the detection frequency compression coefficient corresponding to each cluster to each client in the corresponding cluster, which is stored by each client locally.

[0082] In this way, the client can determine the detection time according to the detection time offset sent by the global coordinator, and compress the detection frequency in proportion according to the detection frequency compression coefficient.

[0083] Before the client needs to initiate a service request, a detection scheduling request is sent to the global coordinator, and the service identification information of the request is carried in the detection scheduling request.

[0084] S22, the global coordinator determines the candidate server node providing the corresponding service according to the service identification information.

[0085] In implementation, the global coordinator maintains a correspondence list of different service identifications and server nodes that can provide corresponding services, and when receiving the detection scheduling request sent by the client, searches for the server nodes that can provide the corresponding services from the correspondence list of service identification and server node, as the candidate server nodes. The candidate server nodes can include all server nodes corresponding to the service identification, and the global coordinator can also select multiple server nodes close to the client from the server nodes that can provide services for the service according to the geographical position of the client as the candidate server nodes, which is not limited in the embodiments of the application.

[0086] S23, the global coordinator sends the identification information of the candidate server node to the client.

[0087] S24, the client sends a detection packet to the candidate server node according to the identification information of the candidate server node, and the detection packet contains the initiation timestamp information of the detection packet.

[0088] In implementation, after receiving the identification information of the candidate server node sent by the global coordinator, the client generates a lightweight detection packet for each candidate server node before initiating a service request, according to the identification information of the candidate server node, the initiation timestamp information of the detection packet and the location hash value of the client. The initiation timestamp is the time of sending the detection packet to the candidate server node subsequently. In the application, the lightweight detection packet is a network data packet with small data volume, simple structure and little impact on system load, which is constructed and sent in network communication for the purpose of performing state detection task on the server node.

[0089] Specifically, the size of the lightweight detection packet can be set to be no more than 10% of the standard service request, which can carry the identification and timestamp field of the candidate server node, and is sent to each candidate server node in parallel through an encrypted channel.

[0090] In an embodiment, the lightweight probe packet can adopt a hierarchical coding structure, the first layer being a packet header for storing the identification of the candidate server node, the initiation timestamp of the probe packet, the protocol version number (such as TCP, UDP, etc.), the second layer being a variable-length payload field for storing the location hash value of the client and the network access type (such as Wi-Fi, 5G or wired network, etc.), and the third layer being a cyclic redundancy check code for integrity check at the application layer. The length of each layer can be set as needed, such as the first layer can be set to 8 bytes, of which 2 bytes can be used to store the identification of the candidate server node, 4 bytes can be used to store the initiation timestamp accurate to microseconds, and 2 bytes can be used to store the protocol version number; the length of the second layer can be set to not more than 40 bytes; the length of the third layer can be set to 4 bytes, which is not limited in the embodiment of the application. The length of the probe packet can be set to satisfy the following constraint condition: wherein, is the average length of the historical service request of the client, which is the average value of the historical service request length sent by the client to all server nodes. In this way, it can be ensured that the probe traffic is negligible compared to the service request traffic, preventing the probe packet calculated in proportion to the large request service (such as file upload, video streaming, etc.) from being still too large, for example, 10% of a 1MB-sized service request is 100KB, at this time, due to the constraint of 52 bytes, the total length of the probe packet will not be higher than 52 bytes, ensuring that the probe overhead is ≤10% and lower than the length of the conventional control message. It should be noted that 52 bytes is only an example, which can be set as needed in implementation, and the embodiment of the application is not limited thereto. The structure of the probe packet can be designed by reducing the UDP minimum message header (RFC768), the Ethernet CRC-32 check specification (IEEE802.3-2018), and the IPv4 / IPv6 MTU) requirements (52 bytes is much smaller than the standard MTU (1500 bytes).

[0091] After the client generates the respective probe packets corresponding to each candidate server node, it can determine the probe time according to the probe time offset issued by the global coordinator, and determine the probe frequency according to the probe frequency compression coefficient, and send the respective probe packets corresponding to each candidate server node to each candidate server node corresponding to the identification of each candidate server node in parallel according to the probe time and the probe frequency.

[0092] S25, after the candidate server node receives the probe packet, returns a response message to the client, and the response message carries the reception timestamp and the load rate information of the candidate server node.

[0093] In an embodiment, after receiving the probe packet sent by the client, each candidate server node generates a response message containing a receiving timestamp and load rate information of the candidate server node, and returns the response message to the client, wherein the receiving timestamp is the time when the probe packet is received. The load rate of the candidate server node can be obtained by weighted summation of the current CPU usage rate, memory usage rate and network bandwidth usage rate, which is not limited in the embodiments of the present application. The size of the response message is limited, for example, can be limited within 1.2 times of the probe packet, which is not limited in the embodiments of the present application.

[0094] S26, the client determines the target transmission time delay between the client and the candidate server node according to the receiving timestamp, the initiating timestamp and the historical transmission time delay.

[0095] In implementation, for each candidate server node, the client extracts the receiving timestamp and the initiating timestamp from the response message returned by the candidate server node, and determines the target transmission time delay between the client and the candidate server node according to the receiving timestamp, the initiating timestamp and the historical transmission time delay.

[0096] In implementation, the target transmission time delay between the client and the candidate server node can be determined according to the flow as shown in Figure 5 , which includes the following steps:

[0097] S51, the client determines the transmission time delay between the client and the candidate server node this time according to the receiving timestamp and the initiating timestamp.

[0098] In implementation, for each candidate server node, the client subtracts the initiating timestamp of the probe packet from the receiving timestamp in the response message returned by the candidate server node, to obtain the transmission time delay between the client and the candidate server node this time.

[0099] S52, a preset number of historical transmission time delays before this time are obtained.

[0100] In implementation, the historical transmission time delays before this time are the corresponding historical transmission time delays when the client initiates the probe packet to all server nodes before initiating this probe packet, and the preset number is M-1, so that the transmission time delay this time is added, and a total of M continuous transmission time delays are included. The client records the transmission time delay sequence of the continuous M times of detection, and the Mth detection is this detection.

[0101] S53, the weight of each historical transmission time delay and the weight of the transmission time delay this time are obtained.

[0102] In implementation, the client can calculate the weight of the Mth transmission time delay by the following formula:

[0103]

[0104] in, Indicates the first One transmission delay, , This represents the total number of historical transmission delays and the current transmission delay.

[0105] By using the formula described above for calculating the weight of transmission delay, the historical transmission delay in the middle part can contribute more, effectively filtering out abnormal fluctuations while maintaining sensitivity to changes in delay trends, thus providing a stable delay input for the path quality scoring model.

[0106] In one implementation, the number of M can be adaptively adjusted according to the network jitter intensity, and the adjustment rule is as follows:

[0107] The total number of historical transmission delays and the current transmission delay. The value of can be determined according to the following formula:

[0108]

[0109] in, This represents the sensitivity coefficient, and V represents the current network jitter variance of the client. Used for control Sensitivity to the current network jitter variance V of the client.

[0110] The current network jitter variance V of the client can be calculated from the transmission delay sample window recorded by the client and determined using the exponentially weighted moving variance algorithm, reflecting the degree of current network delay fluctuation.

[0111] When network jitter is high (V is high), the window M is automatically increased to incorporate more historical data for filtering, making the latency estimation smoother and more stable. When the network is stable, the window M is decreased to make the evaluation more agile. The range of values ​​can be set based on practical experience; for example, when When M is insensitive to network latency jitter, the window size M changes gradually. When the value of is large, such as when When M is constant, it means that the value of M is not sensitive to network latency jitter and the window size M changes gradually.

[0112] In practice, the value of M can also be preset according to the business type, and this application embodiment does not limit this.

[0113] S54. Based on the historical transmission delays and their weights, as well as the current transmission delay and its weight, calculate the weighted average to obtain the target transmission delay between the client and the candidate server node.

[0114] In implementation, the client obtains the target transmission time delay between the client and the candidate server node by weighted average of each historical transmission time delay and its weight and the current transmission time delay and its weight.

[0115] To make the calculated target transmission time delay more accurate, before calculating the weight of each historical transmission time delay and the weight of the current transmission time delay, the 3σ criterion can be used to eliminate outliers in the M transmission time delays, eliminate abnormal transmission time delays deviating from the mean value by more than 3σ, and take the weighted average of the remaining transmission time delays as the effective transmission time delay, i.e. the target transmission time delay.

[0116] In this application, to cope with the jitter and burst anomaly of network time delay, when calculating the target transmission time delay between the client and the candidate server node, a dynamic time window filtering algorithm is used to determine the value of M and the weight of each transmission time delay, and to calculate the weighted average to obtain the effective transmission time delay.

[0117] S27, the client determines the path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay.

[0118] The path quality score is used to represent the path quality between the client and the candidate server node.

[0119] In an embodiment, the client can use the following path quality score model to calculate the path quality score between the client and the i-th candidate server node:

[0120]

[0121] wherein, represents the path quality score between the client and the i-th candidate server node, , , is the number of candidate server nodes;

[0122] represents the load rate of the i-th candidate server node;

[0123] represents the maximum load threshold corresponding to the i-th candidate server node;

[0124] represents the target transmission time delay between the client and the i-th candidate server node; is the i-th candidate server node.

[0125] is the i-th candidate server node. ​​​Load rate of candidate server nodes Weighting coefficients;

[0126] and For the client and the Target transmission delay between candidate server nodes The weighting coefficients.

[0127] The path quality assessment model is a crucial step in determining the final target server node selection. This model combines two core metrics: server node load rate and transmission latency, and uses weighting coefficients... , and A weighted fusion is performed to obtain a comprehensive path quality score.

[0128] In one implementation, there may be a problem of insufficient information in complex network environments. For example, when the available bandwidth, packet loss rate, or queue depth of a server node are highly correlated with service performance, failure to consider these indicators may lead to distorted evaluation results. Based on this, in order to improve the accuracy of path quality evaluation, after a candidate server node receives a probe packet sent by the client, it can return the candidate server node's packet loss rate information, available bandwidth information, and queue depth information along with the receiving timestamp and load rate information to the client.

[0129] Specifically, in addition to the receiving timestamp and the load rate information of the candidate server node, the response message may also include the candidate server's packet loss rate, available bandwidth, and queue depth. The queue depth is the number of pending service requests in the queue of service requests currently being processed by the candidate server node. The client can determine the path quality score between the client and the candidate server node based on the candidate server node's load rate, target transmission latency, packet loss rate, available bandwidth, and queue depth information.

[0130] At this point, the client can use the following path quality scoring model to calculate the client's performance relative to the first... Path quality score between candidate server nodes:

[0131]

[0132] in, Indicates the client and the first Path quality score between candidate server nodes , The number of candidate server nodes;

[0133] Indicates the first Load rate of each candidate server node;

[0134] Indicates the first The maximum load threshold corresponding to each candidate server node;

[0135] Indicates the client and the first Target transmission latency between candidate server nodes;

[0136] Indicates the first Packet loss rate of each candidate server node;

[0137] Indicates the first The available bandwidth of each candidate server node;

[0138] Indicates the first The queue depth of each candidate server node;

[0139] For the first Load rate of candidate server nodes Weighting coefficients;

[0140] and For the client and the Target transmission delay between candidate server nodes Weighting coefficients;

[0141] For the first Packet loss rate of candidate server nodes Weighting coefficients;

[0142] For the first The weighting coefficient of the ratio of available bandwidth to queue depth for each candidate server node.

[0143] Weighting coefficients of packet loss rate The weighting factor for the ratio of available bandwidth to queue depth of candidate server nodes can be configured based on the business's sensitivity to network jitter. The capability of the candidate server node for processing large traffic can be set according to actual experience, and embodiments of the application do not limit this. The packet loss rate supplements the deficiency that the transmission delay cannot comprehensively reflect the stability of the link, and the joint modeling of the available bandwidth and the queue depth can reflect the adaptability of the candidate server node to large traffic, and the introduction of the logarithmic function avoids the marginal effect when the available bandwidth is too large. Through the fusion of multiple quality of service indicators, the path quality score can more comprehensively reflect the service capability of the candidate server node, and provide a more reliable decision basis for service scheduling.

[0144] In the above two path quality scoring models, the weight coefficients 、 and can be periodically adjusted by the global coordinator based on historical service processing performance data of the server nodes. In order to improve real-time adaptive capability, machine learning and optimization algorithms can also be introduced. First, using the reinforcement learning (Reinforcement Learning) framework, the client continuously tries different combinations of weight coefficients in the interaction with the network, and uses throughput and transmission delay stability as reward signals to gradually learn the optimal weight distribution. Second, with the help of Bayesian optimization (Bayesian Optimization), the performance optimal solution is quickly converged in the continuous parameter space, thereby avoiding the inefficiency of manual parameter tuning. Finally, for different types of services, the system can realize service-aware parameter configuration: for example, in the low-latency service scenario, the weight value of is increased, and in the high-throughput scenario, the weight value of and the proportion of bandwidth-related indicators are increased, thereby enhancing the adaptability to complex network environments.

[0145] S28, the client determines the target server node according to the path quality score between the client and the candidate server node.

[0146] In specific implementation, when the client determines that the difference between the highest path quality score and other path quality scores meets the anti-oscillation selection condition, the client selects the candidate server node with the highest historical connection success rate as the target server node from the candidate server node corresponding to the highest path quality score and the candidate server node corresponding to other path quality scores.

[0147] Specifically, when the difference between the highest path quality score and other path quality scores meets the following condition, it is determined that the anti-oscillation selection condition is met:

[0148]

[0149] wherein, represents the highest path quality score;

[0150] represents other any path quality score;

[0151] represents a difference threshold, wherein, represents the total number of accesses of the client to the (arbitrary) server nodes, represents the network steady-state cumulative duration, represents the network steady-state reference duration, represents an adjustment constant. The one or more path quality scores of the second highest can be obtained.

[0152] The client can determine whether the network is in a steady state by monitoring the short-term variance of the transmission delay, and accumulate the duration in the steady state to obtain the network steady-state cumulative duration. The network steady-state reference duration is a preset constant, which can be set to 3600 seconds (1 hour) for example, but is not limited to. The adjustment constant k is used to control the overall magnitude of the difference threshold to prevent it from being too large or too small, and its value range can be set according to requirements, such as [1000, 10000], which is not limited by the embodiments of the present application. When the client has rich access experience and the network is long-term stable , the value of the difference threshold will increase, and the allowed path quality score difference range will be wider, and the existing selection will be more inclined to be maintained, reducing unnecessary switching between candidate server nodes with similar scores. When the number of accesses of the client is small or the network is unstable, the value of the difference threshold is small, and the client is more sensitive to the path quality score difference, and is more likely to switch to explore a better path.

[0153] When the oscillation selection condition is met, the client does not directly select the candidate server node with the highest path quality score, but preferentially selects the candidate server node with a higher historical connection success rate, which can better balance the historical access experience and the network steady-state duration, and thus select a better path.

[0154] Considering future trends, in one possible implementation, time series prediction can also be introduced into the mechanism, for example, using an ARIMA (AutoRegressive Integrated Moving Average) model or an LSTM (Long Short-Term Memory network) model to predict the transmission delay and load trends of the candidate server nodes in the future period of time, so as to avoid possible short-term fluctuations in advance. At the same time, the node switching state is modeled based on a Markov chain model, and the transition probability is used to determine whether there is a high-frequency switching risk. At the business level, the anti-oscillation threshold δ is bound with the SLA (Service Level Agreement) requirement, for example, a smaller threshold is used for real-time business to preferentially guarantee the delay, and a larger threshold is used for background batch processing business to reduce switching overhead. Through predictive enhancement and business-aware adjustment, the anti-oscillation mechanism can achieve a better balance between stability and flexibility.

[0155] S29, the client sends a service request to the target server node.

[0156] In specific implementation, the client encapsulates the service request in a data frame carrying a path selection identifier (i.e., the identifier of the target server node) and sends it to the target server node.

[0157] After the client sends the service request to the target server node, it further includes:

[0158] The client detects the current transmission delay between the client and the target server node in real time; if it is determined that the current transmission delay is greater than the delay threshold, then the shunt ratio is determined according to the current transmission delay and the delay threshold; the subsequent service request is shunted to the candidate server node according to the shunt ratio, and the candidate server node is the candidate server node with the highest path quality score among the remaining candidate server nodes; and the link degradation alarm information is sent to the global coordinator.

[0159] In one implementation, the client can determine the delay threshold by the following formula:

[0160]

[0161] wherein, represents the delay threshold;

[0162] is the historical transmission delay mean;

[0163] is the historical transmission delay standard deviation.

[0164] In an implementation, the time delay threshold value can also be preset according to an experience value, which is not limited in the embodiments of the present application.

[0165] The client can calculate the shunting ratio by the following formula:

[0166]

[0167] wherein, represents the shunting ratio;

[0168] represents the shunting sensitive factor;

[0169] represents the current transmission time delay;

[0170] represents the time delay threshold value.

[0171] The shunting sensitive factor is an adjustable parameter greater than 0, which can be set according to actual conditions, and the embodiments of the present application are not limited thereto. is the current transmission time delay exceeding the time delay threshold value, and the shunting sensitive factor is used to control the sensitivity of the shunting ratio to the current transmission time delay exceeding the time delay threshold value. The greater the value of the shunting sensitive factor is, the more sensitive the system is to the deterioration of the time delay, and only a small time delay exceeding amount is needed to make the shunting ratio rapidly rise to a high value, and vice versa. The smaller the value of the shunting sensitive factor is, the less sensitive the system is to the deterioration of the time delay, and even if the time delay exceeding amount is large, the shunting ratio grows slowly. The shunting ratio adopts an exponential growth form, which can ensure that the shunting action responds quickly when the current transmission time delay suddenly increases.

[0172] S210, after the service request processing is completed, the client obtains the service processing performance information of the target server node.

[0173] In specific implementation, after the service request processing is completed, the client obtains the service processing performance information of the target server node, which can include the transmission throughput information, the packet loss rate information and the response delay information of the target server node, etc.

[0174] S211, the client sends the service processing performance information of the target server node to the global coordinator.

[0175] In specific implementation, the client sends the current service processing performance information of the target server node to the global coordinator.

[0176] S212, the global coordinator determines the health degree of the target server node based on the service processing performance information of the target server node, and updates the health degree of the target server node to the node health degree list.

[0177] In specific implementation, the global coordinator can determine the health degree of the target server node based on the current service processing performance information of the target server node. For each service processing performance index, the health degree can be determined by threshold method, or by weighted summation of the ratio of the actual value of each service processing performance index to the normal reference value, to obtain a comprehensive health degree score, which is not limited in the embodiments of the application. The normal reference value of the service processing performance index can be set according to the demand, for example, the difference between the highest value and the lowest value in the normal range of the service processing performance index. Further, the health degree of the target server node is updated to the node health degree list.

[0178] S213, the global coordinator broadcasts the updated node health degree list to the clients in each cluster in the next list update period.

[0179] In specific implementation, the list update period satisfies the following conditions:

[0180]

[0181] Wherein, T represents the list update period;

[0182] represents the network fluctuation frequency;

[0183] represents the number of online clients;

[0184] represents the reference client scale.

[0185] The list update period adopts a logarithmic function form, which can ensure that the list update period grows slowly and controllably with the increase of the client scale.

[0186] In this way, by checking the node health degree list, the clients in each cluster can preferentially select the candidate server node with high health degree when sending the probe packet to the candidate server node, so as to improve the load balancing efficiency.

[0187] When the service request processing is completed, the global coordinator can also update the weight coefficients 、 and based on the service processing performance information of the target server node, and send the updated weight coefficients 、 and Send to the client, the client uses the updated weight coefficient 、 and Update the path quality score model.

[0188] In the embodiments of the present application, the global coordinator is responsible for the probe scheduling and server node health management of the client cluster, assigns the probe time offset and probe frequency compression coefficient to each cluster, and broadcasts the server node health list. The server node health list is generated periodically, and the update period is ensured to achieve balanced global scheduling when the number of clients changes or the network fluctuates.

[0189] In the load balancing method provided by the embodiments of the present application, a lightweight probe packet is generated by the client and sent to the candidate server node. Based on the initiation timestamp of the probe packet, the return reception timestamp of the candidate server node, and the historical transmission delay, the target transmission delay between the client and the candidate server node is determined. According to the real-time load rate returned by the candidate server node and the target transmission delay between the client and the candidate server node, the path quality is evaluated, which can maintain the stability and accuracy of path selection when the network fluctuates or the load of the candidate server node fluctuates, thereby realizing real-time and multi-dimensional perception of the state of the server node by the client. The load balancing decision in the prior art is changed from the centralized decision on the center side to the distributed intelligent decision on the client side, and the decision power of path quality score calculation and target server node selection is decentralized to each client, which forms an efficient distributed decision network. The client can complete probe, path quality score calculation and target server node selection locally in milliseconds, can quickly respond to network fluctuation or server load mutation, and improves the load balancing efficiency. Moreover, the overhead of the lightweight probe packet is extremely low, which avoids new network congestion caused by the introduction of the probe mechanism. The decision of each client is independent and parallel, and the system does not cause pressure when new clients or server nodes are added, and has strong scalability. Moreover, even if the global coordinator is temporarily disabled, each client can still perform effective load balancing based on local probe, guaranteeing the basic service ability of the system and improving the robustness.

[0190] Based on the same inventive concept, the embodiments of the present application also provide a client-side implemented load balancing method. Since the problem solving principle of the above-mentioned client-side implemented load balancing method is similar to that of the above-mentioned load balancing method, the implementation of the above-mentioned client-side implemented load balancing method can be referred to the implementation of the above-mentioned load balancing method, and the repeated parts will not be described herein.

[0191] As shown in Figure 6 , it is a flowchart of the client-side implemented load balancing method provided by the embodiments of the present application, which can include the following steps:

[0192] S61, the client acquires identification information of the candidate server node.

[0193] S62, a probe packet is sent to the candidate server node according to the identification information of the candidate server node, and the probe packet contains initiation time stamp information of the probe packet;

[0194] S63, a response message returned by the candidate server node is received, and the response message carries receiving time stamp and load rate information of the candidate server node.

[0195] S64, target transmission delay between the client and the candidate server node is determined according to the receiving time stamp, the initiation time stamp and the historical transmission delay.

[0196] S65, path quality score between the client and the candidate server node is determined according to the load rate information of the candidate server node and the target transmission delay.

[0197] The path quality score is used to represent the path quality between the client and the candidate server node.

[0198] S66, a target server node is determined according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0199] In an implementation mode, the target transmission delay between the client and the candidate server node is determined according to the receiving time stamp, the initiation time stamp and the historical transmission delay, and specifically includes:

[0200] The transmission delay between the client and the candidate server node this time is determined according to the receiving time stamp and the initiation time stamp.

[0201] A preset number of historical transmission delays before this time are acquired;

[0202] The weight of each historical transmission delay and the weight of the transmission delay this time are acquired;

[0203] The target transmission delay between the client and the candidate server node is obtained by weighted average according to the historical transmission delays and their weights and the transmission delay this time and its weight.

[0204] In an implementation mode, the response message further carries packet loss rate information, available bandwidth information and queue depth information of the candidate server; then

[0205] The path quality score between the client and the candidate server node is determined according to the load rate information of the candidate server node and the target transmission delay, and specifically includes:

[0206] determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node, the target transmission time delay, the packet loss rate information of the candidate server, the available bandwidth information and the queue depth information.

[0207] In an implementation manner, the target server node is determined according to the path quality score between the client and the candidate server node, specifically comprising:

[0208] When the difference between the highest path quality score and other path quality scores meets an anti-oscillation selection condition, the candidate server node with the highest historical connection success rate is selected as the target server node from the candidate server node corresponding to the highest path quality score and the candidate server node corresponding to the other path quality scores.

[0209] In an implementation manner, after the service request is sent to the target server node, the method further comprises:

[0210] detecting a current transmission time delay between the client and the target server node in real time;

[0211] If it is determined that the current transmission time delay is greater than a time delay threshold, a shunt ratio is determined according to the current transmission time delay and the time delay threshold;

[0212] subsequent service requests are shunted to a candidate server node with the highest path quality score among the remaining candidate server nodes according to the shunt ratio, and

[0213] sending link degradation alarm information to a global coordinator.

[0214] In an implementation manner, before the identification information of the candidate server node is obtained, the method further comprises:

[0215] receiving a probe time offset and a probe frequency compression coefficient issued by a global coordinator;

[0216] determining a probe time according to the probe time offset and determining a probe frequency according to the probe frequency compression coefficient; and

[0217] sending a probe packet to the candidate server node according to the identification information of the candidate server node, specifically comprising:

[0218] sending the probe packet to the candidate server node corresponding to the identification of the candidate server node according to the probe time and the probe frequency.

[0219] Based on the same inventive concept, the embodiment of the present application further provides a client-side implemented load balancing device. Since the principle of the client-side implemented load balancing device to solve the problem is similar to the load balancing method, the implementation of the client-side implemented load balancing device can refer to the implementation of the load balancing method, and the repeated parts will not be described herein.

[0220] As shown in Figure 7 FIG. 1 is a structural schematic diagram of a client-side implemented load balancing device provided by the embodiment of the present application, which can include:

[0221] The obtaining module 71 is configured to obtain the identification information of the candidate server node.

[0222] The sending module 72 is configured to send a probe packet to the candidate server node according to the identification information of the candidate server node, wherein the probe packet contains the initiation timestamp information of the probe packet.

[0223] The first receiving module 73 is configured to receive a response message returned by the candidate server node, wherein the response message carries the receiving timestamp and the load rate information of the candidate server node.

[0224] The first determining module 74 is configured to determine the target transmission time delay between the client and the candidate server node according to the receiving timestamp, the initiation timestamp and the historical transmission time delay.

[0225] The second determining module 75 is configured to determine the path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, wherein the path quality score is used to represent the path quality between the client and the candidate server node.

[0226] The third determining module 76 is configured to determine the target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0227] In an implementation manner, the first determining module 74 is specifically configured to determine the current transmission time delay between the client and the candidate server node according to the receiving timestamp and the initiation timestamp; obtain a preset number of historical transmission time delays before the current time; obtain the weight of each historical transmission time delay and the weight of the current transmission time delay; and perform weighted average according to the historical transmission time delays and their weights and the current transmission time delay and its weight, to obtain the target transmission time delay between the client and the candidate server node.

[0228] In an implementation manner, the response message further carries packet loss rate information, available bandwidth information and queue depth information of the candidate server.

[0229] The second determining module 75 is specifically configured to determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node, the target transmission time delay, the packet loss rate information, the available bandwidth information and the queue depth information of the candidate server.

[0230] In an implementation manner, the third determining module 76 is specifically configured to, when a difference between the highest path quality score and other path quality scores meets an anti-oscillation selection condition, select a candidate server node with the highest historical connection success rate from the candidate server node corresponding to the highest path quality score and the candidate server node corresponding to the other path quality scores as the target server node.

[0231] In an implementation manner, the apparatus further includes:

[0232] The detecting module is configured to detect a current transmission time delay between the target server node in real time after sending a service request to the target server node.

[0233] The fourth determining module is configured to, when determining that the current transmission time delay is greater than a time delay threshold, determine a shunting ratio according to the current transmission time delay and the time delay threshold.

[0234] The shunting module is configured to shunt a subsequent service request to a candidate server node with the highest path quality score among remaining candidate server nodes according to the shunting ratio.

[0235] The alarming module is configured to send link degradation alarm information to a global coordinator.

[0236] In an implementation manner, the apparatus further includes:

[0237] The second receiving module is configured to receive a probe time offset and a probe frequency compression coefficient issued by a global coordinator before acquiring identification information of a candidate server node.

[0238] The fifth determining module is configured to determine a probe time according to the probe time offset and determine a probe frequency according to the probe frequency compression coefficient.

[0239] The sending module is specifically configured to send the probe packet to the candidate server node corresponding to the identification of the candidate server node according to the probe time and the probe frequency.

[0240] Based on the same inventive concept, the embodiment of the present application also provides a load balancing method implemented on the side of a global coordinator. Since the principle of solving problems of the above-mentioned load balancing method implemented on the side of the global coordinator is similar to that of the above-mentioned load balancing method, the implementation of the above-mentioned load balancing method implemented on the side of the global coordinator can be referred to the implementation of the above-mentioned load balancing method, and the repeated parts will not be described herein.

[0241] As shown in Figure 8 FIG. 1 is a flowchart of a load balancing method implemented on the side of a global coordinator according to an embodiment of the present application, which can include the following steps:

[0242] S81, the global coordinator receives a probe scheduling request sent by a client, and the probe scheduling request carries service identification information requested.

[0243] S82, a candidate server node providing a corresponding service is determined according to the service identification information.

[0244] S83, the identification information of the candidate server node is sent to the client, so that the client sends a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet contains initiation timestamp information of the probe packet; a response message returned by the candidate server node is received, the response message carries receiving timestamp and load rate information of the candidate server node; target transmission delay between the client and the candidate server node is determined according to the receiving timestamp, the initiation timestamp and the historical transmission delay; path quality score between the client and the candidate server node is determined according to the load rate information of the candidate server node and the target transmission delay, the path quality score is used to represent the path quality between the client and the candidate server node; a target server node is determined according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0245] In an implementation manner, before receiving the probe scheduling request sent by the client, the method further includes:

[0246] all the clients managed are divided into K clusters according to geographical areas, and each cluster is assigned a unique number;

[0247] a disturbance interval is determined based on a basic probe period;

[0248] for each cluster, a random disturbance value is obtained from the disturbance interval;

[0249] a probe time offset corresponding to the cluster is determined according to the number of the cluster, the basic probe period and the random disturbance value;

[0250] the probe time offset corresponding to each cluster is sent to each client in the corresponding cluster.

[0251] In an implementation manner, the method further includes:

[0252] counting the number of clients included in each cluster;

[0253] determining, for each cluster, a corresponding probe frequency compression coefficient of the cluster according to the number of clients included in the cluster and a benchmark cluster size;

[0254] downloading the corresponding probe frequency compression coefficient of each cluster to each client in the corresponding cluster.

[0255] In an implementation manner, the method further includes:

[0256] receiving service processing performance information of a target server node sent by the client, the service processing performance information of the target server node being acquired by the client after completion of the service request processing;

[0257] determining a health degree of the target server node based on the service processing performance information of the target server node;

[0258] updating the health degree of the target server node to a node health degree list;

[0259] broadcasting the updated node health degree list to the clients in each cluster in a next list updating period.

[0260] Based on the same inventive concept, the embodiments of the present application further provide a load balancing device implemented on a global coordinator side. Since the load balancing device implemented on the global coordinator side solves problems in the same principle as the load balancing method, the implementation of the load balancing device implemented on the global coordinator side can be referred to the implementation of the load balancing method, and the repeated parts will not be described herein.

[0261] As shown in Figure 9 FIG. 1, which is a structural schematic diagram of the load balancing device implemented on the global coordinator side provided by the embodiments of the present application, can include:

[0262] a first receiving module 91 configured to receive a probe scheduling request sent by a client, the probe scheduling request carrying requested service identification information;

[0263] a first determining module 92 configured to determine a candidate server node providing a corresponding service according to the service identification information;

[0264] The sending module 93 is configured to send the identification information of the candidate server node to the client, so that the client sends a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing an initiation time stamp information of the probe packet; receive a response message returned by the candidate server node, the response message carrying a receiving time stamp and load rate information of the candidate server node; determine a target transmission time delay between the client and the candidate server node according to the receiving time stamp, the initiation time stamp and a historical transmission time delay; determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent the path quality between the client and the candidate server node; and determine a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node.

[0265] In an implementation manner, the apparatus further includes:

[0266] The dividing module is configured to divide all the clients managed by the server into K clusters according to geographical areas before receiving a probe scheduling request sent by a client, and assign a unique number to each cluster.

[0267] The second determining module is configured to determine a perturbation interval based on a basic probe period.

[0268] The obtaining module is configured to obtain a random perturbation value from the perturbation interval for each cluster.

[0269] The third determining module is configured to determine a probe time offset corresponding to the cluster according to the number of the cluster, the basic probe period and the random perturbation value.

[0270] The first issuing module is configured to issue the probe time offset corresponding to each cluster to each client in the corresponding cluster.

[0271] In an implementation manner, the method further includes:

[0272] The counting module is configured to count the number of clients included in each cluster.

[0273] The fourth determining module is configured to determine a probe frequency compression coefficient corresponding to each cluster according to the number of clients included in the cluster and a reference cluster size for each cluster.

[0274] The second issuing module is configured to issue the probe frequency compression coefficient corresponding to each cluster to each client in the corresponding cluster.

[0275] In one implementation, the apparatus further includes:

[0276] The second receiving module is used to receive the service processing performance information of the target server node sent by the client. The service processing performance information of the target server node is obtained by the client after the service request is processed.

[0277] The fifth determining module is used to determine the health of the target server node based on the service processing performance information of the target server node;

[0278] The update module is used to update the health status of the target server node to the node health status list;

[0279] The broadcast module is used to broadcast the updated node health list to clients in each cluster during the next list update cycle.

[0280] Based on the same technical concept, this application also provides an electronic device 1000, referring to... Figure 10 As shown, the electronic device 1000 is used to implement the load balancing method described in the above-described method embodiments. The electronic device 1000 in this embodiment may include: a memory 1001, a processor 1002, and a computer program, such as a load balancing program, stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the various load balancing method embodiments described above.

[0281] This application embodiment does not limit the specific connection medium between the memory 1001 and the processor 1002. This application embodiment... Figure 10 The memory 1001 and the processor 1002 are connected via a bus 1003, and the bus 1003 is in Figure 10 The connections between other components are shown in bold and are for illustrative purposes only, not as limiting information. The bus 1003 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 10 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0282] The memory 1001 can be a volatile memory (volatile memory), such as a random access memory (random-access memory, RAM); the memory 1001 can also be a non-volatile memory (non-volatile memory), such as a read-only memory, a flash memory, a hard disk drive (hard disk drive, HDD) or a solid-state drive (solid-state drive, SSD), or the memory 1001 is any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but not limited to this. The memory 1001 can be a combination of the above-mentioned memories.

[0283] The processor 1002 is configured to implement a load balancing method provided by the embodiments of the present application.

[0284] The embodiments of the present application also provide a computer readable storage medium storing computer executable instructions required for the processor to execute the above-mentioned processor.

[0285] In some possible implementation manners, various aspects of the load balancing method provided by the present application can also be implemented in the form of a program product, which includes program codes for causing an electronic device to perform the steps in the load balancing method according to various exemplary embodiments of the present application described above in the specification when the program product is run on the electronic device.

[0286] Those skilled in the art should understand that the embodiments of the present application can be provided in the form of a method, device, or computer program product. Therefore, the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0287] The present application is described with reference to flowcharts and / or block diagrams according to the method, device (apparatus) and computer program product of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing apparatus to produce a machine, so that the instructions executed by the computer or other programmable data processing apparatus produce a device for implementing the functions described in the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.

[0288] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flowchart or multiple flows and / or blocks. Figure 1 one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.

[0289] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flowchart or multiple flows and / or blocks. Figure 1 one or more processes and / or blocks Figure 1 an apparatus for performing the functions specified in the flowchart or multiple flows and / or blocks.

[0290] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the embodiments by those skilled in the art once they learn of the basic inventive concepts. Therefore, the appended claims are intended to cover all such variations and modifications as fall within the scope of the application.

[0291] Obviously, numerous modifications and variations of the present application are possible in light of the above teachings. It is therefore to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A load balancing method, characterized by, The method applied to a client, comprising: obtaining identification information of a candidate server node, the candidate server node being determined by a global coordinator according to service identification information of a request after receiving a probe scheduling request sent by the client; sending a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing initiation timestamp information of the probe packet; receiving a response message returned by the candidate server node, the response message carrying a receiving timestamp and load rate information of the candidate server node; determining a target transmission time delay between the client and the candidate server node according to the receiving timestamp, the initiation timestamp and a historical transmission time delay; determining a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent path quality between the client and the candidate server node; determining a target server node according to the path quality score between the client and the candidate server node, to send a service request to the target server node; before obtaining the identification information of the candidate server node, further comprising: receiving a probe time offset and a probe frequency compression coefficient issued by the global coordinator; determining a probe time according to the probe time offset and determining a probe frequency according to the probe frequency compression coefficient; and sending the probe packet to the candidate server node according to the identification information of the candidate server node, specifically comprising: sending the probe packet to the candidate server node corresponding to the identification of the candidate server node according to the probe time and the probe frequency; wherein the probe time offset is determined by the global coordinator in the following manner: dividing all clients managed by the global coordinator into K clusters according to geographical regions, and assigning a unique number to each cluster; determining a perturbation interval based on a basic probe period; for each cluster, obtaining a random perturbation value from the perturbation interval; determining the probe time offset corresponding to the cluster according to the number of the cluster, the basic probe period and the random perturbation value; the probe frequency compression coefficient is determined by the global coordinator in the following manner: counting the number of clients included in each cluster; for each cluster, determining the probe frequency compression coefficient corresponding to the cluster according to the number of clients included in the cluster and a reference cluster size.

2. The method of claim 1, wherein, determining the target transmission time delay between the client and the candidate server node according to the receiving timestamp, the initiation timestamp and a historical transmission time delay, specifically comprising: determining a transmission time delay between the client and the candidate server node this time according to the receiving timestamp and the initiation timestamp; obtaining a preset number of historical transmission time delays before this time; obtaining weights of the historical transmission time delays and a weight of the transmission time delay this time; According to the historical transmission time delays and the weights thereof and the current transmission time delay and the weight thereof, weighted average is performed to obtain a target transmission time delay between the client and the candidate server node.

3. The method of claim 1, wherein, The response message further carries packet loss rate information, available bandwidth information and queue depth information of the candidate server. According to the load rate information of the candidate server node, the target transmission time delay, the packet loss rate information, the available bandwidth information and the queue depth information of the candidate server, a path quality score between the client and the candidate server node is determined. According to the load rate information of the candidate server node, the target transmission time delay, the packet loss rate information, the available bandwidth information and the queue depth information of the candidate server, a path quality score between the client and the candidate server node is determined.

4. The method of claim 1, wherein, According to the path quality score between the client and the candidate server node, a target server node is determined, specifically including: When the difference between the highest path quality score and other path quality scores meets an anti-oscillation selection condition, a candidate server node with the highest historical connection success rate is selected as the target server node from the candidate server node corresponding to the highest path quality score and the candidate server nodes corresponding to the other path quality scores.

5. The method of claim 1, wherein, After sending a service request to the target server node, further including: Real-time detection of a current transmission time delay between the target server node and the client; If it is determined that the current transmission time delay is greater than a time delay threshold, a shunt ratio is determined according to the current transmission time delay and the time delay threshold; Subsequent service requests are shunted to a candidate server node with the highest path quality score among the remaining candidate server nodes according to the shunt ratio; and Link degradation alarm information is sent to a global coordinator.

6. A load balancing method characterized by, The method applied to a global coordinator, including: Receiving a probe scheduling request sent by a client, the probe scheduling request carrying requested service identification information; Determining a candidate server node providing a corresponding service according to the service identification information; Sending identification information of the candidate server node to the client, so that the client sends a probe packet to the candidate server node according to the identification information of the candidate server node, the probe packet containing an initiation time stamp information of the probe packet; receiving a response message returned by the candidate server node, the response message carrying a receiving time stamp and load rate information of the candidate server node; determining a target transmission time delay between the client and the candidate server node according to the receiving time stamp, the initiation time stamp and a historical transmission time delay; determining a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, the path quality score being used to represent a path quality between the client and the candidate server node; determining a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node; Before receiving the probe scheduling request sent by the client, further comprising: Dividing all managed clients into K clusters according to geographical areas, and assigning a unique number to each cluster; Determining a perturbation interval based on the basic probe period; For each cluster, obtaining a random perturbation value from the perturbation interval; Determining the probe time offset corresponding to the cluster according to the number of the cluster, the basic probe period and the random perturbation value; Downlinking the probe time offset corresponding to each cluster to each client in the corresponding cluster; The method further comprises: Counting the number of clients included in each cluster; For each cluster, determining the probe frequency compression coefficient corresponding to the cluster according to the number of clients included in the cluster and the reference cluster size; Downlinking the probe frequency compression coefficient corresponding to each cluster to each client in the corresponding cluster. Further comprising:

7. The method of claim 6, wherein, Receiving the service processing performance information of the target server node sent by the client, wherein the service processing performance information of the target server node is obtained by the client after the service request processing is completed; Determining the health degree of the target server node based on the service processing performance information of the target server node; Updating the health degree of the target server node to the node health degree list; Broadcasting the updated node health degree list to the clients in each cluster in the next list update period. Applied to the client, the device comprises:

8. A load balancing apparatus, characterized by, An obtaining module for obtaining identification information of a candidate server node, wherein the candidate server node is a server node providing corresponding services determined by a global coordinator according to the service identification information of the request after receiving the probe scheduling request sent by the client; A sending module for sending a probe packet to the candidate server node according to the identification information of the candidate server node, wherein the probe packet contains initiation timestamp information of the probe packet; A first receiving module for receiving a response message returned by the candidate server node, wherein the response message carries reception timestamp and load rate information of the candidate server node; A first determining module for determining target transmission time delay between the client and the candidate server node according to the reception timestamp, the initiation timestamp and historical transmission time delay; A second determining module for determining path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, wherein the path quality score is used to represent the path quality between the client and the candidate server node; A third determining module for determining a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node; The device further comprises: A second receiving module for receiving the probe time offset and the probe frequency compression coefficient downlinked by the global coordinator before obtaining the identification information of the candidate server node; A fifth determining module for determining the probe time according to the probe time offset and determining the probe frequency according to the probe frequency compression coefficient; and ​ The sending module is specifically configured to send the probe packet to the candidate server node corresponding to the identifier of the candidate server node according to the probe time and the probe frequency. The probe time offset is determined by the global coordinator in the following manner: all managed clients are divided into K clusters according to geographical regions, and each cluster is assigned a unique number; a disturbance interval is determined based on a basic probe period; for each cluster, a random disturbance value is obtained from the disturbance interval; and a probe time offset corresponding to the cluster is determined according to the number of the cluster, the basic probe period and the random disturbance value. The probe frequency compression coefficient is determined by the global coordinator in the following manner: the number of clients included in each cluster is counted; for each cluster, a probe frequency compression coefficient corresponding to the cluster is determined according to the number of clients included in the cluster and a reference cluster size.

9. A load balancing apparatus, characterized by, The device is applied to a global coordinator and includes: The first receiving module is configured to receive a probe scheduling request sent by a client, wherein the probe scheduling request carries requested service identifier information. The first determining module is configured to determine a candidate server node providing a corresponding service according to the service identifier information. The sending module is configured to send identifier information of the candidate server node to the client, so that the client sends a probe packet to the candidate server node according to the identifier information of the candidate server node, the probe packet includes an initiation timestamp of the probe packet; receive a response message returned by the candidate server node, wherein the response message carries a reception timestamp and load rate information of the candidate server node; determine a target transmission time delay between the client and the candidate server node according to the reception timestamp, the initiation timestamp and a historical transmission time delay; determine a path quality score between the client and the candidate server node according to the load rate information of the candidate server node and the target transmission time delay, wherein the path quality score is used to represent a path quality between the client and the candidate server node; and determine a target server node according to the path quality score between the client and the candidate server node, so as to send a service request to the target server node. The device further includes: The division module is configured to divide all managed clients into K clusters according to geographical regions and assign a unique number to each cluster before receiving a probe scheduling request sent by a client. The second determining module is configured to determine a disturbance interval based on a basic probe period. The acquisition module is configured to obtain a random disturbance value from the disturbance interval for each cluster. The third determining module is configured to determine a probe time offset corresponding to the cluster according to the number of the cluster, the basic probe period and the random disturbance value. The first delivery module is configured to deliver the probe time offset corresponding to each cluster to each client in the corresponding cluster. The device further includes: The counting module is configured to count the number of clients included in each cluster. A fourth determining module, configured to determine, for each cluster, a corresponding probe frequency compression coefficient of the cluster according to a number of clients contained in the cluster and a benchmark cluster size; A second delivering module, configured to deliver the corresponding probe frequency compression coefficient of each cluster to each client in the corresponding cluster.

10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the load balancing method of any one of claims 1-7 when executing the program.

11. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the steps in the load balancing method of any one of claims 1-7. The program is executed by the processor to implement the steps in the load balancing method of any one of claims 1-7.

Citation Information

Patent Citations

  • Business server side load balancing method, client side, server side and system

    CN104079630A

  • Micro-service dynamic adaptive client load balancing method and system

    CN117155942A