Scheduling method, scheduling device and server node

By introducing a reset mechanism into the load balancing algorithm, the problem of redundancy in the response time calculation of server nodes and ineffective fault handling in the prior art is solved, and more accurate and efficient server node scheduling is achieved.

CN117997905BActive Publication Date: 2025-05-06GUANGZHOU XUANWU WIRELESS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410028980.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2025-05-06
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

The existing load balancing algorithms have problems with redundant calculations and accuracy when calculating the shortest response time of the server node. At the same time, they cannot effectively identify and handle the fault status of the server node, resulting in waste of resources.

Method used

The server node scheduling method with reset mechanism is adopted. By presetting the reset period, the total response time and total number of requests of the server node are reset, the first response time and average response time of each server node are calculated, and the server node with the shortest response time is selected for connection.

Benefits of technology

It effectively reduces the redundancy of server node response time calculation, improves the real-time and accuracy of calculations, and can correctly identify and handle the fault status of server nodes, avoid resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117997905B_ABST
    Figure CN117997905B_ABST
Patent Text Reader

Abstract

The present invention relates to a server node scheduling method. The server node scheduling method of the present invention comprises: S1: resetting each server node; S2: calculating the first response time of each server node; S3: selecting the server node with the shortest first response time, so that the server node establishes a connection with the client; S4: calculating the average response time of each server node; S5: selecting the server node with the shortest average response time, so that the server node establishes a connection with the client; S6: judging whether it reaches a preset value, if so, executing step S1, otherwise executing step S4. The server node scheduling method of the present invention has the advantage that the response time of the server node is not affected by the abnormal response time of the node earlier, thereby selecting the server node with the real shortest response time to allocate the client's request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer transmission, and in particular to a scheduling method, a scheduling device and a server of a server node. Background Art

[0002] In a computer network, a client accesses data on a server by initiating a request. Figure 1 As shown, the server usually includes multiple servers, each server is provided with multiple server nodes, and the client exchanges information with the server through one of the server nodes. Since the information exchange between numerous clients and numerous server nodes is complicated, a scheduling device is provided on the server to allocate server nodes to the clients. The scheduling device allocates server nodes through a load balancing algorithm.

[0003] Existing load balancing algorithms include: polling strategy, which assigns client requests to each server node in order, in a cycle; weighted polling strategy, which assigns a weight to each server node and distributes connections with client requests in proportion to the weight; IP hash strategy, which performs hash calculations based on the IP address of the client request and assigns requests with the same IP to the same server node. In addition, the response time of each server node to the client's request is not the same. The number of data interactions between the server node and the client connection and the content of the interaction will affect the response time of the server node. In order to respond to the client as quickly as possible, the load balancing algorithm also includes a shortest response time strategy to select the server node with the shortest response time and assign it to the client connection.

[0004] The ideal processing logic of the shortest response time strategy is that when a client sends a request, the server node is immediately traversed to calculate the shortest response time of the current request. However, in reality, due to the large number of clients, the server node receives tens of thousands of requests in a certain period of time; and because the server node is also connected to some clients for data interaction, these all cause a lot of redundant calculations for the server node to calculate the shortest response time of the current request, which not only consumes a lot of resources, but also affects the accuracy of the results. Therefore, the shortest response time is currently characterized by using the average response time of the server node. The calculation formula for the average response time is:

[0005]

[0006] The total response time is the sum of the time differences between the server node connecting to each client within a time period, processing each client's data and returning the data to the client. The total number of requests is the total number of times the server node connects to each client within a time period.

[0007] In addition, server node failures occur from time to time. Among the various strategies of the above load balancing algorithm, the polling strategy, the weighted polling strategy, and the IP hash strategy cannot identify whether the server node has a fault. If a server node fails, the above three strategies will still assign the client request to the faulty server node, resulting in abnormal request processing or slow response speed. As for the shortest response time strategy, according to the calculation formula of its average response time, the total response time of the faulty server node is too long, so the shortest response time strategy will not assign the client's request to the faulty server node. However, the faulty server node will not remain in a faulty state all the time, and it is possible that it will return to normal after a period of failure. When the faulty server node returns to normal, since the total response time calculated includes the response time during the fault period, its average response time is greatly increased, which leads to the inability to correctly identify the fault removal situation. That is, at this time, the shortest response time strategy characterized by the calculation method of the average response time will not assign the client request to the server node that has returned to normal, resulting in the server node being idle, thereby causing a waste of computer resources. Summary of the invention

[0008] Based on this, the purpose of the present invention is to provide a server node scheduling method with a reset mechanism to solve the situation where a normal server node is in an idle state.

[0009] S1: Reset each server node;

[0010] S2: Calculate the first response time of each server node;

[0011] S3: Select the server node with the shortest first response time, and establish a connection between the server node and the client;

[0012] S4: Calculate the average response time of each server node;

[0013] S5: Select the server node with the shortest average response time, and establish a connection between the server node and the client;

[0014] S6: Determine whether the preset value is reached, if yes, execute step S1, otherwise execute step S4.

[0015] The server node scheduling method of the present invention presets a reset period so that the server node response time is not affected by the node's earlier abnormal response time, thereby selecting the server node with the real shortest response time to allocate the client's request.

[0016] Furthermore, the reset operation is to traverse all server nodes and delete the total response time and total number of requests of the nodes.

[0017] By presetting a reset period, the calculation of the shortest response time maintains a certain real-time performance, ensuring that the most accurate shortest response time can be calculated in each new reset period.

[0018] In one embodiment, the first response time is the time difference required for each server node to process the client request and return the request.

[0019] By calculating the delay in establishing a connection between the client and the server node in this way, determining the delay in establishing a connection between the client and the server node as the first response time can enable the client to obtain the fastest responding server node as the first choice, while reducing the calculation overhead of the scheduling device. Among them, by selecting the shortest response time for the first time in the above manner, a server node can be assigned the fastest to process the client's request.

[0020] In one embodiment, the first response time is the sum of the time difference between each server node processing a client request and returning the request, and the time difference between the server node processing the data and returning the data after the client sends the data again. The first response time is the sum of the time difference between each server node processing a client request and returning the request, and the time difference between the server node processing the data and returning the data after the client sends the data again.

[0021] Among them, the calculation method is to take the delay of establishing a connection between the client and the server node, and the sum of the delays of the server node processing data and returning it to the client. This method can ensure that the client chooses the server node with the relatively best performance and the fastest response as the first choice.

[0022] Furthermore, the preset value is a time period, which is counted down by the preset time. When the countdown ends, the reset operation of step S1 is performed. After the reset is performed, the time period starts counting again.

[0023] Furthermore, the preset value is a numerical value, and it is determined whether the total number of connections of all server nodes reaches the preset value, and if so, the execution operation of step S1 is executed.

[0024] Among them, by presetting a value, the total number of connections of all server nodes can be determined and reset more dynamically, thereby reducing the calculation overhead of the scheduling device.

[0025] A scheduling device includes a reset module, a first calculation module, a first selection module, a second calculation module, a second selection module and a judgment module;

[0026] The reset module is used to reset each server node;

[0027] The first calculation module is used to calculate the first response time of each server node;

[0028] The first selection module is used to select a server node with the shortest first response time, so that the server node establishes a connection with the client;

[0029] The second calculation module is used to calculate the average response time of each server node;

[0030] The second selection module is used to select a server node with the shortest average response time, so that the server node establishes a connection with the client;

[0031] The judging module is used to judge whether a preset value is reached, and if so, a reset operation is performed through the resetting module, otherwise, the average response time of each server is continuously calculated through the second calculating module.

[0032] A service end includes multiple servers and a scheduling device. The server is provided with multiple service end nodes, and the service end nodes are used to process requests returned to the client. The scheduling device is used in the method described above.

[0033] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is a schematic diagram of the connection between the client and the server;

[0035] Figure 2 This is a schematic diagram of the server structure;

[0036] Figure 3 for Figure 2 The structural schematic diagram of the scheduling device shown;

[0037] Figure 4 This is a flow chart of a server node scheduling method proposed by the present invention. DETAILED DESCRIPTION

[0038] The shortest response time allocation strategy is to calculate the average response time over a period of time to represent the shortest response time. When a server node fails and then is cleared, the response time increases during the failure period, which affects the average response time and ultimately affects the accuracy of its allocation. The existing solution is to design a shorter update time to reduce the number of times this situation occurs within the update time.

[0039] If the update time is set too small, it will cause redundant calculations, affect the calculation overhead of the scheduling device, and affect the accuracy of the average response time calculation. At the same time, the design of the update time requires technicians to consider various factors such as server connection frequency, server performance, or whether there is a connection peak in a certain period of time, and design one or more update time periods to ensure that the calculation of the average response time remains relatively accurate.

[0040] However, the above methods cannot solve the problem of server node failure and troubleshooting from the root, thereby affecting the improvement of average response time. At the same time, designing an accurate update time period requires a lot of experience. Based on this, the present invention proposes a new idea for the shortest response time strategy, which cuts off the impact of possible previous failures by resetting and recalculates the shortest response time.

[0041] During the research process of the reset-instead-update method, the inventor found that the response time of the server node needs to be recalculated after each reset, and the recalculation of the server node affects the computing overhead of the scheduling device. Based on this, after improving and optimizing the allocation strategy of the reset-instead-update method, the present invention finally formed the following server node scheduling method, and formed a scheduling device based on this method.

[0042] See also Figure 2 , Figure 2 This is a schematic diagram of the server structure.

[0043] The server includes multiple servers and a scheduling device. The server is provided with multiple server nodes, and the server nodes are used to process requests returned to the client. The scheduling device is used to calculate the response time of the server nodes and allocate the client's request to the server node with the shortest response time.

[0044] Please also see Figure 3 and Figure 4 , Figure 3 for Figure 2 The structural diagram of the scheduling device shown in FIG. Figure 4 This is a flow chart of a server node scheduling method proposed by the present invention.

[0045] The scheduling device includes a resetting module 1, a first calculating module 2, a first selecting module 3, a second calculating module 4, a second selecting module 5 and a judging module 6.

[0046] The resetting module 1 is used to execute step S1: resetting each server node.

[0047] Specifically, the reset operation is to traverse all server nodes and delete the total response time and total request times of the server nodes.

[0048] The first calculation module 2 is used to execute step S2: calculate the first response time of each server node.

[0049] In this embodiment, the first response time is the time difference between each server node processing the client request and returning the request. The calculation method is the delay in establishing a connection between the client and the server node, and determining the delay in establishing a connection between the client and the server node as the first response time can make the client get the fastest response server node as the first choice, while reducing the calculation overhead of the scheduling device.

[0050] In another embodiment, the first response time is the sum of the time difference between each server node processing the client request and returning the request, and the time difference between the server node processing the data and returning the data after the client sends the data again. The calculation method is to take the delay of establishing a connection between the client and the server node, and the sum of the delay of the server node processing the data and returning it to the client. In this way, the client can ensure that the server node with the relatively best performance and the fastest response is selected as the first choice.

[0051] The first selection module 3 is used to execute step S3: select a server node with the shortest first response time, and enable the server node to establish a connection with the client.

[0052] Specifically, the first response time of each server node is traversed, and a server node with the shortest first response time is selected, so that the server node establishes a connection with the client.

[0053] The second calculation module 4 is used to execute step S4: calculating the average response time of each server node.

[0054] In this embodiment, the average response time is calculated by dividing the total response time of each server node by the total number of requests, that is,

[0055]

[0056] The total response time is the sum of the time difference between the server node receiving and processing the client request each time, and the time difference between the server node processing the client data and returning the data to the client each time after connecting with the client. The total number of requests is the sum of the number of times the server node receives client requests and connects with the client.

[0057] The second selection module 5 is used to execute step S5: select a server node with the shortest average response time, and enable the server node to establish a connection with the client.

[0058] Specifically, the average response time of each server node is traversed, and the server node with the shortest average response time is selected, so that the server node can establish a connection with the client.

[0059] The judging module 6 is used to execute step S6: judging whether a preset value is reached, if yes, executing step S1, otherwise executing step S4.

[0060] In this embodiment, the preset value is a time period, and the preset time is counted down. When the countdown ends, the reset operation of step S1 is performed. After the reset is performed, the time period starts counting again.

[0061] In another embodiment, the preset value is a numerical value, and it is determined whether the total number of connections of all server nodes reaches the preset value, and if so, the execution operation of step S1 is executed.

[0062] Compared with the prior art, the balanced scheduling method proposed in the present invention provides a server node response time that is not affected by the node's earlier abnormal response time, and selects the server node with the real shortest response time to allocate the client's request.

[0063] Based on the same inventive concept, the present application also provides an electronic device, which may be a terminal device such as a server, a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the server node scheduling method of an embodiment of the present invention; and the memory is used to store a computer program executable by the processor.

[0064] Based on the same inventive concept, the present application also provides a computer-readable storage medium, corresponding to the embodiment of the aforementioned server node scheduling method, wherein the computer-readable storage medium stores a computer program thereon, and when the program is executed by a processor, the steps of the server node scheduling method recorded in any of the aforementioned embodiments are implemented.

[0065] The present application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved 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, tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0066] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.

Claims

1. A scheduling method for a server node, characterized in that: The following steps are involved: S1: Reset each server node; wherein the reset operation is to traverse all server nodes and delete the total response time and total number of requests of the server nodes; S2: Calculate the first response time of each server node; wherein the first response time is the time difference required for each server node to process the client request and return the request; or, the first response time is the sum of the time difference required for each server node to process the client request and return the request, and the time difference required for the server node to process the data and return the data after the client sends the data again; S3: Select the server node with the shortest first response time, and establish a connection between the server node and the client; S4: Calculate the average response time of each server node; wherein the average response time is calculated by dividing the total response time of each server node by the total number of requests, specifically, The total response time is the sum of the time difference between the server node receiving and processing the client request each time, and the time difference between the server node processing the client data and returning the data to the client each time after connecting with the client; the total number of requests is the sum of the number of times the server node receives client requests and connects with the client; S5: Select the server node with the shortest average response time, and establish a connection between the server node and the client; S6: Determine whether the preset value is reached, if so, execute step S1, otherwise execute step S4; wherein, the preset value is a time period, and the countdown is performed through the preset time. When the countdown ends, the reset operation of step S1 is performed, and after the reset is performed, the time period starts again; or, the preset value is a numerical value, and it is determined whether the total number of connections of all server nodes reaches the preset value, if so, execute step S1.

2. A scheduling device, characterized in that: It includes a reset module, a first calculation module, a first selection module, a second calculation module, a second selection module and a judgment module; The reset module is used to reset each server node; wherein the reset operation is to delete the total response time and total number of requests of the server node by traversing all server nodes; The first calculation module is used to calculate the first response time of each server node; wherein the first response time of the first selection module is the time difference required for each server node to process the client request and return the request; or, the first response time of the first selection module is the sum of the time difference required for each server node to process the client request and return the request, and the time difference for the server node to process the data and return the data after the client sends the data again; The first selection module is used to select a server node with the shortest first response time, so that the server node establishes a connection with the client; The second calculation module is used to calculate the average response time of each server node; wherein the average response time is calculated by dividing the total response time of each server node by the total number of requests, specifically, The total response time is the sum of the time difference between the server node receiving and processing the client request each time, and the time difference between the server node processing the client data and returning the data to the client each time after connecting with the client; the total number of requests is the sum of the number of times the server node receives client requests and connects with the client; The second selection module is used to select a server node with the shortest average response time, so that the server node establishes a connection with the client; The judgment module is used to judge whether a preset value has been reached. If so, a reset operation is performed through the reset module, otherwise, the average response time of each server continues to be calculated through the second calculation module; wherein, the preset value is a time period, and the preset time is counted down. When the timing ends, the reset module performs a reset operation, and after the reset is performed, the time period starts again; or, the preset value is a numerical value, and it is judged whether the total number of connections of all server nodes has reached the preset value. If so, a reset operation is performed through the reset module.

3. A server, characterized in that: It comprises a plurality of servers and a scheduling device, wherein the server is provided with a plurality of service end nodes, wherein the service end nodes are used to process requests returned to the client, and the scheduling device is used to execute the method described in claim 1.

Citation Information

Patent Citations

  • Modbus timeout response adaptive configuration method and device, equipment and storage medium

    CN117354081A

  • Load balance realizing method and load balance device

    CN1937534A