Task scheduling method and system of dynamic hierarchical queue
By dynamically analyzing the multidimensional attribute information of tasks and updating the hierarchical queue, the problem of a single task scheduling strategy is solved, achieving efficient and adaptable task scheduling and reducing time consumption and conflicts.
Patent Information
- Application Number
- CN202510971993.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies employ a single task scheduling strategy, which cannot adapt to complex business needs. Task scheduling efficiency is low, and it takes a long time in the case of large-scale tasks, resulting in problems such as repeated task execution and scheduling conflicts.
By dynamically analyzing the multidimensional attribute information of tasks, including time, resource, and stage dimensions, the hierarchical structure of the task queue is dynamically updated, enabling dynamic migration and optimized scheduling of tasks.
It improves the adaptability and efficiency of task scheduling, reduces task scheduling time, avoids duplicate task execution and scheduling conflicts, and ensures the consistency and accuracy of the task queue.
Smart Images

Figure CN120994327A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer technology, and in particular to a task scheduling method and system of dynamic hierarchical queues. BACKGROUND
[0002] With the development of big data, artificial intelligence and other fields, the demand for task scheduling is increasing, and the application scenarios are developing. Distributed task scheduling has gradually become one of the focuses of relevant staff.
[0003] At present, the related technology usually allocates priority to the to-be-scheduled task in the task scheduling platform through simple rules and adds storage to the memory queue, and realizes task scheduling through traversal. The scheduling strategy of this method is relatively single, and cannot well adapt to complex business task requirements, and the adaptability of task scheduling is poor. In addition, when the task scale in the memory queue is large, the time consumption of task scheduling is long, and the task scheduling efficiency is not satisfactory.
[0004] Therefore, the problems of the related technology still need to be solved and optimized. SUMMARY
[0005] The purpose of the present application is to at least partially solve one of the technical problems in the related art.
[0006] To this end, one purpose of an embodiment of the present application is to provide a task scheduling method and system of dynamic hierarchical queues, wherein the method can effectively improve the adaptability and efficiency of task scheduling.
[0007] In order to achieve the above technical purpose, the technical solution adopted by the embodiments of the present application includes:
[0008] In a first aspect, the present application provides a task scheduling method of dynamic hierarchical queues, applied to a source node, the method comprising:
[0009] receiving task submission information from a target node, the task submission information comprising a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information comprising time dimension information, resource dimension information and stage dimension information;
[0010] performing dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task;
[0011] sending the original queue information and the target queue information to a queue platform, so that the queue platform updates a first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list, and the target node schedules to execute a second target task in the updated first task queue list;
[0012] wherein the first task queue list comprises a plurality of hierarchical queues of different levels.
[0013] In addition, the method according to the above-mentioned embodiments of the present application can have the following additional technical features:
[0014] Further, in an embodiment of the present application, the dynamic queue analysis of the first target task according to the multi-dimensional attribute information to obtain the original queue information and the target queue information of the first target task comprises:
[0015] obtaining a queue rule table, the queue rule table recording a plurality of hierarchical queues in the first task queue list and a priority score range of each of the hierarchical queues;
[0016] determining the original queue information according to the first target task;
[0017] performing priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information.
[0018] Further, in an embodiment of the present application, the performing priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information comprises:
[0019] performing time priority analysis on the time dimension information to obtain a time priority score value;
[0020] performing resource priority analysis on the resource dimension information to obtain a resource priority score value;
[0021] performing stage priority analysis on the stage dimension information to obtain a stage priority score value;
[0022] performing score matching on the queue rule table according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information.
[0023] Further, in an embodiment of the present application, the performing score matching on the queue rule table according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information comprises:
[0024] performing weighted analysis on the time priority score value, the resource priority score value and the stage priority score value to obtain a task priority score value of the first target task;
[0025] performing task queue matching on the queue rule table according to the task priority score value to obtain target queue information of the first target task.
[0026] In a second aspect, the embodiments of the present application provide a task scheduling method of a dynamic hierarchical queue, applied to a queue platform, and the method comprises:
[0027] obtaining a first task queue list and receiving original queue information and target queue information from a source node, wherein the first task queue list comprises a plurality of hierarchical queues of different levels;
[0028] updating the first task queue list according to the original queue information and the target queue information to obtain an updated first task queue list;
[0029] The original queue information and the target queue information are obtained through the following steps:
[0030] a target node schedules a second target task of the updated first task queue list to obtain task submission information, and sends the task submission information to the source node, wherein the task submission information comprises the first target task and multi-dimensional attribute information of the first target task, the first target task is the second target task most recently scheduled by the target node, and the multi-dimensional attribute information comprises time dimension information, resource dimension information and stage dimension information;
[0031] The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain the original queue information and the target queue information of the first target task.
[0032] Further, in an embodiment of the present application, the updating of the first task queue list according to the original queue information and the target queue information to obtain the updated first task queue list comprises:
[0033] performing queue screening on the first task queue list according to the original queue information to obtain a first hierarchical queue, wherein the first hierarchical queue is a hierarchical queue in which the first target task is located before execution of the first target task by the target node;
[0034] removing the first target task in the first hierarchical queue;
[0035] According to the target queue information, the first target task is added to a second hierarchical queue in the first task queue list, and the second hierarchical queue is a hierarchical queue indicated by the target queue information in the first task queue list.
[0036] In a third aspect, the embodiments of the present application provide a task scheduling method of a dynamic hierarchical queue, applied to a target node, and the method comprises:
[0037] Scheduling a second target task in the updated first task queue list to obtain task submission information, and sending the task submission information to a source node, wherein the task submission information comprises the first target task and multi-dimensional attribute information of the first target task, the first target task is a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information comprises time dimension information, resource dimension information and stage dimension information.
[0038] The updated first task queue list is obtained through the following steps:
[0039] The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task.
[0040] The source node sends the original queue information and the target queue information to a queue platform.
[0041] The queue platform updates the first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list, and the first task queue list comprises a plurality of hierarchical queues of different levels.
[0042] Further, in an embodiment of the present application, the scheduling of the second target task in the updated first task queue list to obtain the task submission information comprises:
[0043] Obtaining load resource information;
[0044] Sending a task acquisition request to the queue platform, so that the queue platform extracts a task according to the task acquisition request to obtain a second target task returned by the queue platform, and the second target task is a task with the largest task priority score value in the plurality of hierarchical queues of the updated first task queue list.
[0045] According to the load resource information, performing resource matching on the second target task to obtain a resource matching result.
[0046] According to the resource matching result, the second target task is executed, and the task submission information is obtained.
[0047] Further, in an embodiment of the present application, the method further comprises:
[0048] receiving a migration message from the queue platform, the migration message comprising original queue information, target queue information and task priority score value of the first target task;
[0049] According to the original queue information and the target queue information, the second task queue list in the target node is migrated to queue, so that the first target task is migrated from a third hierarchical queue to a fourth hierarchical queue, the third hierarchical queue being a hierarchical queue in the second task queue list in which the first target task was located before execution of the target node; and the fourth hierarchical queue being a hierarchical queue indicated by the target queue information in the second task queue list.
[0050] According to the task priority score value, the fourth hierarchical queue is updated in score value, and an updated fourth hierarchical queue is obtained.
[0051] In a fourth aspect, an embodiment of the present application provides a task scheduling system of a dynamic hierarchical queue, the system comprising a source node, a target node and a queue platform;
[0052] The source node is configured to receive task submission information from the target node, the task submission information comprising a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information comprising time dimension information, resource dimension information and stage dimension information; and the first target task is subjected to dynamic queue analysis according to the multi-dimensional attribute information, and original queue information and target queue information of the first target task are obtained.
[0053] The queue platform is configured to receive the original queue information and the target queue information, and update a first task queue list in the queue platform according to the original queue information and the target queue information, and obtain an updated first task queue list.
[0054] The target node is configured to schedule and execute a second target task in the updated first task queue list.
[0055] In a fifth aspect, an embodiment of the present application further provides an electronic device, comprising:
[0056] at least one processor;
[0057] at least one memory configured to store at least one program;
[0058] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0059] In a sixth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a processor executable program. The processor executable program, when executed by a processor, is used to implement the above method.
[0060] The advantages and beneficial effects of the present application will be partially given in the following description, partially will become obvious from the following description, or will be learned by the practice of the present application:
[0061] The task scheduling method and system of the dynamic hierarchical queue disclosed by the embodiments of the present application, wherein the method receives task submission information from a target node, the task submission information includes a first target task and multi-dimensional attribute information of the first target task, the first target task is a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information includes time dimension information, resource dimension information and stage dimension information; according to the multi-dimensional attribute information, the first target task is dynamically analyzed to obtain original queue information and target queue information of the first target task; the original queue information and the target queue information are sent to a queue platform, so that the queue platform updates a first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list, and the target node schedules and executes a second target task in the updated first task queue list; wherein the first task queue list includes a plurality of hierarchical queues of different levels. The method updates a plurality of hierarchical queues of different levels of the first task queue list based on the original queue information and the target queue information obtained by analyzing the multi-dimensional attribute information, the updated first task queue list can better adapt to the task demand of complex business, effectively improves the adaptability of task scheduling, and is conducive to reducing the task scheduling time required by the second target task in the first task queue list of the target node, effectively improving the task scheduling efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following introduces the drawings of the related technical solutions in the embodiments of the present application or the prior art. It should be understood that the drawings in the following introduction are only for the convenience of expressing part of the embodiments of the technical solutions of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the premise of the drawings.
[0063] Figure 1A flowchart of a task scheduling method of a dynamic hierarchical queue provided by an embodiment of the present application is shown in the figure.
[0064] Figure 2 A framework diagram of a task scheduling system of a dynamic hierarchical queue provided by an embodiment of the present application is shown in the figure.
[0065] Figure 3 A structural diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0066] Embodiments of the present application are described in detail below, examples of which are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are only used to explain the present application and cannot be understood as limiting the present application. For the step numbers in the following embodiments, they are only set for the convenience of explanation and description, and the order between the steps is not limited in any way, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0067] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0068] At present, the related art usually allocates priority to a task to be scheduled in a task scheduling platform through a simple rule and adds storage to a memory queue, and implements task scheduling through a traversal manner. However, since the simple rule usually calculates and allocates task priority in a single dimension (such as a timestamp or a fixed priority), it cannot fuse multi-dimensional features (such as CPU core number and memory bandwidth) of time sensitivity, resource affinity, and execution phase state of the task, resulting in a single scheduling strategy and a lack of dynamic evaluation of real-time state (such as historical execution delay fluctuation rate and interruption recovery times) of the task, which cannot adapt to complex business requirements and has poor adaptability of task scheduling.
[0069] In addition, the memory queue used in this way is usually a single or fixed layer queue, and the tasks to be executed in the memory queue are relatively fixed. The traditional queue scanning algorithm is to traverse the queue in priority order to obtain the task, and its complexity is O(n). When the task size in the queue increases, the traversal time increases linearly, and when the queue is highly loaded, it cannot effectively guarantee the key task, the time consumption of task scheduling is long, and the overall task scheduling efficiency is not high. For example, when the task size reaches ten million, the priority query delay is often more than 200 ms, which cannot meet the real-time business requirements (such as industrial control instructions that need to respond within 50 ms).
[0070] In addition, there is a part of the related art, which builds an edge node cluster through distributed technology, and synchronizes the memory queue (such as a simple message queue) in an unstructured manner. The synchronization of the memory queue in this manner is difficult, and it depends on the local storage of the edge node memory queue in structure, which is prone to inconsistent distributed queue situations, and further prone to task repetition execution or scheduling conflicts, and the accuracy of task scheduling is not satisfactory.
[0071] It should be noted that the above-mentioned related art is only used to assist in understanding the technical solutions of the present application, and does not mean that it belongs to the prior art disclosed.
[0072] Therefore, the embodiments of the present application provide a task scheduling method and system of dynamic hierarchical queue, wherein the method analyzes the multi-dimensional attribute information of the target task executed by the latest scheduling, specifically analyzes the time dimension feature information (such as historical execution delay fluctuation rate), resource dimension feature information and stage dimension feature information (such as interruption recovery times) in the multi-dimensional attribute information, which not only can integrate the multi-dimensional features of the task, but also fully considers the real-time state of the task and performs dynamic evaluation, which can better adapt to complex business requirements and effectively improve the adaptability of task scheduling.
[0073] In addition, the method updates the first task queue list in the queue platform based on the target queue information and the original queue information determined based on the multi-dimensional attribute information, specifically, according to the original queue information, the first target task is migrated from the original hierarchical queue in the task queue list; and according to the target queue information, the first target task is migrated and updated to the specified hierarchical queue in the task queue list, which can realize the dynamic change of the to-be-executed task in the queue, which is beneficial to reduce the size of the queue task, and at the same time, when the queue is highly loaded, non-critical tasks can be migrated to the ordinary hierarchical queue, and critical tasks can be migrated to the real-time hierarchical queue, effectively reducing the task scheduling time and improving the task scheduling efficiency.
[0074] In addition, the method schedules and executes the second target task in the updated first task queue list from the queue platform by the target node, and receives the migration message of the queue platform by the target node, and migrates and updates the second task queue list stored by itself according to the migration message, which can make the queue state of each node in the edge node cluster consistent, and avoid the situation of task repetition execution or scheduling conflict, effectively improving the accuracy of task scheduling.
[0075] Reference Figure 1 In the embodiments of the present application, a task scheduling method of dynamic hierarchical queue is applied to a source node, and the method comprises:
[0076] Step 110, receiving task submission information from the target node, the task submission information including a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled for execution by the target node, and the multi-dimensional attribute information including time dimension information, resource dimension information and stage dimension information;
[0077] In the embodiments of the present application, the source node can be any edge node in the edge node cluster. The source node can receive task submission information from the target node, which records the first target task and its multi-dimensional attribute information, including time dimension information, resource dimension information and stage dimension information. Specifically, the time dimension information can include the absolute deadline of the first target task, the slack time, the historical execution delay fluctuation rate, the time window offset and other characteristic information, wherein the absolute deadline is used to represent the time point at which the first target task must be completed after being migrated to a new queue; the slack time is the maximum delay that the first target task can tolerate; the historical execution delay fluctuation rate is the standard deviation of the execution delay of the first target task, which reflects the stability of task scheduling execution; and the time window offset is the difference between the expected execution time of the task and the current system time.
[0078] It can be understood that the resource dimension information includes CPU core number requirement, GPU existing occupancy rate, I / O operation frequency, memory bandwidth requirement and other characteristic information. The stage dimension information includes first execution flag, interruption recovery times, feedback queue migration history, background service life cycle stage and other characteristic information, wherein the first execution flag is used to represent whether the first target task is first entered into the queue; the interruption recovery times are used to represent the cumulative number of uncompleted executions of the first target task caused by resource preemption; the feedback queue migration history is used to represent the number of migrations between different levels of hierarchical queues of the first target task; and the background service life cycle stage is used to represent the state of non-interactive background service, which specifically includes states such as not started, starting, running, pausing and termination request.
[0079] Step 120, performing dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task;
[0080] In the embodiments of the present application, the source node can determine the original queue information of the first target task before scheduling execution by the target node and the target queue information required for task migration after scheduling execution by the target node based on the first target task and the current multi-dimensional attribute information of the first target task.
[0081] In some embodiments, the dynamic queue analysis on the first target task according to the multi-dimensional attribute information comprises:
[0082] obtaining a queue rule table, wherein the queue rule table records a plurality of hierarchical queues in the first task queue table and a priority score range of each of the hierarchical queues;
[0083] determining the original queue information according to the first target task;
[0084] In the embodiments of the present application, taking the queue rule table comprising six hierarchical queues as an example, the priority levels of which are HRQ hierarchical queue, SRQ hierarchical queue, QRQ hierarchical queue, CIQ hierarchical queue, IOQ hierarchical queue and MSQ hierarchical queue from high to low, the queue rule table can refer to the following table 1:
[0085] Table 1
[0086] Queue type Priority score range Task type HRQ 90-100 Hard real-time task SRQ 70-89 Soft real-time task QRQ 50-69 Quasi real-time task CIQ 30-49 Compute-intensive task IOQ 10-29 I / O-intensive task MSQ 0-9 Memory-sensitive task
[0087] It can be understood that there are many ways to obtain the original queue information in the embodiments of the present application. Specifically, in a first feasible implementation, the source node receives the multi-dimensional attribute information of the first target task before scheduling and execution when receiving the task submission information provided by the target node, and the source node can determine the original queue information of the first target task through priority analysis and queue matching based on the multi-dimensional attribute information of the first target task before scheduling and execution. Alternatively, the source node can retrieve the hierarchical queue recording the first target task in the source node task queue table based on the task queue table maintained and stored by the source node, and generate the original queue information according to the hierarchical queue recording the first target task.
[0088] performing priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information.
[0089] Further, the priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information comprises:
[0090] performing time priority analysis on the time dimension information to obtain a time priority score value;
[0091] performing resource priority analysis on the resource dimension information to obtain a resource priority score value;
[0092] performing stage priority analysis on the stage dimension information to obtain a stage priority score value;
[0093] In the embodiments of the present application, the time priority analysis can be quantitative calculation of each feature information in the time dimension information in the time dimension, so as to convert the feature information in the time dimension into a time priority score value. Specifically, the time priority score value can be expressed as:
[0094]
[0095] wherein, T s is the time priority score value; Deadline is the absolute deadline time in the time dimension information; T now is the current time of the source node.
[0096] It can be understood that the time priority score value shown in the embodiments of the present application is only one of the possible implementation manners, and there can be many possible implementation manners. For example, after obtaining the above T s , the T s can also be multiplied with the remaining feature information (historical execution delay fluctuation rate) to obtain the final time priority score value.
[0097] It should be noted that the resource priority analysis can be quantitative calculation of each feature information in the resource dimension information in the resource dimension, so as to convert the feature information in the resource dimension into a resource priority score value. The resource priority score value can be expressed as:
[0098]
[0099] wherein, R a is the resource priority score value; R max is the maximum value of resource demand in the edge node cluster; R min is the minimum value of resource demand in the edge node cluster; R1, R2, R3 and R4 are the quantitative values of CPU core demand, GPU existing occupancy rate, I / O operation frequency and memory bandwidth demand in the resource dimension information, respectively.
[0100] The stage priority analysis can be quantitative calculation of each feature information in the stage dimension information in the stage dimension, to obtain a stage priority score value. The stage priority score value can be expressed as:
[0101] S e = 30 × (α S2 × (1 + β × S1) × γ S3 )
[0102] wherein, S eis a stage priority score value; a, b and g are constants; S2 is the number of interruption recoveries in the stage dimension information; S1 is a first execution flag in the stage dimension information; and S3 is a feedback queue migration history in the stage dimension information.
[0103] The queue rule table is score matched according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information.
[0104] Further, the score matching of the queue rule table according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information comprises:
[0105] The time priority score value, the resource priority score value and the stage priority score value are analyzed by weighting to obtain a task priority score value of the first target task.
[0106] The queue rule table is task queue matched according to the task priority score value to obtain the target queue information of the first target task.
[0107] In the embodiments of the present application, the score matching can first be the weighting analysis of the time priority score value, the resource priority score value and the stage priority score value, and the task priority score value of the first target task can be specifically calculated by the weighted summation, wherein the weights used by the time priority score value, the resource priority score value and the stage priority score value can be fixed weights or dynamic weights.
[0108] It can be understood that for the first target task, the higher the task priority score value determined by the source node is, the more critical the first target task is, and the higher the priority level of the hierarchical queue indicated by the target queue information is; on the contrary, the lower the task priority score value determined by the source node is, the less critical the first target task is, and the lower the priority level of the hierarchical queue indicated by the target queue information is.
[0109] It can be understood that the task queue matching can be the matching of the task priority score value with a plurality of priority score ranges in the queue rule table, and the target queue information of the first target task can be determined based on the hierarchical queue corresponding to the successfully matched priority score range.
[0110] Step 130, the original queue information and the target queue information are sent to the queue platform, so that the queue platform updates the first task queue table in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue table, and the target node schedules and executes a second target task in the updated first task queue table.
[0111] The first task queue list includes a plurality of hierarchical queues of different levels.
[0112] In the embodiments of the present application, after determining the original queue information and the target queue information of the first target task, the source node can send the target queue information and the original queue information to the queue platform.
[0113] In the embodiments of the present application, a task scheduling method of dynamic hierarchical queue is applied to a queue platform, and the method comprises:
[0114] obtaining a first task queue list, and receiving original queue information and target queue information from a source node, wherein the first task queue list includes a plurality of hierarchical queues of different levels;
[0115] updating the first task queue list according to the original queue information and the target queue information to obtain an updated first task queue list;
[0116] The original queue information and the target queue information are obtained through the following steps:
[0117] The target node schedules a second target task of the updated first task queue list to obtain task submission information, and sends the task submission information to the source node, wherein the task submission information includes a first target task and multi-dimensional attribute information of the first target task, the first target task is a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information includes time dimension information, resource dimension information and stage dimension information.
[0118] The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task.
[0119] In the embodiments of the present application, the queue platform can be a Redis server, and the queue platform maintains a first task queue list. Specifically, after receiving the original queue information and the target queue information provided by the source node, the queue platform can remove or migrate the hierarchical queues involved in the first task queue list based on the received original queue information and target queue information, to obtain an updated first task queue list. In addition, the content of obtaining the original queue information and the target queue information is similar to the aforementioned content, and it can be simply deduced, and the present application will not be described here.
[0120] In some embodiments, the updating the first task queue list according to the original queue information and the target queue information to obtain an updated first task queue list comprises:
[0121] According to the original queue information, the first task queue list is subjected to queue screening to obtain a first hierarchical queue, the first hierarchical queue being a hierarchical queue in which the first target task is located before the target node executes the first target task;
[0122] The first target task in the first hierarchical queue is removed;
[0123] According to the target queue information, the first target task is added and updated to a second hierarchical queue in the first task queue list, the second hierarchical queue being a hierarchical queue indicated by the target queue information in the first task queue list.
[0124] In the embodiments of the present application, the updating of the first task queue list can be that the queue platform determines, based on the original queue information, a hierarchical queue in which the first target task is currently located in the first task queue list, denoted as a first hierarchical queue; then, the queue platform removes the first target task in the first hierarchical queue of the first task queue list; then, based on a hierarchical queue indicated by the target queue information, denoted as a second hierarchical queue, the first target task is added and updated to the second hierarchical queue of the first task queue list, and the first task queue list in which the removing and migrating adding operations are completed is determined as an updated first task queue list, so as to realize the dynamic change of tasks in the queue.
[0125] In the embodiments of the present application, a task scheduling method of a dynamic hierarchical queue is applied to a target node, and the method comprises:
[0126] The second target task in the updated first task queue list is scheduled to be executed to obtain task submission information, and the task submission information is sent to a source node, the task submission information comprising a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled to be executed by the target node, and the multi-dimensional attribute information comprising time dimension information, resource dimension information and stage dimension information;
[0127] The updated first task queue list is obtained through the following steps:
[0128] The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task;
[0129] The source node sends the original queue information and the target queue information to a queue platform;
[0130] The queue platform updates a first task queue list in the queue platform according to the original queue information and the target queue information, to obtain an updated first task queue list, and the first task queue list includes a plurality of hierarchical queues at different levels.
[0131] In the embodiments of the present application, the target node can be any one of the edge nodes in the edge node cluster except the source node. Specifically, the target node can schedule and execute a second target task in the updated first task queue list of the queue platform based on a trigger signal (such as a timing trigger signal or an event-driven trigger signal), and update the multi-dimensional attribute information of the second target task after the scheduling and execution of the second target task are completed, to obtain updated multi-dimensional attribute information; then, the second target task after the scheduling and execution is determined as the first target task, and the updated multi-dimensional attribute information is recorded as the multi-dimensional attribute information of the first target task, and the first target task and the multi-dimensional attribute information thereof are determined as the task submission information.
[0132] It can be understood that the content of the updated first task queue is similar to the foregoing content, and can be simply analogized, which will not be described herein again.
[0133] In some embodiments, the scheduling and execution of the second target task in the updated first task queue list obtains the task submission information, including:
[0134] Obtaining load resource information;
[0135] Sending a task obtaining request to the queue platform, so that the queue platform extracts a task from the updated first task queue list according to the task obtaining request, to obtain a second target task returned by the queue platform, and the second target task is a to-be-executed task with the maximum task priority score value in a plurality of hierarchical queues of the updated first task queue list;
[0136] According to the load resource information, performing resource matching on the second target task to obtain a resource matching result;
[0137] According to the resource matching result, executing the second target task to obtain the task submission information.
[0138] In the embodiments of the present application, the target node can obtain its own workload resource information, which includes CPU processing load, memory load, etc. Then, the target node sends a task obtaining request to the queue platform, so that the queue platform extracts at least one second target task from the several hierarchical queues in the updated first task queue list based on the task obtaining request, and returns the extracted second target task to the target node. For example, after receiving the task obtaining request, the queue platform can obtain the task with the maximum task priority score value in the first three hierarchical queues of the updated first task queue list, and record it as the second target task.
[0139] It can be understood that after the target node receives the second target task returned by the queue platform, the target node can match the resource requirement of the second target task with the current load resource information of the target node to obtain a resource matching result. Specifically, if the resource matching result is that the load resource information of the target node does not meet the resource requirement of the second target task, at this time, the multi-dimensional attribute information of the second target task can be updated, specifically, the interruption recovery times of the stage dimension information in the multi-dimensional attribute information of the second target task is updated to obtain updated multi-dimensional attribute information; then the second target task is regarded as being scheduled and executed, and the task submission information is constructed together with the updated multi-dimensional attribute information and sent to the source node.
[0140] Alternatively, if the resource matching result is that the load resource information of the target node meets the resource requirement of the second target task, at this time, the target node can execute the second target task, and after the execution of the second target task is interrupted or completed, the multi-dimensional attribute information of the second target task is updated; then the second target task after scheduling and execution is constructed together with the updated multi-dimensional attribute information to form task submission information and sent to the source node.
[0141] In some embodiments, the method further comprises:
[0142] receiving a migration message from the queue platform, the migration message comprising original queue information, target queue information and task priority score value of the first target task;
[0143] performing queue migration on a second task queue list in the target node according to the original queue information and the target queue information, so that the first target task is migrated from a third hierarchical queue to a fourth hierarchical queue, the third hierarchical queue being the hierarchical queue in which the first target task is located before being executed in the target node, and the fourth hierarchical queue being the hierarchical queue indicated by the target queue information in the second task queue list;
[0144] performing score value update on the fourth hierarchical queue according to the task priority score value to obtain an updated fourth hierarchical queue.
[0145] In the embodiment of the present application, after the queue platform completes the update of the first task queue list, the queue platform can send a migration message to the target node and / or the source node; after receiving the migration message, the target node can update the second task queue list of the target node based on the original queue information and the target queue information carried in the migration message. The update content of the second task queue list is similar to the update content of the first task queue list of the queue platform, which can be simply analogized, and the present application will not be described here.
[0146] It can be understood that after the target node migrates the first target task to the fourth hierarchical queue in the second task queue list, the target node can also add and update the task priority score value in the migration message to the fourth hierarchical queue in the second task queue list, so as to obtain the final updated fourth hierarchical queue, and further complete the migration update of the second task queue list of the target node.
[0147] A task scheduling system of a dynamic hierarchical queue according to an embodiment of the present application is described in detail below with reference to the accompanying drawings.
[0148] Referring to Figure 2 The task scheduling system of the dynamic hierarchical queue according to the embodiment of the present application includes a source node, a target node and a queue platform.
[0149] The source node 101 is configured to receive task submission information from the target node, wherein the task submission information includes a first target task and multi-dimensional attribute information of the first target task, the first target task is a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information includes time dimension information, resource dimension information and stage dimension information; and the first target task is dynamically analyzed based on the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task.
[0150] The queue platform 102 is configured to receive the original queue information and the target queue information, and update a first task queue list in the queue platform based on the original queue information and the target queue information to obtain an updated first task queue list.
[0151] The target node 103 is configured to schedule and execute a second target task in the updated first task queue list.
[0152] It can be understood that the content in the above method embodiment is applicable to the present system embodiment, the present system embodiment specifically realizes the same functions as the above method embodiment, and achieves the same beneficial effects as the above method embodiment.
[0153] Referring toFigure 3 The embodiment of the present application further provides an electronic device, comprising:
[0154] at least one processor 201;
[0155] at least one memory 202, configured to store at least one program;
[0156] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the method embodiments described above.
[0157] Similarly, it can be understood that the contents in the above method embodiments are all applicable to the present device embodiments, the device embodiments specifically implement the functions same as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0158] The embodiment of the present application further provides a computer readable storage medium, wherein a program executable by the processor 201 is stored, and the program executable by the processor 201, when executed by the processor 201, is used for implementing the above method embodiments.
[0159] Similarly, the contents in the above method embodiments are all applicable to the present computer readable storage medium embodiments, the computer readable storage medium embodiments specifically implement the functions same as the above method embodiments, and achieve the same beneficial effects as the above method embodiments.
[0160] The embodiment of the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps in the above method embodiments.
[0161] Those skilled in the art can understand that all or part of the processes in the above method embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the computer program can include the processes of the above method embodiments.
[0162] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be executed substantially simultaneously or the blocks can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flowcharts of the present application are provided by way of example, and the purpose is to provide a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.
[0163] Furthermore, although the present application is described in the context of functional modules, it is to be understood that one or more of the functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also to be understood that detailed discussion of the actual implementation of each module is unnecessary to an understanding of the present application. Rather, the actual implementation is to be understood within the context of the properties, functions and internal relationships of the various functional modules disclosed herein. Thus, the present application, as set forth in the claims, can be implemented, with ordinary skill in the art, and without undue trial and error, using the ordinary skill in the art in light of the disclosure herein. It is also to be understood that the specific concepts disclosed are merely illustrative and that the scope of the present application is to be determined solely by the appended claims and the entire range of equivalents thereof.
[0164] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0165] The logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a list of executable instructions for implementing logic functions, and can be specifically embodied in any computer readable medium for use by an instruction execution system, device or apparatus, such as a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, device or apparatus, or in conjunction with these instructions execution system, device or apparatus. For the purpose of the present specification, the "computer readable medium" can be any device that can contain, store, communicate, propagate or transport programs for use by an instruction execution system, device or apparatus, or in conjunction with these instruction execution system, device or apparatus.
[0166] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
[0167] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, or combinations thereof, can be used: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), and / or the like.
[0168] In the above description of the present specification, reference to the description of the terms "one embodiment / one example", "another embodiment / another example" or "certain embodiments / certain examples" and the like means that a particular feature, structure, material or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. The illustrative representations of the above terms in the present specification do not necessarily refer to the same embodiment or example. Also, the described particular features, structures, materials or characteristics can be combined in any appropriate manner in one or more embodiments or examples.
[0169] Although embodiments of the present application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, alternatives, and variations can be made thereto without departing from the spirit and scope of the application, which should be limited only by the scope of the claims and the equivalents thereof.
[0170] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.
Claims
1. A method for task scheduling of a dynamic hierarchical queue, characterized in that, Applied to a source node, the method comprises: receiving task submission information from a target node, the task submission information comprising a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled for execution by the target node, the multi-dimensional attribute information comprising time dimension information, resource dimension information and stage dimension information; performing dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task; sending the original queue information and the target queue information to a queue platform, so that the queue platform updates a first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list, and the target node schedules the second target task in the updated first task queue list for execution; wherein the first task queue list comprises a plurality of hierarchical queues at different levels.
2. The method of claim 1, wherein, The dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain the original queue information and the target queue information of the first target task comprises: obtaining a queue rule table, the queue rule table recording a plurality of hierarchical queues in the first task queue list and a priority score range of each of the hierarchical queues; determining the original queue information according to the first target task; performing priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information.
3. The method of claim 2, wherein, The priority analysis and queue matching on the multi-dimensional attribute information according to the queue rule table to obtain the target queue information comprises: performing time priority analysis on the time dimension information to obtain a time priority score value; performing resource priority analysis on the resource dimension information to obtain a resource priority score value; performing stage priority analysis on the stage dimension information to obtain a stage priority score value; performing score matching on the queue rule table according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information.
4. The method of claim 3, wherein, The score matching on the queue rule table according to the time priority score value, the resource priority score value and the stage priority score value to obtain the target queue information comprises: performing weighted analysis on the time priority score value, the resource priority score value and the stage priority score value to obtain a task priority score value of the first target task; performing task queue matching on the queue rule table according to the task priority score value to obtain the target queue information of the first target task.
5. A method for task scheduling of a dynamic hierarchical queue, characterized in that, Applied to a queue platform, the method comprises: obtaining a first task queue list comprising a plurality of hierarchical queues at different levels and receiving original queue information and target queue information from a source node; updating the first task queue list according to the original queue information and the target queue information to obtain an updated first task queue list; The original queue information and the target queue information are obtained through the following steps: The target node schedules a second target task in the updated first task queue list to obtain task submission information, and sends the task submission information to the source node, the task submission information including the first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information including time dimension information, resource dimension information, and stage dimension information. The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain the original queue information and the target queue information of the first target task.
6. The method of claim 5, wherein, The first task queue list is updated according to the original queue information and the target queue information to obtain an updated first task queue list, including: The first task queue list is subjected to queue screening according to the original queue information to obtain a first hierarchical queue, the first hierarchical queue being a hierarchical queue in which the first target task is located before being executed by the target node. The first target task in the first hierarchical queue is removed. The first target task is added to and updated in a second hierarchical queue in the first task queue list according to the target queue information, the second hierarchical queue being a hierarchical queue indicated by the target queue information in the first task queue list.
7. A method for task scheduling of a dynamic hierarchical queue, characterized in that, The method is applied to a target node, and includes: Scheduling a second target task in the updated first task queue list to obtain task submission information, and sending the task submission information to a source node, the task submission information including the first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled and executed by the target node, and the multi-dimensional attribute information including time dimension information, resource dimension information, and stage dimension information. The updated first task queue list is obtained through the following steps: The source node performs dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain the original queue information and the target queue information of the first target task. The source node sends the original queue information and the target queue information to a queue platform. The queue platform updates a first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list, the first task queue list including a plurality of hierarchical queues at different levels.
8. The method of claim 7, wherein, The scheduling of the second target task in the updated first task queue list to obtain task submission information includes: Obtaining load resource information; Sending a task acquisition request to the queue platform to enable the queue platform to perform task extraction on the updated first task queue list according to the task acquisition request to obtain a second target task returned by the queue platform, the second target task being a task with the largest task priority score value in a plurality of hierarchical queues in the updated first task queue list. According to the load resource information, resource matching is performed on the second target task to obtain a resource matching result; According to the resource matching result, the second target task is executed to obtain the task submission information.
9. The method of claim 7, wherein, The method further comprises: receiving a migration message from the queue platform, the migration message comprising original queue information, target queue information and a task priority score value of the first target task; According to the original queue information and the target queue information, the second task queue list in the target node is subjected to queue migration, so that the first target task is migrated from a third hierarchical queue to a fourth hierarchical queue, the third hierarchical queue being the hierarchical queue in the second task queue list where the first target task was located before execution in the target node, and the fourth hierarchical queue being the hierarchical queue indicated by the target queue information in the second task queue list; According to the task priority score value, the fourth hierarchical queue is subjected to score value updating to obtain an updated fourth hierarchical queue.
10. A task scheduling system for dynamic hierarchical queuing, characterized by The system comprises a source node, a target node and a queue platform; The source node is configured to receive task submission information from the target node, the task submission information comprising a first target task and multi-dimensional attribute information of the first target task, the first target task being a second target task recently scheduled for execution in the target node, and the multi-dimensional attribute information comprising time dimension information, resource dimension information and stage dimension information; and perform dynamic queue analysis on the first target task according to the multi-dimensional attribute information to obtain original queue information and target queue information of the first target task; The queue platform is configured to receive the original queue information and the target queue information, and update a first task queue list in the queue platform according to the original queue information and the target queue information to obtain an updated first task queue list; The target node is configured to schedule and execute a second target task in the updated first task queue list.