Task delivery method and device, computer device, storage medium and program product
By mapping tasks to specific scheduling threads based on storage node identifier hashes in a distributed cloud storage system, and combining resource information and threshold scheduling, the problem of load imbalance is solved, efficient task delivery and resource allocation are achieved, and the system's load balancing and fault response capabilities are improved.
Patent Information
- Application Number
- CN202611132118.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-28
- Publication Date
- 2026-11-13
AI Technical Summary
Distributed cloud storage systems are prone to load imbalance when delivering multiple types of concurrent services, leading to local congestion and uneven resource allocation.
By mapping pending tasks to specific scheduling threads based on storage node identifier hashes, and combining available resource information and resource occupancy thresholds for scheduling, high-priority tasks are prioritized, and low-priority task resources are proactively cleared in fault scenarios. A round-robin strategy is used for task delivery.
It achieves load balancing of scheduling threads, reduces the risk of local congestion when delivering multiple types of concurrent services, improves overall load balancing and availability in fault scenarios, and ensures priority processing of critical services and fairness in resource allocation.
Smart Images

Figure CN123089762A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of distributed cloud storage technology, and in particular to a task delivery method, apparatus, computer equipment, storage medium, and program product. Background Technology
[0002] With the widespread application of distributed cloud storage technology, distributed cloud storage systems need to simultaneously support multiple types of concurrent services, effectively improving the efficiency of data storage and access, and providing a foundation for high scalability and high availability for large-scale business systems.
[0003] However, distributed cloud storage systems have limited resources, and when delivering multiple types of concurrent services, they are prone to load imbalance. Summary of the Invention
[0004] Therefore, it is necessary to provide a task delivery method, apparatus, computer equipment, storage medium, and program product to address the aforementioned technical problems.
[0005] Firstly, this application provides a task delivery method, including:
[0006] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0007] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0008] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0009] In the above task delivery method, the load balancing of the scheduling thread is achieved by mapping the tasks to be processed to specific scheduling threads based on the storage node identifier hash. On this basis, scheduling is performed by combining the available resources with the resource occupancy thresholds corresponding to the tasks to be processed, so that each task must undergo resource level verification before being enqueued. Then, the final task is delivered according to the priority of the target delivery queue, so that tasks in the high-priority queue are processed first, reducing the risk of local congestion when delivering multiple types of concurrent services and improving the overall load balancing.
[0010] In one embodiment, the task to be processed is delivered to the target scheduling thread based on the identification information of the target storage node corresponding to the task to be processed, including:
[0011] Calculate the hash value of the task to be processed based on the identification information;
[0012] The thread identifier of the target scheduling thread is determined based on the hash value;
[0013] The first candidate thread group is determined based on the task type of the task to be processed.
[0014] The target scheduling thread is determined based on the thread identifier and the current load of the first candidate thread group;
[0015] The task to be processed is submitted to the target scheduling thread.
[0016] In this embodiment, the hash value is first calculated based on the storage node identifier to determine the thread identifier. The task delivery trajectory can be located based on the thread identifier. Then, the candidate thread group is determined based on the task type, and the target scheduling thread is finally selected by referring to the current load of the candidate thread group. This allows the thread with less pressure to be flexibly selected based on the real-time load status of the candidate thread group, thereby avoiding overload of individual threads due to hash skew and achieving load balancing of scheduling threads.
[0017] In one embodiment, determining the target scheduling thread based on the thread identifier and the current load of the first candidate thread group includes:
[0018] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread;
[0019] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
[0020] In this embodiment, the scheduling thread corresponding to the thread identifier in the candidate thread group is given priority. If its current load is less than a preset threshold, it is directly used as the target scheduling thread. When the load of the thread exceeds the threshold, the target thread is re-determined from other thread groups. This avoids the situation where some threads are overloaded and other threads are idle due to uneven hash distribution or concentrated hot tasks. While taking into account the orderliness of tasks, it provides dynamic adjustment space for load balancing and effectively improves the flexibility and balance of scheduling thread selection in multiple concurrent scenarios.
[0021] In one embodiment, determining the target scheduling thread from thread groups other than the first candidate thread group includes:
[0022] The thread groups whose current load is less than the second preset load threshold are identified as the second candidate thread groups; the second preset load threshold is greater than the first preset load threshold.
[0023] The target scheduling thread is determined from the scheduling threads corresponding to the second candidate thread group.
[0024] In this embodiment, when the thread corresponding to the thread identifier in the candidate thread group is overloaded, the thread groups whose current load is less than the second preset load threshold are first selected from other thread groups as candidates, and then the final target scheduling thread is determined from the scheduling threads corresponding to these candidate thread groups, which further improves the flexibility and balance of scheduling thread selection in multiple concurrency scenarios.
[0025] In one embodiment, determining the target scheduling thread from the scheduling threads corresponding to the second candidate thread group includes:
[0026] If there is only one second candidate thread group, then the scheduling thread corresponding to the thread identifier in the second candidate thread group is determined as the target scheduling thread;
[0027] If there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups will be determined as the target scheduling thread.
[0028] In this embodiment, when there is only one second candidate thread group, the scheduling thread corresponding to the original thread identifier in the second candidate thread group is directly used as the target scheduling thread, ensuring the continuity of the hash mapping and the orderliness of the tasks, and avoiding additional computational overhead. When there are multiple second candidate thread groups, the thread group with the lowest priority is selected, and the scheduling thread corresponding to the original thread identifier in the lowest priority thread group is used as the target scheduling thread. The migration task is preferentially directed to the low-priority idle thread group, thereby avoiding resource contention of high-priority thread groups and reserving more processing capacity for high-priority tasks. While ensuring load balancing, the rationality of resource allocation in multi-priority concurrent scenarios is further improved.
[0029] In one embodiment, the target scheduling thread is invoked, and, based on the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed, the task to be processed is scheduled to the target delivery queue, including:
[0030] If the available resources exceed the resource occupancy threshold, the target scheduling thread is invoked to schedule the tasks to be processed to the target delivery queue corresponding to the priority of the tasks to be processed.
[0031] If the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks to the waiting queue. This continues until the available resource information is greater than the resource occupancy threshold, at which point the target scheduling thread is invoked to schedule the pending tasks in the waiting queue to the target delivery queue corresponding to the priority of the pending tasks.
[0032] In this embodiment, when available resources are sufficient, tasks are directly scheduled to the delivery queue of the corresponding priority; when resources are insufficient, tasks are temporarily stored in the waiting queue and transferred to the target delivery queue after resources are restored. This avoids queue congestion and ineffective consumption caused by repeated scheduling attempts or disorderly occupation of limited resources due to resource shortages, and further improves the stability of resource allocation and scheduling efficiency in various concurrent scenarios.
[0033] In one embodiment, the target scheduling thread is invoked, and, based on the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed, the task to be processed is scheduled to the target delivery queue, including:
[0034] If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a lower priority than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold. Then, the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
[0035] In this embodiment, under fault scenarios, by actively emptying the resources occupied by tasks with a priority lower than the current task, the available resources are restored to above the threshold as soon as possible, thereby ensuring that the current task can be successfully scheduled to the delivery queue of the corresponding priority. This can avoid the allocation imbalance caused by resource occupation when the system is abnormal, and effectively improve the availability and resource turnover efficiency of the distributed cloud storage system under fault scenarios.
[0036] In one embodiment, the task to be processed is delivered to the target storage node according to the priority of the target delivery queue, including:
[0037] Based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, the tasks to be processed are added to the corresponding waiting list.
[0038] The sending token corresponding to the target delivery queue is determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0039] A polling strategy is adopted, which delivers the pending tasks in the waiting list to the target storage node based on the sent token.
[0040] In this embodiment, by concatenating waiting lists according to scheduling thread identifiers within the delivery queue, and determining the sending tokens for each queue based on the available proportion corresponding to the queue priority and the total number of available tokens in the system, differentiated quotas for the sending bandwidth of queues with different priorities are achieved. Then, a polling strategy is used to distribute tokens chain by chain, allowing high-priority queues to obtain more sending opportunities proportionally, while low-priority queues can also fairly obtain the remaining tokens according to the polling order. This ensures the priority passage of critical services in the sending process and avoids low-priority tasks being shelved for a long time, improving the fairness and controllability of sending resource allocation in multi-queue scenarios.
[0041] In one embodiment, the method further includes:
[0042] If a distributed cloud storage system malfunctions during the delivery of tasks to the target storage node, the waiting list corresponding to other delivery queues with lower priority than the target delivery queue will be emptied.
[0043] In this embodiment, when a system failure occurs, the waiting list corresponding to other delivery queues with a priority lower than the target delivery queue is directly emptied. This avoids low-priority tasks blocking the delivery path of high-priority tasks during the failure period, thereby ensuring that high-priority tasks can obtain sending resources first. This reduces the risk of additional delays or interruptions in critical services due to the accumulation of sending queues in failure scenarios, and improves the failure response efficiency and service assurance capabilities at the delivery end.
[0044] In one embodiment, the method further includes:
[0045] If a stripe overlap block occurs during the delivery of a task to the target storage node, the preceding task is removed from the waiting list based on its thread identifier; the task priority of the task to be processed is higher than that of the preceding task.
[0046] In this embodiment, when a high-priority task cannot be delivered due to the blockage of a preceding task, it is directly removed from the waiting list based on the thread identifier corresponding to the preceding task, thereby quickly removing the blockage point and reducing the situation where high-priority services are forced to wait for a long time due to the difference in processing speed of the underlying storage nodes. This improves the delivery continuity and response speed of critical services in distributed storage systems under complex IO interaction scenarios such as stripe overlap.
[0047] Secondly, this application also provides a task delivery device, comprising:
[0048] The first delivery module is used to deliver each of the multiple pending tasks received to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system.
[0049] The scheduling module is used to call the target scheduling thread, and combine the available resource information in the distributed cloud storage system with the resource occupancy threshold corresponding to the task to be processed to schedule the task to be processed to the target delivery queue.
[0050] The second delivery module is used to deliver the tasks to be processed to the target storage node according to the priority of the target delivery queue.
[0051] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0052] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0053] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0054] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0055] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:
[0056] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0057] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0058] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0059] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:
[0060] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0061] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0062] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0063] The aforementioned task delivery method, apparatus, computer equipment, storage medium, and program product, for each of the multiple pending tasks received, delivers the pending task to the target scheduling thread based on the identifier information of the target storage node corresponding to the pending task. The target scheduling thread is a thread in the target thread group among multiple thread groups in the distributed cloud storage system. The target scheduling thread is invoked, and, combining the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the pending task, the pending task is scheduled to the target delivery queue. Based on the priority of the target delivery queue, the pending task is delivered to the target storage node. This achieves load balancing of the scheduling thread by mapping the pending task to a specific scheduling thread based on the storage node identifier hash. Furthermore, by combining available resources with the resource occupancy threshold corresponding to the pending task for scheduling, each task undergoes resource level verification before being enqueued. Finally, the task is distributed according to the priority of the target delivery queue, ensuring that tasks in high-priority queues are processed first, reducing the risk of local congestion during the delivery of multiple concurrent services, and improving overall load balancing. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is an internal structural diagram of a computer device provided in an embodiment of this application;
[0066] Figure 2This is a flowchart illustrating a task delivery method provided in an embodiment of this application;
[0067] Figure 3 This is a flowchart illustrating a target scheduling thread allocation method provided in an embodiment of this application;
[0068] Figure 4 This is a flowchart illustrating another target scheduling thread allocation method provided in an embodiment of this application;
[0069] Figure 5 This is a flowchart illustrating another target scheduling thread allocation method provided in the embodiments of this application;
[0070] Figure 6 This is a flowchart illustrating a task scheduling method provided in an embodiment of this application;
[0071] Figure 7 This is a schematic diagram of a task scheduling method provided in an embodiment of this application;
[0072] Figure 8 This is a schematic diagram of a communication retention mode provided in an embodiment of this application;
[0073] Figure 9 This is a flowchart illustrating a method for delivering tasks to be processed, as provided in an embodiment of this application.
[0074] Figure 10 This is a schematic diagram of a strip overlap blocking processing method provided in an embodiment of this application;
[0075] Figure 11 This is a flowchart illustrating another task delivery method provided in an embodiment of this application;
[0076] Figure 12 This is a structural block diagram of a task delivery device provided in an embodiment of this application. Detailed Implementation
[0077] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0078] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0079] With the widespread application of distributed cloud storage technology, distributed cloud storage systems need to simultaneously support multiple types of concurrent services, effectively improving the efficiency of data storage and access, and providing a foundation for high scalability and high availability for large-scale business systems.
[0080] However, distributed cloud storage systems have limited resources, and when delivering multiple types of concurrent services, they are prone to load imbalance.
[0081] The task delivery method provided in this application embodiment can be applied to, for example, Figure 1 The application environment shown. Figure 1 This is an internal structure diagram of a computer device provided in an embodiment of this application. The computer device may be a server, and its internal structure diagram may be as follows: Figure 1 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and databases. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a task delivery method.
[0082] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0083] In one embodiment, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating a task delivery method provided in an embodiment of this application. This method can be applied to... Figure 1 The method, using a computer device, includes the following steps:
[0084] S201, for each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task.
[0085] The target scheduling thread is a thread in the target thread group among multiple thread groups in the distributed cloud storage system.
[0086] Optionally, the distributed cloud storage system will receive multiple pending tasks (such as I / O tasks) during operation. These pending tasks can be divided into various types according to priority, such as metadata tasks, data read tasks, data write tasks, flush tasks, and background tasks.
[0087] The tasks to be processed are sorted by priority from highest to lowest as follows: metadata tasks, data read tasks, data write tasks, refresh tasks, and background tasks.
[0088] For example, a distributed cloud storage system is pre-configured with multiple thread groups, each of which includes multiple scheduling threads, and different thread groups correspond to different task types.
[0089] In this embodiment, for each of the multiple pending tasks received, the identification information of the target storage node corresponding to the pending task can be obtained, and then the pending task can be delivered to the target scheduling thread according to the identification information and the type of the pending task.
[0090] Optionally, tasks to be processed can be preferentially assigned to the scheduling thread corresponding to the identification information in the thread group corresponding to the task type. If the thread group corresponding to the task type of the task to be processed has uneven load, and the scheduling thread corresponding to the identification information in that thread group is overloaded, the task to be processed can be assigned to the scheduling thread corresponding to the identification information in other thread groups to dynamically balance the load pressure of the scheduling threads.
[0091] S202, invoke the target scheduling thread, and combine the available resource information in the distributed cloud storage system with the resource occupancy threshold corresponding to the task to be processed to schedule the task to be processed to the target delivery queue.
[0092] Optionally, available resource information may include available memory size, available page count, available bandwidth, etc., in the distributed cloud storage system. Each task to be processed corresponds to a resource consumption threshold, which indicates the amount of resources required by the task during execution, such as the memory size and number of pages required by the task.
[0093] In this embodiment, after the task to be processed is delivered to the target scheduling thread, the target scheduling thread can be invoked to determine whether the amount of resources required by the task to be processed is sufficient, by combining the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed. If the amount of resources required by the task to be processed is sufficient, the task to be processed is scheduled to the target delivery queue; otherwise, the task to be processed is first scheduled to the waiting queue. After the amount of resources required by the task to be processed is sufficient and there is an empty space in the target delivery queue, the task to be processed is then scheduled from the waiting queue to the target delivery queue.
[0094] S203, based on the priority of the target delivery queue, deliver the task to be processed to the target storage node.
[0095] In this embodiment, the distributed cloud storage system contains multiple delivery queues with different priorities. Tasks can be retrieved from each delivery queue in sequence according to their priorities and sent to the corresponding target storage node.
[0096] In this embodiment, load balancing of scheduling threads is achieved by mapping tasks to be processed to specific scheduling threads based on storage node identifier hashes. On this basis, scheduling is performed by combining available resources with resource occupancy thresholds corresponding to tasks to be processed, so that each task must undergo resource level verification before being enqueued. Then, the final task is delivered according to the priority of the target delivery queue, so that tasks in high-priority queues are processed first, reducing the risk of local congestion when delivering multiple types of concurrent services and improving overall load balancing.
[0097] Reference Figure 3 , Figure 3 This is a flowchart illustrating a target scheduling thread allocation method provided in an embodiment of this application. This embodiment relates to a possible implementation of how to deliver a task to a target scheduling thread based on the identification information of the target storage node corresponding to the task. In an exemplary embodiment, S201 above includes the following steps:
[0098] S301, Calculate the hash value of the task to be processed based on the identification information.
[0099] Optionally, the identification information may include the volume identifier and segment identifier corresponding to the target storage node.
[0100] In this embodiment, the hash value of the task to be processed can be calculated using a hash algorithm based on the volume identifier and segment identifier as input.
[0101] S302, Determine the thread identifier of the target scheduling thread based on the hash value.
[0102] In this embodiment, the thread identifier of the target scheduling thread can be determined based on the hash value and a preset mapping relationship. The preset mapping relationship refers to the pre-defined mapping between different hash values and different thread identifiers.
[0103] S303, determine the first candidate thread group based on the task type of the task to be processed.
[0104] Optionally, based on the task type of the task to be processed, the thread group corresponding to the task type of the task to be processed in the distributed cloud storage system can be determined as the first candidate thread group.
[0105] For example, if the task to be processed is a metadata task, then the first candidate thread group is the metadata thread group; if the task to be processed is a data read task, then the first candidate thread group is the data read thread group.
[0106] S304. Determine the target scheduling thread based on the thread identifier and the current load of the first candidate thread group.
[0107] In this embodiment, if the current load of the first candidate thread group is sufficient, the scheduling thread corresponding to the identification information in the first candidate thread group can be preferentially determined as the target scheduling thread. If the current load of the first candidate thread group is too high, the tasks to be processed are delivered to the scheduling threads corresponding to the identification information in other thread groups to dynamically balance the load pressure of the scheduling threads.
[0108] S305, delivers the task to be processed to the target scheduling thread.
[0109] For example, after determining the target scheduling thread, the task to be processed can be submitted to that thread for handling. Simultaneously, the basic information of the task to be processed is stored in the hash bucket of the current target scheduling thread. This allows for direct retrieval of the specified task during subsequent emptying processes based on the basic information. This basic information may include, for example, the storage node identifier corresponding to the task, the task type, the task priority, and the resource consumption threshold.
[0110] In this embodiment, the hash value is first calculated based on the storage node identifier to determine the thread identifier. The task delivery trajectory can be located based on the thread identifier. Then, the candidate thread group is determined based on the task type, and the target scheduling thread is finally selected by referring to the current load of the candidate thread group. This allows the thread with less pressure to be flexibly selected based on the real-time load status of the candidate thread group, thereby avoiding overload of individual threads due to hash skew and achieving load balancing of scheduling threads.
[0111] Reference Figure 4 , Figure 4This is a flowchart illustrating another target scheduling thread allocation method provided in this application embodiment. This embodiment relates to a possible implementation of how to determine the target scheduling thread based on the thread identifier and the current load of the first candidate thread group. In an exemplary embodiment, the above S304 includes the following steps:
[0112] S401, if the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread.
[0113] In this embodiment, the current load can be compared with a first preset load threshold. If the current load is less than the first preset load threshold, it means that the load of the scheduling thread is relatively light, and the scheduling thread can be directly determined as the target scheduling thread.
[0114] The load of a scheduling thread can be represented by one or more of the following metrics: the number of tasks currently being processed by the scheduling thread, the amount of memory resources it occupies, and its CPU utilization.
[0115] S402, if the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
[0116] In another implementation, if the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than a first preset load threshold, it indicates that the scheduling thread is heavily loaded. If tasks continue to be delivered to this scheduling thread, it may cause the scheduling thread to become overloaded. In this case, it is necessary to determine the target scheduling thread from other thread groups besides the first candidate thread group.
[0117] In this embodiment, the scheduling thread corresponding to the thread identifier in the candidate thread group is given priority. If its current load is less than a preset threshold, it is directly used as the target scheduling thread. When the load of the thread exceeds the threshold, the target thread is re-determined from other thread groups. This avoids the situation where some threads are overloaded and other threads are idle due to uneven hash distribution or concentrated hot tasks. While taking into account the orderliness of tasks, it provides dynamic adjustment space for load balancing and effectively improves the flexibility and balance of scheduling thread selection in multiple concurrent scenarios.
[0118] Reference Figure 5 , Figure 5 This is a flowchart illustrating another target scheduling thread allocation method provided in this application embodiment. This embodiment relates to a possible implementation of how to determine the target scheduling thread from thread groups other than the first candidate thread group. In an exemplary embodiment, the above S402 includes the following steps:
[0119] S501, determine the thread group whose current load is less than the second preset load threshold as the second candidate thread group.
[0120] The second preset load threshold is greater than the first preset load threshold.
[0121] In this embodiment, the load of the thread group is the sum of the loads of all scheduled threads in the thread group, and the second preset load threshold is a threshold set for the overall load of the thread group.
[0122] Optionally, from the thread groups other than the first candidate thread group, the thread group with the lighter overall load can be selected as the candidate, that is, the second candidate thread group can be obtained.
[0123] S502, determine the target scheduling thread from the scheduling threads corresponding to the second candidate thread group.
[0124] In one implementation, if there is only one second candidate thread group, the scheduling thread corresponding to the thread identifier in the second candidate thread group is directly determined as the target scheduling thread.
[0125] In another implementation, if there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the lowest priority thread group among the multiple second candidate thread groups is determined as the target scheduling thread, thereby avoiding resource preemption of high priority thread groups, reserving more processing capacity for high priority tasks, and further improving the rationality of resource allocation in multi-priority concurrent scenarios while ensuring load balancing.
[0126] In this embodiment, when the thread corresponding to the thread identifier in the candidate thread group is overloaded, the thread groups whose current load is less than the second preset load threshold are first selected from other thread groups as candidates, and then the final target scheduling thread is determined from the scheduling threads corresponding to these candidate thread groups, which further improves the flexibility and balance of scheduling thread selection in multiple concurrency scenarios.
[0127] Reference Figure 6 , Figure 6 This is a flowchart illustrating a task scheduling method provided in an embodiment of this application. This embodiment relates to a possible implementation of how to invoke a target scheduling thread, combining available resource information in a distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed, to schedule the task to be processed to a target delivery queue. In an exemplary embodiment, the above S202 includes the following steps:
[0128] S601, when the available resource information is greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the task to be processed to the target delivery queue corresponding to the priority of the task to be processed.
[0129] In this embodiment, resource consumption thresholds can be set for each type of task based on task priority. For example, the distributed cloud storage system contains three priority task types, ranked from lowest to highest as Category 1, Category 2, and Category 3 tasks. The resource consumption threshold for Category 1 tasks is 30% of all available resources in the distributed cloud storage system; for Category 2 tasks, it is 60%; and for Category 3 tasks, it is 100%.
[0130] For example, the available resource information of the current distributed cloud storage system can be obtained, and this information can be compared with the resource occupancy threshold corresponding to the task to be processed. If the available resource information is greater than the resource occupancy threshold, it indicates that the current system resources are sufficient to meet the resource requirements of the task. In this case, the system calls the target scheduling thread to directly schedule the task to be processed to the target delivery queue corresponding to the priority of the task. Figure 7 As shown, during the scheduling phase, tasks are assigned to the corresponding delivery queues according to their priority.
[0131] S602, if the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks to the waiting queue. Until the available resource information is greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks in the waiting queue to the target delivery queue corresponding to the priority of the pending tasks.
[0132] Optionally, if the available resource information is not greater than the resource occupancy threshold, it indicates that the current system resources are insufficient and cannot meet the resource requirements of the task. In this case, the system can call the target scheduling thread to temporarily store the task to be processed in the waiting queue, and then continuously monitor the system's available resource information. When it detects that the available resource information is greater than the resource occupancy threshold (for example, other tasks have completed and released resources), the system can call the target scheduling thread to retrieve the task to be processed from the waiting queue and schedule it to the target delivery queue corresponding to the priority of the task.
[0133] In one implementation, if the number of tasks in the waiting queue exceeds a preset threshold, the tasks to be processed are directly returned to the upper layer for delayed retry.
[0134] In this embodiment, when available resources are sufficient, tasks are directly scheduled to the delivery queue of the corresponding priority; when resources are insufficient, tasks are temporarily stored in the waiting queue and transferred to the target delivery queue after resources are restored. This avoids queue congestion and ineffective consumption caused by repeated scheduling attempts or disorderly occupation of limited resources due to resource shortages, and further improves the stability of resource allocation and scheduling efficiency in various concurrent scenarios.
[0135] Reference Figure 8 , Figure 8 This is a schematic diagram of a communication maintenance mode provided in an embodiment of this application. In an exemplary embodiment, the method further includes the following steps:
[0136] If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a lower priority than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold. Then, the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
[0137] Optionally, when a distributed cloud storage system fails, the fault handling process is often accompanied by concurrent business operations, which can easily lead to I / O backlog and resource shortages due to the failure. If the task scheduling process encounters a situation where high-priority tasks lack sufficient resources during a fault scenario, the system will switch to a continuity-preservation mode to prioritize the smooth operation of high-priority tasks.
[0138] In this embodiment, when the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold corresponding to the task to be processed, the emptying of low-priority tasks can be actively triggered to empty the low-priority tasks that have acquired resources, release the resources they occupy, and continuously monitor the available resource information until the available resource information is greater than the resource occupancy threshold corresponding to the task to be processed, and then schedule the task to be processed to the target delivery queue corresponding to the priority of the task.
[0139] In this embodiment of the application, under fault scenarios, by actively emptying the resources occupied by tasks with a priority lower than the current task, the available resources are restored to above the threshold as soon as possible, thereby ensuring that the current task can be successfully scheduled to the delivery queue of the corresponding priority. This can avoid the allocation imbalance caused by resource occupation when the system is abnormal, and effectively improve the availability and resource turnover efficiency of the distributed cloud storage system under fault scenarios.
[0140] Reference Figure 9 , Figure 9 This is a flowchart illustrating a method for delivering tasks to be processed according to an embodiment of this application. This embodiment relates to a possible implementation of how to deliver tasks to be processed to a target storage node based on the priority of the target delivery queue. In an exemplary embodiment, step S203 above includes the following steps:
[0141] S901, based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, add the tasks to be processed to the corresponding waiting list.
[0142] In this embodiment, after task scheduling is completed, it is delivered to a queue waiting to be sent, i.e., a delivery queue. For each delivery queue, tasks can be added to the waiting list corresponding to the target scheduling thread, based on the thread identifier of that thread. For example, in the target delivery queue, all tasks scheduled by the same target scheduling thread are linked together in the same waiting list. Each delivery queue contains multiple waiting lists, and each waiting list corresponds to a scheduling thread.
[0143] S902, determine the sending token corresponding to the target delivery queue based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0144] For example, the availability ratio is the proportion of the number of sending tokens that the target delivery queue can occupy during the task delivery process to the total number of available tokens in the distributed cloud storage system. High-priority queues can correspond to a higher availability ratio, while low-priority queues correspond to a lower availability ratio.
[0145] In this embodiment, the number of sending tokens corresponding to the target delivery queue can be determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system. Then, sending tokens are allocated to tasks in the target delivery queue based on the number of sending tokens.
[0146] S903 employs a polling strategy, delivering pending tasks from the waiting list to the target storage node based on the sent token.
[0147] For example, a polling strategy can be used to send tasks by going around the waiting lists of each delivery queue. Each task in the waiting list needs to hold a send token to be delivered to the target storage node. Once a task holds the token and is delivered to the target storage node in the backend disk layer for reading and writing, the task is completed and the token is returned.
[0148] In this embodiment, by concatenating waiting lists according to scheduling thread identifiers within the delivery queue, and determining the sending tokens for each queue based on the available proportion corresponding to the queue priority and the total number of available tokens in the system, differentiated quotas for the sending bandwidth of queues with different priorities are achieved. Then, a polling strategy is used to send tokens chain by chain, so that high-priority queues get more sending opportunities proportionally, while low-priority queues can also fairly obtain the remaining tokens according to the polling order. This not only ensures the priority passage of critical services in the sending process, but also avoids low-priority tasks being shelved for a long time, improving the fairness and controllability of sending resource allocation in multi-queue scenarios.
[0149] In one exemplary embodiment, the method further includes the following steps:
[0150] If a distributed cloud storage system malfunctions during the delivery of tasks to the target storage node, the waiting list corresponding to other delivery queues with lower priority than the target delivery queue will be emptied.
[0151] Optionally, when the distributed cloud storage system fails, if the tasks to be processed are still queued in the target delivery queue, the waiting lists of other delivery queues with lower priority than the target delivery queue are directly emptied, and the tasks in these waiting lists are returned to the upper layer with a delay and retry, thereby quickly releasing resources. If the tasks to be processed have already been delivered to the backend, dequeueing is triggered directly to ensure that the tasks to be processed are completed as quickly as possible.
[0152] In this embodiment of the application, when the system fails, the waiting list corresponding to other delivery queues with a priority lower than the target delivery queue is directly emptied. This avoids low-priority tasks blocking the delivery path of high-priority tasks during the failure period, thereby ensuring that high-priority tasks can obtain sending resources first. This reduces the risk of additional delays or interruptions caused by the accumulation of sending queues in critical services during failure scenarios, and improves the failure response efficiency and service assurance capabilities at the delivery end.
[0153] Reference Figure 10 , Figure 10 This is a schematic diagram of a stripe overlap blocking processing method provided in an embodiment of this application. In an exemplary embodiment, the method further includes the following steps:
[0154] If a stripe overlap block occurs during the delivery of a task to the target storage node, the preceding task is removed from the waiting list based on its thread identifier; the task priority of the task to be processed is higher than that of the preceding task.
[0155] Optionally, in Erasure Coding (EC) mode, there may be overlapping stripe scenarios where multiple tasks hit the same stripe. Due to varying backend processing capabilities, slower disks may cause task backlog, and earlier submitted backend tasks may affect subsequent tasks on the same stripe. In such scenarios, if a high-priority task cannot be submitted due to a low-priority preceding task, the preceding task can be retrieved from the hash bucket based on its thread identifier, removed directly from the waiting list, and forced to dequeue, allowing it to execute immediately and quickly clearing the blockage.
[0156] In this embodiment, when a high-priority task cannot be delivered due to the blockage of a preceding task, it is directly removed from the waiting list based on the thread identifier corresponding to the preceding task, thereby quickly unblocking the blockage point and reducing the situation where high-priority services are forced to wait for a long time due to the difference in processing speed of the underlying storage nodes. This improves the delivery continuity and response speed of critical services in distributed storage systems under complex IO interaction scenarios such as stripe overlap.
[0157] The following will use a complete embodiment to illustrate... Figure 11 The overall implementation logic and beneficial effects of the task delivery method proposed in this application are explained below:
[0158] In this embodiment, the distributed cloud storage system pre-sets multiple thread groups based on task type. When a task to be processed is received, the first candidate thread group is determined according to the task type. Then, the volume ID and segment ID of the target storage node corresponding to the task are obtained, and a hash value is calculated to determine the thread identifier. Next, the load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is checked. If the current load of the scheduling thread is less than a first preset load threshold, the scheduling thread is directly determined as the target scheduling thread. If the current load of the scheduling thread is not less than the first preset load threshold, the thread group that meets the second preset load threshold and has the lowest priority is selected from other thread groups, and the scheduling thread corresponding to the thread identifier in the thread group is selected as the target scheduling thread. Finally, the task to be processed is delivered to the target scheduling thread, and the basic information of the task to be processed is stored in the hash bucket of that thread.
[0159] In the target scheduling thread, available resource information of the distributed cloud storage system can be obtained and compared with the resource consumption threshold of the task to be processed. If the available resource information is greater than the resource consumption threshold, it means that resources are sufficient, and the system will directly schedule the task to be processed to the target delivery queue corresponding to the priority of the task. If the available resource information is not greater than the resource consumption threshold, it means that resources are insufficient, and the system will temporarily store the task to be processed in the waiting queue, waiting for resources to be released before scheduling it to the target delivery queue.
[0160] After a task is scheduled to the target delivery queue, the system adds it to the corresponding waiting list based on the thread identifier of the target scheduling thread. Then, based on the available proportion of the target delivery queue's priority and the total number of available tokens in the system, the system determines the sending token for that target delivery queue. Finally, using a round-robin strategy, tasks in the waiting lists of each delivery queue are sequentially delivered to the target storage node based on the sending token.
[0161] When the distributed cloud storage system fails, it switches to a continuity-preserving mode. Regarding task scheduling, if a high-priority or medium-priority task encounters resource shortages, the system proactively clears the resources occupied by tasks with lower priorities, releases the resources, and then schedules the task to the target delivery queue. For the sending queue, the system clears the waiting list corresponding to other delivery queues with lower priorities than the target delivery queue, quickly releasing sending resources.
[0162] During the process of delivering a task to the target storage node, if a high-priority task is detected to be blocked by a preceding low-priority task due to stripe overlap, the system searches for the preceding task in the hash bucket based on the thread identifier corresponding to the preceding task, removes it directly from the waiting list, forcibly triggers dequeueing, and unblocks it.
[0163] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0164] Based on the same inventive concept, this application also provides a task delivery device for implementing the task delivery method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more task delivery device embodiments provided below can be found in the limitations of the task delivery method described above, and will not be repeated here.
[0165] In one exemplary embodiment, such as Figure 12 As shown, Figure 12 This is a structural block diagram of a task delivery device provided in an embodiment of this application. The task delivery device includes:
[0166] The first delivery module is used to deliver each of the multiple pending tasks received to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system.
[0167] The scheduling module is used to call the target scheduling thread, and combine the available resource information in the distributed cloud storage system with the resource occupancy threshold corresponding to the task to be processed to schedule the task to be processed to the target delivery queue.
[0168] The second delivery module is used to deliver the tasks to be processed to the target storage node according to the priority of the target delivery queue.
[0169] In one embodiment, the first delivery module includes:
[0170] The calculation unit is used to calculate the hash value of the task to be processed based on the identification information;
[0171] The first determining unit is used to determine the thread identifier of the target scheduling thread based on the hash value;
[0172] The second determining unit is used to determine the first candidate thread group based on the task type of the task to be processed.
[0173] The third determining unit is used to determine the target scheduling thread based on the thread identifier and the current load of the first candidate thread group;
[0174] The first delivery unit is used to deliver the task to be processed to the target scheduling thread.
[0175] In one embodiment, the third determining unit includes:
[0176] The first determining subunit is used to determine the scheduling thread as the target scheduling thread if the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold.
[0177] The second determining subunit is used to determine the target scheduling thread from other thread groups besides the first candidate thread group if the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold.
[0178] In one embodiment, the second determining subunit is specifically used to determine the thread group whose current load is less than a second preset load threshold in other thread groups as the second candidate thread group; the second preset load threshold is greater than a first preset load threshold; and determine the target scheduling thread from the scheduling threads corresponding to the second candidate thread group.
[0179] In one embodiment, the second determining subunit is specifically used to determine the scheduling thread corresponding to the thread identifier in the second candidate thread group as the target scheduling thread if there is only one second candidate thread group; and to determine the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups as the target scheduling thread if there are multiple second candidate thread groups.
[0180] In one embodiment, the scheduling module includes:
[0181] The first scheduling unit is used to call the target scheduling thread to schedule the tasks to be processed to the target delivery queue corresponding to the priority of the tasks to be processed when the available resource information is greater than the resource occupancy threshold.
[0182] The second scheduling unit is used to call the target scheduling thread to schedule the tasks to be processed into the waiting queue when the available resource information is not greater than the resource occupancy threshold, until the available resource information is greater than the resource occupancy threshold, and then call the target scheduling thread to schedule the tasks to be processed in the waiting queue into the target delivery queue corresponding to the priority of the tasks to be processed.
[0183] In one embodiment, the scheduling module includes:
[0184] The third scheduling unit is used to clear the resources occupied by tasks with lower priorities than the pending tasks when the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, until the available resource information is greater than the resource occupancy threshold, and then schedule the pending tasks to the target delivery queue corresponding to the priority of the pending tasks.
[0185] In one embodiment, the second delivery module includes:
[0186] The addition unit is used to add the tasks to be processed to the corresponding waiting list according to the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue.
[0187] The token distribution unit is used to determine the sending token corresponding to the target delivery queue based on the available ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0188] The second delivery unit is used to deliver the pending tasks in the waiting list to the target storage node based on the sending token using a polling strategy.
[0189] In one embodiment, the device further includes:
[0190] The third delivery module is used to empty the waiting list corresponding to other delivery queues with lower priority than the target delivery queue if the distributed cloud storage system fails during the delivery of the task to be processed to the target storage node.
[0191] In one embodiment, the device further includes:
[0192] The removal module is used to remove the preceding task from the waiting list if stripe overlap blocking occurs during the delivery of the task to the target storage node. The preceding task has a higher priority than the preceding task.
[0193] Each module in the aforementioned task delivery device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0194] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0195] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0196] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0197] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0198] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0199] Calculate the hash value of the task to be processed based on the identification information;
[0200] The thread identifier of the target scheduling thread is determined based on the hash value;
[0201] The first candidate thread group is determined based on the task type of the task to be processed.
[0202] The target scheduling thread is determined based on the thread identifier and the current load of the first candidate thread group;
[0203] The task to be processed is submitted to the target scheduling thread.
[0204] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0205] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread;
[0206] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
[0207] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0208] The thread groups whose current load is less than the second preset load threshold are identified as the second candidate thread groups; the second preset load threshold is greater than the first preset load threshold.
[0209] The target scheduling thread is determined from the scheduling threads corresponding to the second candidate thread group.
[0210] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0211] If there is only one second candidate thread group, then the scheduling thread corresponding to the thread identifier in the second candidate thread group is determined as the target scheduling thread;
[0212] If there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups will be determined as the target scheduling thread.
[0213] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0214] If the available resources exceed the resource occupancy threshold, the target scheduling thread is invoked to schedule the tasks to be processed to the target delivery queue corresponding to the priority of the tasks to be processed.
[0215] If the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks to the waiting queue. This continues until the available resource information is greater than the resource occupancy threshold, at which point the target scheduling thread is invoked to schedule the pending tasks in the waiting queue to the target delivery queue corresponding to the priority of the pending tasks.
[0216] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0217] If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a lower priority than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold. Then, the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
[0218] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0219] Based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, the tasks to be processed are added to the corresponding waiting list.
[0220] The sending token corresponding to the target delivery queue is determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0221] A polling strategy is adopted, which delivers the pending tasks in the waiting list to the target storage node based on the sent token.
[0222] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0223] If a distributed cloud storage system malfunctions during the delivery of tasks to the target storage node, the waiting list corresponding to other delivery queues with lower priority than the target delivery queue will be emptied.
[0224] In one embodiment, the processor, when executing a computer program, also performs the following steps:
[0225] If a stripe overlap block occurs during the delivery of a task to the target storage node, the preceding task is removed from the waiting list based on its thread identifier; the task priority of the task to be processed is higher than that of the preceding task.
[0226] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0227] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0228] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0229] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0230] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0231] Calculate the hash value of the task to be processed based on the identification information;
[0232] The thread identifier of the target scheduling thread is determined based on the hash value;
[0233] The first candidate thread group is determined based on the task type of the task to be processed.
[0234] The target scheduling thread is determined based on the thread identifier and the current load of the first candidate thread group;
[0235] The task to be processed is submitted to the target scheduling thread.
[0236] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0237] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread;
[0238] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
[0239] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0240] The thread groups whose current load is less than the second preset load threshold are identified as the second candidate thread groups; the second preset load threshold is greater than the first preset load threshold.
[0241] The target scheduling thread is determined from the scheduling threads corresponding to the second candidate thread group.
[0242] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0243] If there is only one second candidate thread group, then the scheduling thread corresponding to the thread identifier in the second candidate thread group is determined as the target scheduling thread;
[0244] If there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups will be determined as the target scheduling thread.
[0245] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0246] If the available resources exceed the resource occupancy threshold, the target scheduling thread is invoked to schedule the tasks to be processed to the target delivery queue corresponding to the priority of the tasks to be processed.
[0247] If the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks to the waiting queue. This continues until the available resource information is greater than the resource occupancy threshold, at which point the target scheduling thread is invoked to schedule the pending tasks in the waiting queue to the target delivery queue corresponding to the priority of the pending tasks.
[0248] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0249] If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a lower priority than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold. Then, the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
[0250] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0251] Based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, the tasks to be processed are added to the corresponding waiting list.
[0252] The sending token corresponding to the target delivery queue is determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0253] A polling strategy is adopted, which delivers the pending tasks in the waiting list to the target storage node based on the sent token.
[0254] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0255] If a distributed cloud storage system malfunctions during the delivery of tasks to the target storage node, the waiting list corresponding to other delivery queues with lower priority than the target delivery queue will be emptied.
[0256] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0257] If a stripe overlap block occurs during the delivery of a task to the target storage node, the preceding task is removed from the waiting list based on its thread identifier; the task priority of the task to be processed is higher than that of the preceding task.
[0258] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0259] For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system;
[0260] The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue.
[0261] Based on the priority of the target delivery queue, the tasks to be processed are delivered to the target storage node.
[0262] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0263] Calculate the hash value of the task to be processed based on the identification information;
[0264] The thread identifier of the target scheduling thread is determined based on the hash value;
[0265] The first candidate thread group is determined based on the task type of the task to be processed.
[0266] The target scheduling thread is determined based on the thread identifier and the current load of the first candidate thread group;
[0267] The task to be processed is submitted to the target scheduling thread.
[0268] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0269] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread;
[0270] If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
[0271] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0272] The thread groups whose current load is less than the second preset load threshold are identified as the second candidate thread groups; the second preset load threshold is greater than the first preset load threshold.
[0273] The target scheduling thread is determined from the scheduling threads corresponding to the second candidate thread group.
[0274] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0275] If there is only one second candidate thread group, then the scheduling thread corresponding to the thread identifier in the second candidate thread group is determined as the target scheduling thread;
[0276] If there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups will be determined as the target scheduling thread.
[0277] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0278] If the available resources exceed the resource occupancy threshold, the target scheduling thread is invoked to schedule the tasks to be processed to the target delivery queue corresponding to the priority of the tasks to be processed.
[0279] If the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the pending tasks to the waiting queue. This continues until the available resource information is greater than the resource occupancy threshold, at which point the target scheduling thread is invoked to schedule the pending tasks in the waiting queue to the target delivery queue corresponding to the priority of the pending tasks.
[0280] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0281] If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a lower priority than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold. Then, the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
[0282] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0283] Based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, the tasks to be processed are added to the corresponding waiting list.
[0284] The sending token corresponding to the target delivery queue is determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system.
[0285] A polling strategy is adopted, which delivers the pending tasks in the waiting list to the target storage node based on the sent token.
[0286] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0287] If a distributed cloud storage system malfunctions during the delivery of tasks to the target storage node, the waiting list corresponding to other delivery queues with lower priority than the target delivery queue will be emptied.
[0288] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:
[0289] If a stripe overlap block occurs during the delivery of a task to the target storage node, the preceding task is removed from the waiting list based on its thread identifier; the task priority of the task to be processed is higher than that of the preceding task.
[0290] Those skilled in the art will understand that all or part of the processes in the methods of 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, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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, artificial intelligence (AI) processors, etc., and are not limited to these.
[0291] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0292] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A task delivery method, characterized in that, The method includes: For each of the multiple pending tasks received, the pending task is delivered to the target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among multiple thread groups in the distributed cloud storage system; The target scheduling thread is invoked, and the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed are combined to schedule the task to be processed to the target delivery queue. The task to be processed is delivered to the target storage node according to the priority of the target delivery queue.
2. The method according to claim 1, characterized in that, The step of delivering the task to the target scheduling thread based on the identifier information of the target storage node corresponding to the task to be processed includes: Calculate the hash value of the task to be processed based on the identification information; The thread identifier of the target scheduling thread is determined based on the hash value; The first candidate thread group is determined based on the task type of the task to be processed; The target scheduling thread is determined based on the thread identifier and the current load of the first candidate thread group; The task to be processed is submitted to the target scheduling thread.
3. The method according to claim 2, characterized in that, The step of determining the target scheduling thread based on the thread identifier and the current load of the first candidate thread group includes: If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is less than the first preset load threshold, then the scheduling thread is determined as the target scheduling thread; If the current load of the scheduling thread corresponding to the thread identifier in the first candidate thread group is not less than the first preset load threshold, then the target scheduling thread is determined from other thread groups besides the first candidate thread group.
4. The method according to claim 3, characterized in that, The step of determining the target scheduling thread from thread groups other than the first candidate thread group includes: The thread groups whose current load is less than the second preset load threshold are identified as the second candidate thread groups; the second preset load threshold is greater than the first preset load threshold. The target scheduling thread is determined from the scheduling threads corresponding to the second candidate thread group.
5. The method according to claim 4, characterized in that, The step of determining the target scheduling thread from the scheduling threads corresponding to the second candidate thread group includes: If there is only one candidate thread group, then the scheduling thread corresponding to the thread identifier in the second candidate thread group is determined as the target scheduling thread; If there are multiple second candidate thread groups, the scheduling thread corresponding to the thread identifier in the thread group with the lowest priority among the multiple second candidate thread groups shall be determined as the target scheduling thread.
6. The method according to any one of claims 1-5, characterized in that, The step of invoking the target scheduling thread, combining the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed, to schedule the task to be processed to the target delivery queue includes: If the available resource information is greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the task to be processed to the target delivery queue corresponding to the priority of the task to be processed. If the available resource information is not greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the task to be processed into the waiting queue. If the available resource information is greater than the resource occupancy threshold, the target scheduling thread is invoked to schedule the task to be processed in the waiting queue into the target delivery queue corresponding to the priority of the task to be processed.
7. The method according to claim 1, characterized in that, The step of invoking the target scheduling thread, combining the available resource information in the distributed cloud storage system and the resource occupancy threshold corresponding to the task to be processed, to schedule the task to be processed to the target delivery queue includes: If the distributed cloud storage system fails and the available resource information is not greater than the resource occupancy threshold, the resources occupied by tasks with a priority lower than the pending task will be cleared until the available resource information is greater than the resource occupancy threshold, and then the pending task will be scheduled to the target delivery queue corresponding to the priority of the pending task.
8. The method according to any one of claims 1-5, characterized in that, The step of delivering the task to be processed to the target storage node according to the priority of the target delivery queue includes: Based on the thread identifier of the target scheduling thread corresponding to each task in the target delivery queue, the task to be processed is added to the corresponding waiting list; The sending token corresponding to the target delivery queue is determined based on the availability ratio corresponding to the priority of the target delivery queue and the total number of available tokens in the distributed cloud storage system. A polling strategy is adopted to deliver the pending tasks in the waiting list to the target storage node based on the sending token.
9. The method according to claim 8, characterized in that, The method further includes: If the distributed cloud storage system malfunctions during the delivery of the task to be processed to the target storage node, the waiting list corresponding to other delivery queues with a lower priority than the target delivery queue will be emptied.
10. The method according to claim 8, characterized in that, The method further includes: If stripe overlap blocking occurs during the delivery of the task to be processed to the target storage node, the preceding task is removed from the waiting list based on the thread identifier of the preceding task of the task to be processed; wherein the task priority of the task to be processed is higher than the task priority of the preceding task.
11. A task delivery device, characterized in that, The device includes: The first delivery module is used to deliver each of the multiple pending tasks received to a target scheduling thread according to the identification information of the target storage node corresponding to the pending task; wherein, the target scheduling thread is a thread in the target thread group among the multiple thread groups of the distributed cloud storage system. The scheduling module is used to call the target scheduling thread, and combine the available resource information in the distributed cloud storage system with the resource occupancy threshold corresponding to the task to be processed, to schedule the task to be processed to the target delivery queue. The second delivery module is used to deliver the task to be processed to the target storage node according to the priority of the target delivery queue.
12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.
