A dynamic load balancing method for a server and related equipment
Through dynamic load balancing method, the server's processing delay is predicted using attention mechanism and LSTM model, and the target server is selected in combination with transmission and performance information, which solves the problem of unreasonable load allocation in the existing technology and improves the efficiency and stability of the server system sex.
Patent Information
- Application Number
- CN202410989885.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The existing load balancing method ignores the current workload of the server, resulting in underutilization of servers with strong processing capabilities, resulting in waste of resources and overloading of certain servers, affecting the stability of the service, and reducing the overall performance and processing tasks of the server system. efficiency.
By obtaining the client's task identification resolution request and server information, including location, performance and load information, the task processing delay is predicted using the attention mechanism-based long-term memory network (LSTM) model, and the task processing delay is determined in combination with transmission parameters and server performance information. Target server for dynamic load balancing.
It realizes more accurate load allocation, improves resource usage efficiency, avoids overloading of a single server, enhances the reliability and response speed of the system, improves the stability of the service and user satisfaction, and has good scalability.
Smart Images

Figure CN118540326B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of wireless communication networks, and in particular to a dynamic load balancing method for a server and related equipment. Background Art
[0002] Existing load balancing methods are usually based on predetermined rules and strategies, focusing on the fairness of the allocation algorithm, and trying to ensure that the load allocated to each server is even. However, this situation often ignores the current workload of each server, resulting in that servers with strong processing capabilities may not be fully utilized, causing resource waste, and some servers are overloaded, affecting the stability of the service. Therefore, the existing load balancing method causes the load to be unable to be reasonably distributed, resulting in a decrease in the overall performance of the server system and a decrease in the efficiency of processing tasks. Summary of the invention
[0003] The present disclosure proposes a dynamic load balancing method for a server and related equipment, which can solve the technical problems that the server load cannot be reasonably distributed, resulting in a decrease in the overall performance of the server system and a decrease in the efficiency of processing tasks.
[0004] In a first aspect, the present disclosure provides a method for dynamic load balancing of a server, comprising:
[0005] Obtaining an identity resolution request for a task and server information about a server from a client; wherein the server information includes server location information, server performance information, and server load information of the server;
[0006] Parsing the identification resolution request to obtain identification location information of the client;
[0007] Determining a transmission parameter of the task based on the identification location information and the server location information;
[0008] Predicting a predicted processing delay of the task at the next moment based on the server performance information;
[0009] Determine a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information, and the server load information;
[0010] The task is sent to the target server for processing.
[0011] In a second aspect of the present disclosure, a dynamic load balancing device for a server is provided, comprising:
[0012] An acquisition module, used to acquire an identity resolution request for a task and server information about a server from a client; wherein the server information includes server location information, server performance information, and server load information of the server;
[0013] A parsing module, used to parse the identification resolution request to obtain the identification location information of the client;
[0014] A transmission parameter module, used to determine the transmission parameters of the task based on the identification location information and the server location information;
[0015] A delay prediction module, used to predict the predicted processing delay of the task at the next moment based on the server performance information;
[0016] a target determination module, configured to determine a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information, and the server load information;
[0017] The sending module is used to send the task to the target server for processing.
[0018] In a third aspect of the present disclosure, an electronic device is provided, comprising one or more processors, a memory; and one or more programs, wherein the one or more programs are stored in the memory and executed by the one or more processors, and the programs include instructions for executing the method described in the first aspect.
[0019] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium containing a computer program is provided. When the computer program is executed by one or more processors, the processors execute the method described in the first aspect.
[0020] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the method described in the first aspect.
[0021] From the above, it can be seen that the present invention provides a dynamic load balancing method and related equipment for a server, which predicts transmission parameters by analyzing the geographical information in the identification code and the actual location information of the server, and predicts the processing delay according to the CPU load, memory load and network bandwidth load of the server, and determines the target server in combination with the performance and load of the server, so that the entire system can distribute the load more accurately and realize efficient and balanced identification resolution services. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 A schematic diagram of a dynamic load balancing architecture of a server according to an embodiment of the present disclosure.
[0024] Figure 2 The figure is a schematic diagram of the hardware structure of an exemplary electronic device according to an embodiment of the present disclosure.
[0025] Figure 3 The present invention is a flowchart of a method for dynamic load balancing of a server according to an embodiment of the present invention.
[0026] Figure 4 Schematic diagram of the structure of the LSTM of the embodiment of the present disclosure.
[0027] Figure 5 The present invention is a schematic diagram of the principle of a dynamic load balancing method for a server according to an embodiment of the present invention.
[0028] Figure 6 A schematic diagram of a dynamic load balancing device for a server according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0030] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0031] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0032] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0033] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0034] Figure 1 A schematic diagram of a dynamic load balancing architecture of a server according to an embodiment of the present disclosure is shown. Figure 1 The dynamic load balancing architecture 100 of the server may include a server 110, a terminal 120, and a network 130 providing a communication link. The server 110 and the terminal 120 may be connected via a wired or wireless network 130. The server 110 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, security services, and CDN.
[0035] The terminal 120 may be implemented in hardware or software. For example, when the terminal 120 is implemented in hardware, it may be various electronic devices having a display screen and supporting page display, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, and desktop computers, etc. When the terminal 120 device is implemented in software, it may be installed in the electronic devices listed above; it may be implemented as multiple software or software modules (such as software or software modules used to provide distributed services), or it may be implemented as a single software or software module, which is not specifically limited here.
[0036] It should be noted that the dynamic load balancing method for the server provided in the embodiment of the present application can be executed by the terminal 120 or by the server 110. It should be understood that Figure 1 The number of terminals, networks and servers in the embodiment is only for illustration and is not intended to limit the number of terminals, networks and servers. Any number of terminals, networks and servers may be provided as required.
[0037] Figure 2 FIG. 2 shows a schematic diagram of the hardware structure of an exemplary electronic device 200 provided in an embodiment of the present disclosure. Figure 2 As shown, the electronic device 200 may include: a processor 202, a memory 204, a network module 206, a peripheral interface 208 and a bus 210. The processor 202, the memory 204, the network module 206 and the peripheral interface 208 are connected to each other in communication within the electronic device 200 through the bus 210.
[0038] Processor 202 may be a central processing unit (CPU), a dynamic load balancer of a server, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 202 may be used to perform functions related to the technology described in this disclosure. In some embodiments, processor 202 may also include multiple processors integrated into a single logical component. For example, Figure 2 As shown, processor 202 may include a plurality of processors 202a, 202b, and 202c.
[0039] The memory 204 may be configured to store data (eg, instructions, computer code, etc.). Figure 2 As shown, the data stored in the memory 204 may include program instructions (for example, program instructions for implementing the dynamic load balancing method of the server in the embodiment of the present disclosure) and data to be processed (for example, the memory may store configuration files of other modules, etc.). The processor 202 may also access the program instructions and data stored in the memory 204, and execute the program instructions to operate on the data to be processed. The memory 204 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 204 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0040] The network module 206 can be configured to provide the electronic device 200 with communication with other external devices via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network module 306 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
[0041] The peripheral interface 208 can be configured to connect the electronic device 200 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0042] The bus 210 may be configured to transmit information between various components of the electronic device 200 (e.g., the processor 202, the memory 204, the network module 206, and the peripheral interface 208), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0043] It should be noted that, although the architecture of the electronic device 200 only shows the processor 202, the memory 204, the network module 206, the peripheral interface 208 and the bus 210, in the specific implementation process, the architecture of the electronic device 200 may also include other components necessary for normal execution. In addition, it can be understood by those skilled in the art that the architecture of the electronic device 200 may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0044] Faced with high concurrency requirements, load balancing technology has become a key component of the solution. It mainly improves the performance and response speed of the entire system by evenly distributing processing tasks to each server. By avoiding overloading of any single server, load balancing ensures the smooth operation of the system and higher user satisfaction. At present, according to the working mechanism of load balancing technology, it is mainly divided into two categories: static load balancing technology and dynamic load balancing technology. Static load balancing technology is usually based on predetermined rules and strategies, focusing on the fairness of the distribution algorithm, that is, trying to ensure that the load on each server is even. Due to the short development time of identity resolution technology in my country, only some static negative balancing solutions are simply applied to relieve server pressure. However, static load balancing solutions often ignore the current workload of each server, resulting in that servers with strong processing capabilities may not be fully utilized, resulting in a decline in the overall performance of the system, and even some servers may be overloaded, affecting the stability of the service. Therefore, how to reasonably distribute the load of the server, improve the task processing efficiency and server system performance, etc. have become technical problems that need to be solved urgently.
[0045] In view of this, the embodiments of the present disclosure provide a method and related equipment for dynamic load balancing of a server. By analyzing the regional information in the identification code and the actual location information of the server to predict the transmission parameters, and predicting the processing delay according to the CPU load, memory load and network bandwidth load of the server, and combining the performance and load of the server to determine the target server, the entire system can distribute the load more accurately and realize efficient and balanced identification resolution services.
[0046] The dynamic load balancing technology of the disclosed embodiment dynamically adjusts traffic distribution by real-time monitoring of the performance indicators of the back-end server (such as CPU usage, memory usage, response time, etc.) to ensure the optimal operating efficiency and load balancing of the network or server group. It not only improves the efficiency of resource utilization and ensures that no single server becomes a bottleneck due to overload, but also enhances the overall reliability of the system. When the server performance degrades or fails, the traffic can be quickly redirected to other healthy servers, reducing the risk of service interruption. In addition, it also has the characteristics of fast response speed, and can quickly adjust strategies to respond to emergencies during traffic peaks, greatly improving the stability of the service and user satisfaction. The dynamic load balancing technology of the disclosed embodiment also has good scalability, supports seamless addition or removal of servers, and enables the system to flexibly adapt to business growth and changing needs. It is an indispensable key technology in modern large-scale online services and cloud infrastructure.
[0047] See also Figure 3 , Figure 3The schematic flow chart of the dynamic load balancing method of the server according to the embodiment of the present disclosure is shown. The dynamic load balancing method of the server according to the embodiment of the present disclosure can be deployed on the server side. Figure 3 In the present invention, the server dynamic load balancing method 300 may further include the following steps.
[0048] In step S310, an identity resolution request for a task and server information about a server are obtained from a client; wherein the server information includes server location information, server performance information, and server load information of the server.
[0049] Among them, the identity resolution request can be a request sent from the client to obtain resolution information related to a specific task, which may be a task ID or other unique identifier for subsequent processing and routing decisions. Server information can include server location information of the server (i.e., the physical or network location of the server, which affects data transmission latency), server performance information (such as CPU speed, memory size, etc., which affects task processing speed) and server load information (the amount of tasks currently being processed, which helps determine whether the server is capable of accepting more tasks).
[0050] In order to meet the needs of large-scale resolution, the server system mainly adopts a distributed server deployment method. Each region has an independent server node to provide identity resolution services. These nodes are connected through the Internet to form a wide range of identity resolution networks. In such a structure, the data between server nodes is replicated, that is, each node stores the identity resolution data of the entire network. This ensures that even if a node stops serving, other nodes can seamlessly take over the service, greatly enhancing the robustness of the entire system.
[0051] In step S320, the identification resolution request is resolved to obtain identification location information of the client.
[0052] The location information may be identified by parsing the client's request to obtain the client's location information, which helps calculate the data transmission cost and delay and optimize task allocation.
[0053] In step S330, a transmission parameter of the task is determined based on the identification location information and the server location information.
[0054] Among them, transmission parameters refer to various parameters used to control and optimize communication quality during data transmission.
[0055] In some embodiments, determining the transmission parameters of the task based on the identification location information and the server location information includes:
[0056] ,in, For the i The transmission parameters of the server, For the i Server location information for each server, The identification location information of the client.
[0057] In step S340, a predicted processing delay of the task at the next moment is predicted based on the server performance information.
[0058] Among them, using the current server performance information to predict the approximate time required to process a specified task in the future (next moment) helps evaluate the server's ability to handle new tasks.
[0059] In some embodiments, predicting the predicted processing delay of the task at the next moment based on the server performance information includes:
[0060] Arranging the server performance information in chronological order to obtain a performance information sequence; wherein the server performance information includes at least one of: CPU utilization, memory utilization, and hard disk input and output information;
[0061] The performance information sequence is input into a trained delay prediction model to obtain the predicted processing delay; wherein the delay prediction model includes a long short-term memory model with an attention mechanism.
[0062] Among them, the Long Short-Term Memory (LSTM) model can be a type of Recurrent Neural Network (RNN), which can effectively process and memorize long sequence data. In traditional RNNs, due to the problems of gradient vanishing and gradient exploding, it is often difficult to capture distant relationships in the sequence. Compared with ordinary RNNs, LSTM effectively solves this problem by introducing gate mechanisms and cell states, making it perform well in processing time series data, including time series prediction problems. Therefore, LSTM can be used to predict the processing delay of each server in the future. See Figure 4 , Figure 4 A schematic diagram of the structure of an LSTM according to an embodiment of the present disclosure is shown. Figure 4 In LSTM, the core is the cell state, which passes through Figure 4 The long horizontal line at the top of is called the cell state, which determines what kind of information will be retained and what kind of information will be forgotten, denoted as . The cell state plays a role similar to a "memory transmission belt" in the entire LSTM network. It can transmit information continuously and orderly without being easily affected by the gradient vanishing or gradient exploding problems. The reason why LSTM can achieve precise control of information is mainly because it adopts a unique gating mechanism. The "gate" mechanism mentioned here is a sophisticated design structure. This structure consists of a sigmoid activation function layer and the subsequent point multiplication operation. The sigmoid layer can limit the output range between 0 and 1. This value can be understood as a weight ratio of information passing through. 0 means completely blocking the information transmission. In the internal structure of LSTM, three key gating mechanisms are carefully designed, namely the forget gate, input gate and output gate. The forget gate is responsible for filtering and regulating information by reading the hidden state of the previous moment. and the current input , and generates a 0-1 numerical vector through the sigmoid function, which is multiplied element by element with the cell state at the previous moment, and then determines which information will be retained and integrated into the cell state at the current moment. The calculation formula of the forget gate is generally expressed as:
[0063] .
[0064] The input gate is responsible for deciding which of the current input information should be retained and added to the current cell state. The input gate consists of two parts: a sigmoid layer that outputs a probability value vector between 0 and 1, indicating the degree to which each input feature updates the cell state; and a tanh layer that converts the current input data into a new candidate cell state value vector, which has a value between -1 and 1 and represents new information that may be added to the cell state. The tanh layer creates a new cell state value vector. , Will be added to the state. The calculation formula is as follows:
[0065] ;
[0066] .
[0067] When the cell state is updated, the output of the sigmoid layer Candidate cell state values generated by the tanh layer Multiply and then add the result to , so as to obtain the updated cell state at the current moment ,in Represents the cell state at the previous moment, is the output of the forget gate, indicating the proportion of the cell state that needs to be forgotten at the previous moment. The calculation formula is as follows:
[0068] .
[0069] The output gate is responsible for controlling which information in the cell state will be output to the hidden state at the current moment, and ultimately affects the output of the network. The output gate uses a sigmoid activation function layer to determine which parts of the cell state will be output to the next moment or used for subsequent calculations. At the same time, LSTM uses the tanh function to normalize the original cell state to generate a new vector. The element values of this vector converted by the tanh activation function are limited to the range of -1 to 1, and each element represents the degree of "activation" of the original value in the cell state after a saturated nonlinear transformation. Finally, LSTM multiplies the output of the sigmoid gate by the cell state after tanh processing element by element. In this way, only those parts of the cell state determined by the sigmoid gate to be output will be retained and ultimately output as the hidden state at the current moment. The calculation formula is as follows:
[0070] ;
[0071] .
[0072] The attention mechanism is a computational model that draws on human cognitive characteristics. It imitates the ability of the human brain to selectively focus on the most important or relevant parts when faced with a large amount of information input, while temporarily ignoring or weakening the processing of non-critical information. In the field of machine learning, the attention mechanism enables the model to dynamically allocate its "attention" when processing complex inputs, focusing on those factors that have the greatest impact on the current task. The attention mechanism originally originated from the study of visual models in the field of image processing. With the in-depth exploration of its potential, it has gradually been promoted and applied to more AI fields. Especially in natural language processing and speech recognition, it has been widely used and further developed due to its excellent flexibility and universality. The attention mechanism plays a key role in solving the problem of information overload. It enables the model to grasp the core information in the input sequence more accurately, thereby improving the model's prediction performance and generalization ability. For sequence models, by introducing the attention mechanism, the model can flexibly give different degrees of importance to different parts of the input sequence when generating prediction results, and more efficiently discover and utilize the input fragments that are most relevant to the current prediction target. The core of the attention mechanism is to assign a weight to each element in the input sequence, which represents the importance of the element to a specific position in the output sequence. The weight value is determined by a trainable function that is calculated based on the current input element and the context information that may be contained. Through operations such as weighted summation or dot product, a context vector is formed that integrates the input information that is critical to the current task.
[0073] Therefore, the LSTM model combined with the attention mechanism can be used to predict the processing delay of the server. The model uses the key performance indicators of the server, such as CPU frequency, memory size and network bandwidth parameters, to infer the time required for the server to process the identity resolution request at the next moment. Since the CPU frequency, memory size and network bandwidth have different effects on latency, and there is currently no unified standard for measuring the impact of each parameter, the attention mechanism is introduced on the basis of LSTM. By assigning each parameter a dynamic weight that matches its degree of influence, the correlation information between different features can be captured more accurately. The prediction model can include an input layer, a feature attention mechanism layer, an LSTM layer, and a fully connected layer. Among them, the input layer is mainly responsible for receiving input data. In this article, the input data is multiple server performance indicators at each time step, including CPU usage, memory usage, hard disk I / O, etc. These parameters are arranged and combined in time series to form an ordered data sequence, which is then input into the model.
[0074] The feature attention mechanism layer is responsible for screening and emphasizing key features. It determines their relative contribution to delay prediction by assigning a weight to each feature that matches its importance. The weight is usually calculated using the softmax function. The softmax function is a nonlinear activation function commonly used in multi-category classification tasks. It maps a real number vector to a normalized probability distribution vector, ensuring that the weight value of each feature is between 0 and 1, and the sum of all feature weights is 1, ensuring the normalization and rationality of weight distribution. Weight vector The calculation formula is as follows:
[0075] ,
[0076] in, Represents the set of m input data features observed at the current time T, specifically expressed as . and They are the trainable weight matrix and bias vector of the feature attention mechanism. Next, the weight vector is combined with the input data to calculate , the formula is as follows:
[0077] .
[0078] Afterwards, the LSTM layer receives the input processed by the feature attention layer , learn and identify long-term dependencies in the input, accurately grasp and capture the dynamic changes between various features in the time series data at different time points. At each time step, the LSTM layer generates a hidden state, which is connected in series to form a time series that reflects the model's understanding of the input data. Finally, this hidden state sequence is passed to the fully connected layer, which integrates and extracts the hidden states from the LSTM layer to generate the final output of the model.
[0079] In step S350, a target server among the servers is determined based on the transmission parameters, the predicted processing delay, the server performance information, and the server load information.
[0080] In some embodiments, determining a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information, and the server load information includes:
[0081] determining a performance parameter of the server based on the server performance information;
[0082] Determining a load parameter of the server based on the server load information and the server performance parameter information;
[0083] determining a processing parameter of the server based on the predicted processing delay and a current processing delay of the server at a current moment;
[0084] determining a server weight of the server based on the transmission parameter, the processing parameter, the performance parameter, and the load parameter;
[0085] The server corresponding to the maximum value of the server weight is determined as the target server.
[0086] In some embodiments, determining a server weight of the server based on the transmission parameter, the processing parameter, the performance parameter, and the load parameter includes:
[0087] ,in, For the first i The server weight of the server, For the first i The performance parameters of the server, For the i The load parameters of the servers, For the i The transmission parameters of the server, For the i Processing parameters for each server.
[0088] In some embodiments, determining the performance parameter of the server based on the server performance information includes:
[0089] ,in, For the i The performance parameters of the server, For the i The CPU frequency of each server, For the i The memory capacity of each server, For the i The network width of each server, , , is the first weight coefficient and , , The sum of is 1, n is the number of servers.
[0090] In some embodiments, determining the load parameter of the server based on the server load information and the server performance parameter information includes:
[0091] ,in, For the i The load parameters of the servers, For the i The CPU utilization of each server, For the i Memory utilization of each server, For the i The network bandwidth utilization of each server, , , is the second weight coefficient and , , The sum of is 1.
[0092] In some embodiments, determining the processing parameters of the server based on the predicted processing delay and the current processing delay of the server at the current moment includes:
[0093] ,in, For the i The processing parameters of each server, For the i The current processing delay of a server at the current time t, For the i The predicted processing delay of a server at the next time t+1, , is the third weight coefficient and , The sum of is 1.
[0094] Specifically, the weight of the server can be evaluated based on the request transmission delay and the request processing delay. Among them, the request transmission delay is related to the distance between the server storing the information related to the identifier in the identifier resolution request and the server processing the identifier resolution request, which is obtained through the regional information carried in the identifier and the regional information of each server. The factors affecting the delay of processing the identifier resolution request include the performance index of the node and the node load, which can be measured by the CPU main frequency, network bandwidth and running memory. The CPU main frequency refers to the number of operations that the CPU can perform within a fixed time. The higher the main frequency, the stronger its ability to process tasks. When the server is processing a large number of requests, if the CPU main frequency is higher, it can complete the calculation task faster, thereby shortening the time to process the request. On the contrary, if the CPU main frequency is low, it may increase the time required to process the same number of network requests, thereby increasing the delay of the resolution request. Network bandwidth refers to the ability of the network to transmit data per unit time, and is an important network characteristic measurement indicator. The larger the network bandwidth, the more requests the node can process in parallel, and the smaller the processing delay. On the contrary, if the network bandwidth is small, bottlenecks may occur when processing a large number of concurrent resolution requests, resulting in an increase in the processing delay of the resolution request. The running memory determines the number of tasks that the server can process simultaneously. When the server receives a large number of network requests, if the running memory is large enough, the server can process more requests simultaneously, thereby reducing the task queuing time and further reducing the latency of parsing requests. However, if the running memory is small, the server may not be able to process multiple requests simultaneously, which will cause the request to wait in the task queue, thereby increasing the latency of network requests. Therefore, these three indicators can be used to measure the performance of the server and predict the processing latency of the server at the next moment.
[0095] Can be defined is the i-th server in the cluster, and encodes the location of the ith server, The geographical information of the marker is revealed. In addition, Cd, Md and Nd respectively reflect the CPU main frequency, memory capacity and network bandwidth of the server, and Cu, Mu and Nu respectively reflect the load information of the CPU, memory and bandwidth of the server, then the following steps can be performed:
[0096] (1) Calculate the distance index D(Si) of the i-th server: .
[0097] (2) Calculate the performance index P(Si) of the i-th server:
[0098] , where the weight coefficient , , The sum of is 1.
[0099] (3) Calculate the node load L(Si) of the i-th server:
[0100] , where the weight coefficient , , The sum of is 1.
[0101] (4) Calculate the processing delay Rank(Si) of the i-th server:
[0102] ,in: It is the request processing delay of the server at the next moment predicted by the LSTM model combined with the attention mechanism; It indicates the current actual request processing delay, weight coefficient , The sum is 1.
[0103] The weight of the nth server is defined as W(Si), and its value directly determines the possibility of it being assigned a request. The weight is inversely proportional to the distance index of the server, that is, the farther the distance and the longer the transmission delay, the lower the corresponding weight value. When the server is idle, the weight of the server is positively correlated with its performance, that is, the higher the server performance index, the greater the number of requests that can be carried and processed in theory. However, as time goes by, especially after the server has been running for a period of time, relying solely on the basic performance index of the server cannot accurately reflect its actual ability to process requests. At this time, the current performance status of the server, that is, the remaining performance index, becomes the key factor in determining the number of requests it can process. Therefore, the real-time load L(Si) of the server is introduced, and the remaining performance of the server is represented by P(Si)*(1-L(Si)). The remaining performance of the server is proportional to the weight. The higher the remaining performance, the more requests the server can process. In addition, considering the impact of processing delay on service quality, servers with longer processing delays should reduce the possibility of being selected. Conversely, for servers with shorter processing delays, the probability of being selected should be increased. In summary, the following weight calculation formula can be obtained:
[0104] .
[0105] Through the above analysis, the problem of finding the optimal node can be transformed into a process of finding a server with the largest weight, that is, the optimal node is determined by calculating the maximum value Max(W(Sn)) of the weight function W(Sn) among all servers.
[0106] Figure 5 , Figure 5 A schematic diagram showing the principles of a dynamic load balancing method according to an embodiment of the present disclosure is shown. Figure 5 In the identification information processing module: the main task of this module is to extract and process the regional information carried in the identification in the user identification resolution request, process it in combination with the regional information of each server, and provide the result to the request scheduling module. Real-time load monitoring module: this module is responsible for real-time monitoring of the load of each server, collecting the CPU utilization, memory utilization and network bandwidth utilization information of each server, and providing it to the processing delay prediction module and the request scheduling module. Performance indicator collection module: this module is responsible for collecting the CPU main frequency, memory capacity and network bandwidth of each server, and providing it to the request scheduling module. Processing delay prediction module: this module uses a long short-term memory network combined with an attention mechanism to predict the processing delay of each server in the future, and provide the result to the request scheduling block. Request scheduling module: through the information provided by each module, through the load balancing decision algorithm, the best node is predicted, and the request is forwarded.
[0107] When receiving a user-initiated identity resolution request, the distance information between the identity and the server is first calculated to predict the transmission delay, and then the real-time load monitoring module and performance indicator collection module are used to collect the real-time load and performance indicators of each server. After that, the long short-term memory network model combined with the attention mechanism is used to predict the processing delay of each server, and finally this information is passed to the request scheduling module. The request scheduling module is equipped with a load balancing algorithm to predict the best node and forward the request to the node for processing.
[0108] In step S360, the task is sent to the target server for processing.
[0109] Specifically, the task can be actually scheduled and sent to the selected target server to wait or start processing. In order to forward high-concurrency task requests to each server in a balanced manner, the task response delay can be divided into transmission delay and processing delay. Among them, the transmission delay can be the time required for the identity resolution request to propagate in the network; the processing delay can be the actual time it takes for the server to process the resolution request, which depends on the performance indicators of the server. The transmission delay is predicted by analyzing the geographical information in the identity encoding and the actual location information of the server; while the processing delay is predicted based on the CPU load, memory load and network bandwidth load of the server. Since the weights of various factors affecting the processing delay of the identity resolution service are uncertain, in order to improve the prediction accuracy, the attention mechanism can be introduced into the LSTM model to give reasonable weighted consideration to each influencing factor, so that the entire system can distribute the load more accurately and achieve efficient and balanced identity resolution services.
[0110] It can be seen that according to the method of the embodiment of the present disclosure, when a user initiates an identity resolution request, the distance information between the identity and the server is first calculated to predict the transmission delay, and then the real-time load monitoring module and the performance indicator collection module are used to collect the real-time load and performance indicators of each server. Then, the long short-term memory network model combined with the attention mechanism is used to predict the processing delay of each server, and finally the information is passed to the request scheduling module. The request scheduling module is equipped with a load balancing algorithm to predict the best node and forward the request to the node for processing. It can meet the needs of large-scale resolution. The identity resolution system mainly adopts a distributed server deployment method. Each region has an independent server node to provide identity resolution services. These nodes are connected through the Internet to form a wide range of identity resolution networks. In such a structure, the data between the server nodes is copied to each other, that is, each node stores the identity resolution data of the entire network. This ensures that even if a node stops serving, other nodes can seamlessly take over the service, which greatly enhances the robustness of the entire system. The impact of network transmission delay on system performance is fully considered. By analyzing the geographic information and server location in the identity resolution request, the delay of the request during transmission is effectively reduced. It achieves accurate evaluation and dynamic scheduling of server processing capabilities. It directly predicts the server processing delay by combining the LSTM model with the attention mechanism, and then selects the best server to process the identity resolution request based on the server's performance indicators, achieving accurate evaluation and dynamic scheduling of server processing capabilities, making the load balancing strategy more flexible and accurate. It not only avoids the waste of high-performance server resources, but also promptly alleviates the processing delay caused by excessive load on low-performance servers, thereby maximizing the overall performance of the server cluster and ensuring the stability and reliability of the system under high concurrent requests.
[0111] In order to forward high-concurrency requests to each server in a balanced manner, the embodiment of the present disclosure proposes a dynamic load balancing solution based on the attention mechanism and LSTM, in which the response delay is subdivided into two key parts: one is the transmission delay, that is, the time required for the identity resolution request to propagate in the network; the other is the processing delay, that is, the actual time consumed by the server to process the resolution request, which depends on the performance indicators of the server. In the dynamic load balancing solution designed in this article, the transmission delay is predicted by analyzing the regional information in the identity code and the actual location information of the server; and the processing delay is predicted based on the CPU load, memory load and network bandwidth load of the server. Since the weights of various factors affecting the processing delay of the identity resolution service are uncertain, in order to improve the prediction accuracy, the embodiment of the present disclosure introduces the attention mechanism in the LSTM model, and gives reasonable weighted consideration to each influencing factor, so that the entire system can distribute the load more accurately and realize efficient and balanced identity resolution services.
[0112] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0113] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0114] Based on the same technical concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a dynamic load balancing device for a server, see Figure 6 , the dynamic load balancing device of the server includes:
[0115] An acquisition module, used to acquire an identity resolution request for a task and server information about a server from a client; wherein the server information includes server location information, server performance information, and server load information of the server;
[0116] A parsing module, used to parse the identification resolution request to obtain the identification location information of the client;
[0117] A transmission parameter module, used to determine the transmission parameters of the task based on the identification location information and the server location information;
[0118] A delay prediction module, used to predict the predicted processing delay of the task at the next moment based on the server performance information;
[0119] a target determination module, configured to determine a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information, and the server load information;
[0120] The sending module is used to send the task to the target server for processing.
[0121] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0122] The device of the above embodiment is used to implement the dynamic load balancing method of the corresponding server in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0123] Based on the same technical concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the dynamic load balancing method of the server as described in any of the above embodiments.
[0124] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0125] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the dynamic load balancing method of the server as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0126] It should be understood by those skilled in the art that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0127] In addition, to simplify the description and discussion, and in order not to obscure the embodiments of the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, devices may be shown in the form of block diagrams to avoid obscuring the embodiments of the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0128] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.
[0129] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.
Claims
1. A dynamic load balancing method for a server, comprising: Obtaining an identity resolution request for a task and server information about a server from a client; wherein the server information includes server location information, server performance information, and server load information of the server; Parsing the identification resolution request to obtain identification location information of the client; Determining the transmission parameter of the task based on the identification location information and the server location information includes: ,in, For the i The transmission parameters of the server, For the i Server location information for each server, The identification location information of the client; Predicting a predicted processing delay of the task at the next moment based on the server performance information; Determining a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information, and the server load information includes: determining a performance parameter of the server based on the server performance information; Determining a load parameter of the server based on the server load information and the server performance parameter information; determining a processing parameter of the server based on the predicted processing delay and a current processing delay of the server at a current moment; Determining a server weight of the server based on the transmission parameter, the processing parameter, the performance parameter, and the load parameter includes: ,in, For the i The server weight of the server, For the i The performance parameters of the server, For the i The load parameters of the servers, For the i The transmission parameters of the server, For the i Processing parameters for each server; Determine the server corresponding to the maximum value of the server weight as the target server; The task is sent to the target server for processing.
2. The method according to claim 1, wherein: Determining the performance parameters of the server based on the server performance information includes: ,in, For the i The performance parameters of the server, For the i The CPU frequency of each server, For the i The memory capacity of each server, For the i The network width of the server, , , is the first weight coefficient and , , The sum of is 1, n is the number of servers.
3. The method according to claim 1, wherein: Determining the load parameter of the server based on the server load information and the server performance parameter information includes: ,in, For the i The load parameters of the servers, For the i The CPU utilization of each server, For the i Memory utilization of each server, For the i Network bandwidth utilization of each server, , , is the second weight coefficient and , , The sum of is 1.
4. The method according to claim 1, wherein: Determining a processing parameter of the server based on the predicted processing delay and a current processing delay of the server at a current moment includes: ,in, For the i The processing parameters of each server, For the i The current processing delay of a server at the current time t, For the i The predicted processing delay of a server at the next time t+1, , is the third weight coefficient and , The sum of is 1.
5. The method according to claim 4, wherein: Predicting a predicted processing delay of the task at a next moment based on the server performance information includes: Arranging the server performance information in chronological order to obtain a performance information sequence; wherein the server performance information includes at least one of: CPU utilization, memory utilization, and hard disk input and output information; The performance information sequence is input into a trained delay prediction model to obtain the predicted processing delay; wherein the delay prediction model includes a long short-term memory model with an attention mechanism.
6. A dynamic load balancing device for a server, comprising: An acquisition module, used to acquire an identity resolution request for a task and server information about a server from a client; wherein the server information includes server location information, server performance information, and server load information of the server; A parsing module, used to parse the identification resolution request to obtain the identification location information of the client; A transmission parameter module, used to determine the transmission parameters of the task based on the identification location information and the server location information, including: ,in, For the i The transmission parameters of the server, For the i Server location information for each server, The identification location information of the client; A delay prediction module, used to predict the predicted processing delay of the task at the next moment based on the server performance information; A target determination module, used to determine a target server among the servers based on the transmission parameter, the predicted processing delay, the server performance information and the server load information, comprising: determining a performance parameter of the server based on the server performance information; Determining a load parameter of the server based on the server load information and the server performance parameter information; determining a processing parameter of the server based on the predicted processing delay and a current processing delay of the server at a current moment; Determining a server weight of the server based on the transmission parameter, the processing parameter, the performance parameter, and the load parameter includes: ,in, For the i The server weight of the server, For the i The performance parameters of the server, For the i The load parameters of the servers, For the i The transmission parameters of the server, For the i Processing parameters for each server; Determine the server corresponding to the maximum value of the server weight as the target server; A sending module is used to send the task to the target server for processing.
7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 5 when executing the program.
8. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 5.
