A task distribution method and system

CN122594034BActive Publication Date: 2026-09-18HANGZHOU YOUYUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611095758.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-23
Publication Date
2026-09-18
Estimated Expiration
2046-07-23

AI Technical Summary

Technical Problem

[0004]然而,由于个人设备天然具有算力差异大、网络质量参差不齐、在线时间不稳定的问题,导致用户提交的任务时而快速完成、时而迟迟无果,等待时长随机性大,体验难以保障

Benefits of technology

本申请能够根据各边缘节点本地第一队列长度和第一队列中正在排队的任务量,控制向每个边缘节点分发的任务数量,从而基于各节点的真实处理能力实现差异化的任务量分配;同时,在边缘节点执行已分发任务的过程中,调度中心将后续任务提前推送并缓存至其第一队列,使后续任务的网络传输与当前任务处理在时间上重叠,降低节点因等待数据而产生的空闲等待;当节点离线时,调度中心可通过本地维护的第二队列,识别出每一边缘节点上尚未处理完成的任务,并将这些任务回收并重新分发至其他边缘节点继续执行,避免任务因单节点故障而长期滞留或丢失。最终,在整个调度过程中,差异化分配、传输与处理并行、离线任务快速恢复协同作用,使得所有待处理任务在整体上获得相对稳定的响应体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594034B_ABST
    Figure CN122594034B_ABST
Patent Text Reader

Abstract

The application discloses a task distribution method and system, the method comprises the following steps: determining the first queue length of the current edge node; determining the target task quantity based on the first queue length of the current edge node and the current cache amount; based on the target task quantity, while the current edge node processes the tasks in the first queue, distributing the to-be-processed tasks to the current edge node, so that the to-be-processed tasks are cached to the first queue; in the second queue, synchronizing the task list and the execution state of all tasks in the first queue in real time; judging whether the current edge node is offline or not, if yes, obtaining the unprocessed tasks in the first queue based on the second queue, and sending the unprocessed tasks to other edge nodes; if not, for each unprocessed task, distributing the task based on the waiting time length of the task, and the waiting time length is the time length from the distribution time to the current time. The application can realize differentiated task allocation based on the processing capacity of each node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer network communication, and in particular to a task distribution method and system. Background Technology

[0002] With the continuous improvement of personal computer hardware performance, a large amount of computing power remains idle in daily use. If this scattered idle computing power is effectively organized and used for computing scenarios that can be broken down into independent sub-tasks, such as image recognition, video segmentation analysis, and image and video generation, the cost of using computing power can be significantly reduced without the need to build additional dedicated data centers.

[0003] In the traditional centralized task scheduling model, the system maintains a unified global task queue, and the scheduler distributes the tasks in the global task queue to each idle node one by one according to the load balancing or round-robin method.

[0004] However, due to the inherent problems of large differences in computing power, inconsistent network quality, and unstable online time of personal devices, user-submitted tasks are sometimes completed quickly and sometimes take a long time to complete, resulting in highly random waiting times and making it difficult to guarantee a good user experience. Summary of the Invention

[0005] In view of the above-mentioned defects or deficiencies in the existing technology, it is desirable to provide a task distribution method and system that can determine the target amount of tasks to be distributed to the edge nodes by using the total length of the first queue used by the edge nodes to cache tasks and the amount of tasks being queued in the first queue. Thus, differentiated task allocation can be achieved based on the actual processing capacity of each edge node. Furthermore, while the edge nodes are processing tasks, tasks to be processed are distributed to the first queue. When offline, unprocessed tasks are determined based on the second queue of the scheduling center, and unprocessed tasks are distributed to other edge nodes. Ultimately, this ensures that all tasks to be processed have a relatively stable response experience as a whole.

[0006] In a first aspect, this application provides a task distribution method applied to a task distribution system, the system including a scheduling center and multiple edge nodes, the method comprising: The scheduling center determines the length of the first queue of the current edge node. The length of the first queue is used to represent the total number of tasks that can be cached and queued in the first queue of the current edge node. The target task quantity is determined based on the first queue length and the current cache size of the current edge node. The current cache size represents the number of tasks waiting to be processed in the first queue of the current edge node, and the target task quantity represents the number of tasks that can be accepted and cached in the remaining free slots of the first queue. Based on the target task volume, while the current edge node is processing the tasks in the first queue, it distributes the tasks to be processed to the current edge node so that the tasks to be processed are cached in the first queue. In the second queue, the task list and execution status of all tasks in the first queue are synchronized in real time. The second queue is located in the scheduling center. Determine if the current edge node is offline. If so, retrieve the unprocessed tasks from the first queue based on the second queue and send the unprocessed tasks to other edge nodes. If not, for each unprocessed task, the task is distributed based on the task's waiting time, which is the time elapsed from the time the task was distributed to the current time.

[0007] In conjunction with the first aspect, in one possible implementation, for each unprocessed task, tasks are distributed based on their waiting time, specifically as follows: For each unprocessed task, the system compares the task's waiting time with a preset threshold to determine if the task has timed out. If so, the unprocessed task is sent to other edge nodes.

[0008] In conjunction with the first aspect, one possible implementation method also includes: For each unfinished task: If the current edge node does not respond within the first preset time, it will receive the execution results of the task from other edge nodes. If the execution result of the current edge node is received at the second preset time, and the task is waiting to be executed in other edge nodes, then the task in the other edge nodes will be removed. The second preset time is less than the first preset time. If the execution result of the current edge node is received at the second preset time, and the task is being executed on other edge nodes, then the execution results of the task on other edge nodes are discarded. If the execution results of the task are received from the current edge node and other edge nodes respectively, the execution results that are received later in the order they are received are discarded.

[0009] In conjunction with the first aspect, in one possible implementation, the task list and execution status of all tasks in the first queue are synchronized in real time in the second queue, including: Distribute tasks to be processed to the current edge node so that the tasks to be processed are cached in the first queue, while simultaneously caching tasks to be processed in the second queue; When the current edge node finishes processing each current task, it removes the current task from both the first and second queues.

[0010] In conjunction with the first aspect, one possible implementation method also includes: Get the current task being processed by the current edge node and the next task to be processed immediately following the current task; While the current edge node is processing the current task, it downloads the task data for the next task to be processed from the scheduling center.

[0011] In conjunction with the first aspect, in one possible implementation, the scheduling center determines the length of the first queue for the current edge node, specifically as follows: The scheduling center determines the first average time for the current edge node to process a single test task on the test task set. The first queue length of the current edge node is determined based on the first average duration.

[0012] In conjunction with the first aspect, in one possible implementation, the first queue length of the current edge node is determined based on the first average duration, specifically as follows:

[0013] In the formula, L The length of the first queue; k This is a preset reference value for the length of the first queue; This is a preset reference value for the first average processing time; This is the first average processing time.

[0014] In conjunction with the first aspect, in one possible implementation, the first queue length of the current edge node is determined based on the first average duration, specifically as follows: The current edge node is classified into different levels based on the first average duration to obtain the performance level of the current edge node; The database is queried based on the performance level to obtain the first queue length of the current edge node. The database is used to maintain the mapping relationship between the performance level and the first queue length to determine the first queue length of the current edge node.

[0015] In conjunction with the first aspect, one possible implementation method also includes: Based on a preset time interval, the second average time for the current edge node to process a single pending task is periodically obtained, the first average time is periodically updated based on the second average time, and the length of the first queue is periodically updated based on the updated first average time.

[0016] Secondly, this application discloses a task distribution system, including: The current edge node is configured to cache and queue multiple tasks in the first queue; The scheduling center is configured to determine the first queue length of the current edge node. The first queue length is used to characterize the total number of tasks that can be cached and queued for processing in the first queue of the current edge node. The scheduling center is also configured to determine the target task volume based on the length of the first queue of the current edge node and the current cache size. The current cache size is used to represent the number of tasks waiting to be processed in the first queue of the current edge node, and the target task volume is used to represent the number of tasks that can be accepted and cached in the remaining free slots of the first queue. The current edge node is also configured to receive pending tasks distributed by the scheduling center based on the target task volume while processing tasks in the first queue, and cache them in the first queue. The scheduling center is also configured to synchronize the task list and execution status of all tasks in the first queue in real time in the second queue, which is located in the scheduling center. The scheduling center is also configured to determine whether the current edge node is offline. If so, it retrieves the unprocessed tasks from the first queue based on the second queue and sends the unprocessed tasks to other edge nodes. If not, it distributes the tasks for each unprocessed task based on the task's waiting time, where the waiting time is the time from the time of distribution to the current time.

[0017] Compared with the prior art, this application has the following beneficial effects: This application can control the number of tasks distributed to each edge node based on the length of the local first queue and the amount of tasks queued in the first queue, thereby achieving differentiated task allocation based on the actual processing capacity of each node. Simultaneously, while edge nodes are executing distributed tasks, the scheduling center pushes subsequent tasks in advance and caches them in their first queue, allowing network transmission of subsequent tasks to overlap with the processing of current tasks, reducing idle waiting time caused by nodes waiting for data. When a node goes offline, the scheduling center can identify unfinished tasks on each edge node through a locally maintained second queue, and reclaim these tasks and redistribute them to other edge nodes for continued execution, preventing tasks from being delayed or lost due to single-node failures. Ultimately, throughout the entire scheduling process, the synergistic effect of differentiated allocation, parallel transmission and processing, and rapid recovery of offline tasks ensures a relatively stable response experience for all pending tasks. Attached Figure Description

[0018] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the structure of an existing task distribution system in one embodiment; Figure 2 This is a schematic diagram of the structure of the task distribution system of this application in one embodiment; Figure 3 This is a flowchart illustrating the task distribution method of this application in one embodiment. Detailed Implementation

[0019] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present application will now be described in detail with reference to the accompanying drawings and embodiments. Furthermore, the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The terms "first" and "second," etc., in the specification and claims of the embodiments of this application are used to distinguish different objects, not to describe a specific order of objects.

[0021] With the continuous improvement of personal computer hardware performance, a large amount of computing power remains idle for extended periods during daily use. Effectively organizing this dispersed idle computing power into shared computing power can significantly reduce computing power usage costs without the need to build dedicated data centers.

[0022] In the existing task distribution system 10, such as Figure 1 As shown, a global queue containing all user-requested tasks is maintained. All pending tasks are first queued in the global queue. The central scheduler 101 retrieves tasks from the global queue according to load conditions or a round-robin method and directly distributes them to currently idle nodes 102. Node 102 immediately begins execution upon receiving the task, and after completion, sends the calculation results back to the central scheduler 101, which then summarizes or forwards them to the task submitter. The entire process can be summarized into four stages: "queuing and waiting—immediate distribution—node 102 execution—result feedback."

[0023] The above scheduling scheme works well in dedicated data centers, but in shared computing power scenarios composed of personal devices, due to the inherent characteristics of personal devices such as large differences in computing power, inconsistent network quality, and unstable online time, this scheduling scheme will expose multiple problems: First, each task must undergo a complete network transmission process before execution. Network latency is directly added to the task's waiting time. However, the network quality of individual devices varies significantly, and the transmission time of some nodes may far exceed the computation time, severely lengthening the end-to-end execution time of the task.

[0024] Second, personal devices may be shut down or disconnected from the network at any time, or they may be in a "fake dead" state where the process is stuck but the network connection is still maintained. In the existing technology, once node 102 goes offline or gets stuck, the tasks that have been issued will not be processed normally, and the central scheduler 101 will have difficulty detecting the abnormality in a short time. The tasks may be lost or get stuck for a long time.

[0025] Third, the central scheduler 101 does not consider the differences in computing power among nodes 102 when distributing tasks, and distributes tasks equally to each node 102. Therefore, nodes 102 with stronger computing power will process tasks faster, with relatively shorter waiting times for single tasks; while nodes 102 with weaker computing power will process tasks slower, with significantly longer waiting times for single tasks. From the perspective of overall throughput, this difference does not significantly affect overall efficiency; both strong and weak nodes are busy, and the overall output does not decrease. However, for individual task submitters, the specific node 102 to which their task falls is random: if the task is assigned to a strong node, it can be completed quickly; if it is assigned to a weak node, it will wait longer. This instability in waiting time introduced by the hardware differences of nodes 102 makes it difficult to guarantee the submitter's experience. Even if the overall operation is smooth, some users' tasks may still not receive a response for a long time due to being assigned to a weak node.

[0026] Based on this, this application provides a task distribution method and system 20, which can determine the target task quantity to be distributed to the edge nodes by using the total length of the first queue used by the edge nodes for caching tasks and the number of tasks being queued in the first queue. Thus, differentiated task quantity allocation can be achieved based on the actual processing capabilities of each edge node. Furthermore, while the edge nodes are processing tasks, tasks to be processed are distributed to the first queue. When offline, unprocessed tasks are determined based on the second queue of the scheduling center 201, and the unprocessed tasks are distributed to other edge nodes 203. Ultimately, this ensures that all tasks to be processed receive a relatively stable response experience as a whole.

[0027] The method provided in this application embodiment can be applied to, for example... Figure 2 The task distribution system 20 shown includes: The current edge node 202 is configured to cache and queue multiple tasks in the first queue; The scheduling center 201 is configured to determine the first queue length of the current edge node 202. The first queue length is used to characterize the total number of tasks that can be cached and queued for processing in the first queue of the current edge node 202. The scheduling center 201 is also configured to determine the target task volume based on the first queue length and the current cache size of the current edge node 202. The current cache size is used to represent the number of tasks waiting to be processed in the first queue of the current edge node 202, and the target task volume is used to represent the number of tasks that can be accepted and cached in the remaining free slots in the first queue. The current edge node 202 is also configured to receive tasks to be processed by the scheduling center 201 based on the target task volume while processing tasks in the first queue, and cache them in the first queue. The scheduling center 201 is also configured to synchronize the task list and execution status of all tasks in the first queue in real time in the second queue, which is set in the scheduling center 201. The scheduling center 201 is also configured to determine whether the current edge node 202 is offline. If so, it retrieves the unprocessed tasks from the first queue based on the second queue and sends the unprocessed tasks to other edge nodes 203. If not, it distributes the tasks for each unprocessed task based on the task's waiting time, where the waiting time is the duration from the time of distribution to the current time.

[0028] like Figure 3 As shown, this application also provides a task distribution method applied to a task distribution system 20, the method comprising: S301, the scheduling center 201 determines the first queue length of the current edge node 202. The first queue length is used to characterize the total number of tasks that can be cached and queued for processing in the first queue of the current edge node 202. like Figure 2 As shown, after multiple pending tasks submitted by the user are submitted to the scheduling center 201 of the task distribution system 20, they enter the global queue to wait for distribution. In one possible implementation, the scheduling center 201 determines the length of the first queue of the current edge node 202, specifically as follows: The scheduling center 201 determines the first average time for the current edge node 202 to process a single test task on the test task set; The first queue length of the current edge node 202 is determined based on the first average duration.

[0029] The measurement task is a benchmark task with controllable specifications and time consumption. Specifically, "controllable" means that the input data size, calculation amount and execution steps of the measurement task are fixed and can be pre-configured, and will not fluctuate due to the operating environment or other factors.

[0030] One possible implementation is to determine the first queue length of the current edge node 202 based on the first average duration, specifically as follows:

[0031] In the formula, L The length of the first queue; k This is a preset reference value for the length of the first queue; This is a preset reference value for the first average processing time; This is the first average processing time.

[0032] In one possible implementation, k is the lower limit of L, and the value of k can be set by those skilled in the art based on the hardware configuration, network conditions and historical processing performance of the current edge node 202.

[0033] For the developers of the task distribution system 20, when delivering the system, the expected average time for the current edge node 202 to process a single task is provided to the user.

[0034] From the above formula, it can be seen that, The smaller the value, the stronger the computing power of the current edge node 202; correspondingly, the length of the first queue... The larger.

[0035] One possible implementation is to determine the first queue length of the current edge node 202 based on the first average duration, specifically as follows: Based on the first average duration, the current edge node 202 is classified into different levels to obtain the performance level of the current edge node 202. The database is queried based on the performance level to obtain the first queue length of the current edge node 202. The database is used to maintain the mapping relationship between the performance level and the first queue length to determine the first queue length of the current edge node 202.

[0036] Specifically, it can be based on the first average duration. The edge nodes are divided into several tiers (e.g., high / medium / low), and each tier is mapped to a fixed first queue length. Or the length of the first queue Within the specified range, this solution is simple to implement and easy to maintain.

[0037] One possible implementation method also includes: Based on a preset time interval, the second average time for the current edge node 202 to process a single pending task is periodically obtained, the first average time is periodically updated based on the second average time, and the length of the first queue is periodically updated based on the updated first average time.

[0038] In other words, when edge node 202 first connects to task distribution system 20, since there is no historical task execution data for reference, scheduling center 201 issues a unified test task. The average time taken for the node to complete a single test task is used as the initial computing power estimation benchmark, and the initial first queue length is set accordingly. Once the edge node is officially operational, as real tasks are processed, scheduling center 201 continuously collects the actual execution time of each task on the edge node, updates the first average time using a smooth weighting method, and recalculates and adjusts the first queue length based on the updated first average processing time, ensuring that the queue capacity always matches the current actual processing capacity of the edge node. This update process is then repeated continuously during the operation of the edge node, ensuring that the scheduling strategy can adapt to the dynamic changes in the edge node's performance.

[0039] This application maintains a dynamically updated first queue length for each edge node. The larger the first queue length, the more tasks an edge node can cache, allowing nodes with stronger computing power to continuously handle more tasks in transit and fully utilize their processing advantages. The smaller the first queue length, the fewer tasks a node with weaker computing power has in transit, preventing a large number of tasks from accumulating in its queue for extended periods and occupying queuing slots. Furthermore, this application dynamically adjusts the upper limit of the first queue length based on the first average processing time of each node, ensuring that the task distribution volume matches the actual processing capacity of the nodes. Ultimately, this ensures that the expected queuing time for tasks is similar regardless of whether they are assigned to strong or weak nodes, improving the fairness of the experience for all task submitters.

[0040] S302. Determine the target task quantity based on the first queue length and the current cache quantity of the current edge node 202. The current cache quantity is used to represent the number of tasks waiting to be processed in the first queue of the current edge node 202. The target task quantity is used to represent the number of tasks that can be accepted and cached in the remaining free slots of the first queue. Specifically, the scheduling center 201 distributes tasks in the global queue to the corresponding node queues based on the length of the first queue of each node and the current cache size in the first queue (i.e., the number of slots currently occupied), including: The target waiting time is obtained by multiplying the first average duration of the current edge node 202 with the current cache size. The target waiting time is used to characterize the time required to wait from when the task to be processed is sent to the current edge node 202 until the task is processed. For each edge node, the target waiting time is calculated sequentially. If multiple edge nodes have the shortest target waiting time, the scheduling center 201 further compares the lengths of their first queues and prioritizes distributing tasks to the edge node with the longest first queue. A longer first queue length means that the edge node can accommodate a higher backlog of tasks, has stronger carrying capacity and fault tolerance margin, and avoids nodes with smaller capacity from filling their queues too early and frequently triggering timeouts and recycling. If the lengths of the first queues are still the same, the node with more free slots in the first queue is selected for distribution based on the difference between the first queue length and the current cache size.

[0041] S303. Based on the target task volume, while the current edge node 202 is processing the tasks in the first queue, the tasks to be processed are distributed to the current edge node 202 so that the tasks to be processed are cached in the first queue. Specifically, in S303, this application uses a first queue to push subsequent tasks to the first computation queue in advance while the current edge node 202 is processing the current task, so that the task distribution operation on the scheduling side and the task computation operation on the node side overlap in time.

[0042] This application makes the processing time of the current task and the distribution of the next task parallel (overlap), so that the network transmission time such as task distribution and state synchronization is covered within the computation time window of the edge node processing the current task. This makes the single transmission delay no longer directly added to the total end-to-end time of the task, thereby reducing the difference in task response time of each edge node due to different network conditions.

[0043] Therefore, one possible implementation method also includes: Obtain the current task being processed by the current edge node 202 and the next task to be processed immediately adjacent to the current task; While the current edge node 202 is processing the current task, it downloads the task data for the next task to be processed from the scheduling center.

[0044] This application distributes the next task while processing the previous task for different tasks; and while processing the current task, it downloads the data for the next task to be processed at the same time. The two pipelines are superimposed, so that the edge nodes have executable computing tasks at any time, shortening the idle time caused by waiting for data, thereby maintaining a high effective throughput even in a weak network environment.

[0045] Because of the pipelined task distribution and execution methods in this application, L cannot be less than a specific value k. Therefore, in another possible implementation, the value of k can also be determined based on the I / O and computational processes required by the task: Specifically, if the time taken for I / O operations such as downloading data for the next pending task and uploading the results of the current task is significantly longer than the actual computation time, then k should be preset to a smaller value to avoid consuming too many pre-cached tasks and thus occupying storage resources; otherwise, k can be appropriately increased so that the current edge node 202 has enough time to cache the input data of subsequent tasks locally while computing the current task, thereby allowing computation and I / O to overlap in time.

[0046] S304. In the second queue, the task list and execution status of all tasks in the first queue are synchronized in real time. The second queue is set in the scheduling center 201. It should be noted that the second queue is a mirror queue of the first queue, which allows the scheduling center 201 to accurately grasp the complete list and current status of all pending and executing tasks in the first queue of the current edge node 202 without real-time communication with the current edge node 202. Thus, when the node is offline, the task times out, or the distribution strategy needs to be actively adjusted, the unfinished tasks can be identified and recycled to the global queue for redistribution, avoiding additional network overhead and latency caused by frequent node status queries.

[0047] One possible implementation involves synchronizing the task list and execution status of all tasks in the first queue in real time within the second queue, including: Distribute tasks to be processed to the current edge node 202 so that the tasks to be processed are cached in the first queue, and at the same time, cache the tasks to be processed in the second queue, or push the tasks to be processed to the second queue, and at the same time the tasks to be processed enter the second queue, push them to the first queue of the current edge node 202 via the network. When the current edge node 202 finishes processing each current task, it removes the current task from both the first and second queues.

[0048] Specifically, when a task is completed, it is removed from the first queue, and the current edge node 202 sends a message indicating that the task has been completed to the scheduling center 201, so that the scheduling center 201 synchronously removes the task from the corresponding second queue. At this time, an empty slot becomes available in the first queue, and new tasks are then added from the global queue to the first and second queues respectively.

[0049] S305. Determine whether the current edge node 202 is offline. If so, obtain the unprocessed tasks in the first queue based on the second queue, and send the unprocessed tasks to other edge nodes 203. Specifically, when the current edge node 202 is offline, tasks that have not yet been confirmed to be completed in its first queue are inserted into the head of the global queue in the original order of the first queue, so that uncompleted tasks are redistributed to the first queue of other available edge nodes 203.

[0050] S306. If not, for each unprocessed task, the task is distributed based on the task's waiting time, which is the time from the time of task distribution to the current time.

[0051] Specifically, the task to be processed can be a task that can be broken down into independent sub-tasks, such as image recognition, video slice analysis, and image and video generation.

[0052] One possible implementation involves distributing tasks based on their waiting time for each unprocessed task, specifically as follows: For each unprocessed task, based on the comparison between the task's waiting time and a preset threshold, it is determined whether the task has timed out. If so, the unprocessed task is sent to other edge nodes 203.

[0053] One possible implementation method also includes: For each unfinished task: If the current edge node 202 does not respond within the first preset time, it will receive the execution results of the task from other edge nodes 203. If the execution result of the current edge node 202 is received at the second preset time, and the task is waiting to be executed in other edge nodes 203, then the task in other edge nodes 203 will be removed. The second preset time is less than the first preset time. If the execution result of the current edge node 202 is received at the second preset time, and the task is being executed in other edge nodes 203, then the execution results of the task by other edge nodes 203 are discarded. If the execution results of the task are received from the current edge node 202 and other edge nodes 203 respectively, the execution results that are received later are discarded based on the order in which they are received.

[0054] In other words, if the current edge node 202 has not left but is processing tasks slowly or not at all due to poor network signal, it is considered a "fake dead" node. At this time, a preset threshold (i.e., a waiting timeout) is set for each unprocessed task in the first queue. When the waiting time for a task exceeds the preset threshold, it is determined to have timed out. The task is copied from the original node's queue and placed at the head of the global queue, awaiting priority redistribution. Afterward, the fake dead node may not respond or may report completion results late. Specifically: No response during the first preset time period: Unfinished tasks will be executed and completed by other edge nodes 203 until the task is completed.

[0055] If a dead node returns a calculation result after a delay (in the second preset time period), and the unprocessed task is still in the global queue or the first queue of other edge nodes 203: delete the unprocessed task in the corresponding queue and deliver it to the task submitter based on the execution result of the dead node.

[0056] The dead node returns the calculation result after a delay (in the second preset time period), and the unprocessed task is being executed by other edge nodes 203: the execution result of the dead node is used as the basis for delivery to the task submitter; the execution results subsequently reported by other edge nodes 203 are discarded.

[0057] If a seemingly dead node returns a delayed calculation result, and the unfinished task has been completed and reported by other edge nodes 203: the delayed execution result of the seemingly dead node is discarded, and the execution result reported by other edge nodes 203 shall prevail.

[0058] It should be noted that although the operations of the method of the present invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0059] On the other hand, this application also provides a computer-readable storage medium, which may be included in a computer device or exist independently without being assembled into the computer device. The aforementioned computer-readable storage medium stores one or more programs that, when used by one or more processors, execute the methods described in this application. For example, it may execute... Figure 3 The steps of the method shown.

[0060] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0061] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A task distribution method, characterized in that, Applied to a task distribution system, the system including a scheduling center and multiple edge nodes, the method includes: The scheduling center determines the first queue length of the current edge node, and the first queue length is used to characterize the total number of tasks that can be cached and queued in the first queue of the current edge node; The target task quantity is determined based on the first queue length and the current cache size of the current edge node. The current cache size is used to represent the number of tasks waiting to be processed in the first queue of the current edge node. The target task quantity is used to represent the number of tasks that can be accepted and cached in the remaining free slots of the first queue. Based on the target task volume, while the current edge node is processing the tasks in the first queue, tasks to be processed are distributed to the current edge node so that the tasks to be processed are cached in the first queue; In the second queue, the task list and execution status of all tasks in the first queue are synchronized in real time. The second queue is located in the scheduling center. Determine whether the current edge node is offline. If so, retrieve the unprocessed tasks from the first queue based on the second queue, and send the unprocessed tasks to other edge nodes. If not, for each unprocessed task, the task is distributed based on the waiting time of the task, where the waiting time is the duration from the time of distribution to the current time.

2. The method according to claim 1, characterized in that, For each unprocessed task, the task is distributed based on its waiting time, specifically as follows: For each unprocessed task, based on the comparison between the waiting time of the task and a preset threshold, it is determined whether the task has timed out. If so, the unprocessed task is sent to other edge nodes.

3. The method according to claim 2, characterized in that, The method further includes: For each unfinished task: If the current edge node does not respond within a first preset time, the execution results of the task from the other edge nodes are received. If the execution result of the current edge node is received at a second preset time, and the task is waiting to be executed at other edge nodes, then the task at the other edge nodes is removed, and the second preset time is less than the first preset time. If the execution result of the current edge node is received at the second preset time, and the task is being executed on other edge nodes, then the execution results of the other edge nodes for the task are discarded. If the execution results of the task are received from the current edge node and the other edge nodes respectively, the execution results that are received later are discarded based on the order in which they are received.

4. The method according to claim 1, characterized in that, In the second queue, the task list and execution status of all tasks in the first queue are synchronized in real time, including: While distributing the task to be processed to the current edge node so that the task to be processed is cached in the first queue, the task to be processed is also cached in the second queue. When the current edge node finishes processing each current task, the current task is simultaneously removed from both the first queue and the second queue.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the current task being processed by the current edge node and the next task to be processed immediately adjacent to the current task; While the current edge node is processing the current task, it downloads the task data for the next task to be processed from the scheduling center.

6. The method according to claim 1, characterized in that, The scheduling center determines the first queue length of the current edge node as follows: The scheduling center determines the first average time for the current edge node to process a single test task on the test task set. The first queue length of the current edge node is determined based on the first average duration.

7. The method according to claim 6, characterized in that, The first queue length of the current edge node is determined based on the first average duration, specifically as follows: In the formula, L The length of the first queue; k This is a preset reference value for the length of the first queue; This is a preset reference value for the first average processing time; This is the first average processing time.

8. The method according to claim 6, characterized in that, The first queue length of the current edge node is determined based on the first average duration, specifically as follows: The current edge node is classified into different levels based on the first average duration to obtain the performance level of the current edge node; The database is queried based on the performance level to obtain the first queue length of the current edge node. The database is used to maintain the mapping relationship between the performance level and the first queue length to determine the first queue length of the current edge node.

9. The method according to claim 7 or 8, characterized in that, The method further includes: Based on a preset time interval, the second average time for the current edge node to process a single task to be processed is periodically obtained, the first average time is periodically updated based on the second average time, and the first queue length is periodically updated based on the updated first average time.

10. A task distribution system, characterized in that, include: The current edge node is configured to cache and queue multiple tasks in the first queue; The scheduling center is configured to determine the first queue length of the current edge node, the first queue length being used to characterize the total number of tasks that can be cached and queued for processing in the first queue of the current edge node; The scheduling center is also configured to determine the target task volume based on the first queue length and the current cache size of the current edge node. The current cache size is used to represent the number of tasks waiting to be processed in the first queue of the current edge node, and the target task volume is used to represent the number of tasks that can be accepted and cached in the remaining free slots of the first queue. The current edge node is also configured to receive tasks to be processed distributed by the scheduling center based on the target task volume while processing tasks in the first queue, and cache them in the first queue. The scheduling center is also configured to synchronize the task list and execution status of all tasks in the first queue in real time in the second queue, and the second queue is set in the scheduling center; The scheduling center is also configured to determine whether the current edge node is offline. If so, it retrieves the unprocessed tasks from the first queue based on the second queue and sends the unprocessed tasks to other edge nodes. If not, it distributes the tasks for each unprocessed task based on the waiting time of the task, where the waiting time is the duration from the time of distribution to the current time.

Citation Information

Patent Citations

  • Task synchronization method and device, main / standby system and storage medium

    CN114281607A

  • GPU-oriented multi-queue adaptive scheduling method and system

    CN121210077A