Computing task allocation method, distributed computing system, and device

By having multiple nodes jointly decide on the allocation of subtasks in a distributed computing system, the problem of excessive burden on the central node is solved, and the system's load balancing and performance are improved.

CN115525423BActive Publication Date: 2026-11-24ALIBABA CLOUD COMPUTING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211117416.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-14
Publication Date
2026-11-24
Estimated Expiration
2042-09-14

AI Technical Summary

Technical Problem

In existing distributed computing systems, the central node is overburdened, resulting in poor system performance.

Method used

In a distributed computing system, task assignment messages are generated, and multiple computing nodes jointly decide on the allocation of subtasks. The allocation of computing tasks is completed by generating and propagating subtask claim messages.

Benefits of technology

It improves the load balancing of the distributed computing system, avoids overload of a single node, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115525423B_ABST
    Figure CN115525423B_ABST
Patent Text Reader

Abstract

This application provides a computing task allocation method, a distributed computing system, and a device. The method includes the following steps: generating a task allocation message for a computing task; the task allocation message includes requirement information for multiple subtasks corresponding to the computing task; propagating the task allocation message in the distributed computing system; determining the target computing node corresponding to each subtask from the distributed computing system based on subtask claim messages sent by the propagated computing nodes in response to the task allocation message; the subtask claim messages are generated by the propagated computing nodes based on the task allocation message and their own resource allocation; and allocating each subtask to its corresponding target computing node. The technical solution provided by this application helps improve the load balancing of the entire distributed computing system and avoids the problem of a single node being overloaded due to the entire allocation work being completed by that node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a method for allocating computing tasks, a distributed computing system, and a device. Background Technology

[0002] Distributed computing breaks down computational tasks and distributes them to multiple computers for processing. Finally, the results from these multiple computers are combined to obtain the final result. This saves overall computation time and improves computational efficiency.

[0003] Currently, most existing distributed computing systems consist of a central node and multiple computing nodes that are communicatively connected to the central node. The central node is used to schedule the multiple computing nodes, maintain their load status, and allocate subtasks of the computing task based on their load.

[0004] It is evident that in existing distributed computing systems, the central node has a heavy allocation task, resulting in poor system performance. Summary of the Invention

[0005] In view of the above problems, this application is made to provide a computing task allocation method, distributed computing system and device that solves or at least partially solves the above problems.

[0006] Therefore, in one embodiment of this application, a method for allocating computing tasks is provided, comprising:

[0007] For a computing task, a task assignment message is generated; the task assignment message includes: the requirement information of multiple subtasks corresponding to the computing task;

[0008] The task assignment message is propagated in a distributed computing system; the distributed computing system includes multiple computing nodes.

[0009] Based on the subtask claim messages sent by the propagated computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system; the subtask claim messages are generated by the propagated computing nodes based on the task assignment message and their own resource allocation.

[0010] Each subtask is assigned to its corresponding target computing node.

[0011] In another embodiment of this application, a method for allocating computing tasks is provided, wherein the method includes:

[0012] The system receives a transmitted task assignment message; the task assignment message includes the requirement information of multiple subtasks corresponding to the computing task; the task assignment message is generated by the task initiating computing node that initiates the computing task in the distributed computing system.

[0013] Based on its own resource allocation and the task to be assigned message, a subtask claim message is generated.

[0014] The subtask claim message is sent to the task initiating computing node, so that the task initiating computing node can allocate the multiple subtasks according to the subtask claim message.

[0015] In another embodiment of this application, a distributed computing system is provided, comprising: multiple computing nodes;

[0016] The computing node is used for:

[0017] For a computing task, a task assignment message is generated; the task assignment message includes: the requirement information of multiple subtasks corresponding to the computing task;

[0018] The task assignment message is propagated in the distributed computing system.

[0019] Based on the subtask claim messages sent by the distributed computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system.

[0020] Each subtask is assigned to its corresponding target computing node.

[0021] In another embodiment of this application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein,

[0022] The memory is used to store programs;

[0023] The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the method described in any of the preceding embodiments.

[0024] In another embodiment of this application, a computer-readable storage medium storing a computer program is provided, which, when executed by a computer, can implement the methods described in any of the above-described embodiments.

[0025] In the technical solution provided in this application embodiment, a task-to-be-assigned message is generated for each computing task. Then, the task-to-be-assigned message is propagated in the distributed computing system. The computing nodes to which the message is propagated generate and return sub-task claim messages based on these messages, and the computing tasks are assigned according to the returned sub-task claim messages. In other words, the assignment of computing tasks is not performed by a single node in the distributed computing system, but rather by multiple nodes working together. This effectively breaks down and distributes the task assignment process, which helps improve the load balancing of the entire distributed computing system and avoids the problem of a single node being overloaded if it handles the entire assignment. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This is a schematic diagram of the structure of a centralized distributed computing system provided in an embodiment of this application;

[0028] Figure 2 A flowchart illustrating a decentralized distributed computing system provided in an embodiment of this application;

[0029] Figure 3 A flowchart illustrating a computational task allocation method provided in an embodiment of this application;

[0030] Figure 4 Example diagram of a subtask claim matrix provided in an embodiment of this application;

[0031] Figure 5 A flowchart illustrating a computational task allocation method provided in yet another embodiment of this application;

[0032] Figure 6 This is a schematic diagram of the structure of a computing task allocation system provided in an embodiment of this application;

[0033] Figure 7 Signaling diagram of a computing task allocation method provided in an embodiment of this application;

[0034] Figure 8 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0035] In existing technologies, distributed computing systems typically include a central node and multiple computing nodes communicatively connected to the central node. Each computing node is equipped with a load monitoring device, which collects the current load information of the node and uploads it to the central node. In other words, the central node needs to maintain the load information of each computing node. When initiating a computing task, the central node determines multiple target computing nodes based on the load information uploaded by each computing node, and then assigns multiple subtasks of the computing task to these target computing nodes. That is, in existing technologies, the entire task allocation process is entirely handled by the central node. However, in practical applications, large-scale distributed computing systems handle a vast number of computing tasks, often placing the central node under heavy load and resulting in poor overall system performance.

[0036] To address the aforementioned technical problems, this application proposes a novel method for allocating computing tasks. Specifically, for each computing task, a task-to-be-allocated message is generated. This message is then propagated throughout the distributed computing system, where each receiving computing node generates and returns a subtask claim message. The computing task is then allocated based on the returned subtask claim message. In other words, the allocation of computing tasks is not performed by a single node in the distributed computing system, but rather by multiple nodes working together. This effectively breaks down and distributes the task allocation process, improving the load balancing of the entire distributed computing system and avoiding the problem of a single node being overloaded when the entire allocation is performed.

[0037] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0038] Furthermore, some processes described in the specification, claims, and accompanying drawings of this application include multiple operations that appear in a specific order. These operations may be performed out of order or in parallel. Operation numbers such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be performed sequentially or in parallel. It should be noted that the terms "first," "second," etc., used herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0039] Before introducing the computing task allocation method provided in the embodiments of this application, the system architecture involved in the computing task allocation method provided in the embodiments of this application will be described. In practical applications, the distributed computing system can be a centralized distributed computing system or a decentralized distributed computing system. Figure 1 As shown, the centralized distributed computing system includes a central node 11 and multiple computing nodes 12 communicatively connected to the central node 11. Figure 2 As shown, the decentralized distributed computing system includes multiple interconnected computing nodes 21. There is no central node in the decentralized distributed computing system; the relationship between the multiple computing nodes 21 is equal. That is, each computing node can receive computing requests sent by users and, based on the computing requests, generate (or initiate) corresponding computing tasks and allocate the computing tasks.

[0040] The execution entity of the computing task allocation method provided in this application embodiment can be the central node 11 in a centralized distributed computing system, or any computing node in a decentralized distributed computing system. This application embodiment does not specifically limit this. For ease of description, the following will take a decentralized distributed computing system as an example, and a computing node in the decentralized distributed computing system (referred to as the task initiating computing node to distinguish it from other computing stages in the system) as the execution entity of the computing task allocation method, to introduce the technical solution provided in this application embodiment.

[0041] Figure 3 A flowchart illustrating a computing task allocation method according to an embodiment of this application is shown. Figure 3 As shown, the method includes:

[0042] 301. For computation tasks, generate a task assignment message.

[0043] 302. Propagate the task assignment message in the distributed computing system. The distributed computing system includes multiple computing nodes.

[0044] 303. Based on the subtask claim messages sent by the computing nodes in response to the task assignment message, determine the target computing nodes corresponding to each subtask from the distributed computing system.

[0045] 304. Assign each subtask to the corresponding target computing node.

[0046] In the above-mentioned 301, the task assignment message includes: requirement information for multiple subtasks corresponding to the computing task. The requirement information may include: the computing resource requirement and time requirement for each subtask. The computing resource requirement can be represented by operations per second (ops); the time requirement includes the final time point that the corresponding subtask needs to be completed. The time requirements for different subtasks may be the same or different, and can be set according to actual needs. This application embodiment does not specifically limit this.

[0047] After receiving a computation request from a user, the task-initiating computing node generates a computation task based on the request. The computation task is then broken down into multiple subtasks. Subsequently, the computation results of these subtasks are obtained and merged to obtain the final computation result. The decomposition and merging processes of the computation task are described in existing technologies and will not be detailed here.

[0048] In one example, the data to be processed corresponding to the computing task can be obtained; the data to be processed can be divided into multiple data segments; based on the multiple data segments, the computing task can be divided into multiple subtasks, wherein each data segment corresponds to one subtask.

[0049] In the above 302 example, each computing node in the distributed computing system maintains global routing information. In this way, the task initiating computing node can send the task assignment message to all other computing nodes in the distributed computing system except for the current node.

[0050] In another example, the task allocation message can be propagated through a flooding mechanism in a distributed computing system. Using a flooding mechanism, each computing node in the distributed computing system does not need to maintain global routing information, reducing routing maintenance costs and making the system more robust. However, the flooding mechanism is prone to the problem of message duplication due to message backhaul. A flooding mechanism refers to sending the data stream received from a certain interface to all interfaces except that interface; that is, sending the task allocation message to all neighboring nodes except the source neighbor node. To solve this problem, after receiving the task allocation message, the computing nodes in the distributed computing system perform a deduplication operation on the task allocation message to avoid duplicate processing. Specifically, each computing node in the distributed computing system can record the task allocation messages it has received locally, forming a historical message reception record. Thus, when any subsequent task allocation message is received, the received task allocation message can be deduplicated based on the historical message reception record, avoiding duplicate processing. The specific implementation of the deduplication operation will be described in detail in the following embodiments.

[0051] In the above 303, the subtask request message is generated by the compute node being propagated based on the task to be assigned message and its own resource allocation status. The resource allocation status refers to the compute resource allocation status. This resource allocation status can include: resource already allocated status and resource pre-allocation status. Resource pre-allocation refers to the compute node locking relevant compute resources for the requested subtask when requesting it.

[0052] After receiving the task assignment message, the receiving compute node can generate a subtask request message based on the task assignment message and its own resource allocation. The subtask request message may include indication information indicating the subtask requested by the received compute node. In one example, the subtask request message may include a request vector, where multiple elements correspond one-to-one with multiple subtasks of the compute task. The value of the element corresponding to the subtask requested by the received compute node in the request vector can be a first value, and the values ​​of the remaining elements can be second values. The first and second values ​​are different; for example, the first value can be 1, and the second value can be 0. After receiving the subtask request message, the task-initiating compute node, based on the request vector, determines the subtask corresponding to the element with the first value as the subtask requested by the received compute node. The request vector is the same as the indication information mentioned above indicating the subtask requested by the received compute node.

[0053] In one instance, for each subtask, the target computing node corresponding to the subtask can be randomly determined from multiple computing nodes that applied for the subtask.

[0054] In another instance, the subtask request message may also include the estimated completion time of the requested subtask. In this way, after receiving the subtask request message, the task-initiating computing node can select the most suitable target computing node for each subtask based on the estimated completion times of the subtasks requested in the subtask request messages sent by multiple propagated computing nodes, thus ensuring that the aforementioned computing task is completed in the shortest possible time.

[0055] In one instance of the above 304, the fragmented data and computation program corresponding to each subtask can be sent to its corresponding target computing node; the target computing node, after receiving the fragmented data and computation program corresponding to the corresponding subtask, runs the computation program to process the fragmented data, obtains the computation result corresponding to the subtask, and returns it to the task initiating computing node.

[0056] In the technical solution provided in this application embodiment, a task-to-be-assigned message is generated for each computing task. Then, the task-to-be-assigned message is propagated in the distributed computing system. The computing nodes to which the message is propagated generate and return sub-task claim messages based on these messages, and the computing tasks are assigned according to the returned sub-task claim messages. In other words, the assignment of computing tasks is not performed by a single node in the distributed computing system, but rather by multiple nodes working together. This effectively breaks down and distributes the task assignment process, which helps improve the load balancing of the entire distributed computing system and avoids the problem of a single node being overloaded if it handles the entire assignment.

[0057] Furthermore, in practical applications, after the propagated computing node generates a subtask claim message in response to the task to be assigned message, it can lock the computing resources pre-allocated for the subtask claimed in the subtask claim message. After locking, if the propagated computing node receives a subtask of the computing task allocated by the task initiating computing node, it will allocate the computing resources locked for the subtask to the subtask. If it does not receive a subtask of the computing task allocated by the task initiating computing node within a timeout, it will release the computing resources pre-allocated for the subtask claimed in the subtask claim message.

[0058] Optionally, the task assignment message may further include: task version information generated for the computing task. The task version information can be used to uniquely identify the task version of the computing task. In this embodiment, each computing task may correspond to multiple task versions.

[0059] In one example, task version information can be generated for a computation task based on its task description information. The task description information may include, but is not limited to: task name, task description, computation programs corresponding to each subtask, data shards, application status, computational resource requirements, and time requirements. The application statuses of each subtask can form an application status vector, with each element corresponding to a subtask. Similarly, the computational resource requirements of each subtask can form a computational resource requirement vector, with each element corresponding to a subtask. Elements at the same position in both the application status vector and the computational resource requirement vector correspond to the same subtask. Initially, all elements in the application status vector are set to a third value (e.g., 0), indicating that the corresponding subtask is unapplicationable; a fourth value (e.g., 1) indicates that the corresponding subtask is application-acquired. In one example, the task description information can be input into a hash algorithm to obtain a hash value; this hash value is then used as the task version information for the computation task. In another example, the node address of the computation node initiating the above task and the task description information of the above computation task can be input into a hash algorithm to obtain a hash value; this hash value is then used as the task version information corresponding to the computation task. The node address includes the MAC (Media Access Control) address.

[0060] The above methods may also include:

[0061] 305. When the computation task corresponds to a subtask that needs to be reallocated, regenerate the task version information.

[0062] The regenerated task version information is different from the task version information historically generated for the computing task.

[0063] 306. Based on the subtasks to be reassigned and the regenerated task version information, regenerate the task to be reassigned message.

[0064] In the regenerated task assignment message, the application status of the sub-task to be reassigned is "unclaimed", and the application status of other sub-tasks is "claimed". The regenerated task assignment message also includes the regenerated task version information.

[0065] 307. Assign the subtask to be reallocated according to the regenerated task assignment message.

[0066] In clause 305 above, when the result of a subtask in a computation task fails to return on time, the subtask needs to be reassigned; when the pending data corresponding to a subtask in a computation task is updated by the user, the subtask needs to be reassigned. In one example, when a computation task has a subtask to be reassigned, the corresponding content in the task description information of the computation task can be modified according to the subtask to be reassigned, resulting in the modified task description information; based on the modified task description information, the task version information is regenerated for the computation task. In one example, the node address of the task initiating node and the modified task description information can be input into a hash algorithm to obtain a hash value; this hash value is used as the regenerated task version number.

[0067] In a specific instance, the claim status vector in the task description information can be modified to ensure that the value of the element corresponding to the subtask to be reallocated in the claim status vector is set to the third value, and the values ​​of other elements are set to the fourth value.

[0068] In another specific instance, when there is a subtask that needs updating among multiple subtasks corresponding to a computation task, this subtask that needs updating can be updated to obtain the updated subtask corresponding to the computation task. This updated subtask is then used as the subtask to be reassigned. Typically, subtask updates involve updating the corresponding shard data and the computation program. Therefore, in addition to modifying the claim state vector, the shard data and / or computation program corresponding to the subtask in the task description information can also be modified.

[0069] In another specific instance, to enable multiple retries for reassigned subtasks to ensure task integrity, the current number of assignments to the computation task can be considered when regenerating the task version information. Specifically, the current number of assignments to the computation task, the modified task description information corresponding to the computation task, and the node address of the task initiating node can be input into a hash algorithm to obtain a hash value that serves as the regenerated task version number.

[0070] In the above 306, "other subtasks" refers to the remaining subtasks among the multiple subtasks corresponding to the computation task, excluding the subtask to be reassigned. The regenerated task to be reassigned message may include a claim status vector, where the value of the element corresponding to the subtask to be reassigned in the claim status vector is the third value mentioned above (e.g., 0), and the values ​​of other elements are the fourth value mentioned above (e.g., 1). The regenerated task to be reassigned message may also include the regenerated task version information.

[0071] In the above 307, the propagation method of the regenerated task-to-assignment message and the processing logic of the computing nodes to which the message is propagated can be found in the corresponding contents of the above embodiments, and will not be described in detail here.

[0072] It should be noted that since the task version information in the regenerated task assignment message is new, the compute nodes that receive the regenerated task assignment message will not ignore it due to deduplication. Therefore, the technical solution provided in this application can achieve reallocation only for the subtasks of a compute task that need to be reallocated. In the prior art, once a subtask of a compute task fails or is updated, all subtasks of that compute task need to be reallocated. After reallocation, the processing of all subtasks needs to start over. That is, the processing of all subtasks before reallocation in the distributed computing system is considered invalid, which is equivalent to blocking the processing of subtasks that did not originally need to be reallocated. Thus, existing distributed computing systems use a synchronous blocking method to process compute tasks, resulting in low collaborative efficiency and high overhead. In contrast, the technical solution provided in this application uses an asynchronous non-blocking method for collaborative work, resulting in very low system synchronization overhead and high collaborative efficiency.

[0073] In one instance, the above method may further include:

[0074] 308. If the calculation result of the first subtask corresponding to the calculation task is not received before the preset time, it is determined that the subtask corresponding to the calculation task needs to be reallocated.

[0075] The subtask to be reassigned includes the first subtask.

[0076] Specifically, the aforementioned preset time refers to the expected completion time determined by the target computing node corresponding to the first subtask for the first subtask.

[0077] In another instance, the above method may also include:

[0078] 309. When an update request is received for the second subtask corresponding to the computing task, it is determined that the computing task has a subtask that needs to be reassigned.

[0079] 310. Update the second subtask according to the update request.

[0080] The subtask to be reassigned includes the updated second subtask.

[0081] In practical applications, the update request mentioned in 309 above can be sent by the user. When a user wants to update the sharded data and / or computation program of the second subtask, they can send an update request to the task initiating node for the second subtask corresponding to the computation task.

[0082] In step 310 above, the sharded data and / or computing program corresponding to the second subtask corresponding to the computing task can be updated according to the update request.

[0083] Thus, the regenerated task assignment message may also include: the requirement information of the second subtask corresponding to the updated computing task.

[0084] In practical applications, a corresponding retry threshold can be set for each subtask. Once the number of retries exceeds the threshold, the calculation is considered a failure and no further retries are made, thus avoiding waste of computing resources. The retry thresholds for different subtasks can be the same or different; this embodiment does not specifically limit this. Therefore, the phrase "when the calculation task corresponds to a subtask that needs to be reallocated, regenerate the task version information" in section 305 above can be implemented using the following steps:

[0085] 3051. When the computation task corresponds to a subtask that needs to be reallocated, determine whether the number of allocations for the subtask to be reallocated is less than or equal to the retry threshold.

[0086] 3052. When the number of times the subtask to be reassigned is less than or equal to the retry threshold, the task version information is regenerated.

[0087] The retry threshold can be set according to actual needs, and this application embodiment does not impose specific limitations on it.

[0088] After step 3052 above, the number of allocations for the subtasks to be reallocated can be updated. Specifically, the number of allocations for the subtasks to be reallocated can be incremented by 1.

[0089] Optionally, the phrase "when the computation task corresponds to a subtask that needs to be reallocated, regenerate the task version information" in clause 305 above can be implemented using the following steps:

[0090] S11. When the computation task corresponds to a subtask that needs to be reallocated, determine the time elapsed between the current time and the last time point that the subtask to be reallocated needs to be completed.

[0091] S12. If the duration is greater than or equal to the preset duration, the task version information is regenerated.

[0092] S13. If the duration is less than the preset duration, the calculation task is determined to have failed.

[0093] Setting the above preset duration is to ensure that the subtask to be reassigned has enough time to be processed after reassignment. If the current time is very close to the deadline for the subtask to be reassigned, even if it is reassigned, the calculation result of the subtask to be reassigned cannot be guaranteed to return before the deadline for the subtask to be reassigned.

[0094] Optionally, the subtask request message includes: the estimated completion time point corresponding to the requested subtask. The step 103 above, "determining the target computing node corresponding to each subtask from the distributed computing system based on the subtask request message sent by the propagated computing node in response to the task allocation message," can be implemented using the following steps:

[0095] 1031. Based on the subtask claim messages sent by multiple propagated computing nodes in response to the task assignment message, determine at least one expected completion time point for each subtask.

[0096] 1032. Based on at least one expected completion time point corresponding to each subtask, determine the target computing node corresponding to each subtask from the distributed computing system.

[0097] In step 1031 above, based on the subtask claim messages sent by multiple propagated computing nodes in response to the task assignment message received within a preset time period, at least one expected completion time point corresponding to each subtask is determined. The preset time period can be a period of time after the task initiating computing node begins propagating the task assignment message.

[0098] In one example, a subtask claim matrix can be generated based on at least one expected completion time for each subtask. For instance, in a distributed computing system with n computing nodes, a computing task is broken down into m subtasks. The claim vectors in the subtask claim messages received by the task initiating node within a preset time period can be summarized into a subtask claim matrix, such as... Figure 4 The m×n matrix shown indicates whether the j-th computing node has claimed the i-th subtask. A matrix element of 0 indicates that it has not claimed the subtask, and a matrix element of non-zero value t indicates that it has not claimed the subtask. ij This indicates that an application has been submitted, and t ij This represents the estimated completion time given by the j-th computing node for the i-th subtask.

[0099] The computation task execution is transactional. A subtask claim mask matrix is ​​constructed. The value of the element in the i-th row and j-th column of the subtask claim mask matrix is ​​determined by the value of the element in the i-th row and j-th column of the subtask claim matrix: if the value of the element in the i-th row and j-th column of the subtask claim matrix is ​​0, then the value of the element in the i-th row and j-th column of the subtask claim mask matrix is ​​also 0; if the value of the element in the i-th row and j-th column of the subtask claim matrix is ​​a non-zero value t... ij If the value of the element in the i-th row and j-th column of the subtask claim mask matrix is ​​1, then the value of the element in the subtask claim mask matrix is ​​1. Each row of the subtask claim mask matrix corresponds to a subtask. A bitwise OR operation is performed on the elements of each row of the subtask claim mask matrix to obtain a first vector. Each element in the first vector represents whether the corresponding subtask has a node claim. Then, a bitwise AND operation is performed on all elements of the first vector. If the result is 0, it means that the computation task as a whole cannot be executed completely, and the computation task fails and is not executed. If the result is 1, it means that the computation task can be executed completely, and the target computation node for the subtask is selected.

[0100] Optionally, the goal of the algorithm for selecting target computing nodes for each subtask is to ensure that the computing task is completed in the shortest possible time. Therefore, a subtask allocation matrix A can be constructed. m×n , element a ij The value is either 0 or 1, where 1 indicates that the i-th subtask is assigned to the i-th computing node for execution. The goal of task allocation is to assign each subtask to only one computing node and to minimize the overall completion time. The subtask allocation matrix is ​​obtained by solving the following optimization model:

[0101] argmin i,j max(t ij (1)

[0102]

[0103] Formula (1) above is the objective function of the optimization model, namely: minimizing the overall completion time. Formula (2) above is the constraint condition of the optimization model, namely: each subtask can only be assigned to one computing node. Where t ij This represents the estimated completion time given by the j-th computing node for the i-th subtask; a ij This indicates whether the i-th subtask is assigned to the i-th computing node for execution.

[0104] The above optimization model can be solved using a solution algorithm, thereby determining the target computing nodes corresponding to each subtask.

[0105] The following describes a plagiarism detection method applicable to the computer nodes to which the deduplication is performed. The computer nodes to which the deduplication is performed are also used for:

[0106] S21. After receiving the task to be assigned message, determine whether the task version information in the task to be assigned message is in the historical message receiving record;

[0107] S22. If the task version information is not in the historical message receiving record, then record the task version information in the historical message receiving record and process the task to be assigned message;

[0108] S23. If the task version information is in the historical message reception record, then the task to be assigned message is ignored.

[0109] The historical message reception record contains the task version information from the task-to-be-assigned messages that were received by the compute nodes that were propagated.

[0110] In an optional embodiment of S22 above, if the task version information is not in the historical message receiving record, it is determined whether the task to be assigned message has expired; if the task to be assigned message has not expired, the task version information is recorded in the historical message receiving record and the task to be assigned message is processed; if the task to be assigned message has expired, the task to be assigned message is ignored.

[0111] The process of handling the task to be assigned message includes the following steps S31-S33.

[0112] The following methods can be used to determine whether a task assignment message has expired:

[0113] The process involves obtaining the time requirements for each subtask in a pending task message; and determining whether the pending task message has expired based on the time requirements of each subtask. Specifically, the time requirements include the final time point that the corresponding subtask needs to complete; the earliest target final time point can be determined from the final time points that each subtask needs to complete; if the target final time point is earlier than or equal to the current time, the pending task message is determined to have expired; if the target final time point is later than the current time, the pending task message is determined not to have expired.

[0114] By checking for expired deadlines, invalid operations on the task assignment messages propagated to the computing nodes can be avoided, thus preventing the waste of computing resources.

[0115] To reduce storage resource consumption, task version information for expired pending task messages can be deleted from the historical message reception record. Whether a pending task message has expired can be determined as described above.

[0116] Optionally, the compute node to which the propagation is made can also be used for:

[0117] S31. Based on the claim status of each of the multiple subtasks in the task assignment message, determine the unclaimed subtasks.

[0118] S32. Based on its own resource allocation and the demand information of the unclaimed sub-tasks in the task assignment message, generate a sub-task claim message.

[0119] S33. After updating the application status of the subtask applied for in the subtask application message in the task allocation message, send the task allocation message to the neighboring computing node.

[0120] In S31 above, subtasks whose claim status is "not claimed" are defined as unclaimed subtasks. The number of unclaimed subtasks can be one or more.

[0121] In step S32 above, the remaining resources are determined based on the total resources and resource allocation. Based on the remaining resources and the demand information for unclaimed subtasks in the task allocation message, the subtasks claimed by the propagated computing nodes are identified from the unclaimed subtasks. A subtask claim message is generated based on the subtasks claimed by the propagated computing nodes. Specifically, based on the remaining resources and the demand information for unclaimed subtasks in the task allocation message, the estimated completion time of the subtasks claimed by the propagated computing nodes can also be determined. A subtask claim message is generated based on the subtasks claimed by the propagated computing nodes and their corresponding estimated completion times. The subtask claim message includes: indication information indicating the subtasks claimed by the propagated computing nodes and the estimated completion time of the subtasks claimed by the propagated computing nodes.

[0122] For specific implementation details, please refer to the corresponding content in the above embodiments, which will not be repeated here.

[0123] In S33 above, the subtask requested in the subtask request message is the same subtask requested by the propagated computing node. The request status of the subtask requested in the subtask request message in the task allocation message is modified to "requested". After updating the request status of the subtask requested in the subtask request message in the task allocation message, the task allocation message is sent to the neighboring computing nodes of the propagated computing node. The processing logic of the neighboring computing nodes after receiving the task allocation message is consistent with the processing logic of the propagated computing node. Specifically, the propagated computing node sends the task allocation message to other neighboring computing nodes besides the message source neighboring computing node. The message source neighboring computing node is a neighboring computing node of the propagated computing node, and the task allocation message is sent from the message source neighboring computing node to the propagated computing node.

[0124] After modifying the claim status of the subtasks claimed in the subtask claim message to "claimed," the task allocation message is forwarded to neighboring nodes. Upon receiving this message, neighboring nodes will only claim unclaimed subtasks. In other words, a subtask claimed by a compute node closer to the task initiating node cannot be claimed again by a compute node farther away. This ensures that subtasks are assigned to compute nodes closer to the task initiating node, thereby shortening the communication path between them.

[0125] It should be further noted that, in this embodiment, the task-initiating computing node can also generate a sub-task request message in response to the task-to-be-assigned message; subsequently, the task-initiating computing node can determine the target computing node corresponding to each sub-task based on its own generated sub-task request message and the received sub-task request messages. The task-initiating computing node can generate the sub-task request message based on its own resource allocation and the task-to-be-assigned message.

[0126] Figure 5 A flowchart illustrating a computational task allocation method according to another embodiment of this application is shown. Figure 4 As shown, the method includes:

[0127] 501. Receive the transmitted task assignment message.

[0128] The task to be assigned message includes the requirement information of multiple subtasks corresponding to the computing task. The task to be assigned message is generated by the task initiating computing node that initiates the computing task in the distributed computing system.

[0129] 502. Based on its own resource allocation and the task to be assigned message, generate a sub-task claim message.

[0130] 503. Send the subtask claim message to the task initiating computing node, so that the task initiating computing node can allocate the multiple subtasks according to the subtask claim message.

[0131] In the above 501, the task initiating computing node that initiates the computing task can be understood as the computing node that receives the computing request sent by the user regarding the computing task.

[0132] The specific implementation of steps 501, 502 and 503 above can be found in the corresponding contents of the above embodiments, and will not be repeated here.

[0133] In the technical solution provided in this application embodiment, a task-to-be-assigned message is generated for each computing task. Then, the task-to-be-assigned message is propagated in the distributed computing system. The computing nodes to which the message is propagated generate and return sub-task claim messages based on these messages, and the computing tasks are assigned according to the returned sub-task claim messages. In other words, the assignment of computing tasks is not performed by a single node in the distributed computing system, but rather by multiple nodes working together. This effectively breaks down and distributes the task assignment process, which helps improve the load balancing of the entire distributed computing system and avoids the problem of a single node being overloaded if it handles the entire assignment.

[0134] Optionally, the above method may further include:

[0135] 504. After receiving the task to be assigned message, determine whether the task version information in the task to be assigned message is in the historical message receiving record.

[0136] 505. If the task version information is not in the historical message receiving record, then the task version information is recorded in the historical message receiving record, and the task to be assigned message is processed.

[0137] 506. If the task version information is in the historical message reception record, then the task to be assigned message is ignored.

[0138] The specific implementation of steps 504, 505, and 506 can be found in the corresponding contents of the above embodiments, and will not be repeated here.

[0139] Furthermore, the statement in clause 505 above, "If the task version information is not in the historical message receiving record, then record the task version information in the historical message receiving record and process the task to be assigned message," can be implemented using the following steps:

[0140] 5051. If the task version information is not in the historical message receiving record, then determine whether the task to be assigned message has expired.

[0141] 5052. If the task to be assigned message has not expired, then record the task version information in the historical message receiving record and process the task to be assigned message.

[0142] The specific implementation of step 5052 can be found in the corresponding content of the above embodiments, and will not be repeated here.

[0143] Furthermore, the above method may also include:

[0144] 507. Based on the claim status of each of the multiple subtasks in the task to be assigned message, determine the unclaimed subtasks;

[0145] 508. Based on its own resource allocation and the demand information of the unclaimed sub-tasks in the task assignment message, generate a sub-task claim message;

[0146] 509. After updating the application status of the subtask applied for in the subtask application message in the task allocation message, send the task allocation message to the neighboring computing node.

[0147] Optionally, "sending the task allocation message to neighboring computing nodes" in step 509 above may include:

[0148] 5091. If any of the subtasks in the task allocation message are in an unclaimed state, then the task allocation message is sent to the neighboring computing node.

[0149] It should be noted that any steps in the method provided in this application that are not described in detail can be found in the corresponding content of the above embodiments, and will not be repeated here. Furthermore, the method provided in this application may include other parts or all of the steps in the above embodiments in addition to the steps described above; for details, please refer to the corresponding content of the above embodiments, and will not be repeated here.

[0150] Example scenario:

[0151] The following will combine Figure 6 and Figure 7 The technical solutions provided in the embodiments of this application are illustrated with examples:

[0152] like Figure 6 As shown, the distributed computing system includes: computing node A, computing node B, computing node C, and computing node D. It should be noted that... Figure 6This is just an example showing a small number of computing nodes. In real-world applications, the number of computing nodes in a distributed computing system is much larger.

[0153] When a supermarket user wants to request a distributed computing system to analyze sales data for the past month, the following steps are required:

[0154] Step 1: Send a calculation request.

[0155] The supermarket user sends a calculation request to computing node A. The calculation request is used to request statistics on sales over the past month. The calculation request carries a calculation task, which includes the supermarket's sales records (i.e., the data to be processed mentioned above).

[0156] Step 2: Compute node A generates a task to be assigned message.

[0157] For ease of description, let's assume the supermarket sells two products, S1 and S2. The supermarket's sales records can be broken down into sales records for product S1 and product S2. Based on these two data segments, the calculation task is further divided into two subtasks, a and b. Subtask a calculates the total sales amount for product S1, and subtask b calculates the total sales amount for product S2.

[0158] Step 3: Compute node A sends a task pending assignment message.

[0159] Computing node A sends a task assignment message to its neighboring nodes, including computing node B.

[0160] Step 4: Computing node B performs a deduplication operation on the task assignment messages.

[0161] After receiving the task assignment message, compute node B performs a deduplication check to avoid processing the task assignment message repeatedly.

[0162] Step 5: After the deduplication check passes, compute node B determines whether the task assignment message has expired.

[0163] When compute node B determines that the task allocation message is the first message it has received, it judges whether the task allocation message has expired based on the time requirement in the task allocation message.

[0164] Step 6: If the deadline has not passed, compute node B generates a subtask claim message based on its own resource allocation and the task to be assigned message.

[0165] Step 7: Compute node B returns a subtask request message to compute node A.

[0166] In this embodiment, computing node A is also the task initiation computing node.

[0167] Step 8: Compute node B modifies the application status of the subtasks applied for in the subtask application message in the task pending assignment message.

[0168] Step 9: Compute node B sends the modified task to be assigned message to compute node C.

[0169] Computing node B can determine whether there is an unclaimed status among the claim statuses of multiple subtasks in the modified task-to-assignment message. If so, it sends the modified task-to-assignment message to computing node C; otherwise, it does not send it.

[0170] Step 10: Computing node A determines the target computing node corresponding to each subtask based on the subtask claim message.

[0171] The target computing node for subtask a is determined as computing node B, and the target computing node for subtask b is determined as computing node C.

[0172] Step 11: Computing node A assigns subtask a to computing node B.

[0173] Step 12: Computing node A assigns subtask b to computing node C.

[0174] Step 13: Calculation node B returns the calculation result of subtask a.

[0175] Step 14: Calculation node C returns the calculation result of subtask b.

[0176] Step 15: Calculate the results of the subtasks in node A.

[0177] Step 16: Node A returns the merged results to the supermarket user.

[0178] Furthermore, after steps 11 and 12 above, if the supermarket user discovers an error in the sales record related to product S1 sent to computing node A (the error may be caused by a malfunction in the supermarket user's local recording system), the supermarket user can send an update request to computing node A. Upon receiving the update request, computing node A updates subtask a; and only reallocates subtask a, that is, only assigns the updated subtask a. Subsequently, it merges the calculation results of subtask b and the calculation results of the updated subtask a to obtain the final calculation result of the calculation task.

[0179] After steps 11 and 12 above, if the calculation result of subtask b times out and is not returned, computing node A can also reallocate only subtask b, and then merge the calculation results of subtask b and the updated calculation results of subtask a to obtain the final calculation result of the computing task.

[0180] In practical applications, an upper limit can be set for the number of times each subtask can be assigned to avoid wasting computing resources.

[0181] Another embodiment of this application provides a distributed computing system. This distributed computing system includes: multiple computing nodes;

[0182] The computing node is used for:

[0183] For a computing task, a task assignment message is generated; the task assignment message includes: the requirement information of multiple subtasks corresponding to the computing task;

[0184] The task assignment message is propagated in the distributed computing system.

[0185] Based on the subtask claim messages sent by the distributed computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system.

[0186] Each subtask is assigned to its corresponding target computing node.

[0187] The processing logic of each computing node in the above distributed computing system can be found in the corresponding content of the above embodiments, and will not be repeated here.

[0188] Figure 8 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Figure 8 As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operation on the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0189] The memory 1101 is used to store programs;

[0190] The processor 1102 is coupled to the memory 1101 and is used to execute the program stored in the memory 1101 to implement the methods provided in the above-described method embodiments.

[0191] Furthermore, such as Figure 8As shown, the electronic device also includes: communication component 1103, display 1104, power supply component 1105, audio component 1106, and other components. Figure 8 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 8 The components shown.

[0192] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the steps or functions of the methods provided in the above-described method embodiments.

[0193] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0194] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0195] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for allocating computational tasks, wherein, include: For computational tasks, generate task assignment messages; The task assignment message includes: the requirement information of multiple subtasks corresponding to the computing task; The task assignment message is propagated in a distributed computing system; the distributed computing system includes multiple computing nodes. Based on the subtask claim messages sent by the propagated computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system; the subtask claim messages are generated by the propagated computing nodes based on the task assignment message and their own resource allocation. Assign each subtask to the corresponding target computing node; The task assignment message also includes: task version information generated for the computing task; The method further includes: when the computing task corresponds to a subtask to be reallocated, regenerating task version information; wherein the regenerated task version information is different from the task version information historically generated for the computing task; regenerating a task-to-be-assigned message based on the subtask to be reallocated and the regenerated task version information; wherein the application status of the subtask to be reallocated in the regenerated task-to-be-assigned message is "unclaimed" and the application status of other subtasks is "claimed"; the regenerated task-to-be-assigned message also includes the regenerated task version information; and assigning the subtask to be reallocated based on the regenerated task-to-be-assigned message.

2. The method according to claim 1, wherein, Also includes: If the calculation result of the first subtask corresponding to the calculation task is not received before the preset time, it is determined that the calculation task needs to be reassigned to a subtask. The subtask to be reassigned includes the first subtask.

3. The method according to claim 1, wherein, Also includes: Upon receiving an update request for the second subtask corresponding to the computing task, it is determined that the computing task corresponds to a subtask that needs to be reallocated. Update the second subtask according to the update request; The subtask to be reassigned includes the updated second subtask.

4. The method according to any one of claims 1 to 3, wherein, When the computation task corresponds to a subtask that needs to be reallocated, the task version information is regenerated, including: When the computation task corresponds to a subtask that needs to be reallocated, determine whether the number of allocations for the subtask to be reallocated is less than or equal to the retry threshold. When the number of assignments for the subtask to be reassigned is less than or equal to the retry threshold, the task version information is regenerated.

5. The method according to any one of claims 1 to 3, wherein, Propagating the task assignment message in a distributed computing system includes: The task assignment message is propagated to neighboring computing nodes in the distributed computing system. In this distributed computing system, the computing nodes that are propagated to the system are used to: determine the unclaimed subtasks based on the claim status of each of the multiple subtasks in the task to be allocated message; generate a subtask claim message based on their own resource allocation and the demand information of the unclaimed subtasks in the task to be allocated message; update the claim status of the subtasks claimed in the subtask claim message in the task allocation message; and send the task allocation message to neighboring computing nodes.

6. The method according to claim 5, wherein, The compute nodes to which the propagation is made are also used for: After receiving the task to be assigned message, determine whether the task version information in the task to be assigned message is in the historical message receiving record; If the task version information is in the historical message reception record, then the task to be assigned message is ignored.

7. The method according to any one of claims 1 to 3, wherein, The subtask application message includes: the estimated completion time of the applied subtask; Based on the subtask claim messages sent by the distributed computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system, including: Based on the subtask claim messages sent by multiple computing nodes in response to the task assignment message, at least one expected completion time point is determined for each subtask. Based on at least one expected completion time for each subtask, the target computing node corresponding to each subtask is determined from the distributed computing system.

8. A method for allocating computational tasks, wherein, The method includes: The system receives a transmitted task assignment message; the task assignment message includes requirement information for multiple subtasks corresponding to the computing task and task version information generated for the computing task; the task assignment message is generated by the task initiating computing node that initiates the computing task in the distributed computing system; the task initiating computing node is further configured to: regenerate task version information when the computing task has subtasks to be reassigned; wherein the regenerated task version information is different from the task version information historically generated for the computing task; regenerate the task assignment message based on the subtasks to be reassigned and the regenerated task version information; wherein the regenerated task assignment message shows the application status of the subtasks to be reassigned as unclaimed and the application status of other subtasks as claimed; the regenerated task assignment message also includes the regenerated task version information; and assign the subtasks to be reassigned based on the regenerated task assignment message. Based on its own resource allocation and the task to be assigned message, a subtask claim message is generated. The subtask claim message is sent to the task initiating computing node, so that the task initiating computing node can allocate the multiple subtasks according to the subtask claim message.

9. The method according to claim 8, wherein, Also includes: After receiving the task to be assigned message, determine whether the task version information in the task to be assigned message is in the historical message receiving record; If the task version information is not in the historical message receiving record, then the task version information is recorded in the historical message receiving record, and the task to be assigned message is processed. If the task version information is in the historical message reception record, then the task to be assigned message is ignored.

10. The method according to claim 9, wherein, If the task version information is not in the historical message reception record, then the task version information is recorded in the historical message reception record, and the task to be assigned message is processed, including: If the task version information is not in the historical message receiving record, then it is determined whether the task to be assigned message has expired; If the task to be assigned message has not expired, the task version information is recorded in the historical message reception record, and the task to be assigned message is processed.

11. The method according to any one of claims 8 to 10, wherein, Also includes: Based on the claim status of each of the multiple subtasks in the task assignment message, the unclaimed subtasks are determined. Based on its own resource allocation and the demand information of the unclaimed sub-tasks in the task assignment message, a sub-task claim message is generated. After updating the application status of the subtask applied for in the subtask application message in the task allocation message, the task allocation message is sent to the neighboring computing node.

12. The method according to any one of claims 8 to 10, wherein, Sending the task assignment message to neighboring computing nodes includes: If any of the subtasks in the task allocation message are in an unclaimed state, then the task allocation message is sent to the neighboring computing node.

13. A distributed computing system, wherein, include: Multiple computing nodes; The computing node is used for: For computational tasks, generate task assignment messages; The task assignment message includes: the requirement information of multiple subtasks corresponding to the computing task; The task assignment message is propagated in the distributed computing system. Based on the subtask claim messages sent by the propagated computing nodes in response to the task assignment message, the target computing nodes corresponding to each subtask are determined from the distributed computing system; the subtask claim messages are generated by the propagated computing nodes based on the task assignment message and their own resource allocation. Assign each subtask to the corresponding target computing node; The task assignment message also includes: task version information generated for the computing task; The computing node is further configured to: regenerate task version information when the computing task corresponds to a subtask to be reallocated; wherein the regenerated task version information is different from the task version information historically generated for the computing task; regenerate a task-to-be-assigned message based on the subtask to be reallocated and the regenerated task version information; wherein the application status of the subtask to be reallocated in the regenerated task-to-be-assigned message is "unclaimed" and the application status of other subtasks is "claimed"; the regenerated task-to-be-assigned message also includes the regenerated task version information; and allocate the subtask to be reallocated based on the regenerated task-to-be-assigned message.

14. An electronic device, wherein, include: Memory and processor, among which, The memory is used to store programs; The processor, coupled to the memory, is configured to execute the program stored in the memory to implement the method of any one of claims 1 to 12.

Citation Information

Patent Citations

  • Teaching transaction processing method, apparatus and device based on a block chain and storage medium

    CN108984311A

  • Load balancing method and system for multi-node cluster

    CN112003898A