Multi-task adaptive scheduling method, device, equipment, medium and program

By introducing hierarchical time wheels and dynamic nuclear resource management into the radar signal processing framework of FPGA+DSP, the problems of low data processing efficiency and low resource utilization in the existing technology are solved, and efficient task scheduling and resource utilization are achieved.

CN120353548APending Publication Date: 2025-07-22四川九洲防控科技有限责任公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510314006.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-17
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In the radar signal processing framework of FPGA+DSP, the existing multi-task adaptive scheduling method leads to low data processing efficiency and low system resource utilization. Especially in large data volume or multi-beam multi-coded scenarios, the processing delay of DSP is too long, resulting in packet loss and system data disorder.

Method used

The multi-task adaptive scheduling method is adopted. By putting the task data into the hierarchical time wheel, setting the task status for each task cluster, dynamically determine whether there are tasks pending on the first level of the time wheel, and processing it using an idle core until all task clusters are completed, and finally sending processing completion information to the task scheduling center.

Benefits of technology

It improves data processing efficiency and system resource utilization, ensures data processing smoothness in complex and large-scale scenarios, and avoids data disorders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353548A_ABST
    Figure CN120353548A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-task self-adaptive scheduling method and device, equipment, a medium and a program, and the method comprises the steps: enabling received task data to enter a hierarchical time wheel, setting a task state, judging whether a first-layer time wheel in the hierarchical time wheel has a to-be-processed task or not, if yes, setting a next time wheel as the first-layer time wheel, then carrying out the re-judgment, and if not, carrying out the next-layer time wheel; otherwise, judging whether an idle core exists in the preset core resource pool or not, if not, returning to the step of judging, otherwise, processing the task data by utilizing the idle core to obtain a task processing result, updating the task state of each task cluster in the task data, and judging whether all the task clusters in the task data are processed or not; and if the task clusters in the task data are not completely processed, returning to the step of judging whether the first-layer time wheel in the hierarchical time wheel has the task to be processed or not according to the task state, and if all the task clusters in the task data are completely processed, sending task processing completion information to a preset task scheduling center.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of task scheduling, and in particular to a multi-task adaptive scheduling method, apparatus, device, medium and program. Background Art

[0002] In the radar signal processing framework of FPGA (Field Programmable Gate Array) + DSP (Digital Signal Processor), whether the processing delay of the DSP can meet the system packet sending time interval is a long-existing problem. If the static data allocation method of multi-core DSP is used for radar signal detection, in the scenarios of large data volume or multi-beam multi-chip, the processing delay of the DSP will be too long, resulting in packet loss or system data disorder.

[0003] In the existing DSP signal detection framework, input data is obtained through communication between SRIO (Serial RapidIO) and FPGA, and the data is fixedly allocated to each core for processing. The data does not flow, and the next set of data can only be received after the previous set of data is processed. In complex scenarios and large-scale scenarios, it is difficult to ensure that the processing delay of the DSP meets the system packet sending time interval, and data disorder will occur. This method has low processing efficiency and low system resource utilization rate. Summary of the Invention

[0004] The present disclosure provides a multi-task adaptive scheduling method, apparatus, device, medium and program to solve the problems of low data processing efficiency and low system resource utilization rate of the existing multi-task adaptive scheduling method.

[0005] In a first aspect, the present disclosure provides a multi-task adaptive scheduling method, including:

[0006] After receiving task data, putting the task data into a preset hierarchical time wheel and setting a task state for each task cluster in the task data;

[0007] Judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task state;

[0008] If there is no task to be processed in the first-level time wheel, setting the next time wheel as the first-level time wheel and then returning to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task state;

[0009] If there is a task to be processed in the first-level time wheel, judging whether there is an idle core in a preset core resource pool;

[0010] If there is no idle core in the nuclear resource pool, return to the step of determining whether there is an idle core in the preset nuclear resource pool;

[0011] If there is an idle core in the nuclear resource pool, use the idle core to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result;

[0012] Determine whether all task clusters in the task data have been processed;

[0013] If there are unprocessed task clusters in the task data, return to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0014] If all task clusters in the task data have been processed, send a task processing completion message to a preset task scheduling center.

[0015] In some embodiments, putting the task data into a preset hierarchical time wheel and setting a task status for each task cluster in the task data includes:

[0016] Design a corresponding number of memory ping-pongs according to the timing scenario of the system;

[0017] Establish time wheels with the same number as the memory ping-pongs, and establish a task pool for each time wheel;

[0018] Divide the task data into multiple task cluster data, where each task cluster data contains three task clusters;

[0019] Put one copy of the task cluster data into each task pool, set the first task cluster in each task pool to the to-be-processed state, and set the remaining task clusters to the non-processable state.

[0020] In some embodiments, determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status includes:

[0021] Determine whether the first-level time wheel contains task clusters;

[0022] If the first-level time wheel does not contain task clusters, it is determined that the first-level time wheel has no tasks to be processed;

[0023] If the first-level time wheel contains task clusters, obtain the task status of the task clusters and determine whether the task status is the to-be-processed state;

[0024] If the task status is the to-be-processed state, it is determined that the first-level time wheel has tasks to be processed;

[0025] If the task status is not the pending status, it is determined that there are no pending tasks in the first-level time wheel.

[0026] In some embodiments, the processing of the task data by using the idle core to obtain a task processing result includes:

[0027] Using the scheduling core of the idle core to obtain the task type of the task data;

[0028] Calling the computing core according to the task type to process the task clusters in the task data;

[0029] Obtaining the processing results of each computing core to obtain a task processing result.

[0030] In some embodiments, the updating of the task status of each task cluster in the task data according to the task processing result includes:

[0031] Setting the first task cluster corresponding to the task processing result to an unprocessable status;

[0032] Setting the second task cluster corresponding to the task processing result to a pending status;

[0033] Setting the third task cluster corresponding to the task processing result to an unprocessable status.

[0034] In some embodiments, the judgment as to whether all task clusters in the task data have been processed includes:

[0035] Obtaining the task statuses of all task clusters in the task data to obtain task status data;

[0036] Judging whether there are pending task clusters in the task data according to the task status data;

[0037] If there are pending task clusters in the task data, it is determined that there are unprocessed task clusters in the task data;

[0038] If there are no pending task clusters in the task data, it is determined that all task clusters in the task data have been processed.

[0039] In a second aspect, the present disclosure provides a multi-task adaptive scheduling device, including:

[0040] A data setting module, configured to, after receiving task data, put the task data into a preset hierarchical time wheel and set a task status for each task cluster in the task data;

[0041] The first judgment module is used to judge whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status. If there is no task to be processed in the first-level time wheel, after setting the next time wheel as the first-level time wheel, return to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0042] The second judgment module, if there is a task to be processed in the first-level time wheel, judges whether there is an idle core in the preset core resource pool. If there is no idle core in the core resource pool, return to the step of judging whether there is an idle core in the preset core resource pool. If there is an idle core in the core resource pool, use the idle core to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result;

[0043] The third judgment module judges whether all task clusters in the task data have been processed. If there are task clusters in the task data that have not been processed, return to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status. If all task clusters in the task data have been processed, send a task processing completion message to the preset task scheduling center.

[0044] In a third aspect, the present disclosure provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the method described in the above aspect.

[0045] In a fourth aspect, the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the above aspect are implemented.

[0046] In a fifth aspect, the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method described in the above aspect are implemented.

[0047] A multi-task adaptive scheduling method, device, equipment, medium and program provided by the present disclosure, after receiving task data, puts the task data into a preset hierarchical time wheel, sets task statuses for each task cluster in the task data, and determines whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task statuses. If there are no tasks to be processed in the first-level time wheel, sets the next time wheel as the first-level time wheel and then returns to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task statuses. If there are tasks to be processed in the first-level time wheel, determines whether there are idle cores in a preset core resource pool. If there are no idle cores in the core resource pool, returns to the step of determining whether there are idle cores in the preset core resource pool. If there are idle cores in the core resource pool, uses the idle cores to process the task data to obtain a task processing result, updates the task statuses of each task cluster in the task data according to the task processing result, determines whether all task clusters in the task data have been processed. If there are task clusters in the task data that have not been processed, returns to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task statuses. If all task clusters in the task data have been processed, sends a task processing completion message to a preset task scheduling center; thereby solving the problems of low data processing efficiency and low system resource utilization rate in the existing multi-task adaptive scheduling method, and improving the data processing efficiency and system resource utilization rate in a multi-task scenario. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The present disclosure will be described in more detail below based on embodiments with reference to the drawings:

[0049] Figure 1 It is a flowchart of a multi-task adaptive scheduling method provided by an embodiment of the present disclosure;

[0050] Figure 2 It is a functional module diagram of a multi-task adaptive scheduling device provided by an embodiment of the present disclosure.

[0051] In the drawings, the same components are denoted by the same reference numerals, and the drawings are not drawn to actual scale. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] To enable those skilled in the art to better understand the technical solutions of the present disclosure, and to fully understand and implement how the present disclosure uses technical means to solve technical problems and achieve the corresponding technical effects, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The embodiments of the present disclosure and each feature in the embodiments can be combined with each other on the premise of not conflicting, and the formed technical solutions are all within the protection scope of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.

[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0054] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0055] Example 1

[0056] Figure 1 This is a schematic flowchart of a multi-task adaptive scheduling method provided for the embodiments of the present disclosure. As Figure 1 shown, a multi-task adaptive scheduling method includes:

[0057] S1. After receiving the task data, put the task data into a preset hierarchical time wheel, and set a task status for each task cluster in the task data.

[0058] In an embodiment of the present invention, putting the task data into a preset hierarchical time wheel is achieved by designing memory ping-pong. The task data is divided into multiple portions and placed into different memory ping-pongs. Each portion of data contains three task clusters. Then, time wheels with the same number as the memory ping-pongs are designed. A task cluster is established for each time wheel, and different task clusters are placed into a task pool.

[0059] Specifically, the hierarchical time wheel refers to a structure composed of multiple time wheels. The time wheel is a data structure for task scheduling, which is particularly suitable for handling a large number of timing tasks in computer science, such as task scheduling in web servers, distributed systems, and real-time systems. The core idea of the time wheel is to divide time into discrete time periods, and each time period corresponds to a "slot" or "bucket" for storing tasks whose expiration times fall within that time period.

[0060] Specifically, the memory ping-pong is a data flow control processing technique mainly used to improve the efficiency of data transmission and processing, especially when exchanging data between two modules. When the result of the upper-level processing cannot be immediately completed by the lower-level processing, introducing memory ping-pong can avoid performance losses caused by the upper-level waiting for the lower-level processing to end.

[0061] In an embodiment of the present invention, when putting the task data into a preset hierarchical time wheel, setting task states for each task cluster in the task data includes:

[0062] Designing a corresponding number of memory ping-pongs according to the timing scenario of the system;

[0063] Establishing time wheels with the same number as the memory ping-pongs and creating a task pool for each time wheel;

[0064] Dividing the task data into multiple portions of task cluster data, where each portion of task cluster data contains three task clusters;

[0065] Putting one portion of task cluster data into each task pool, setting the first task cluster in each task pool to the to-be-processed state, and setting the remaining task clusters to the non-processable state.

[0066] Specifically, designing a corresponding number of memory ping-pongs according to the timing scenario of the system means designing memory ping-pongs according to the intensity of the timing scenario of the system. For a tense timing scenario, multiple memory ping-pongs are designed, and for a non-tense timing scenario, one or two memory ping-pongs can be designed.

[0067] Furthermore, it is possible to judge whether the timing scenario is tense based on the utilization rate of hardware resources.

[0068] Specifically, each time slot of each time wheel will have a corresponding task pool, which is usually a data structure, such as a linked list, a queue, etc., for storing all tasks whose due times fall within that time slot.

[0069] In the embodiment of the present invention, after receiving task data, by putting the task data into a preset hierarchical time wheel and setting task statuses for each task cluster in the task data, the efficiency of subsequent task processing is improved.

[0070] S2. Judge whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status.

[0071] In the embodiment of the present invention, the first-level time wheel refers to the time wheel located in the first layer of the hierarchical time wheel.

[0072] In the embodiment of the present invention, judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status is to judge whether the first-level time wheel is assigned a task cluster and whether the task status of the assigned task cluster is the to-be-processed status.

[0073] In the embodiment of the present invention, judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status includes:

[0074] Judge whether the first-level time wheel contains a task cluster;

[0075] If the first-level time wheel does not contain a task cluster, it is determined that there are no tasks to be processed in the first-level time wheel;

[0076] If the first-level time wheel contains a task cluster, obtain the task status of the task cluster and judge whether the task status is the to-be-processed status;

[0077] If the task status is the to-be-processed status, it is determined that there are tasks to be processed in the first-level time wheel;

[0078] If the task status is not the to-be-processed status, it is determined that there are no tasks to be processed in the first-level time wheel.

[0079] In the embodiment of the present invention, by judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status, the task processing efficiency is improved.

[0080] If there are no tasks to be processed in the first-level time wheel, then execute S3. After setting the next time wheel as the first-level time wheel, return to S2. Judge whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status.

[0081] In an embodiment of the present invention, when there is no task to be processed in the first-level time wheel, the next time wheel in the hierarchical time wheel needs to be set as the new first-level time wheel, and it is necessary to re-determine whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel until there is a task to be processed in the re-set first-level time wheel, and then the next step of processing is carried out.

[0082] In an embodiment of the present invention, when there is no task to be processed in the first-level time wheel, by setting the next time wheel as the first-level time wheel and returning to the step of determining whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status, the task scheduling efficiency is improved, and the utilization rate of system resources is improved.

[0083] If there is a task to be processed in the first-level time wheel, then execute S4 to determine whether there is an idle core in the preset core resource pool.

[0084] In an embodiment of the present invention, when there is a task to be processed in the first-level time wheel, it means that the next step of processing can be carried out. Since the processing of the task cluster needs to utilize the computing core, it is necessary to pre-determine whether there is an idle core in the core resource pool.

[0085] In an embodiment of the present invention, the core resource pool is a shared core resource pool established according to a resource table, which is used for the mobilization and management of processing cores.

[0086] In an embodiment of the present invention, when there is a task to be processed in the first-level time wheel, by determining whether there is an idle core in the preset core resource pool, the utilization rate of system resources is improved.

[0087] If there is no idle core in the core resource pool, then return to S4 to determine whether there is an idle core in the preset core resource pool.

[0088] In an embodiment of the present invention, when there is no idle core in the core resource pool, it means that all the cores in the core resource pool are busy, so waiting is required. During the waiting process, it is continuously determined whether there is an idle core in the preset core resource pool, so as to execute the subsequent steps at the first time when an idle core appears.

[0089] If there is an idle core in the core resource pool, then execute S5 to process the task data by using the idle core to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result.

[0090] In an embodiment of the present invention, the processing of the task data by using the idle core to obtain a task processing result is to process the task data by using a scheduling core to schedule a computing core.

[0091] In an embodiment of the present invention, the processing of the task data by using the idle core to obtain a task processing result includes:

[0092] Obtaining the task type of the task data by using the scheduling core of the idle core;

[0093] Invoking a computing core to process a task cluster in the task data according to the task type;

[0094] Obtaining the processing result of each computing core to obtain a task processing result.

[0095] Specifically, the scheduling core is used to complete the dynamic scheduling of the system, and is responsible for managing and scheduling the execution of tasks in the system. It determines when and where a task is executed, and how to allocate system resources to optimize performance and response time.

[0096] Specifically, the computing core refers to a physical unit in a processor, which includes a set of processor instruction execution units and can perform basic arithmetic and logical operations. Each computing core can independently execute programs and process data.

[0097] Specifically, the scheduling core communicates with each computing core, and the computing cores do not communicate with each other.

[0098] In an embodiment of the present invention, the updating of the task status of each task cluster in the task data according to the task processing result includes:

[0099] Setting the first task cluster corresponding to the task processing result to an unprocessable state;

[0100] Setting the second task cluster corresponding to the task processing result to a to-be-processed state;

[0101] Setting the third task cluster corresponding to the task processing result to an unprocessable state.

[0102] Specifically, the first task cluster, the second task cluster, and the third task cluster refer to three task clusters in the same task pool.

[0103] Specifically, after the idle core executes task processing, it is marked as a busy state, and after the task processing ends, it is marked as an idle state.

[0104] In an embodiment of the present invention, when there is an idle core in the core resource pool, by using the idle core to process the task data to obtain a task processing result, and updating the task status of each task cluster in the task data according to the task processing result, the efficiency of task scheduling is improved.

[0105] S6. Determine whether all task clusters in the task data have been processed.

[0106] In an embodiment of the present invention, to determine whether all task clusters in the task data have been processed, it is determined whether there are task clusters to be processed in the task data.

[0107] In an embodiment of the present invention, determining whether all task clusters in the task data have been processed includes:

[0108] Obtain the task statuses of all task clusters in the task data to obtain task status data;

[0109] Determine whether there are task clusters to be processed in the task data according to the task status data;

[0110] If there are task clusters to be processed in the task data, it is determined that there are unprocessed task clusters in the task data;

[0111] If there are no task clusters to be processed in the task data, it is determined that all task clusters in the task data have been processed.

[0112] In an embodiment of the present invention, by determining whether all task clusters in the task data have been processed, the efficiency of task scheduling is improved.

[0113] If there are unprocessed task clusters in the task data, return to S2, and determine whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status.

[0114] In an embodiment of the present invention, when there are unprocessed task clusters in the task data, task scheduling needs to be continued and the processing of task clusters needs to be completed. Therefore, it is necessary to re-execute the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status, so as to call the idle check to process the task clusters.

[0115] If all task clusters in the task data have been processed, execute S7, and send a task processing completion message to a preset task scheduling center.

[0116] In an embodiment of the present invention, the task scheduling center is a module for managing system task scheduling and system resources.

[0117] In an embodiment of the present invention, when all task clusters in the task data have been processed, a task processing completion message is sent to a preset task scheduling center, so that the task scheduling center can update the system resource utilization information.

[0118] Example 2

[0119] Based on the above embodiments, this embodiment provides an application example.

[0120] The present invention relates to a method for using a multi-core DSP dynamic scheduling system in radar signal detection. The multi-core DSP system is divided into a driver layer, a configuration layer, and an application layer. The driver layer is responsible for configuring various peripheral drivers; the configuration layer is responsible for establishing a resource table and allocating core resources, memory resources, peripheral resources, etc. of the DSP; the application layer is responsible for establishing a multi-task dynamic scheduling framework and scheduling tasks in an orderly manner.

[0121] In an embodiment of the present invention, regarding the configuration layer, while the configuration layer performs resource allocation, it also separates software and hardware. The present invention first divides different steps of radar signal detection into different task clusters, and then allocates core resources and memory resources according to the load and data volume of each task cluster. At the same time, the core resources are bound to different EDMA (Enhanced Direct Memory Access) channels. For load balancing, as much core resources as possible are allocated to the task clusters with higher load, and fewer core resources are allocated to the task clusters with lower load. The number of tasks in each task cluster is the same as the number of cores allocated to that task cluster. Radar signal detection is usually divided into three steps: moving target detection, constant false alarm detection, and angle measurement. Therefore, the task clusters here are the moving target detection task cluster, the constant false alarm detection task cluster, and the angle measurement task cluster.

[0122] For the design of the dynamic scheduling system in the application layer, the present invention is designed in the following steps:

[0123] 1. Divide the memory into multiple ping-pongs and use data stream driving:

[0124] (1) Design the memory ping-pongs according to the system timing. For scenarios with tight timing, design multiple ping-pongs. For scenarios with loose timing, one or two ping-pongs can be designed;

[0125] (2) Put the input data into different ping-pongs. Each piece of data has three task clusters, and the processing order between each task cluster is strictly ordered;

[0126] 2. Design a time wheel. The number of time wheels is designed to be the same as the number of memory ping-pongs, and a task pool is established for each time wheel:

[0127] (1) Each time, start traversing from the previous time wheel of the current time wheel to check if there are tasks to be processed;

[0128] (2) Put each task cluster into the task pool and number and set the status of each task in each task cluster (the initial status is all non-processable status);

[0129] (3) When new data is received, set the status of the first task cluster (moving target detection task cluster) of the corresponding time wheel to pending. After all tasks in the first task cluster are processed, set the status to unprocessable. At the same time, change the status of the second task cluster to pending. The status change of each task cluster follows this rule;

[0130] 3. Establish a shared core resource pool according to the resource table:

[0131] (1) After querying that there are pending tasks in the time wheel, query whether there are idle cores in the core resource pool that can be used. If there are idle cores, push the current pending task to the idle core; otherwise, wait;

[0132] (2) The cores in use are marked as busy, and marked as idle after use;

[0133] 4. Divide the cores of the DSP into scheduling cores and computing cores:

[0134] (1) One scheduling core and multiple slave cores;

[0135] (2) The scheduling core completes the dynamic scheduling of the system, marks the status change of each task cluster, queries and pushes each task. The status change marking of the slave cores is also completed by the scheduling core;

[0136] (3) The computing core only performs data calculation and does not participate in scheduling, and is controlled by the scheduling core;

[0137] (4) The scheduling core communicates with the computing cores, and each computing core is independent of each other and has no communication requirements.

[0138] Example 3

[0139] As Figure 2 shown, it is a functional module diagram of a multi-task adaptive scheduling device provided in this embodiment.

[0140] The multi-task adaptive scheduling device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the multi-task adaptive scheduling device 100 can include a data setting module 101, a first judgment module 102, a second judgment module 103, and a third judgment module 104. The modules of the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.

[0141] In this embodiment, the functions of each module / unit are as follows:

[0142] The data setting module 101 is configured to, after receiving task data, place the task data into a preset hierarchical time wheel and set a task status for each task cluster in the task data;

[0143] The first judgment module 102 is configured to judge whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status. If there is no task to be processed in the first-level time wheel, then set the next time wheel as the first-level time wheel and return to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0144] The second judgment module 103, if there is a task to be processed in the first-level time wheel, then judge whether there is an idle core in the preset core resource pool. If there is no idle core in the core resource pool, then return to the step of judging whether there is an idle core in the preset core resource pool. If there is an idle core in the core resource pool, then use the idle core to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result;

[0145] The third judgment module 104 judges whether all task clusters in the task data have been processed. If there are task clusters in the task data that have not been processed, return to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status. If all task clusters in the task data have been processed, then send a task processing completion message to a preset task scheduling center.

[0146] Example 4

[0147] Based on the above embodiments, this embodiment provides a computer device, including a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the following steps:

[0148] After receiving task data, place the task data into a preset hierarchical time wheel and set a task status for each task cluster in the task data;

[0149] Judge whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0150] If there is no task to be processed in the first-level time wheel, then set the next time wheel as the first-level time wheel and return to the step of judging whether there is a task to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0151] If there is a task to be processed in the first-level time wheel, then judge whether there is an idle core in the preset core resource pool;

[0152] If there is no idle core in the core resource pool, return to the step of determining whether there is an idle core in the preset core resource pool;

[0153] If there is an idle core in the core resource pool, use the idle core to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result;

[0154] Determine whether all task clusters in the task data have been processed;

[0155] If there are unprocessed task clusters in the task data, return to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0156] If all task clusters in the task data have been processed, send a task processing completion message to a preset task scheduling center.

[0157] In some embodiments of this embodiment, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the following steps are implemented:

[0158] After receiving the task data, put the task data into a preset hierarchical time wheel, and set a task status for each task cluster in the task data;

[0159] Determine whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0160] If there are no tasks to be processed in the first-level time wheel, set the next time wheel as the first-level time wheel, and then return to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0161] If there are tasks to be processed in the first-level time wheel, determine whether there is an idle core in the preset core resource pool;

[0162] If there is no idle core in the core resource pool, return to the step of determining whether there is an idle core in the preset core resource pool;

[0163] If there is an idle core in the core resource pool, use the idle core to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result;

[0164] Determine whether all task clusters in the task data have been processed;

[0165] If there are unprocessed task clusters in the task data, return to the step of determining whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status;

[0166] If all task clusters in the task data are processed, send a task processing completion message to a preset task scheduling center.

[0167] In some embodiments of this embodiment, a computer program product is provided, including a computer program, characterized in that when the computer program is executed by a processor, the steps of the method described in the above embodiment are implemented.

[0168] The processor may include, but is not limited to, for example, one or more processors or microprocessors, etc. Each processor may be implemented by an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components, and is used to execute the method in the above embodiment.

[0169] The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof. The computer-readable storage medium may include, but is not limited to, for example, a random access memory (RAM), a read-only memory (ROM), a flash memory, an EPROM memory, an EEPROM memory, a register, a computer storage medium (such as a hard disk, a floppy disk, a solid-state drive, a removable disk, a Blu-ray disc, etc.).

[0170] The computer-readable storage medium may also store at least one computer-executable program, and the computer-executable program is, for example, a computer-readable instruction. The computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, a random access memory (RAM) and / or a cache, etc. The computer-readable storage medium may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer. Then, when the computing device runs the computer-readable instructions stored on the computer-readable storage medium, the various methods described above may be performed.

[0171] In addition, the computer device may further include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (such as a keyboard, a mouse, a speaker, etc.).

[0172] The processor may communicate with external devices via the I / O bus through a wired or wireless network.

[0173] In one embodiment, the at least one computer-executable instruction may also be compiled into or form a software product / computer program product, and when one or more computer-executable instructions are run by a processor, each function and / or step of the method in the embodiments described in this technology is executed.

[0174] In the embodiments provided in this disclosure, it should be understood that the disclosed apparatus and method may also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program product according to multiple embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above-mentioned module, program segment, or part of code includes one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.

[0175] It should be noted that in this disclosure, the term "comprise", "include" or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element limited by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element.

[0176] Although the embodiments disclosed in the present disclosure are as above, the above content is only an embodiment adopted for the convenience of understanding the present disclosure and is not intended to limit the present disclosure. Any person skilled in the art within the technical field to which the present disclosure pertains may make any modifications and changes in the form of implementation and details without departing from the spirit and scope disclosed in the present disclosure. However, the scope of patent protection of the present disclosure shall still be subject to the scope defined by the appended claims.

Claims

1. A multi-task adaptive scheduling method, characterized in that Including: After receiving the task data, put the task data into a preset hierarchical time wheel, and set the task status for each task cluster in the task data; Judge whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status; If there are no tasks to be processed in the first-level time wheel, set the next time wheel as the first-level time wheel, and then return to the step of judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status; If there are tasks to be processed in the first-level time wheel, judge whether there are idle cores in the preset core resource pool; If there are no idle cores in the core resource pool, return to the step of judging whether there are idle cores in the preset core resource pool; If there are idle cores in the core resource pool, use the idle cores to process the task data to obtain a task processing result, and update the task status of each task cluster in the task data according to the task processing result; Judge whether all task clusters in the task data have been processed; If there are task clusters in the task data that have not been processed, return to the step of judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status; If all task clusters in the task data have been processed, send a task processing completion message to a preset task scheduling center.

2. The method according to claim 1, wherein The step of putting the task data into a preset hierarchical time wheel and setting the task status for each task cluster in the task data includes: Design a corresponding number of memory ping-pongs according to the timing scenario of the system; Establish time wheels with the same number as the memory ping-pongs, and establish a task pool for each time wheel; Divide the task data into multiple task cluster data, where each task cluster data contains three task clusters; Put one copy of the task cluster data into each task pool, set the first task cluster in each task pool to the to-be-processed state, and set the remaining task clusters to the non-processable state.

3. The method according to claim 1, characterized in that The step of judging whether there are tasks to be processed in the first-level time wheel in the hierarchical time wheel according to the task status includes: Judge whether there are task clusters in the first-level time wheel; If there are no task clusters in the first-level time wheel, it is determined that there are no tasks to be processed in the first-level time wheel; If there are task clusters in the first-level time wheel, obtain the task status of the task clusters, and judge whether the task status is the to-be-processed state; If the task status is the to-be-processed state, it is determined that there are tasks to be processed in the first-level time wheel; If the task status is not the to-be-processed state, it is determined that there are no tasks to be processed in the first-level time wheel.

4. The method according to claim 1, wherein The step of using the idle cores to process the task data to obtain a task processing result includes: Use the scheduling core of the idle core to obtain the task type of the task data; Call the computing cores according to the task type to process the task clusters in the task data; Obtain the processing results of each computing core to obtain a task processing result.

5. The method according to claim 4, wherein The step of updating the task status of each task cluster in the task data according to the task processing result includes: Set the first task cluster corresponding to the task processing result to the non-processable state; Set the second task cluster corresponding to the task processing result to the to-be-processed state; Set the third task cluster corresponding to the task processing result to the non-processable state.

6. The method according to claim 5, characterized in that, The determination of whether all task clusters in the task data have been processed includes: Obtain the task statuses of all task clusters in the task data to obtain task status data; Judge whether there is a to-be-processed task cluster in the task data according to the task status data; If there is a to-be-processed task cluster in the task data, it is determined that there are task clusters in the task data that have not been processed; If there is no to-be-processed task cluster in the task data, it is determined that all task clusters in the task data have been processed.

7. A multi-task adaptive scheduling device, characterized in that, Including: A data setting module, configured to, after receiving task data, put the task data into a preset hierarchical time wheel, and set task statuses for each task cluster in the task data; A first judgment module, configured to judge whether there is a to-be-processed task in the first-level time wheel in the hierarchical time wheel according to the task status. If there is no to-be-processed task in the first-level time wheel, set the next time wheel as the first-level time wheel, and then return to the step of judging whether there is a to-be-processed task in the first-level time wheel in the hierarchical time wheel according to the task status; A second judgment module, if there is a to-be-processed task in the first-level time wheel, judge whether there is an idle core in a preset core resource pool. If there is no idle core in the core resource pool, return to the step of judging whether there is an idle core in the preset core resource pool. If there is an idle core in the core resource pool, use the idle core to process the task data to obtain a task processing result, and update the task statuses of each task cluster in the task data according to the task processing result; A third judgment module, judge whether all task clusters in the task data have been processed. If there are task clusters in the task data that have not been processed, return to the step of judging whether there is a to-be-processed task in the first-level time wheel in the hierarchical time wheel according to the task status. If all task clusters in the task data have been processed, send a task processing completion message to a preset task scheduling center.

8. A computer device, comprising a memory, a processor, and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. 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 6.

10. 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 6.