A task allocation method and device for a server node

By determining the performance index and sequence based on the task execution time in a distributed server and dynamically adjusting the task allocation, the problem of inability to take into account performance differences and dynamic adjustment in the existing technology is solved, and load balancing and efficient task allocation are achieved.

CN112685177BActive Publication Date: 2025-07-22LENOVO (BEIJING) LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011562811.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2025-07-22
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

In the prior art, the task allocation method of distributed servers cannot take into account the performance differences and dynamic adjustment of server nodes, resulting in overall inefficiency and difficulty in meeting the needs of scenarios such as stream computing.

Method used

By determining the performance index based on the task execution time of the server node, establishing a performance sequence, and dynamically adjusting the task allocation to make the number of tasks positively correlated with performance, and load balancing is achieved.

Benefits of technology

It realizes low-cost dynamic adjustment when server nodes change, improves the efficiency of the overall computing system, and meets the needs of scenarios such as stream computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112685177B_ABST
    Figure CN112685177B_ABST
Patent Text Reader

Abstract

The present invention discloses a task allocation method and device for server nodes, including: determining the performance index of each server node in the computing system according to the task execution duration of each server node in the computing system; determining the performance sequence of the computing system according to the performance index of each server node; determining the allocation parameter corresponding to the target task; and determining the server node corresponding to the target task according to the allocation parameter and the performance sequence. This method can take into account the performance differences of server nodes during task allocation, so that the number of tasks allocated to server nodes is positively correlated with their performance, thereby achieving load balancing among server nodes in the entire computing system and improving the overall efficiency. At the same time, when server nodes change, only the changed part can be dynamically adjusted at low cost, which can meet the usage requirements in scenarios such as stream computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a method and device for task allocation of server nodes. Background Art

[0002] At present, in large server systems, distributed servers are mostly used to provide stronger performance. A distributed server consists of multiple server nodes, and each server node can be a complete computer device. Therefore, compared with traditional single servers, the performance of distributed servers can break through the constraints of hardware performance. In a distributed server, the task allocation method for each server node is the key to improving the overall work efficiency.

[0003] There are various common task allocation methods. For example, the weight method is to set the weight according to the performance of each server node; the number of tasks assigned to a server node is positively correlated with the weight. This method fully considers the performance differences of each server node during task allocation, but the defect is that both weight setting and task allocation are static configurations and cannot be dynamically adjusted when necessary. The minimum connection number method is to perform dynamic task allocation according to the size of the connection number of the server node. Although it is convenient to adjust the task allocation, it does not consider the performance differences of the server nodes.

[0004] It can be seen that the task allocation methods in the prior art cannot take into account both the performance differences of server nodes and the dynamic adjustment of tasks. Summary of the Invention

[0005] The present invention provides a method and device for task allocation of server nodes to at least solve the above technical problems existing in the prior art.

[0006] In a first aspect, the present invention provides a method for task allocation of server nodes, including:

[0007] Determine the performance index of each server node according to the task execution duration of each server node in the computing system;

[0008] Determine the performance sequence of the computing system according to the performance index of each server node;

[0009] Determine the allocation parameters corresponding to the target task; determine the server node corresponding to the target task according to the allocation parameters and the performance sequence.

[0010] Preferably, before determining the performance index of each server node, it further includes:

[0011] Determine the elapsed time data of multiple executed tasks in the server node according to a preset period;

[0012] Determine the task execution duration according to the elapsed time data of the multiple executed tasks.

[0013] Preferably, the determining the performance index of each server node includes:

[0014] Determine the performance index of the server node according to the task execution duration of each server node and a preset standard duration.

[0015] Preferably, the determining the performance sequence of the computing system according to the performance indexes of each server node includes:

[0016] Arrange the performance indexes of each server node in order to determine the performance sequence.

[0017] Preferably, the determining the allocation parameter corresponding to the target task includes:

[0018] Determine the total performance value of the computing system as the sum of the performance indexes of each server node in the performance sequence;

[0019] Determine a random number not greater than the total performance value as the allocation parameter corresponding to the target task.

[0020] Preferably, the determining the server node corresponding to the target task according to the allocation parameter and the performance sequence includes:

[0021] Calculate the sum of the performance indexes of the first k server nodes and the sum of the performance indexes of the first k - 1 server nodes in the performance sequence; so that the allocation parameter of the target task is less than the sum of the performance indexes of the first k server nodes and not less than the sum of the performance indexes of the first k - 1 server nodes;

[0022] Determine the k-th server node in the performance sequence as the server node corresponding to the target task; where k is a positive integer.

[0023] Preferably, when a server node in the computing system goes offline, it further includes:

[0024] Determine the unfinished tasks running on the offline server node as the target tasks.

[0025] Preferably, when a server node in the computing system goes online, it further includes:

[0026] Determine the performance index of the online server node, and update the performance sequence of the computing system according to the performance index of the online server node.

[0027] Second aspect, the present invention provides a task allocation device for server nodes, including:

[0028] A performance index determination module, configured to determine the performance index of each server node according to the task execution duration of each server node in the computing system;

[0029] A performance sequence determination module, configured to determine the performance sequence of the computing system according to the performance index of each server node;

[0030] A task allocation module, configured to determine the allocation parameters corresponding to the target task; and determine the server node corresponding to the target task according to the allocation parameters and the performance sequence.

[0031] Third aspect, the present invention provides an electronic device, including:

[0032] A processor;

[0033] A memory for storing executable instructions of the processor;

[0034] The processor is configured to read the executable instructions from the memory and execute the instructions to implement the task allocation method for server nodes of the present invention.

[0035] Compared with the prior art, the task allocation method and device for server nodes provided by the present invention determine the performance index based on the performance of the server nodes, determine the performance sequence according to the performance index, and use the performance sequence to implement the allocation of the target task. It can take into account the performance differences of the server nodes during task allocation, so that the number of tasks allocated to the server nodes is positively correlated with their performance, thereby achieving load balancing of each server node in the entire computing system and improving the overall efficiency; at the same time, when the server nodes change, only the changed part can be dynamically adjusted at low cost, which can meet the usage requirements in scenarios such as stream computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic flowchart of a task allocation method for server nodes provided by an embodiment of the present invention;

[0037] Figure 2 It is a schematic flowchart of another task allocation method for server nodes provided by an embodiment of the present invention;

[0038] Figure 3 It is a schematic structural diagram of a task allocation device for server nodes provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the objectives, features, and advantages of the present invention more obvious and understandable, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0040] In distributed servers, there are various task allocation methods. Common ones include the weight method, the least connection number method, the consistent hashing algorithm, etc.

[0041] The weight method sets the weight of each server node according to its performance strength; the number of tasks assigned to the server node is positively correlated with the weight. This method fully considers the performance differences of each server node during task allocation. However, the so-called "weight" in this method is essentially a "percentage", and the sum of the weights of all server nodes is always equal to 100%. If the number of server nodes in the distributed server increases or decreases, the weights of all server nodes will change, and it is necessary to recalculate. Therefore, in the weight method, both weight setting and task allocation are static configurations and cannot be dynamically adjusted only for the changed part when the server node changes.

[0042] The least connection number method performs dynamic task allocation according to the size of the connection number of the server node. This method is exactly the opposite of the weight method. It is convenient for dynamic adjustment of task allocation and can adapt to server node changes. However, during the task allocation process, only the connection number is used as the basis, without considering the performance differences of the server nodes, that is, it is impossible to achieve load balancing between server nodes.

[0043] The consistent hashing algorithm can, to a certain extent, take into account both the performance differences of server nodes and dynamic adjustment of tasks. However, in this method, if a server node goes online, task allocation must be carried out immediately, otherwise the server node cannot be incorporated into the hashing algorithm. Therefore, this method is more suitable for scenarios that are not sensitive to data allocation such as data storage and stateless short-term tasks. In scenarios such as stream computing, the consistent hashing algorithm will cause a large number of task switches, which will have an obvious impact on the ongoing tasks.

[0044] As can be seen from the above, the current task allocation methods each have different defects and it is difficult to achieve low-cost dynamic adjustment of tasks while allocating tasks based on the performance of server nodes to meet the usage requirements in scenarios such as stream computing.

[0045] Therefore, the embodiments of the present invention will provide a task allocation method for server nodes to at least solve the above technical problems existing in the prior art. As Figure 1As shown, the method in this embodiment includes the following steps:

[0046] Step 101: Determine the performance index of each server node according to the task execution duration of each server node in the computing system.

[0047] The computing system can be a distributed server, or a cluster server for short. The computing system includes multiple server nodes. In this embodiment, a specific program can be run on a certain server node to make this server node the driving node. The driving node can be the execution entity of the method in this embodiment.

[0048] In this embodiment, the performance of each server node will be evaluated by calculating its task execution duration, and the corresponding performance index will be determined. The process of determining the task execution duration is as follows: According to a preset period, determine the time-consuming data of multiple executed tasks in the server node; according to the time-consuming data of the multiple executed tasks, determine the task execution duration. Specifically, the logs can be grabbed from the server node within a certain period, and some tasks that have been executed and completed on the server node can be sampled and analyzed, that is, the time-consuming data of the executed tasks is determined. This time-consuming data is the actual execution duration of the executed tasks. And take the average value of the time-consuming data of the executed tasks as the task execution duration of the server node. In this embodiment, it can be considered that the task execution duration of the server node is negatively correlated with the performance of the server node, that is, the stronger the performance of the server node, the faster the task is executed, and the corresponding task execution duration is shorter. Therefore, the task execution duration can be used as the basis for evaluating the performance of the server node.

[0049] The preset period can be a time period, that is, determine the task execution duration of the server node within a certain time range. It can also use the sampling quantity of the executed tasks as the period. For example, when the sampling quantity reaches a specific value, the task execution duration can be calculated once. Through the preset period, the performance index of the server node will be determined regularly in this embodiment, so that the performance index can reflect the true performance of the server node. And this performance index can be used as the basis for task allocation based on the performance of the server node.

[0050] The performance index represents a data metric obtained by quantifying the performance of server nodes. Since there is a clear correlation between the task execution duration of server nodes and their performance, in this embodiment, the task execution duration is used to determine the performance index. Different from the prior art, this performance index is not essentially a "percentage" or "ratio value" anymore, but an absolute value used to measure the performance of server nodes. The value of this performance index only depends on the server performance itself and can be updated according to the above-mentioned preset period. Generally, the larger the value of the performance index, the stronger the performance of the server node. That is to say, since the performance index is an absolute value, when the number of server nodes in the computing system increases or decreases, the performance indices of other server nodes will not be affected and there is no need to recalculate.

[0051] In this embodiment, there is no limitation on the calculation method of the performance index, and any algorithm that can achieve the same or similar effects can be incorporated into the overall technical solution of this embodiment. For example, the performance index of a server node can be determined based on the task execution duration of each server node and a preset standard duration. The preset standard duration is the duration theoretically required to complete the task, while the task execution duration represents the actual duration for the server node to complete the task. By comparing the two, the performance index of the server node can be determined. Specifically, the task execution duration and the standard duration of the server node can be calculated based on the logistic regression algorithm to determine the performance index, and the calculation formula is as follows:

[0052]

[0053] where n represents the performance index, x represents the task execution duration, c represents the standard duration, and e is the natural constant.

[0054] Step 102: Determine the performance sequence of the computing system according to the performance indices of each server node.

[0055] After determining the performance indices of each server node, a set can be established based on this, or arranged in order based on this to determine the performance sequence of the computing system. The performance sequence includes each performance index, which reflects the actual performance distribution of each server node in the computing system. Subsequently, task allocation is performed according to the performance sequence, and the performance differences of server nodes can be considered during task allocation, so that the number of tasks assigned to server nodes is positively correlated with their performance, thereby achieving load balancing of each server node in the entire computing system and improving the overall efficiency.

[0056] When the number of server nodes in the computing system increases or decreases, only the corresponding items (i.e., performance indices) need to be added or reduced in the performance sequence. The performance indices corresponding to other server nodes are not affected, so the tasks already assigned to other server nodes do not need to be changed. Therefore, the method in this embodiment can perform low-cost dynamic adjustment only for the changed part when the server nodes change, and can meet the usage requirements in scenarios such as stream computing.

[0057] Step 103: Determine the allocation parameters corresponding to the target task; according to the allocation parameters and the performance sequence, determine the server node corresponding to the target task.

[0058] The target task is the task to be assigned to the server node for processing. The allocation parameter is an identifier determined for the target task during the allocation process. According to the allocation parameter, it can be determined which specific performance index in the performance sequence the target task hits. Furthermore, the target task can be assigned to the server node corresponding to the hit performance index, that is, the task allocation is realized. Usually, the larger the value of the performance index, the higher the probability of its hit. Therefore, according to probability statistics, the high-performance server nodes in the computing system will execute more tasks, and conversely, the low-performance server nodes will execute fewer tasks. Thus, the load balance of each server node in the entire computing system is achieved. In this embodiment, no specific limitation is imposed on the specific allocation algorithm, and any algorithm that can achieve the same or similar effect can be incorporated into the overall technical solution of this embodiment.

[0059] It should be noted that in the above method of this embodiment, low-cost dynamic adjustment can be performed only for the changed part when the server nodes change. Specifically, it includes two specific situations: server node offline and server node online. The details are as follows:

[0060] When there is a server node offline in the computing system, the unfinished tasks running on the offline server node are determined as the target tasks. In this embodiment, there is a constant connection relationship between the execution main body, the driving node, and each server node. When the server node is controlled to go offline, it will inform the driving node through the constant connection. Or when the server node is forced to go offline due to a crash, the constant connection will be disconnected, and it will also be known to the driving node. Therefore, in either case, the driving node can determine that the server node is offline.

[0061] When a server node goes offline, the performance index corresponding to the server node can be deleted from the performance sequence, that is, one item is reduced in the performance sequence, and other items remain unaffected. All unfinished tasks being executed on the server node are determined as target tasks, and are reallocated to normal server nodes in the manner of step 103, and are re-executed after the allocation. Thus, when a server node goes offline, this method can perform targeted adjustment at low cost, so that other server nodes and other tasks are not affected.

[0062] When a server node comes online in the computing system, determine the performance index of the online server node, and update the performance sequence of the computing system according to the performance index of the online server node. When a new server node comes online, it can immediately report to the drive node and establish a permanent connection, so that the drive node is aware of the newly online server node. Then, the performance index of the newly online server node can be determined in the manner of steps 101 to 102, and the performance index is added to the performance sequence. That is, one item is added to the performance sequence, and other items remain unaffected. Other already allocated tasks do not need to change either.

[0063] When a new target task appears, it can be allocated in the manner of step 103. Since there are no tasks allocated in the new node, its performance is usually high and the value of the performance index is large. Therefore, in the performance sequence, it has a greater probability of being preferentially allocated to the target task. And the difference between this embodiment and the consistent hashing algorithm is that after a new server node comes online, it does not need to be immediately allocated tasks. Instead, it can be normally allocated when a target task appears, so it does not affect other tasks being executed. Thus, when a server node comes online, this method can perform targeted adjustment at low cost, so that other server nodes and other tasks are not affected.

[0064] From the above technical solutions, it can be seen that the beneficial effects of this embodiment are as follows: The performance index is determined based on the performance of the server node, and the performance sequence is determined according to the performance index. The target task is allocated by using the performance sequence, and the performance difference of the server node can be considered during task allocation, so that the number of tasks allocated to the server node is positively correlated with its performance, thereby achieving the load balance of each server node in the entire computing system and improving the overall efficiency; at the same time, when the server node changes, only the changed part can be dynamically adjusted at low cost, which can meet the usage requirements in scenarios such as stream computing.

[0065] Figure 1 The shown is only the basic embodiment of the method of the present invention. Based on this, with certain optimization and expansion, other preferred embodiments of the method can also be obtained.

[0066] Such as Figure 2As shown, this is another specific embodiment of the task allocation method for the server node of the present invention. This embodiment is described by way of example on the basis of the foregoing embodiment. The method specifically includes the following steps:

[0067] Step 201: Determine the performance index of each server node according to the task execution duration of each server node in the computing system.

[0068] In this embodiment, the calculation method of the performance index may be the same as that of the foregoing embodiment, and will not be repeated here. Assume that the computing system includes 5 server nodes, and their performance indexes are n1, n2, n3, n4, and n5 respectively; specifically: n1 = 10, n2 = 15, n3 = 12, n4 = 20, n5 = 8.

[0069] Step 202: Arrange the performance indexes of each server node in order to determine the performance sequence.

[0070] In this embodiment, the hit probability of each performance index in the performance sequence depends on its numerical value and has nothing to do with its arrangement order. Therefore, the sorting method of the performance index in this step is not limited, and any sorting method can be combined in the overall technical solution of this embodiment.

[0071] Specifically, the performance sequence can be expressed as follows: [10, 15, 12, 20, 8].

[0072] Step 203: Determine the sum of the performance indexes of each server node in the performance sequence as the total performance value of the computing system.

[0073] The total performance value can represent the overall performance of the computing system. In this step, the total performance value is represented as N. This total performance value is the sum of the above n1 to n5. That is:

[0074] N = n1 + n2 + n3 + n4 + n5 = 65.

[0075] Step 204: Determine a random number not greater than the total performance value as the allocation parameter corresponding to the target task.

[0076] In this embodiment, when there is a target task to be allocated, its allocation parameter can be determined by a random algorithm. The random algorithm can adopt existing algorithms and will not be elaborated here. The allocation parameter is a random number not greater than the value of the total performance value. Specifically, the allocation parameter can be expressed as m. In this step, it is assumed that m = 42.

[0077] Step 205: Determine the server node corresponding to the target task according to the allocation parameter and the performance sequence.

[0078] According to the allocation parameters and the performance sequence, it is possible to determine which specific performance index the allocation parameters hit, and then allocate the target task to the server node corresponding to the hit performance index. Specifically, the hitting method of the allocation parameters can be referred to as follows:

[0079] Calculate the sum of the performance indices of the first k server nodes and the sum of the performance indices of the first k - 1 server nodes in the performance sequence; ensure that the allocation parameters of the target task are less than the sum of the performance indices of the first k server nodes and not less than the sum of the performance indices of the first k - 1 server nodes; determine the kth server node in the performance sequence as the server node corresponding to the target task; where k is a positive integer.

[0080] In the above method, k represents the serial number of the performance index in the performance sequence. For example, when k = 1, it can be specifically calculated to determine whether the allocation parameters hit the first performance index in the performance sequence. At this time, the sum of the performance indices of the first k server nodes is equal to n1, that is, 10. And the sum of the performance indices of the first k - 1 server nodes is 0. In this embodiment, the value of the allocation parameter m is 42, which does not meet the above conditions. It means that the first performance index in the performance sequence is not hit.

[0081] Similarly, when k = 2, it can be calculated to determine whether the allocation parameters hit the second performance index in the performance sequence. At this time, the sum of the performance indices of the first k server nodes is equal to n1 + n2, that is, 25. And the sum of the performance indices of the first k - 1 server nodes is equal to n1, that is, 10. The allocation parameter m also does not meet the above conditions. It means that the second performance index in the performance sequence is not hit.

[0082] Until k = 4, the sum of the performance indices of the first k server nodes is equal to n1 + n2 + n3 + n4, that is, 57. And the sum of the performance indices of the first k - 1 server nodes is equal to n1 + n2 + n3, that is, 37. At this time, 37 < m < 57 is satisfied. That is, it satisfies that the allocation parameters of the target task are less than the sum of the performance indices of the first k server nodes and not less than the sum of the performance indices of the first k - 1 server nodes. It means that the allocation parameters hit the fourth performance index in the performance sequence. Further, the target task can be allocated to the server node corresponding to the fourth performance index in the performance sequence.

[0083] It can be understood from the above task allocation method that since the allocation parameter m is a random number, the target task can randomly hit any server node with a certain probability. The specific hit probability is proportional to the value of the server node performance parameter and is not related to the arrangement order in the performance sequence. In this case, the performance differences of the server nodes can be considered during task allocation, so that the number of tasks assigned to the server nodes is positively correlated with their performance, thereby achieving load balancing of each server node in the entire computing system and improving the overall efficiency.

[0084] As Figure 3 shown, it is a specific embodiment of the task allocation device for the server node described in the present invention. The device in this embodiment is an entity device for executing Figures 1 - 2 the method described above. Its technical solution is essentially the same as that of the above embodiment, and the corresponding descriptions in the above embodiment also apply to this embodiment. The device in this embodiment includes:

[0085] A performance index determination module 301, configured to determine the performance index of each server node in the computing system according to the task execution duration of each server node.

[0086] A performance sequence determination module 302, configured to determine the performance sequence of the computing system according to the performance indexes of each server node.

[0087] A task allocation module 303, configured to determine the allocation parameter corresponding to the target task; and determine the server node corresponding to the target task according to the allocation parameter and the performance sequence.

[0088] In addition, on the basis of the embodiment shown in Figure 3 , preferably, it further includes:

[0089] A task duration determination module 304, configured to determine the elapsed time data of multiple executed tasks in the server node according to a preset period; and determine the task execution duration according to the elapsed time data of the multiple executed tasks.

[0090] The task allocation module 303 includes:

[0091] A performance total value determination unit 331, configured to determine the sum of the performance indexes of each server node in the performance sequence as the performance total value of the computing system.

[0092] An allocation parameter determination unit 332, configured to determine a random number not greater than the performance total value as the allocation parameter corresponding to the target task.

[0093] A task allocation unit 333 is configured to calculate the sum of the performance indices of the first k server nodes and the sum of the performance indices of the first k - 1 server nodes in the performance sequence, so that the allocation parameter of the target task is less than the sum of the performance indices of the first k server nodes and not less than the sum of the performance indices of the first k - 1 server nodes, and determine the k-th server node in the performance sequence as the server node corresponding to the target task, where k is a positive integer.

[0094] It further includes a offline processing module 305 configured to determine the unfinished tasks running on the offline server node as target tasks.

[0095] It further includes an online processing module 306 configured to determine the performance index of the online server node and update the performance sequence of the computing system according to the performance index of the online server node.

[0096] In addition to the above methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions that, when run by a processor, cause the processor to execute the steps in the methods according to various embodiments of the present invention described in the "Exemplary Method" section above of this specification.

[0097] The computer program product can be written in any combination of one or more programming languages for the program code to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0098] Furthermore, an embodiment of the present invention may also be a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are run by a processor, the processor is caused to execute the steps in the methods according to various embodiments of the present invention described in the "Exemplary Method" section above of this specification.

[0099] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0100] The basic principles of the present invention have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present invention are only examples and not limitations. It cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present invention. In addition, the above-disclosed specific details are only for the purposes of illustration and facilitating understanding, rather than limitations. The above details do not limit the present invention to necessarily adopt the above specific details for implementation.

[0101] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present invention are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended words, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the word "and / or", and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with each other.

[0102] It should also be noted that in the devices, equipment, and methods of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent solutions of the present invention.

[0103] The above description of the disclosed aspects enables any person skilled in the art to make or use the present invention. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.

[0104] The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the invention to the form disclosed herein. Although several example aspects and embodiments have been discussed above, those skilled in the art will recognize some variations, modifications, alterations, additions, and subcombinations thereof.

Claims

1. A task allocation method for server nodes, comprising: Determining a performance index for each of the server nodes according to the task execution duration of each server node in the computing system; Determining a performance sequence of the computing system according to the performance indexes of the server nodes; Determining an allocation parameter corresponding to a target task, where the allocation parameter is a random number used to identify the target task; and determining the server node corresponding to the target task according to the allocation parameter and the performance sequence, so that the number of tasks allocated to each server node is positively correlated with its performance; Wherein, the determining the server node corresponding to the target task according to the allocation parameter and the performance sequence includes: calculating the sum of the performance indexes of the first k server nodes and the sum of the performance indexes of the first k - 1 server nodes in the performance sequence; so that the allocation parameter of the target task is less than the sum of the performance indexes of the first k server nodes and not less than the sum of the performance indexes of the first k - 1 server nodes; and determining the kth server node in the performance sequence as the server node corresponding to the target task; where k is a positive integer.

2. The method according to claim 1, before determining the performance index of each server node, further comprising: Determining the elapsed time data of multiple executed tasks in the server node at a preset period; Determining the task execution duration according to the elapsed time data of the multiple executed tasks.

3. The method according to claim 1, the determining the performance index of each server node includes: Determining the performance index of the server node according to the task execution duration of each server node and a preset standard duration.

4. The method according to claim 1, the determining the performance sequence of the computing system according to the performance indexes of the server nodes includes: Arranging the performance indexes of the server nodes in order to determine the performance sequence.

5. The method according to claim 4, the determining the allocation parameter corresponding to the target task includes: Determining the total performance value of the computing system as the sum of the performance indexes of the server nodes in the performance sequence; Determining a random number not greater than the total performance value as the allocation parameter corresponding to the target task.

6. The method according to any one of claims 1 to 5, when there is a server node offline in the computing system, further comprising: Determining the unfinished tasks running on the offline server node as the target task.

7. The method according to any one of claims 1 to 5, when there is a server node online in the computing system, further comprising: Determining the performance index of the online server node and updating the performance sequence of the computing system according to the performance index of the online server node.

8. A task allocation device for server nodes, comprising: A performance index determination module, configured to determine a performance index for each server node according to the task execution duration of each server node in the computing system; A performance sequence determination module, configured to determine a performance sequence of the computing system according to the performance indices of the server nodes; A task allocation module, configured to determine allocation parameters corresponding to a target task, where the allocation parameters are random numbers used to identify the target task; and determine the server node corresponding to the target task according to the allocation parameters and the performance sequence, so that the number of tasks allocated to each server node is positively correlated with its performance; Among them, the task allocation module includes a task allocation unit, configured to calculate the sum of the performance indices of the first k server nodes and the sum of the performance indices of the first k - 1 server nodes in the performance sequence; so that the allocation parameter of the target task is less than the sum of the performance indices of the first k server nodes and not less than the sum of the performance indices of the first k - 1 server nodes; and determine the kth server node in the performance sequence as the server node corresponding to the target task; where k is a positive integer.

9. An electronic device, comprising: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the task allocation method for the server node according to any one of claims 1 - 7 above.

Citation Information

Patent Citations

  • Cloud computing task real-time scheduling method

    CN110502323A