WO2023050901A1 - Procédé et appareil d'équilibrage de charge, dispositif, support de stockage informatique et programme - Google Patents

Procédé et appareil d'équilibrage de charge, dispositif, support de stockage informatique et programme Download PDF

Info

Publication number
WO2023050901A1
WO2023050901A1 PCT/CN2022/099587 CN2022099587W WO2023050901A1 WO 2023050901 A1 WO2023050901 A1 WO 2023050901A1 CN 2022099587 W CN2022099587 W CN 2022099587W WO 2023050901 A1 WO2023050901 A1 WO 2023050901A1
Authority
WO
WIPO (PCT)
Prior art keywords
server
client
load
target
load value
Prior art date
Application number
PCT/CN2022/099587
Other languages
English (en)
Chinese (zh)
Inventor
杨利国
欧阳宇腾
邱路达
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023050901A1 publication Critical patent/WO2023050901A1/fr

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Definitions

  • the present application relates to the technical field of cloud computing of financial technology (Fintech), involving but not limited to a load balancing method, device, electronic equipment, computer storage medium and computer program product.
  • the present application provides a load balancing method, device, electronic equipment, computer storage medium, and computer program product, which can solve the problem of server overload in the related art when transmitting messages based on TCP long connections.
  • An embodiment of the present application provides a load balancing method, the method comprising:
  • the server list includes at least two servers
  • each client After determining that each client establishes a TCP long connection with each server in the corresponding server list, reacquire the load value of each server in the current network; according to the reacquired load value of each server, determine whether The target server that satisfies the set load balancing conditions;
  • Target client is one of the multiple clients.
  • the searching for a target client connected to the target server includes:
  • the target server According to the amount of messages sent by each of the at least two clients to the target server, from among the at least two clients, determine the client that sends the smallest amount of messages as the target client, or , determining any client whose message volume is less than or equal to the first set threshold as the target client.
  • the target server is a server that does not meet the set load balancing conditions in the current network, it is necessary to adjust the load value of the target server to achieve a balanced state;
  • the amount of messages sent by each client is determined, therefore, based on the amount of messages sent by each client to the target server, the target client can be determined in a targeted manner; in addition, from each client connected to the target server , select the client with the smallest amount of messages sent or less than a certain threshold as the target client, which can effectively prevent the jitter problem during the subsequent load adjustment of the target server and ensure the stability of the system.
  • the determining the target server that does not meet the set load balancing condition according to the load value of each server obtained again includes:
  • the server with the highest load value and the server with the lowest load value are obtained; when it is determined that the load difference between the server with the highest load value and the server with the lowest load value is greater than a second set threshold, The server with the highest load value is determined as the target server that does not meet the set load balancing condition; or,
  • the adjusting the server list of the target client includes:
  • the server with the highest load value in the server list of the target client is removed, and a server with the lowest current load value is added to the server list of the target client.
  • the method also includes:
  • the load determination parameters include the number of connections of the server, the server's last statistics At least one of the periodic processing message volume and the last time the server was assigned to the client;
  • the acquisition of the load value of each server in the current network includes:
  • the load value of each server in the current network is determined according to the load determination parameters reported by each server in the current network.
  • the load determination parameters when the load determination parameters include the number of connections of the server, the amount of messages processed by the server in the last statistical period, and the time when the server was allocated to the client last time, the load determination parameters further include connection The weight value of the number, the weight value of the processing message volume, and the weight value of the time parameter;
  • the determining the load value of each server in the current network according to the load determination parameters reported by each server in the current network includes:
  • the time parameter weight value determines the load value of each server in the current network.
  • the load value of each server in the current network can be obtained more accurately.
  • the method also includes:
  • Whether to continue to adjust the server list in the current statistical period is determined according to the relationship between the adjusted session ratio and the fourth set threshold.
  • the number of adjustments to the server list in the current statistical cycle is controlled by adjusting the session ratio of the current statistical cycle, which can prevent the problem of poor system stability caused by large-scale server connection adjustments.
  • the determining whether to continue adjusting the server list in the current statistical period according to the size relationship between the adjusted session ratio and the fourth set threshold includes:
  • the number of adjustments to the server list in the current statistical cycle is controlled, so as to achieve load balancing in the current statistical cycle and ensure that the system stability.
  • the embodiment of the present application also proposes a load balancing device, the device includes a first determination module, a second determination module and an adjustment module, wherein,
  • the first determining module is configured to obtain the load value of each server in the current network after receiving the connection request sent by each client in the plurality of clients; determine the load value of each server according to the load value of each server A server list of the client, sending a corresponding server list to each client; the server list includes at least two servers;
  • the second determination module is configured to reacquire the load value of each server in the current network after determining that each client establishes a TCP long connection with each server in the corresponding server list;
  • the load value of the server determines the target server that does not meet the set load balancing conditions;
  • An adjustment module configured to search for a target client connected to the target server, and adjust the server list of the target client; the target client is one of the plurality of clients.
  • An embodiment of the present application provides an electronic device, the device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements one or more of the aforementioned technologies when executing the program The load balancing method provided by the solution.
  • An embodiment of the present application provides a computer storage medium, where the computer storage medium stores a computer program; after the computer program is executed, the load balancing method provided by the foregoing one or more technical solutions can be implemented.
  • the embodiment of the present application also provides a computer program product, including computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes to implement the aforementioned one or more The load balancing method provided by the technical solution.
  • the embodiment of the present application proposes a load balancing method, device, electronic equipment, computer storage medium and computer program product.
  • the method includes: after receiving a connection request sent by each client among multiple clients, obtaining the current network The load value of each server; according to the load value of each server, determine the server list of each client, and send the corresponding server list to each client; the server list includes at least two server; after determining that each client establishes a TCP long connection with each server in the corresponding server list, reacquire the load value of each server in the current network; according to the reacquired load value of each server , determine the target server that does not meet the set load balancing conditions; find the target client connected to the target server, adjust the server list of the target client; the target client is one of the multiple clients end.
  • the list of servers that each client is allowed to connect can be determined; that is, the client can be connected to To multiple servers with lower load values, so that the client's business volume can be sent to different servers for processing in a more balanced manner.
  • the client after the client establishes a connection with the server, if it is found that the target server does not meet the set load balancing conditions, then adjust the server list of the target client connected to the target server to achieve the purpose of controlling the overall load of the entire server cluster, Maintain the dynamic balance of the load value of each server to effectively solve the problem of server overload.
  • FIG. 1a is a schematic structural diagram of a load balancing in the related art
  • FIG. 1b is a schematic structural diagram of another load balancing in the related art
  • FIG. 2a is a schematic flow diagram of a load balancing method in an embodiment of the present application.
  • FIG. 2b is a schematic structural diagram of a load balancing adjustment in an embodiment of the present application.
  • FIG. 2c is a schematic flow diagram of another load balancing method according to an embodiment of the present application.
  • FIG. 2d is a schematic structural diagram of another load balancing adjustment in the embodiment of the present application.
  • FIG. 3 is a schematic diagram of the composition and structure of a load balancing device according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion, so that a method or device comprising a series of elements not only includes the explicitly stated elements, but also include other elements not explicitly listed, or also include elements inherent in implementing the method or apparatus.
  • an element defined by the phrase “comprising a " does not exclude the presence of additional related elements (such as steps in the method or A unit in an apparatus, for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
  • the load balancing method provided in the embodiment of the present application includes a series of steps, but the load balancing method provided in the embodiment of the present application is not limited to the steps described.
  • the load balancing device provided in the embodiment of the present application includes a A series of modules, but the load balancing device provided by the embodiment of the present application is not limited to include the explicitly recorded modules, and may also include modules that need to be set up to obtain relevant task data or process based on task data.
  • the embodiments of the present application can be applied to a computer system composed of servers, and can operate together with many other general-purpose or special-purpose computing system environments or configurations.
  • the server may be a distributed cloud computing technology environment including a small computer system, a large computer system, and so on.
  • program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computing system storage media including storage devices.
  • TCP-based connections include long connections and short connections.
  • TCP long connections will be used to ensure low system throughput and delay.
  • the reverse proxy server may also have problems with the capacity of the network card or the upper limit of the number of connections.
  • the load balancing method can be realized by using a processor in the load balancing device, and the processor can be an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (Digital Signal Processor, DSP), digital signal processing device (Digital Signal Processing Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable logic gate array (Field Programmable Gate Array, FPGA), central processing unit (Central Processing Unit , CPU), controller, microcontroller, microprocessor at least one.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSP digital signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable logic device
  • FPGA field programmable logic gate array
  • CPU Central Processing Unit
  • controller microcontroller, microprocessor at least one.
  • FIG. 2a is a schematic flow diagram of a load balancing method in the embodiment of the present application, as shown in Figure 2a, the method includes the following steps:
  • Step 200 After receiving the connection request sent by each of the multiple clients, obtain the load value of each server in the current network; determine the server list of each client according to the load value of each server, and send each The client sends a corresponding server list; the server list includes at least two servers.
  • the client is used to access specific business data and forward the business data to the back-end server for subsequent further processing;
  • the server belongs to the back-end processing module and is used to process the business data forwarded by the client .
  • the load balancing method is a method of balancing the load value of each server in the current network when the client establishes a TCP long connection with the server; Before each client establishes a TCP long connection with the server, the client does not know which servers are available in the current network; therefore, when each client needs to send business data to the server, it needs to first send a connection request to the scheduling module. In this way, The scheduling module can then receive the connection request sent by each client in the multiple clients.
  • the scheduling module by introducing the scheduling module, the complexity of connection management between each client and the server can be reduced; the scheduling module will be described in detail in conjunction with FIG. 2b below.
  • FIG. 2b is a schematic structural diagram of a load balancing adjustment in the embodiment of the present application, as shown in Figure 2b, the structural diagram includes: client 1, client 2, server 1 to server n, and a scheduling module; wherein, the scheduling module One end of the scheduling module is connected to client 1 and client 2 respectively, and is responsible for receiving the connection requests sent by these two clients; the other end of the scheduling module is respectively connected to n servers in the current network to collect The data related to its own load reported by the server; client 1 is connected to server 1 and server 2, and client 2 is connected to server 2 and server 3; that is, the client can connect to multiple servers at the same time.
  • the embodiment of the present application does not need to introduce a reverse proxy server, but each client directly connects to the corresponding server, That is, there is no need to connect to each server through the reverse proxy server, so it can solve the problem of high difficulty in implementing load balancing due to the upper limit of the network card capacity or connection number of the reverse proxy server in the related technology; in addition, the embodiment of the present application allows The client connects to multiple server nodes at the same time; in this way, when one of the servers is abnormal, the client can continue to process business through other server nodes, that is, it will not affect the business during the disconnection between the client and the abnormal server, ensuring the server's High availability; further, when a server is offline, upgraded, restarted, etc. changes or abnormalities occur, the expansion of the server can also be quickly completed in the embodiment of the application, which can solve the problem of related technologies due to the limited processing capacity of the reverse proxy server.
  • the client connects to multiple server nodes at the same time; in this way, when one of the servers is abnormal, the
  • the above method may further include: before the scheduling module receives the connection request sent by each client among the plurality of clients, receiving load determination parameters reported by each server in the current network.
  • the load determination parameter may include at least one of the number of connections of the server, the amount of messages processed by the server in the last statistical period, and the last time the server was assigned to the client; The number of connections between the server and the client during the statistical period.
  • the statistical cycle and timing time can be preset in the server, so that the server can count the load determination parameters in each statistical cycle, and when the timing time arrives, the load determination parameters in the last statistical cycle closest to the timing time The load determination parameters are reported to the scheduling module.
  • obtaining the load value of each server in the current network may include: the scheduling module determines the load value of each server in the current network in each statistical period according to the load determination parameters reported by each server in the current network.
  • the load determination parameters when the load determination parameters include the number of connections of the server, the amount of messages processed by the server in the last statistical period, and the time when the server was allocated to the client last time, the load determination parameters also include the weight value of the number of connections, Process message volume weight value and time parameter weight value.
  • the weight value of the number of connections, the weight value of the processed message volume, and the weight value of the time parameter may be set according to actual scenarios, which are not limited in this embodiment of the present application.
  • determining the load value of each server in the current network may include: according to the number of connections of the server reported by each server in the current network and the weight value of the connection number, The amount of messages processed by the server in the last statistical cycle and the weight value of the amount of processed messages, the time when the server was assigned to the client last time and the weight value of time parameters determine the load value of each server in the current network.
  • the scheduling module after the scheduling module receives the load determination parameters regularly reported by each server in the current network, it can obtain the load value Lr of each server in the last statistical period according to the server load evaluation formula (1).
  • Abs represents the calculated absolute value
  • C represents the number of server connections
  • Min(C) represents the connection number with the smallest value among the connections of all servers in the current network
  • ⁇ C represents the tolerance value of the number of server connections. If the difference in the number of connections is less than this value, it can be considered that the number of connections on the server is balanced
  • WC indicates the weight of the number of connections in the server load evaluation formula, corresponding to the weight of the number of connections above.
  • M represents the amount of messages processed by the server in the last statistical cycle
  • Min(M) represents the amount of messages processed with the least amount of messages among all servers in the last statistical cycle
  • ⁇ M represents the tolerance value of the amount of messages processed.
  • WM indicates the weight value of the processed message volume in the server load evaluation formula, which corresponds to the above weight value of the processed message volume.
  • the embodiment of the present application does not limit the values of the above parameters included in the formula (1), and may be set according to actual scenarios. It can be seen that when the server has more connections, the server load value is higher; when the server processes more messages, the server load value is higher; when the server was assigned to the client last time, the closer to the current time , the higher the server load value.
  • the scheduling module can determine the number of servers that each client is allowed to connect to according to the importance of each client's business or the business volume , denoted as cn; here, when the importance of a certain client’s business or business volume is high, the client can be allowed to connect to a larger number of servers; when the importance of a certain client’s business or business volume is low , the client can be allowed to access a smaller number of servers.
  • the scheduling module before the scheduling module receives the connection request sent by each of the multiple clients, it can obtain the load value of each server in the last statistical period according to the formula (1); for example, According to the load value of each server, the implementation manner of determining the server list of each client may be: the scheduling module selects cn servers with lower load values as the server list of each client according to the load value of each server;
  • the server list of each client includes at least two servers, so that when the connection between the client and one of the servers is abnormal, the high availability of the service can still be guaranteed.
  • the server list may include multiple servers, but not all servers in the current network. In this way, the problem of too high connection number of each server caused by connecting all servers can be effectively avoided.
  • the scheduling module obtains the server list of each client, it sends the corresponding server list to each client; in this way, each client can establish a TCP long connection with each server in the corresponding server list.
  • Step 201 After determining that each client establishes a TCP long connection with each server in the corresponding server list, reacquire the load value of each server in the current network; according to the reacquired load value of each server, determine that the Set the target server for load balancing conditions.
  • each client after determining that each client establishes a TCP long connection with each server in the corresponding server list, each client will poll and send business data to each server that has established a TCP long connection; the following uses a
  • the client and two servers are taken as an example for description.
  • the load determination parameters include the amount of processing messages corresponding to the server connection session, the amount of processing messages corresponding to this server, the number of connections to this server, and the time when this server is assigned to client 1; then when the timing time arrives, Server 1 reports the above-mentioned load determination data to the scheduling module; in this way, the scheduling module can reacquire the load value of server 1 according to the formula (1); here, the acquisition process of server 2 load value is similar to the above-mentioned acquisition process, which is not mentioned here. Let me repeat. In this way, the scheduling module can reacquire the load value of each server in the current network.
  • determining the target server that does not meet the set load balancing condition may include: sorting the load value of each server obtained again to obtain the sorting result; Sort the results to determine the target servers that do not meet the set load balancing conditions.
  • the reacquired load value of each server it can be sorted according to the order of the load value from high to low to obtain the sorting result; then, according to the sorting result, determine the target server that does not meet the set load balancing condition .
  • an implementation manner of determining a target server that does not meet the set load balancing condition according to the sorting result may be: from the sorting result, obtain the server with the highest load value and the server with the lowest load value; When the load difference between the server with the highest load value and the server with the lowest load value is greater than the second set threshold, the server with the highest load value is determined as the target server that does not satisfy the set load balancing condition.
  • the server with the highest load value and the server with the lowest load value from the sorting results, first calculate the load difference between the server with the highest load value and the server with the lowest load value; If it is determined according to the comparison result that the load difference is greater than the second set threshold, it means that there are target servers that do not meet the set load balancing conditions, and the server with the highest load value is determined to be unsatisfied.
  • Set the target server for load balancing conditions on the contrary, if it is determined according to the comparison result that the load difference is less than or equal to the second set threshold, it means that there is no target server that does not meet the set load balancing conditions at this time, that is, the currently established All servers with TCP persistent connections meet the load balancing conditions.
  • another implementation manner of determining a target server that does not meet the set load balancing condition according to the sorting result may be: determining any server whose load value is greater than the third set threshold in the sorting result as not meeting Set the target server for load balancing conditions.
  • server 1 can be determined as not meeting the set load
  • the target server of the load balancing condition may also determine the server 2 as the target server that does not meet the set load balancing condition.
  • the load values in the sorting results are all less than or equal to the third set threshold, it means that there is no target server that does not meet the set load balancing conditions at this time, that is, all servers currently establishing TCP long connections meet the load Equilibrium conditions.
  • the values of the second set threshold and the third set threshold may be determined according to actual conditions, which is not limited in this embodiment of the present application.
  • Step 202 Search for a target client connected to the target server, and adjust the server list of the target client; the target client is one of the multiple clients.
  • the target server that does not meet the set load balancing conditions is obtained according to the above step 201, all clients that have established TCP long connections with the target server are obtained, and the server list that needs to be adjusted is searched from these clients.
  • the target client; here, adjusting the server list represents a load balancing adjustment.
  • searching for a target client connected to the target server may include: acquiring at least two clients that establish a TCP long connection with the target server; The message volume, from at least two clients, determines the target client.
  • the scheduling module may determine the target client from multiple clients establishing TCP connections with the target server according to the amount of messages sent by each client to the target server.
  • the target server is a server that does not meet the set load balancing conditions in the current network, it is necessary to adjust the load value of the target server to achieve a balanced state;
  • the amount of messages sent by each client is determined. Therefore, based on the amount of messages sent by each client to the target server, the target client can be determined in a targeted manner.
  • determining the target client from the at least two clients according to the amount of messages sent from each of the at least two clients to the target server may include: according to each of the at least two clients The amount of messages sent by the client to the target server. From at least two clients, the client with the smallest amount of messages sent is determined as the target client, or any client whose amount of messages sent is less than or equal to the first set threshold determined as the target client.
  • the client that sends the smallest amount of messages or less than a certain threshold is selected as the target client, which can effectively prevent the subsequent load on the target server
  • the jitter problem during adjustment ensures the stability of the system.
  • the implementation manner of determining the target client may also be: from all clients establishing connection sessions with the target server, find out the client with the smallest connection session load, and determine the client as the target client; here , the connection session load Las of each client that establishes a connection session with the target server can be determined by formula (2).
  • WAT means the weight value of the time parameter in the client connection session load evaluation formula
  • t means the time when the client connects to the target server
  • t1 means the time of the client's last session adjustment, that is, the last time the client connected
  • MC indicates the amount of messages that need to be processed by this connection session in the latest statistical period, that is, the amount of messages sent by the client to the target server that needs to be processed by the target server.
  • the embodiment of the present application does not limit the values of the above parameters included in the formula (2), and may be set according to actual scenarios. It can be seen from formula (2) that if the number of messages processed by the target server is more, the connection session load of the corresponding client is higher, and if the time from the latest session adjustment is closer, the connection session load of the corresponding client is higher.
  • connection session load of each client that establishes a connection session with the target server is obtained according to formula (2), the client with the smallest connection session load is determined as the target client, or the connection session load is less than or equal to the set The client with the given value is identified as the target client.
  • the server list of the target client is obtained, and the server list is adjusted to realize load balancing among the servers.
  • adjusting the server list of the target client may include: removing the server with the highest load value from the server list of the target client, and adding a server with the lowest load value to the server list of the target client.
  • the server with the highest load value in the server list is removed, that is, the target server in the server list is removed, and a new one with the lowest current load value is added. server.
  • the target server is a server with a high load value in the current network, and its data processing capability is low. If it is not removed, but continues to process the business data sent by the target client, it is very likely that the target server will crash due to overload. In this case, the processing capacity of the entire server cluster is affected; in the embodiment of this application, by adjusting the connection between the target client and the target server to the connection between the target client and the server with the lowest current load value, the target server no longer processes the target client In this way, the overload problem of the target server can be effectively solved, and the possibility of the target server crashing due to overload can be reduced; in addition, since the connection session load between the target client and the target server is minimal, this adjustment method can also Effectively prevent the vibration problem during the adjustment process and ensure the stability of the system.
  • the above method may further include: adding 1 to the number of adjustments each time the server list is adjusted within the current statistical period; calculating the total number of adjustments to the server list within the current statistical period According to the ratio of the total number of connections of each server, the adjusted session proportion of the current statistical period is obtained; according to the relationship between the adjusted session proportion and the fourth threshold value, it is determined whether to continue to adjust the server list in the current statistical period.
  • the number of adjustments to the server list in the current statistical period is controlled by adjusting the session ratio of the current statistical period, which can prevent the problem of poor system stability caused by large-scale server connection adjustments.
  • every time the adjustment of the server list is completed means that every time the load balancing adjustment is completed; here, in the current statistical period, every time the adjustment of the server list is completed, the adjustment number is incremented by 1; Exemplarily, the current The total number of adjustments to the server list in the statistical period is recorded as AT, and the total number of connections to each server in the current network is recorded as CT, so the proportion of adjusted sessions in the current statistical period is AT/CT. Next, it is determined whether to continue to adjust the server list in the current statistical period according to the relationship between the adjusted session proportion and the fourth set threshold.
  • determining whether to continue adjusting the server list in the current statistical period may include: determining that the adjusted session ratio is greater than or equal to the fourth set threshold , wait for the end of the current statistical period; when it is determined that the proportion of adjusted sessions is less than the fourth set threshold and it is determined that there are target servers that do not meet the set load balancing conditions, continue to adjust the server list in the current statistical period.
  • the value of the adjusted session ratio AT/CT is greater than or equal to the fourth set threshold, wait for the end of the current statistical period; that is, no load balancing adjustment is performed in this message statistical period to prevent the system from appearing in a large area. Connection flapping.
  • the value of the adjusted session ratio AT/CT is less than the fourth set threshold, then evaluate again whether the load among the servers in the current network is balanced, that is, determine whether there is a server that does not meet the set load balancing conditions. If the target server is unbalanced, if it is, continue to the next round of adjustment until the entire system achieves load balance again; otherwise, it means that the current statistical cycle has achieved load balance.
  • the value of the fourth set threshold is not limited, and can be set according to the actual scene.
  • the number of adjustments to the server list in the current statistical cycle is controlled, so as to achieve load balancing in the current statistical cycle and ensure that the system stability.
  • the embodiment of the present application proposes a load balancing method, device, electronic equipment, computer storage medium and computer program product.
  • the method includes: after receiving a connection request sent by each client among multiple clients, obtaining The load value of each server; according to the load value of each server, determine the server list of each client, and send the corresponding server list to each client; the server list includes at least two servers; after determining each client After establishing a TCP long connection with each server in the corresponding server list, reacquire the load value of each server in the current network; according to the reacquired load value of each server, determine the target server that does not meet the set load balancing conditions; Find the target client connected to the target server, and adjust the server list of the target client; the target client is one of the multiple clients.
  • the list of servers that each client is allowed to connect can be determined; that is, the client can be connected to To multiple servers with lower load values, so that the client's business volume can be sent to different servers for processing in a more balanced manner.
  • the client after the client establishes a connection with the server, if it is found that the target server does not meet the set load balancing conditions, then adjust the server list of the target client connected to the target server to achieve the purpose of controlling the overall load of the entire server cluster, Maintain the dynamic balance of the load value of each server to effectively solve the problem of server overload.
  • Fig. 2c is a schematic flow diagram of another load balancing method according to the embodiment of the present application. As shown in Fig. 2c, the flow may include:
  • Step A1 The server reports load determination parameters.
  • server 1 to server n respectively report to the scheduling module the load determination parameters in the latest statistical period;
  • the load determination parameters may include the number of server connections, the amount of messages processed by the server in the last statistical period, the last time the server was The time allotted to the client and the amount of messages processed for each connection session of the server.
  • Step A2 The client sends a connection request to the scheduling module.
  • the client needs to send service data to the server, it needs to send a connection request to the scheduling module.
  • Step A3 The scheduling module distributes the server list to the client.
  • the scheduling module determines the load value of each server according to the load determination parameters reported by each server, and then assigns corresponding server list, and send the corresponding server list to the client.
  • Step A4 The client establishes a connection with each server in the server list at the same time.
  • the server list of the client includes the server 1 and the server 2, that is, the client establishes a TCP long connection with the server 1 and the server 2 at the same time.
  • Step A5 The client polls to send business data.
  • the client after determining that the client establishes the TCP long connection with the server 1 and the server 2, the client sends service data to the server 1 and the server 2 that have established the TCP long connection in a polling manner.
  • any server when any server receives the business data sent by the client, it will count the load determination parameters of the latest statistical period, and report the above load determination data to the scheduling module at regular intervals; in this way, the scheduling module can determine the load based on the load. Data, reacquire the load value of each server in the current network; and according to the reacquired load value, determine whether the server connected to the client meets the load balancing conditions, if not, adjust the server list of the client, so that the server with the client Each server connected to the end is in a balanced state.
  • the newly added monitoring module is connected between the scheduling module and each server, so that each The statistics and monitoring of the load determination parameters of each server, and report the load determination parameters of each server obtained from the statistics to the scheduling module; then control the list of servers connected to the client through the scheduling module; that is, complete the server part through the monitoring module tasks, which can improve the processing capacity of the entire server cluster.
  • Fig. 3 is a schematic diagram of the composition and structure of a load balancing device according to an embodiment of the present application. As shown in Fig. 3 , the device includes a first determination module 300, a second determination module 301 and an adjustment module 302, wherein,
  • the first determination module 300 is configured to obtain the load value of each server in the current network after receiving the connection request sent by each client in the plurality of clients; determine the load value of each server according to the load value of each server A server list of a client, and a corresponding server list is issued to each client; the server list includes at least two servers;
  • the second determination module 301 is configured to reacquire the load value of each server in the current network after determining that each client establishes a transmission control protocol TCP long connection with each server in the corresponding server list; Get the load value of each server to determine the target server that does not meet the set load balancing conditions;
  • the adjustment module 302 is configured to search for a target client connected to the target server, and adjust the server list of the target client; the target client is one of the multiple clients.
  • the adjustment module 302 is configured to find the target client connected to the target server, including:
  • the target server According to the amount of messages sent by each of the at least two clients to the target server, from among the at least two clients, determine the client that sends the smallest amount of messages as the target client, or , determining any client whose message volume is less than or equal to the first set threshold as the target client.
  • the second determination module 301 is configured to determine the target server that does not meet the set load balancing condition according to the re-acquired load value of each server, including:
  • the server with the highest load value and the server with the lowest load value are obtained; when it is determined that the load difference between the server with the highest load value and the server with the lowest load value is greater than a second set threshold, The server with the highest load value is determined as the target server that does not meet the set load balancing condition; or,
  • the adjustment module 302 is configured to adjust the server list of the target client, including:
  • the server with the highest load value in the server list of the target client is removed, and a server with the lowest current load value is added to the server list of the target client.
  • the device further includes a receiving module configured to:
  • the load determination parameters include the number of connections of the server, the server's last statistics At least one of the periodic processing message volume and the last time the server was assigned to the client;
  • the first determining module 300 is configured to obtain the load value of each server in the current network, including:
  • the load value of each server in the current network is determined according to the load determination parameters reported by each server in the current network.
  • the load determination parameters when the load determination parameters include the number of connections of the server, the amount of messages processed by the server in the last statistical period, and the time when the server was allocated to the client last time, the load determination parameters further include connection The weight value of the number, the weight value of the processing message volume, and the weight value of the time parameter;
  • the first determination module 300 is configured to determine the load value of each server in the current network according to the load determination parameters reported by each server in the current network, including:
  • the time parameter weight value determines the load value of each server in the current network.
  • the adjustment module 302 is further configured to:
  • Whether to continue to adjust the server list in the current statistical period is determined according to the relationship between the adjusted session ratio and the fourth set threshold.
  • the adjustment module 302 is configured to determine whether to continue adjusting the server list in the current statistical period according to the relationship between the adjustment session ratio and the fourth set threshold, including:
  • the above-mentioned first determination module 300, second determination module 301, adjustment module 302 and receiving module can all be realized by a processor located in an electronic device, and the processor can be ASIC, DSP, DSPD, PLD, FPGA , CPU, controller, microcontroller, microprocessor at least one.
  • each functional module in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or The contribution made by related technologies or all or part of the technical solution can be embodied in the form of software products, the computer software products are stored in a storage medium, and include several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read-only memory (Read Only Memory, ROM), RAM, magnetic disk or optical disk.
  • the computer program instructions corresponding to a load balancing method in this embodiment can be stored on a storage medium such as an optical disk, a hard disk, or a USB flash drive.
  • a storage medium such as an optical disk, a hard disk, or a USB flash drive.
  • FIG. 4 shows an electronic device 400 provided by an embodiment of the present application, which may include: a memory 401 and a processor 402; wherein,
  • memory 401 configured to store computer programs and data
  • the processor 402 is configured to execute a computer program stored in a memory, so as to implement any one of the load balancing methods in the foregoing embodiments.
  • the above-mentioned memory 401 can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 402.
  • volatile memory such as RAM
  • non-volatile memory such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 402.
  • the aforementioned processor 402 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different load balancing devices, the electronic device used to implement the above processor function may also be other, which is not specifically limited in this embodiment of the present application.
  • the embodiment of the present application also provides a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the load balancing method described in the above method embodiment, for details, please refer to the above method embodiment , which will not be repeated here.
  • the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • a software development kit Software Development Kit, SDK
  • the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.
  • a computer-usable storage media including but not limited to disk storage and optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer And Data Communications (AREA)

Abstract

Des modes de réalisation de la présente demande concernent un procédé et un appareil d'équilibrage de charge, un dispositif électronique, un support de stockage informatique et un produit programme d'ordinateur. Le procédé comprend les étapes consistant à : après avoir reçu une requête de connexion envoyée par chaque client au sein d'une pluralité de clients, acquérir une valeur de charge pour chaque serveur dans un réseau actuel ; déterminer une liste de serveurs pour chaque client en fonction de la valeur de charge de chaque serveur et envoyer une liste de serveurs correspondante à chaque client, la liste de serveurs comprenant au moins deux serveurs ; après avoir déterminé que chaque client a établi une connexion TCP de longue durée avec chaque serveur de la liste de serveurs correspondante, réacquérir une valeur de charge pour chaque serveur dans le réseau actuel ; en fonction de la valeur de charge réacquise pour chaque serveur, identifier un serveur cible qui ne satisfait pas à une condition d'équilibrage de charge définie ; et trouver un client cible connecté au serveur cible et ajuster la liste de serveurs du client cible, le client cible étant un client au sein de la pluralité de clients. Le procédé peut résoudre efficacement le problème de surcharge des serveurs.
PCT/CN2022/099587 2021-09-30 2022-06-17 Procédé et appareil d'équilibrage de charge, dispositif, support de stockage informatique et programme WO2023050901A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111165088.9 2021-09-30
CN202111165088.9A CN113810304A (zh) 2021-09-30 2021-09-30 一种负载均衡方法、装置、设备和计算机存储介质

Publications (1)

Publication Number Publication Date
WO2023050901A1 true WO2023050901A1 (fr) 2023-04-06

Family

ID=78939016

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099587 WO2023050901A1 (fr) 2021-09-30 2022-06-17 Procédé et appareil d'équilibrage de charge, dispositif, support de stockage informatique et programme

Country Status (2)

Country Link
CN (1) CN113810304A (fr)
WO (1) WO2023050901A1 (fr)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117149099A (zh) * 2023-10-31 2023-12-01 江苏华鲲振宇智能科技有限责任公司 一种计算存储分体式服务器系统及控制方法
CN117290114A (zh) * 2023-11-23 2023-12-26 南京网眼信息技术有限公司 一种基于cpu积分的负载均衡方法及系统
WO2024023729A1 (fr) 2022-07-28 2024-02-01 Precision Planting Llc Système de conditionnement d'un échantillon agricole et procédés associés
CN117745514A (zh) * 2024-02-20 2024-03-22 浙江宇视科技有限公司 智能服务器集群的图像分配方法、装置、设备及介质

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810304A (zh) * 2021-09-30 2021-12-17 深圳前海微众银行股份有限公司 一种负载均衡方法、装置、设备和计算机存储介质
CN114780463A (zh) * 2022-03-01 2022-07-22 阿里巴巴(中国)有限公司 中断控制方法、设备、分布式系统及存储介质
CN114710496B (zh) * 2022-04-24 2024-05-14 中国工商银行股份有限公司 一种多节点负载均衡方法及装置
CN115242720A (zh) * 2022-08-03 2022-10-25 北京达佳互联信息技术有限公司 长连接服务的连接方法、装置、电子设备以及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471760A (zh) * 2014-09-12 2016-04-06 华为技术有限公司 一种路由方法、负载均衡的装置及数据通信系统
CN107026907A (zh) * 2017-03-30 2017-08-08 上海斐讯数据通信技术有限公司 一种负载均衡方法、负载均衡器及负载均衡系统
US20200110625A1 (en) * 2018-10-04 2020-04-09 Cisco Technology, Inc. Placement of container workloads triggered by network traffic for efficient computing at network edge devices
CN112202918A (zh) * 2020-10-16 2021-01-08 深圳乐播科技有限公司 长连接通信的负载调度方法、装置、设备及存储介质
CN113810304A (zh) * 2021-09-30 2021-12-17 深圳前海微众银行股份有限公司 一种负载均衡方法、装置、设备和计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105471760A (zh) * 2014-09-12 2016-04-06 华为技术有限公司 一种路由方法、负载均衡的装置及数据通信系统
CN107026907A (zh) * 2017-03-30 2017-08-08 上海斐讯数据通信技术有限公司 一种负载均衡方法、负载均衡器及负载均衡系统
US20200110625A1 (en) * 2018-10-04 2020-04-09 Cisco Technology, Inc. Placement of container workloads triggered by network traffic for efficient computing at network edge devices
CN112202918A (zh) * 2020-10-16 2021-01-08 深圳乐播科技有限公司 长连接通信的负载调度方法、装置、设备及存储介质
CN113810304A (zh) * 2021-09-30 2021-12-17 深圳前海微众银行股份有限公司 一种负载均衡方法、装置、设备和计算机存储介质

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024023729A1 (fr) 2022-07-28 2024-02-01 Precision Planting Llc Système de conditionnement d'un échantillon agricole et procédés associés
WO2024023731A1 (fr) 2022-07-28 2024-02-01 Precision Planting Llc Système d'emballage d'échantillon agricole
WO2024023728A1 (fr) 2022-07-28 2024-02-01 Precision Planting Llc Système d'emballage d'échantillon de produit agricole
CN117149099A (zh) * 2023-10-31 2023-12-01 江苏华鲲振宇智能科技有限责任公司 一种计算存储分体式服务器系统及控制方法
CN117149099B (zh) * 2023-10-31 2024-03-12 江苏华鲲振宇智能科技有限责任公司 一种计算存储分体式服务器系统及控制方法
CN117290114A (zh) * 2023-11-23 2023-12-26 南京网眼信息技术有限公司 一种基于cpu积分的负载均衡方法及系统
CN117290114B (zh) * 2023-11-23 2024-01-30 南京网眼信息技术有限公司 一种基于cpu积分的负载均衡方法及系统
CN117745514A (zh) * 2024-02-20 2024-03-22 浙江宇视科技有限公司 智能服务器集群的图像分配方法、装置、设备及介质
CN117745514B (zh) * 2024-02-20 2024-05-10 浙江宇视科技有限公司 智能服务器集群的图像分配方法、装置、设备及介质

Also Published As

Publication number Publication date
CN113810304A (zh) 2021-12-17

Similar Documents

Publication Publication Date Title
WO2023050901A1 (fr) Procédé et appareil d'équilibrage de charge, dispositif, support de stockage informatique et programme
US9804981B2 (en) Method, controller, and system for service flow control in object-based storage system
CN109218355B (zh) 负载均衡引擎,客户端,分布式计算系统以及负载均衡方法
CN109308221B (zh) 一种基于WebSocket长连接的Nginx动态负载均衡方法
US7773522B2 (en) Methods, apparatus and computer programs for managing performance and resource utilization within cluster-based systems
CN111726415B (zh) 一种基于负反馈机制的tcp长连接负载均衡调度方法及系统
WO2010100859A1 (fr) Système distribué
US8015281B2 (en) Dynamic server flow control in a hybrid peer-to-peer network
US9374425B2 (en) Behavior based client selection for disparate treatment
Nakai et al. Load balancing for internet distributed services using limited redirection rates
EP3264723B1 (fr) Procédé, appareil associé et système pour traiter une demande de service
US11316792B2 (en) Method and system of limiting traffic
CN112165436B (zh) 流量控制方法、装置及系统
WO2021120633A1 (fr) Procédé d'équilibrage de charge et dispositif associé
US9736235B2 (en) Computer system, computer, and load balancing method
CN112866394B (zh) 一种负载均衡方法、装置、系统、计算机设备和存储介质
CN112711479A (zh) 服务器集群的负载均衡系统、方法、装置和存储介质
Bang et al. Design and implementation of a load shedding engine for solving starvation problems in Apache Kafka
US20140280866A1 (en) Scalable load balancing
CN113268329A (zh) 一种请求调度方法、装置及存储介质
CN111614735A (zh) 基于加权轮转算法的新型雾计算架构及其任务调度方法
CN111611068B (zh) 分布式系统中的数据写方法、服务器及客户端
Yoshimura et al. A Method of Distributing Clients to MQTT Brokers Using Server Redirection
EP4283954A1 (fr) Procédé de traitement d'informations de puissance de calcul, premier dispositif de réseau et système
CN109445934B (zh) 查询请求的分配方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22874298

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE