Task scheduling method based on system-on-chip, system-on-chip, and electronic apparatus

A hardware-based task scheduling method within the SoC using multiple schedulers addresses the inefficiencies of CPU-based scheduling, ensuring high efficiency and low latency by directly scheduling accelerators, thus improving system performance.

JP2024169341AActive Publication Date: 2024-12-05BEIJING HORIZON INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024078461
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-28
Filing Date
2024-05-14
Publication Date
2024-12-05
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

Existing central processing unit (CPU)-based software scheduling methods for task execution in system-on-chip (SoC) fail to meet the requirements for highly efficient and low-latency task scheduling, especially as applications become more complex and the granularity of data and task scheduling becomes finer, leading to increased delays and frequent interrupts.

Method used

Implement a hardware-based task scheduling method using multiple task schedulers within the SoC, where a first task scheduler determines scheduling information and transmits it to a second task scheduler, which then schedules an accelerator to execute tasks directly, reducing the need for CPU intervention and minimizing delays.

Benefits of technology

This approach improves task scheduling efficiency, reduces delays, and ensures real-time task execution by minimizing CPU interrupts, thereby enhancing system throughput and processing capacity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024169341000001_ABST
    Figure 2024169341000001_ABST
Patent Text Reader

Abstract

To provide a task scheduling method based on a system-on-chip (SoC), a system-on-chip, and an electronic apparatus.TECHNICAL MEANS: The task scheduling method includes the steps of: determining a task set that needs to be executed by an SoC and dependencies between tasks in the task set; determining first scheduling information for a first task that can be executed by a first accelerator in the SoC based on the task set and the dependencies; transmitting, by a first task scheduler in the SoC, the first scheduling information to a second task scheduler of the SoC for scheduling the first accelerator; and scheduling the first accelerator by the second task scheduler based on the first scheduling information, and executing the first task by the first accelerator.SELECTED DRAWING: Figure 3
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to Chinese patent application having application number 202310594269.6 filed on May 24, 2023 and Chinese patent application having application number 202310780260.4 filed on June 28, 2023, the contents of which are incorporated herein by reference in their entireties.

[0002] The present disclosure relates to the technical field of computers, and in particular to a task scheduling method based on a system on chip, a system on chip, a computer-readable storage medium, and an electronic device. [Background technology]

[0003] In intelligent drives, as applications become more and more complex, the granularity of data and task scheduling becomes smaller and smaller, and the requirement for high-efficiency and low-latency task scheduling becomes stronger. In the related art, a central processing unit (CPU) schedules and executes tasks through software, but the requirement for high-efficiency and low-latency task scheduling cannot be met. Summary of the Invention [Problem to be solved by the invention]

[0004] In order to solve the above technical problems, the present disclosure provides a task scheduling method based on a system on a chip (SoC), an SoC, a computer-readable storage medium, and an electronic device, in which a processor can schedule an accelerator to execute a task through hardware scheduling, and since the speed of hardware scheduling is faster than the speed of software scheduling, the use of hardware scheduling can improve the efficiency of task scheduling, reduce the delay in task scheduling, and ensure the real-time nature of task scheduling, thereby ensuring that tasks are executed with high efficiency and low delay. [Means for solving the problem]

[0005] A first aspect of the present disclosure provides a task scheduling method based on a system-on-chip, the task scheduling method including the steps of: determining a task set that needs to be executed by the system-on-chip and dependencies between each task in the task set; determining first scheduling information for a first task executable by a first accelerator in the system-on-chip based on the task set and the dependencies; transmitting the first scheduling information by a first task scheduler in the system-on-chip to a second task scheduler in the system-on-chip for scheduling the first accelerator; and scheduling the first accelerator by the second task scheduler based on the first scheduling information and executing the first task by the first accelerator.

[0006] A second aspect of the present disclosure provides a system-on-chip comprising a processor, a first accelerator, a first task scheduler, and a second task scheduler, wherein the processor is coupled to the second task scheduler via the first task scheduler, and the second task scheduler is coupled to the first accelerator, the processor is used to determine a set of tasks that need to be executed by the system-on-chip and dependencies between each task in the task set, and to determine initial scheduling information of a first task executable by the first accelerator based on the task set and the dependencies, the first task scheduler is used to determine first scheduling information of the first task based on the initial scheduling information and to send the first scheduling information to a second task scheduler for scheduling the first accelerator, the second task scheduler is used to schedule the first accelerator based on the first scheduling information, and the first accelerator is used to execute the first task.

[0007] A third aspect of the present disclosure provides a computer-readable storage medium, the storage medium storing a computer program for executing a task scheduling method based on any one of the above system-on-chips.

[0008] A fourth aspect of the present disclosure provides an electronic device comprising a processor and a memory in which instructions executable by the processor are stored, the processor being used to realize a task scheduling method based on any one of the system-on-chip methods described above by reading and executing the instructions from the memory.

[0009] A fifth aspect of the present disclosure provides a computer program product, the instructions in which, when executed by a processor, cause a task scheduling method based on any one of the above system-on-chips of the present disclosure to be performed. Effect of the Invention

[0010] The present disclosure schedules a second task scheduler in the system-on-chip by a first task scheduler in the system-on-chip, schedules a first accelerator by the second task scheduler to execute a first task, and executes task scheduling by the first task scheduler and the second task scheduler, thereby realizing that the processor schedules the first task scheduler by hardware to execute the task. This can improve the efficiency of task scheduling, reduce the delay of task scheduling, and ensure the real-time nature of task scheduling, so that it can ensure that the task is executed with high efficiency and low delay. Furthermore, in the process of executing each task in the task set, the accelerator is directly scheduled by the hardware scheduler to execute the task, and the processor does not need to interrupt the main program, so that the frequency of the processor being interrupted by interrupts can be reduced and the processing capacity of the system can be improved. [Brief description of the drawings]

[0011] [Figure 1] FIG. 1 is a structural schematic diagram of a system-on-chip according to one exemplary embodiment of the present disclosure. [Diagram 2] FIG. 2 is a structural schematic diagram of a system-on-chip according to another exemplary embodiment of the present disclosure. [Diagram 3] 1 is a schematic flowchart of a task scheduling method according to an exemplary embodiment of the present disclosure. [Figure 4] FIG. 2 is a schematic diagram of dependencies between tasks in one example task set of the present disclosure. [Diagram 5] 4 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure; [Figure 6] 11 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure; [Figure 7] FIG. 2 is a schematic diagram of a data packet configuration according to an exemplary embodiment of the present disclosure; [Figure 8] 11 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure; [Figure 9] 11 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure; [Figure 10] 11 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure; [Figure 11] FIG. 1 is a structural schematic diagram of a system-on-chip according to one exemplary embodiment of the present disclosure. [Figure 12] FIG. 13 is a structural schematic diagram of a system-on-chip according to another exemplary embodiment of the present disclosure. [Figure 13] FIG. 2 is a structural schematic diagram of a first task scheduler according to an exemplary embodiment of the present disclosure; [Figure 14] FIG. 2 is a structural schematic diagram of a second task scheduler according to an exemplary embodiment of the present disclosure; [Figure 15] FIG. 13 is a structural schematic diagram of a third task scheduler according to an exemplary embodiment of the present disclosure; [Figure 16] FIG. 11 is a structural schematic diagram of a first task scheduler according to another exemplary embodiment of the present disclosure; [Figure 17] FIG. 1 is a structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] In the following, in order to explain the present disclosure, embodiments of the present disclosure will be described in detail with reference to the drawings. The described embodiments are not all embodiments of the present disclosure, but are merely some of the embodiments of the present disclosure, and the present disclosure is not limited to the exemplary embodiments.

[0013] The relative arrangement of parts and steps, formulas, and numerical values ​​described in these examples do not limit the scope of the present disclosure unless specifically stated otherwise.

[0014] (Application Summary) In order to ensure the safety of the intelligent drive, the intelligent drive assistance system chip needs to meet the requirements of low-latency task scheduling and fast interrupt processing. A specific task is executed using a hardware accelerator capable of realizing various specific functions, and different hardware accelerators can process data in parallel, so that they have better processing capability and lower latency than a CPU. In the related art, the hardware accelerator in a system on a chip (SoC) is usually managed and scheduled by a CPU in a software manner. When a specific task needs to be scheduled to execute a specific task, the main program being processed by the CPU is interrupted, and the CPU saves the current state before entering the interrupt service, and schedules the hardware accelerator to execute the task in a software scheduling manner. After the execution of the task is completed, the CPU resumes the previous processing and continues the processing of the interrupted main program. When there are many tasks, in order to ensure the real-time scheduling of the tasks and avoid long waiting times, the number of cores of the CPU is usually increased to improve the parallel function, and based on the parallel scheduling of multi-cores, the real-time property of the task scheduling is ensured, the efficiency of the task scheduling is improved, and the delay of the task scheduling is reduced.

[0015] However, as the chip realizes more and more functions, the granularity of task scheduling becomes smaller and smaller, and the number of tasks that need to be executed increases. In the related art, in the scheduling method in which the CPU schedules the accelerator by software to execute a task, the delay tends to become stable as the number of CPU cores increases, so it is not possible to achieve a lower delay. This is because every time scheduling, the CPU needs to save the current state and resume the previous process, which may take a certain amount of time, and even if there is no need to queue during scheduling, it takes hundreds of microseconds to execute the task. Therefore, in the related art, in the scheduling method in which the accelerator is scheduled by software to execute a task, even if the number of CPU cores increases, the delay cannot be reduced to less than a hundred microseconds, which has a certain impact on special scenarios with high real-time requirements such as intelligent drives. In addition, in the related art, in the scheduling method in which the accelerator is scheduled by software to execute a task, as the number of tasks increases, the CPU is interrupted by an interrupt every time it schedules the accelerator, so frequent interrupts affect the processing capacity of the system.

[0016] In order to solve the problems of low efficiency and high latency in task scheduling, the embodiment of the present disclosure provides a task scheduling method based on SoC, which provides multiple hardware task schedulers between a CPU and a hardware accelerator, and can realize the hardware accelerator to execute tasks by scheduling in a hardware scheduling manner, thereby reducing the scheduling latency to the nanosecond level, realizing highly efficient and low latency task scheduling, and ensuring the real-time nature of task scheduling. Furthermore, in the process of using a task scheduler to schedule a hardware accelerator to execute each task, direct scheduling is performed between multiple task schedulers, and the CPU does not need to suspend the main program, thereby reducing the frequency of the CPU being suspended by interrupts and indirectly improving the processing power of the system.

[0017] (Example System) 1 is a structural schematic diagram of a system on chip according to one exemplary embodiment of the present disclosure. As shown in FIG. 1, a system on chip (SoC) 10 includes a processor 101, a first task scheduler 102, a second task scheduler 103, a first accelerator 104, a scheduling bus 105, and a memory 106. Here, the memory 106, the processor 101, the first task scheduler 102, the second task scheduler 103, and the first accelerator 104 are sequentially coupled. As shown in FIG. 1, the first task scheduler 102 and the second task scheduler 103 can be coupled via a dedicated scheduling bus 105.

[0018] The processor 101 may be a CPU and is used to determine a task set that needs to be executed by the SoC 10 and dependencies between each task in the task set, and to determine initial scheduling information for a first task based on the task set and dependencies, the first task being a task that can be executed by the first accelerator 104. In some examples, the first task is any task in the task set, and the task set and dependencies between each task in the task set can be pre-compiled by a compiler and stored in memory. When the task set needs to be executed, the processor 101 reads it from the memory.

[0019] Exemplarily, the SoC 10 may include one or more second task schedulers 103. When the SoC 10 includes a plurality of second task schedulers 103, each of the plurality of second task schedulers 103 schedules one first accelerator 104. In the embodiment of the present disclosure, the number of the second task schedulers 103 and the first accelerators 104 included in the SoC 10 is not limited. FIG. 1 and FIG. 2 show, as an example, that the SoC 10 includes one second task scheduler 103 and one first accelerator 104.

[0020] The first task scheduler 102 has a scheduling function. This first task scheduler 102 can schedule other task schedulers. In the embodiment of the present disclosure, this first task scheduler 102 is used to determine first scheduling information of a first task based on initial scheduling information, and schedule the second task scheduler 103 based on the first scheduling information.

[0021] The second task scheduler 103 has a scheduling function. The second task scheduler 103 can schedule the hardware accelerator to execute a specific task. In an embodiment of the present disclosure, the second task scheduler 103 is used to receive first scheduling information from the first task scheduler 102 and schedule the first accelerator 104 based on the first scheduling information.

[0022] The first accelerator 104 may be an artificial intelligence (AI) accelerator, a neural network processor (Intelligent Processing Unit (IPU)), etc., and may include a hardware acceleration unit capable of implementing various specific computing functions, such as a tensor processing unit (TPU), etc. In an embodiment of the present disclosure, the first accelerator 104 is used to execute a first task according to the scheduling of the second task scheduler 103.

[0023] 2 is a structural schematic diagram of an SoC according to another exemplary embodiment of the present disclosure. As shown in FIG. 2, in addition to the SoC 10 shown in FIG. 1, the SoC 10 further includes a third task scheduler 205 and a second accelerator 206. Here, the third task scheduler 205 is coupled to the first task scheduler 102, the second task scheduler 103, and the second accelerator 206, respectively. In some embodiments, the first task scheduler 102, the second task scheduler 205, and the third task scheduler 205 can be coupled via a dedicated scheduling bus 105.

[0024] The processor 101 is also used to determine initial scheduling information for a second task based on the task set and dependencies, the second task being a task that the second accelerator 206 can execute.

[0025] The first task scheduler 102 is used to determine second scheduling information of the second task based on the initial scheduling information of the second task, and send the second scheduling information to the third task scheduler 205. Exemplarily, the second task is a task that has a dependency relationship with the first task in the task set, for example, the second task is a successor task of the first task, that is, the execution of the second task needs to depend on the execution result of the first task.

[0026] The second task scheduler 103 is also used to determine the execution result of the first task, generate third scheduling information based on the execution result of the first task and the first scheduling information, and send the third scheduling information to the third task scheduler 205.

[0027] The third task scheduler 205 receives second scheduling information from the first task scheduler 102 and third scheduling information from the second task scheduler 103, and is also used to schedule the second accelerator 206 based on the second scheduling information and the third scheduling information.

[0028] The second accelerator 206 is used to execute the second task according to the scheduling of the third task scheduler 205 .

[0029] Exemplarily, the SoC 10 may include one or more third task schedulers 205. When the SoC 10 includes a plurality of third task schedulers 205, each of the plurality of third task schedulers 205 schedules one second accelerator 206. In the embodiment of the present disclosure, the number of the third task schedulers 205 and the second accelerators 206 included in the SoC 10 is not limited. FIG. 2 illustrates, as an example, the SoC 10 includes one third task scheduler 205 and one second accelerator 206.

[0030] Furthermore, the embodiments of the present disclosure do not limit the specific structure of the SoC 10, and the SoC 10 may include more or less components than those shown in Figures 1 and 2. For example, the SoC 10 may further include components such as a configuration bus and an input / output interface.

[0031] Exemplary Methods 3 is a schematic flowchart of a task scheduling method according to an exemplary embodiment of the present disclosure. The task scheduling method according to the embodiment of the present disclosure can be applied to the SoC 10 shown in FIG. 3, the method includes steps 301 to 305.

[0032] Step 301 determines a set of tasks that need to be executed by the SoC and the dependencies between each task in the set.

[0033] In an embodiment of the present disclosure, each task in the task set may include, but is not limited to, an image processing task, an audio processing task, and a data calculation task. The dependency relationship represents an execution sequence of each task in the task set. The task set and the dependency relationships between each task in the task set may be pre-compiled by a compiler and stored in a memory in the SoC. Exemplarily, the dependency relationships between each task may be stored in the memory in a manner such as a sequence or a link. When each task in the task set needs to be executed, a processor in the SoC reads each task and the dependency relationships between each task from the memory.

[0034] Illustratively, FIG. 4 is a schematic diagram of dependencies between each task in one exemplary task set of the present disclosure. As shown in FIG. 4, there are dependencies between task 1 and task 2 and task 3, between task 2 and task 1, task 4 and task 5, between task 3 and task 1 and task 4, between task 4 and task 2, task 3 and task 6, between task 5 and task 2 and task 6, and between task 6 and task 4 and task 5. In the process of task scheduling, task 2 and task 3 are triggered after the processing of task 1 is completed, task 4 and task 5 are triggered after the processing of task 2 is completed, task 4 is triggered after the processing of task 3 is completed, task 6 is triggered after the processing of task 4 is completed, and task 6 is triggered after the processing of task 5 is completed. Here, task 4 starts to execute only when the two trigger conditions of task 2 and task 3 are met simultaneously, and task 6 starts to execute only when the two trigger conditions of task 4 and task 5 are met simultaneously.

[0035] In step 302, first scheduling information for a first task executable by a first accelerator in the SoC is determined based on the task set and dependencies.

[0036] An accelerator in an SoC is a hardware module capable of executing a specific task. In an embodiment of the present disclosure, the first task is a task in the task set that needs to be executed by the accelerator. After obtaining the task set, the processor first determines a first task to be executed by the accelerator from the task set, and the accelerator used to execute the first task is the first accelerator, and then determines initial scheduling information of the first task based on a dependency relationship, and schedules the first task scheduler based on the initial scheduling information. The first task scheduler determines the first scheduling information of the first task based on the initial scheduling information.

[0037] The first task is a task that the first accelerator can execute, including, but not limited to, an image processing task, an audio processing task, and a data calculation task. The first accelerator corresponding to the first task can include, but is not limited to, an image processing accelerator, an audio processing accelerator, and a data calculation accelerator. If the first task is an image processing task, the first accelerator is an accelerator that can execute the image processing task, and if the first task is a data calculation task, the first accelerator is an accelerator that can execute the data calculation task.

[0038] As shown in Fig. 4, for example, a task set includes {task 1, task 2, task 3, task 4, task 5, task 6}, where task 1, task 2, task 4, task 5, and task 6 can be tasks that can be executed by each accelerator in the SoC, and task 3 is a special task that cannot be executed by the accelerator and needs to be executed by the processor. For example, if all accelerators in the SoC cannot process an image of a certain special format, task 3 needs to be executed by the CPU to process the image of the special format.

[0039] In the case of realization, the first scheduling information of the first task that needs to be executed at present may be determined, and when other first tasks in the task set are executed, the first scheduling information of the other first tasks may be determined in real time, or the first scheduling information of all first tasks in the task set may be determined collectively, and when a certain first task is executed, the first scheduling information of the corresponding first task that has been determined previously may be used as is without the need to perform the determination multiple times. For example, when determining the first scheduling information of a first task that can be executed by the first accelerator, only the first scheduling information of the first task currently waiting to be executed (e.g., task 1) may be determined, or the first scheduling information of all first tasks waiting to be executed (including task 1, task 2, task 4, task 5, and task 6) may be determined.

[0040] In an embodiment of the present disclosure, a first scheduling information of the first task can be determined based on a dependency relationship regarding the first task. The dependency relationship includes a dependency and a dependency, and a task that needs to be dependent on in order to execute the first task is called a predecessor task of the first task, and a task that needs to be dependent on the execution of the first task is called a successor task of the first task. The first scheduling information of the first task includes at least a predecessor task of the first task and a successor task of the first task. If the execution of the first task does not depend on other tasks in the task set, the predecessor task of the first task is empty and is written as null. In this case, the first task is scheduled and started by the main program executed by the processor. If other tasks in the task set are not dependent on the first task, the successor task of the first task is empty and is written as null. In this case, after the execution of the first task is completed, the processor returns to the main program executed.

[0041] For example, the first scheduling information of task 1 in the task set shown in Fig. 4 may include {null} and {task 2, task 3}, the first scheduling information of task 2 may include {task 1} and {task 4, task 5}, and the first scheduling information of task 6 may include {task 4, task 5} and {null}. In the above first scheduling information, the first set includes all predecessor tasks of the first task (if the predecessor task is empty, it is written as null), and the second set includes all successor tasks of the first task (if the successor task is empty, it is written as null).

[0042] In step 303, the first scheduling information is sent by a first task scheduler in the SoC to a second task scheduler in the SoC for scheduling the first accelerator.

[0043] After determining the first scheduling information of the first task, the first task scheduler can send the first scheduling information to the second task scheduler via a scheduling bus in the SoC. The first task scheduler is a hardware scheduler in the SoC for scheduling the second task scheduler, the second task scheduler is a hardware scheduler in the SoC for scheduling the first accelerator, and the first accelerator is an accelerator capable of executing the first task. In an embodiment of the present disclosure, hardware scheduling can be performed directly between the first task scheduler and the second task scheduler coupled via the scheduling bus.

[0044] In step 304, the first accelerator is scheduled by a second task scheduler based on the first scheduling information.

[0045] After receiving the first scheduling information, the second task scheduler schedules the first accelerator according to the first scheduling information. During scheduling, if the antecedent task of the first task is empty, the second task scheduler directly schedules the first accelerator according to the first scheduling information; if the antecedent task of the first task is not empty, the second task scheduler needs to obtain the execution result of the antecedent task of the first task, and schedule the first accelerator according to the first scheduling information and the execution result of the antecedent task of the first task.

[0046] Taking as an example that task 1 is executed by accelerator 1 and task 2 is executed by accelerator 2, when the first task is task 1, the second task scheduler schedules accelerator 1 based on the first scheduling information of task 1, and when the first task is task 2, the second task scheduler determines the execution result of task 1 based on the first scheduling information of task 1, and schedules accelerator 2 based on the execution result of task 1 and the first scheduling information of task 2.

[0047] In an embodiment of the present disclosure, the first task scheduler and the second task scheduler are hardware modules provided in an SoC and capable of implementing a scheduling function. When executing task scheduling, the processor first schedules the first task scheduler, then the first task scheduler schedules the second task scheduler, and finally the second task scheduler schedules the first accelerator, thereby implementing the processor scheduling the first accelerator in hardware.

[0048] In step 305, a first task is executed by a first accelerator.

[0049] The first accelerator reads the calculation data required for executing the first task from the memory and performs calculations based on the configuration information determined by the second task scheduler to obtain the execution result of the first task. In some examples, after completing the execution of the first task, the first accelerator can send the execution result of the first task to the second task scheduler, so that the second task scheduler executes the scheduling and execution process of the next waiting first task based on the execution result of the first task.

[0050] According to a task scheduling method according to an embodiment of the present disclosure, a processor schedules a first accelerator by using a first task scheduler and a second task scheduler to execute a first task, and the first task scheduler and the second task scheduler are hardware modules provided in an SoC and capable of implementing a scheduling function, and the processor executes task scheduling by hardware. This improves the efficiency of task scheduling, reduces delays in task scheduling, and ensures real-time performance of task scheduling, thereby ensuring that tasks are executed with high efficiency and low delay. Furthermore, direct scheduling can be performed between the first task scheduler and the second task scheduler, and there is no need to interrupt a main program being processed by the processor during scheduling, which reduces the frequency with which the processor is interrupted by interrupts and indirectly improves the processing capacity of the system.

[0051] In some examples, step 302 in the embodiment shown in FIG. 3 above, of “determining first scheduling information for a first task executable by a first accelerator in the SoC based on a task set and dependencies” can be realized by steps 3021 to 3023 shown in FIG. 5.

[0052] In step 3021, a first task from the task set that is executable by a first accelerator is determined.

[0053] The processor first selects tasks that can be executed by an accelerator in the SoC from the task set, sets these tasks as first tasks, and executes each of the first tasks by the first accelerator.

[0054] For example, in the task set shown in FIG. 4, if task 1, task 2, task 4, task 5, and task 6 are tasks that can be executed by an accelerator in an SoC, then task 1, task 2, task 4, task 5, and task 6 are all first tasks.

[0055] In step 3022, based on the dependencies, a related task from the task set is determined that has a dependency relationship with the first task.

[0056] The processor selects, from each task included in the task set, a task that has a dependency relationship with the first task as a related task of the first task based on the dependency relationship. The related tasks of the first task include a predecessor task of the first task and a successor task of the first task.

[0057] As shown in the task set in Figure 4, the predecessor tasks of task 1 are empty and the successor tasks of task 1 include task 2 and task 3, so the related tasks in the task set that have a dependency relationship with task 1 include task 2 and task 3. As another example, the predecessor tasks of task 4 include task 2 and task 3, and the successor tasks of task 4 include task 6, so the related tasks in the task set that have a dependency relationship with task 4 include task 2, task 3, and task 6.

[0058] In step 3023, first scheduling information for the first task is determined based on the first task and the related tasks.

[0059] The first scheduling information of the first task includes at least the predecessor task of the first task and the successor task of the first task, which can be used to determine whether the first task satisfies a task execution condition (also called a trigger condition), and can also be used to determine the successor tasks of the first task and determine that the execution result of the first task needs to be sent to a corresponding task scheduler based on the successor tasks.

[0060] Take the first task as an example, the tasks that have a dependency relationship with task 1 include task 2 and task 3, and the first scheduling information of task 1 may include {null} and {task 2, task 3}. Based on the first scheduling information of task 1, determine that the predecessor task of task 1 is empty, and directly determine that task 1 meets the task execution condition. After the execution of task 1 is completed, based on the first scheduling information of task 1, determine that the execution result of task 1 needs to be sent to the task scheduler corresponding to task 2 and the task scheduler corresponding to task 3.

[0061] Also, for example, if the first task is task 4, tasks having a dependency relationship with task 4 may include task 2, task 3, and task 6, and the first scheduling information of task 4 may include {task 2, task 3} and {task 6}. Based on the first scheduling information of task 4, it is determined that the preceding tasks of task 4 include task 2 and task 3, and it is determined whether the execution results of task 2 and task 3 have been received. If the execution results of task 2 and task 3 have been received, it is determined that task 4 satisfies the task execution condition. After the execution of task 4 is completed, it is determined that the execution result of task 4 needs to be sent to the task scheduler corresponding to task 6 based on the first scheduling information of task 4.

[0062] In an embodiment of the present disclosure, the task scheduler determines whether the first task meets a trigger condition based on the first scheduling information, and determines that the execution result of the first task needs to be sent to a corresponding next task scheduler. By realizing direct scheduling between task schedulers using the first scheduling information, the frequency of processor interruptions can be reduced, and the processing capacity of the system can be indirectly improved.

[0063] In some embodiments, as shown in FIG. 6, step 304 of “scheduling the first accelerator by the second task scheduler based on the first scheduling information” in the embodiment shown in FIG. 3 above may include steps 3041 to 3043.

[0064] In step 3041, it is determined that the first task satisfies the task execution condition based on the first scheduling information.

[0065] When the second task scheduler receives the first scheduling information from the first task scheduler, it determines whether the first task can be triggered to execute based on the first scheduling information, and when it determines based on the first scheduling information that all of the antecedent tasks of the first task have been executed, or when it determines based on the first scheduling information that the antecedent tasks of the first task are empty, it determines that the first task satisfies the task execution condition, and proceeds to step 3042 to trigger the execution of the first task. Otherwise, it determines that the first task does not satisfy the task execution condition.

[0066] In step 3042, the first scheduling information is analyzed by a second task scheduler to determine first configuration information required for execution of the first task.

[0067] The first scheduling information of the first task further includes information required for executing the first task in addition to the predecessor task of the first task and the successor task of the first task. After receiving the first scheduling information, the second task scheduler analyzes it to obtain parameters and a task type required for executing the first task, and configures the parameters required for executing the first task according to the task type to obtain the first configuration information.

[0068] In some examples, the first task scheduler can send the first scheduling information in the form of a data packet. Figure 7 is a schematic diagram of a data packet according to one example embodiment of the present disclosure, and as shown in Figure 7, the data packet corresponding to the first scheduling information includes a header section and a data section. The header section includes a length, a source, a target, a task type and an associated task, and the data section includes a task number, a static parameter, a dynamic parameter and a data flow parameter. The second task scheduler determines the first configuration information based on the task type, the static parameter and the dynamic parameter.

[0069] In the header section of the data packet corresponding to the first scheduling information, the length is the data length of the entire data packet, the source is the address of the first task scheduler, the target is the address of the second task scheduler, the source and target indicate the sender and receiver of the first scheduling information, respectively, the task type indicates the type of task that needs to be executed and is used to initialize the first configuration information, and the related tasks include the predecessor task and the successor task. In the data section of the data packet corresponding to the first scheduling information, the task number is the number of the task in the task set, the static parameter is the memory address of the static calculation data required to execute the task, the dynamic parameter is the memory address task of the dynamic calculation data required to execute the task, and the data flow parameter is the related data flow information corresponding to the task, such as a timestamp, and for example, when processing a multi-frame image, it is possible to determine which frame of the image is to be processed this time based on this timestamp.

[0070] In step 3043, the first accelerator is scheduled by the second task scheduler based on the first configuration information.

[0071] The first accelerator receives first configuration information from the second task scheduler, executes an operation based on the first configuration information, and outputs an operation result obtained by the first accelerator executing the first task. Exemplarily, the first configuration information may include a memory address in a memory of operation data required for executing the first task, and the first accelerator reads the operation data from the memory based on the memory address included in the first configuration information, executes an operation, and obtains the operation data result.

[0072] In some examples, the number of second task schedulers in the SoC may be one, and the one second task scheduler schedules the first accelerator corresponding to each first task to execute each first task. The number of second task schedulers may be multiple, and direct scheduling can be performed between multiple second task schedulers, and different task schedulers are used to schedule the accelerator corresponding to each task. In the following, two second task schedulers are used as an example. For the sake of distinction, the second task scheduler is called a third task scheduler, the accelerator scheduled by the third task scheduler is called a second accelerator, and the task executed by the second accelerator is called a second task. FIG. 8 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure. The task scheduling method according to the embodiment of the present disclosure can be applied to the SoC 10 shown in FIG. 2. As shown in FIG. 8, the method includes the following steps 801 to 810.

[0073] In step 801, a set of tasks that needs to be executed by the SoC and dependencies between each task in the set of tasks are determined.

[0074] When a main program processed by a processor in the SoC needs to execute each task in the task set, the processor reads each task and the dependencies between each task from the memory in the SoC. The task set stored in the memory and the dependencies between each task in the task set can be pre-compiled by a compiler and stored in the memory.

[0075] In step 802, first scheduling information for a first task executable by a first accelerator in the SoC and second scheduling information for a second task executable by a second accelerator in the SoC are determined based on the task set and dependencies.

[0076] In some examples, the method for implementing the step of determining first scheduling information for a first task executable by a first accelerator in the SoC based on a task set and dependencies in step 802 can refer to the aforementioned step 302, and the description thereof will be omitted here.

[0077] Exemplarily, the second task can be a next task of the first task. The implementation method of the step of determining the second scheduling information of the second task based on the task set and the dependency is similar to the method of determining the first scheduling information. For example, the step of determining the second scheduling information of the second task based on the task set and the dependency includes: determining an associated task having a dependency relationship with the second task from the task set based on the dependency relationship; determining initial scheduling information of the second task based on the second task and the associated task of the second task; and determining the second scheduling information of the second task by the first task scheduler based on the initial scheduling information of the second task.

[0078] As shown in FIG. 4, the processor determines that the first task is task 2 from the task set {task 1, task 2, task 3, task 4, task 5, task 6}, and determines that the related tasks of task 2 include task 1, task 4, and task 5 based on the dependency relationship, and determines the initial scheduling information of task 2. In the data packet corresponding to the initial scheduling information of the task 2, the source is the processor, the target is the first task scheduler, the related tasks include {task 1} and {task 4, task 5}, the task number is task 2, and the static parameter is the memory address in the memory of the static operation data required for executing task 2. The processor transmits the initial scheduling information to the configuration bus, and the first task scheduler determines that the target in the initial scheduling information of task 2 is matching with itself, receives the initial scheduling information of the task 2, and generates the first scheduling information of task 2 based on the initial scheduling information of the task 2. In the data packet corresponding to the first scheduling information of the task 2, the source is the first task scheduler, the target is the second task scheduler, the related tasks include {task 1} and {task 4, task 5}, the task number is task 2, and the static parameters are the memory addresses in the memory of the static calculation data required for the execution of task 2.

[0079] Based on the related tasks of task 2, it is determined that the next tasks of task 2 include task 4 and task 5, and based on the dependency relationship, it is determined that the related tasks of task 4 include {task 2, task 3} and {task 6}, and it is determined that the related tasks of task 5 include {task 2} and {task 6}, and based on task 4 and the related tasks of task 4, initial scheduling information of task 4 is determined. In a data packet corresponding to the initial scheduling information of task 4, the source is the processor, the target is the first task scheduler, the related tasks include {task 2, task 3} and {task 6}, the task number is task 4, and the static parameter is a memory address in the memory of the static calculation data required for the execution of task 4. The processor transmits the initial scheduling information to the configuration bus, and the first task scheduler determines that the target in the initial scheduling information of task 4 is aligned with itself, receives the initial scheduling information of task 4, and generates second scheduling information of task 4 based on the initial scheduling information of task 4. In the data packet corresponding to the second scheduling information of the task 4, the source is the first task scheduler, the target is the third task scheduler, the related tasks include {task 2, task 3} and {task 6}, the task number is task 4, and the static parameter is the memory address in memory of the static calculation data required for the execution of task 4.

[0080] In some embodiments, if the second task includes other subsequent tasks in the task set, step 802 may also determine scheduling information for the other tasks based on the task set and dependencies.

[0081] In step 803, a first task scheduler in the SoC sends first scheduling information to a second task scheduler in the SoC for scheduling the first accelerator, and sends second scheduling information to a third task scheduler in the SoC for scheduling the second accelerator.

[0082] In one implementation, the first task scheduler can send the first scheduling information and the second scheduling information to a dedicated scheduling bus. Each task scheduler coupled to the scheduling bus determines whether each scheduling information is to be sent to itself based on the target in each scheduling information. If the target in the scheduling information is aligned with itself, it receives the corresponding scheduling information. The second task scheduler receives the first scheduling information, and the third task scheduler receives the second scheduling information.

[0083] In step 804, the first accelerator is scheduled by a second task scheduler based on the first scheduling information.

[0084] In step 805, a first task is executed by a first accelerator.

[0085] In an embodiment of the present disclosure, the first task scheduler and the second task scheduler are hardware modules provided in an SoC and capable of realizing a scheduling function, and the processor schedules the first accelerator using the first task scheduler and the second task scheduler, thereby realizing the processor to schedule the accelerator using hardware.

[0086] In step 806, a third task scheduler in the SoC determines second scheduling information for a second task executable by a second accelerator in the SoC.

[0087] In an embodiment of the present disclosure, a third task scheduler is used to schedule the second accelerator, and the third task scheduler receives the second scheduling information transmitted by the first task scheduler via the scheduling bus.

[0088] In step 807, the second task scheduler determines the execution result of the first task.

[0089] After completing the execution of the first task, the first accelerator transmits the execution result of the first task to the second task scheduler.

[0090] In step 808, third scheduling information is sent by the second task scheduler to the third task scheduler based on the execution result of the first task and the first scheduling information.

[0091] The second task scheduler determines, based on the subsequent task in the first scheduling information, that the execution result of the first task needs to be sent to a third task scheduler corresponding to the second task. Based on the execution result of the first task and the first scheduling information, generate third scheduling information to be sent to the third task scheduler. In the data packet corresponding to the third scheduling information, the source is the second task scheduler, the target is the third task scheduler, the task number is task 4, the dynamic parameter is a memory address in the memory of dynamic computation data required for executing task 4, and the dynamic parameter is the execution result of the first task.

[0092] In step 809, the second accelerator is scheduled by a third task scheduler based on the second scheduling information and the third scheduling information.

[0093] The third task scheduler determines static parameters and a task type required for executing task 4 based on the second scheduling information, and determines dynamic parameters required for executing task 4 based on the third scheduling information. The third task scheduler configures the static parameters and the dynamic parameters based on the task type to obtain configuration information of the second task, and schedules the second accelerator to execute the second task based on the configuration information of the second task.

[0094] In step 810, a second task is executed by a second accelerator.

[0095] In the embodiment of the present disclosure, after the execution of the second task is completed, if the task set includes other tasks that follow the second task, and the other tasks are tasks that can be executed by an accelerator in an SoC, the other tasks can be scheduled and executed by referring to the above steps until the execution of all tasks in the task set is completed, thereby realizing the scheduling and execution of each task in the task set.

[0096] According to the task scheduling method according to the embodiment of the present disclosure, the first task scheduler, the second task scheduler, and the third task scheduler are hardware modules provided in an SoC and capable of implementing a scheduling function, and the first task scheduler can schedule the second task scheduler and the third task scheduler, the second task scheduler can schedule the first accelerator and the third task scheduler, and the third task scheduler can schedule the second accelerator. The processor realizes scheduling for the multiple accelerators by the multiple task schedulers. This can improve the efficiency of task scheduling, reduce the delay in task scheduling, and ensure the real-time nature of task scheduling, thereby ensuring that tasks are executed with high efficiency and low delay. Furthermore, in the process of executing each task in a task set, scheduling can be performed directly between each task scheduler, and the hardware scheduler directly schedules the accelerator to execute a task, eliminating the need to interrupt the main program being processed by the processor. This reduces the frequency with which the processor is interrupted by interrupts, and indirectly improves the processing power of the system.

[0097] In some embodiments, as shown in FIG. 9, step 809 of "scheduling the second accelerator by the third task scheduler based on the second scheduling information and the third scheduling information" in the embodiment shown in FIG. 8 above may include the following steps 8091 to 8093.

[0098] In step 8091, a predecessor task having a dependency relationship with the second task is determined by a third task scheduler based on the second scheduling information.

[0099] 4, the predecessor task having a dependency relationship with the second task is the predecessor task of task 4. The third task scheduler determines, based on the second scheduling information of task 4, that the predecessor tasks of task 4 include task 2 and task 3.

[0100] In step 8092, the execution result of the preceding task is determined based on the third scheduling information.

[0101] The third task scheduler receives and analyzes a data packet corresponding to the third scheduling information whose target is the third task scheduler from the scheduling bus, and obtains the execution result of the predecessor task of the second task. Here, the number of the received third scheduling information is the same as the number of the predecessor tasks of the second task. For example, since task 4 has two predecessor tasks, it needs to receive the third scheduling information from the task scheduler corresponding to the two predecessor tasks. Here, the third task scheduler receives the third scheduling information transmitted by the second task scheduler from the scheduling bus, and the third scheduling information includes the execution result of task 2. The third task scheduler receives the third scheduling information transmitted by the first task scheduler from the scheduling bus, and the third scheduling information includes the execution result of task 3.

[0102] If the predecessor tasks of the second task include only tasks that the accelerator can execute, the third scheduling information is sent to the scheduling bus by a second task scheduler for scheduling the accelerator, in which case the third task scheduler is scheduled by the second task scheduler. If the predecessor tasks of the second task include only special tasks that the accelerator cannot execute, the third scheduling information is sent to the scheduling bus by a first task scheduler for scheduling the processor, in which case the third task scheduler is scheduled by the first task scheduler. If the predecessor tasks of the second task include a task that the accelerator can execute and a special task that the accelerator cannot execute, the third scheduling information includes information sent to the scheduling bus by the second task scheduler for scheduling the accelerator and information sent to the scheduling bus by the first task scheduler for scheduling the processor, in which case the third task scheduler is scheduled by the first task scheduler and the second task scheduler.

[0103] In step 8093, the second accelerator is scheduled by the third task scheduler based on the execution result of the preceding task and the second scheduling information.

[0104] When the execution results of all the preceding tasks of the second task and the second scheduling information are obtained, it is determined that the second task satisfies the task execution condition, and the third task scheduler analyzes the second scheduling information to determine second configuration information required for executing the second task, and schedules the second accelerator by the third task scheduler based on the execution results of the preceding tasks and the second configuration information.

[0105] The second scheduling information of the second task includes information required for executing the second task in addition to the predecessor task of the second task and the successor task of the second task. After receiving the second scheduling information from the first task scheduler, the third task scheduler analyzes the second scheduling information to obtain second configuration information required for executing the second task, where the second configuration information may include a memory address in the memory of static calculation data required for executing the second task, and reads the static calculation data of the second task based on the memory address of the static calculation data. The execution result of the predecessor task of the second task is a dynamic parameter of the second task. The third task scheduler determines the configuration information required for executing the second task based on the task type, static parameters and dynamic parameters of the second scheduling information, and sends the configuration information to the second accelerator to schedule the second accelerator to execute the second task.

[0106] After receiving the configuration information required to execute the second task, the second accelerator executes a calculation based on the configuration information and outputs a calculation result, which is the execution result obtained by the second accelerator executing the second task.

[0107] According to the task scheduling method of the embodiment of the present disclosure, the third task scheduler schedules the second accelerator to execute the second task (i.e., the task next to the first task) based on the second scheduling information and the third scheduling information, and after the execution is completed, the second task is set as a new first task, and the above steps are repeated to schedule and execute each task in the task set. In the process of executing each task in the task set, by scheduling among multiple task schedulers, each accelerator is scheduled to execute each task, and the processor does not need to interrupt the main program, so that the frequency of the CPU being interrupted by interrupts can be reduced and the processing capacity of the system can be improved.

[0108] After the second task scheduler obtains the execution result of the first task from the first accelerator, if the second task scheduler determines based on the first scheduling information that the successor task of the first task is a special task that needs to be executed by the processor, the second task scheduler needs to schedule the first task scheduler, and the first scheduling schedules the processor to execute the special task. Based on the above embodiment, the embodiment of the present disclosure further provides another task scheduling method, and FIG. 10 is a schematic flowchart of a task scheduling method according to another exemplary embodiment of the present disclosure. As shown in FIG. 10, the method includes the following steps 1001 to 1010.

[0109] In step 1001, a set of tasks that needs to be executed by the SoC and dependencies between each task in the set of tasks are determined.

[0110] In step 1002, a first scheduling information for a first task that can be executed by a first accelerator in the SoC and a fourth scheduling information for a third task that needs to be executed by a processor in the SoC are determined based on the task set and the dependencies.

[0111] For example, if the first task is task 1 in the task set shown in FIG. 4, in a data packet corresponding to the first scheduling information, the source is the first task scheduler, the target is the second task scheduler, the related tasks include {null} and {task 2, task 3}, the task number is task 1, and the static parameters include the memory address in the memory of the static calculation data required for executing task 1.

[0112] For example, if the third task is task 3 in the task set shown in FIG. 4, in a data packet corresponding to the fourth scheduling information, the source is the processor, the target is the first task scheduler, the related tasks include {task 1} and {task 4}, the task number is task 3, and the static parameters include the memory address in the memory of the static calculation data required for executing task 3.

[0113] In step 1003, the first task scheduler determines fourth scheduling information of a third task that needs to be executed by a processor in the SoC.

[0114] The first task scheduler receives the first scheduling information and the fourth scheduling information transmitted by the processor via the scheduling bus.

[0115] In step 1004, the first scheduling information is sent by a first task scheduler in the SoC to a second task scheduler in the SoC for scheduling the first accelerator.

[0116] In step 1005, the first accelerator is scheduled by a second task scheduler based on the first scheduling information.

[0117] In step 1006, the first task is executed by the first accelerator.

[0118] In step 1007, the second task scheduler determines the execution result of the first task.

[0119] In step 1008, fifth scheduling information is sent by the second task scheduler to the first task scheduler based on the execution result of the first task and the first scheduling information.

[0120] The second task scheduler determines, based on the first scheduling information, that the succeeding task of the first task is a special task that needs to be executed by the processor. After obtaining the execution result of the first task from the first accelerator, the second task scheduler generates fifth scheduling information for scheduling the first task scheduler based on the execution result of the first task and the first scheduling information. Taking task 3 in the task set shown in FIG. 4 as an example, task 3 in the succeeding task of task 1 is a special task, and in the data packet corresponding to the fifth scheduling information generated by the second task scheduler, the source is the second task scheduler, the target is the first task scheduler, the task number is task 3, and the dynamic parameter includes the memory address in the memory of the execution result of task 1.

[0121] In step 1009, the first task scheduler schedules the processor based on the fourth scheduling information and the fifth scheduling information.

[0122] The first task scheduler analyzes the received fourth scheduling information to determine a task type and static parameters of task 3, the first task scheduler analyzes the received fifth scheduling information to determine static parameters of task 3, generates configuration information for task 3 based on the task type, static parameters and dynamic parameters of task 3, and schedules the processor to execute task 3 based on the configuration information of task 3.

[0123] In step 1010, a third task is executed by the processor.

[0124] The processor executes the third task and obtains an execution result of the third task, and then transmits the execution result of the third task to the first task scheduler.

[0125] The first task scheduler determines, based on the fourth scheduling information, that the succeeding task of the third task is the fourth task that needs to be executed by the third accelerator. After obtaining the execution result of the third task from the processor, generates sixth scheduling information for scheduling the fourth task scheduler based on the execution result of the third task and the fourth scheduling information. The subsequent steps are similar to steps 1004 to 1010, and therefore will not be described here.

[0126] According to the task scheduling method according to the embodiment of the present disclosure, the first task scheduler can not only schedule other task schedulers, but also schedule the processor to execute a special task that the accelerator cannot execute, thereby realizing the scheduling and execution of the special task. When the first task scheduler schedules other task schedulers, the accelerator schedules and executes a task that the accelerator can execute, and when the first task scheduler schedules the processor, the accelerator schedules and executes a task that the accelerator cannot execute, thereby realizing the scheduling of different types of tasks by hardware and improving the flexibility of task scheduling.

[0127] (Exemplary Apparatus) 11 is a structural schematic diagram of an SoC according to an exemplary embodiment of the present disclosure, and as shown in FIG 11, an SoC 1100 includes a processor 1101, a first accelerator 1104, a first task scheduler 1102, and a second task scheduler 1103. The processor 1101 is coupled to the second task scheduler 1103 via the first task scheduler 1102, and the second task scheduler 1103 is coupled to the first accelerator 1104.

[0128] Here, the processor 1101 is used to determine a task set that needs to be executed by the SoC 1100 and dependencies between each task in the task set, and to determine initial scheduling information for a first task that can be executed by the first accelerator 1104 based on the task set and dependencies.

[0129] The first task scheduler 1102 is used to determine first scheduling information of the first task based on the initial scheduling information, and send the first scheduling information to the second task scheduler 1103 for scheduling the first accelerator 1104.

[0130] The second task scheduler 1103 is used to schedule the first accelerator 1104 based on the first scheduling information.

[0131] The first accelerator 1104 is used to execute the first task.

[0132] In some examples, the processor 1101 is also used to determine a first task from the task set that is executable by the first accelerator 1104, determine associated tasks from the task set that have dependencies on the first task based on the dependencies, and determine initial scheduling information for the first task based on the first task and the associated tasks.

[0133] The first task scheduler 1102 is also used to determine first scheduling information of the first task based on the initial scheduling information of the first task.

[0134] In some examples, the second task scheduler 1103 is also used to determine, based on the first scheduling information, that the first task satisfies a task execution condition, analyze the first scheduling information to determine first configuration information required for executing the first task, and schedule the first accelerator based on the first configuration information.

[0135] FIG. 12 is a structural schematic diagram of an SoC according to another exemplary embodiment of the present disclosure. As shown in FIG. 12, in addition to the SoC 1100 shown in FIG. 11, the SoC 1100 further includes a second accelerator 1106 and a third task scheduler 1105 for scheduling the second accelerator 1106, and the first task scheduler 1102 is coupled to the second accelerator 1106 via the third task scheduler 1105.

[0136] A third task scheduler 1105 is used to determine second scheduling information of a second task that is executable by a second accelerator 1106 .

[0137] The second task scheduler 1103 is also used to determine the execution result of the first task and send third scheduling information to the third task scheduler 1105 based on the execution result of the first task and the first scheduling information.

[0138] The third task scheduler 1105 is also used to schedule the second accelerator 1106 based on the second scheduling information and the third scheduling information.

[0139] The second accelerator 1106 is used to execute a second task, which is a next task of the first task.

[0140] In some examples, the third task scheduler 1105 is also used to determine a predecessor task that has a dependency on the second task based on the second scheduling information, determine an execution result of the predecessor task based on the third scheduling information, and schedule the second accelerator 1106 based on the execution result of the predecessor task and the second scheduling information.

[0141] In some embodiments, the third task scheduler 1105 is also used to analyze the second scheduling information to determine second configuration information required for executing the second task, and schedule the second accelerator 1106 based on the execution result of the preceding task and the second configuration information.

[0142] In some embodiments, the first task scheduler 1102 is also used to determine fourth scheduling information for a third task that needs to be executed by a processor in the SoC.

[0143] The second task scheduler 1103 is also used to determine the execution result of the first task and send fifth scheduling information to the first task scheduler 1102 based on the execution result of the first task and the first scheduling information.

[0144] The first task scheduler 1102 is also used to schedule the processor 1101 based on the fourth scheduling information and the fifth scheduling information.

[0145] The processor 1101 is also used to perform a third task.

[0146] FIG. 13 is a structural schematic diagram of a first task scheduler according to an exemplary embodiment of the present disclosure. As shown in FIG. 13, the first task scheduler 1102 includes a task sending module 11021.

[0147] The task transmission module 11021 is coupled to the processor 1101 and the scheduling bus, respectively. In the SoC 1100 shown in FIG. 11, the task transmission module 11021 is used to receive initial scheduling information of a first task from the processor 1101, determine first scheduling information based on the initial scheduling information of the first task, and transmit the first scheduling information to the second task scheduler 1103 via the scheduling bus. In the SoC 1200 shown in FIG. 12, the task transmission module 11021 is used to receive initial scheduling information of a first task and initial scheduling information of a second task from the processor 1101, determine first scheduling information based on the initial scheduling information of the first task, determine second scheduling information based on the initial scheduling information of the second task, transmit the first scheduling information to the second task scheduler 1103 via the scheduling bus, and transmit the second scheduling information to the third task scheduler 1105.

[0148] 14 is a structural schematic diagram of a second task scheduler according to an exemplary embodiment of the present disclosure. As shown in FIG. 14, the second task scheduler 1103 includes a task receiving module 11031, a precondition determining module 11032, and a task trigger module 11033, which are sequentially coupled, and an interrupt response module 11034, an output module 11035, and a task sending module 11036, which are sequentially coupled. The task receiving module 11031 and the task sending module 11036 are both coupled to a scheduling bus, and are coupled to another task scheduler (the third task scheduler 1105 is shown as an example in FIG. 14) via the scheduling bus. The task trigger module 11033 and the interrupt response module 11034 are both coupled to the first accelerator 1104.

[0149] The task receiving module 11031 is used to receive first scheduling information from the scheduling bus, where the first scheduling information is the scheduling information from the task sending module 11021 in the first task scheduler 1102 shown in FIG.

[0150] The pre-condition determination module 11032 is used to determine whether the first task satisfies the task execution condition based on the first scheduling information, and if the first task satisfies the task execution condition, the first task can be triggered. In one implementation, if the first task is the first task waiting to be executed in the task set, the first task does not have a predecessor task with a dependency relationship and determines that the first task satisfies the task execution condition, and if the first task is not the first task waiting to be executed in the task set, the first task has a predecessor task with a dependency relationship and determines that the first task satisfies the task execution condition when all the predecessor tasks on which the first task depends are executed.

[0151] The task trigger module 11033 is used to convert the first task that satisfies the task execution condition into configuration information corresponding to the first accelerator 1104. The first accelerator 1104 executes the first task based on the configuration information. In an implementation, the task trigger module 11033 can analyze the first scheduling information to determine first configuration information required for executing the first task, where the first configuration information is configuration information corresponding to the first accelerator 1104.

[0152] The interrupt response module 11034 is used to perform local processing on the interrupt of the first accelerator 1104, convert the interrupt into a processing result, and make the processing result the execution result of the first task.

[0153] The output module 11035 is used for generating third scheduling information for triggering the lower-task scheduler based on the execution result of the first task and the first scheduling information.

[0154] The task sending module 11036 is used to send the third scheduling information to the scheduling bus.

[0155] 15 is a structural schematic diagram of a third task scheduler according to an exemplary embodiment of the present disclosure. As shown in FIG. 15, the third task scheduler 1105 includes a task receiving module 11051, a precondition determining module 11052, and a task trigger module 11053, which are sequentially coupled, and an interrupt response module 11054, an output module 11055, and a task sending module 11056, which are sequentially coupled. The task receiving module 11051 and the task sending module 11056 are both coupled to a scheduling bus, and are coupled to other task schedulers (the fourth task scheduler 1107 is shown as an example in FIG. 15) via the scheduling bus. The task trigger module 11053 and the interrupt response module 11054 are both coupled to the second accelerator 1106.

[0156] The task receiving module 11051 is used to receive second scheduling information and third scheduling information from the scheduling bus, where the second scheduling information is the scheduling information from the task transmitting module 11021 in the first task scheduler 1102 shown in FIG. 13, and the third scheduling information is the scheduling information from the task transmitting module 11036 in the second task scheduler 1103 shown in FIG. 14.

[0157] The precondition determination module 11052 is used to determine whether the second task satisfies the task execution condition based on the second scheduling information, and if the second task satisfies the task execution condition, the second task can be triggered. In one implementation, when the execution results of all the antecedent tasks on which the second task depends are received, it is determined that the second task satisfies the task execution condition when it is determined that all the antecedent tasks on which the second task depends have been executed. Whether the execution results of the antecedent tasks have been received can be determined by analyzing the scheduling information from the upper task scheduler. For example, when the third scheduling information including the execution result of the first task is received, it is determined that the first task on which the second task depends has been executed, and if the second task depends only on the first task, it can be determined that the antecedent task on which the second task depends has been executed, and if the second task depends on other tasks other than the first task, it is necessary to further determine whether the scheduling information including the execution results of the other tasks has been received.

[0158] The task trigger module 11053 is used to convert the second task that satisfies the task execution condition into configuration information corresponding to the second accelerator 1106. The second accelerator 1106 executes the second task based on the corresponding configuration information. In one implementation, the task trigger module 11053 can analyze the second scheduling information to determine second configuration information required for executing the second task, and take the corresponding second configuration information and the execution results of all preceding tasks of the second task as the configuration information corresponding to the second accelerator 1106.

[0159] The interrupt response module 11054 is used for locally processing the interrupt of the second accelerator 1106, converting the interrupt into a processing result, and making the processing result the execution result of the second task.

[0160] The output module 11055 is used to generate lower-level scheduling information for triggering a lower-level task scheduler based on the execution result of the second task and the third scheduling information. In some examples, if there is a subsequent task that depends on the second task, the lower-level scheduling information is used to schedule the lower-level task scheduler, which is a task scheduler for scheduling a lower-level accelerator, which is an accelerator that can execute the subsequent task of the second task. In addition, the subsequent task of the second task may be one or more. If there is no subsequent task that depends on the second task, the lower-level scheduling information is used to schedule the first task scheduler 1102, which can send the execution result of the second task to the processor 1101.

[0161] The task sending module 11056 is used to send the lower level scheduling information to the scheduling bus.

[0162] In some examples, if there is a special task (hereinafter referred to as a third task) in the task set that cannot be executed by the hardware accelerator and needs to be executed by the processor 1101, the first task scheduler 1102 is also used to schedule the processor 1101 to execute the third task.

[0163] 16 is a structural schematic diagram of a first task scheduler according to another exemplary embodiment of the present disclosure. As shown in FIG. 16, the first task scheduler 1102 includes a task sending module 11021, a task receiving module 11022, a precondition determining module 11023, an interrupt trigger module 11024, a result trigger module 11025, and an output module 11026. The task sending module 11021 and the task receiving module 11022 are coupled to a scheduling bus, and are coupled to other task schedulers (the second task scheduler 1103 and the third task scheduler 1105 are shown as examples in FIG. 16, respectively) via the scheduling bus. The task sending module 11021, the interrupt trigger module 11024, and the result trigger module 11025 are all coupled to the processor 1101.

[0164] The task receiving module 11022 is used to receive fifth scheduling information of the third task from the processor 1101, and is also used to receive fourth scheduling information from the scheduling bus, where the fourth scheduling information is the scheduling information sent to the scheduling bus by the task scheduler corresponding to the preceding task on which the third task depends.

[0165] The pre-condition determination module 11023 is used to determine whether the third task satisfies the task execution condition based on the fifth scheduling information, and when all preceding tasks on which the third task depends are executed and it is determined that the third task satisfies the task execution condition, the third task can be triggered.

[0166] The interrupt trigger module 11024 is used to convert the third task that satisfies the task execution condition into interrupt configuration information corresponding to the processor 1101. The processor 1101 executes the third task based on the interrupt configuration information. In one implementation, the interrupt trigger module 11024 can analyze the fourth scheduling information to determine third configuration information required for executing the third task, and set the third configuration information and the execution results of all preceding tasks of the third task as interrupt configuration information corresponding to the processor 1101.

[0167] The result trigger module 11025 is used to receive a trigger from the processor 1101 and obtain the execution result of the third task executed by the processor 1101 .

[0168] The output module 11026 is used for generating lower-level scheduling information for triggering the lower-level task scheduler based on the execution result of the third task and the fifth scheduling information.

[0169] The task sending module 11021 is used to send the lower-level scheduling information to the scheduling bus, and send the lower-level scheduling information to the lower-level task scheduler via the scheduling bus.

[0170] The above description of the exemplary embodiment of the device is similar to the description of the above method, and has the same beneficial effects as the corresponding exemplary embodiment of the method. For the technical details and corresponding beneficial technical effects not disclosed in the exemplary embodiment of the device of the present disclosure, those skilled in the art can understand them by referring to the description of the exemplary embodiment of the method of the present disclosure, and the description will be omitted here.

[0171] (Example Electronic Devices) FIG. 17 is a structural diagram of an electronic device according to one embodiment of the present disclosure. The electronic device 1700 includes at least one processor 1701 and a memory 1702.

[0172] The processor 1701 may be a central processing unit (CPU) or other type of processing unit having data processing and / or instruction execution capabilities, and may control other components within the electronic device 1700 to perform desired functions.

[0173] The memory 1702 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache). The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. The computer-readable storage media may store one or more computer program instructions, and the processor 1701 may execute the one or more computer program instructions to realize the task scheduling method of each embodiment of the present disclosure described above and / or other desired functions.

[0174] In one example, the electronic device 1700 may further include an input device 1703 and an output device 1704 connected to each other via a bus system and / or other type of connection mechanism (not shown).

[0175] The relevant input device 1703 may include, for example, a keyboard, a mouse, and the like.

[0176] The output device 1704 can output various information to the outside, and can include, for example, a display, a speaker, a printer, a communication network, and remote output devices to which they are connected.

[0177] For simplicity, Fig. 17 shows only some of the components related to the present disclosure in the electronic device 1700, and omits components such as buses, input / output interfaces, etc. In addition, the electronic device 1700 may further include any appropriate components according to specific application conditions.

[0178] Exemplary Computer Program Products and Computer-Readable Storage Media In addition to the above methods and apparatus, embodiments of the present disclosure may provide a computer program product including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the SoC-based task scheduling method according to the embodiments of the present disclosure described in the "Exemplary Method" section above.

[0179] The computer program product may produce program code for carrying out operations of the disclosed embodiments in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and traditional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed as follows: entirely on the user computing device, partially on the user device, as a separate software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or a server.

[0180] In addition, the embodiments of the present disclosure may further provide a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, cause the processor to perform steps of the SoC-based task scheduling method according to the embodiments of the present disclosure described in the "Exemplary Method" section above.

[0181] Any combination of one or more readable media can be employed as the computer readable storage medium. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include an electrical connection with one or more conductors, a mobile hard drive, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0182] Although the basic principles of the present disclosure have been described above with reference to specific examples, the advantages, merits, effects, etc. mentioned in the present disclosure are merely illustrative and not limiting, and these advantages, merits, effects, etc. are not necessarily possessed by each embodiment of the present disclosure. In addition, the specific details of the above disclosure are merely illustrative and easy-to-understand functions and are not limiting, and the above details do not necessarily limit the present disclosure to be realized by the above specific details.

[0183] Those skilled in the art can make various modifications and variations to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.

Claims

1. determining a set of tasks that need to be executed by the system on chip and dependencies between tasks in the set of tasks; determining, based on the task set and the dependencies, first scheduling information for a first task executable by a first accelerator in the system-on-chip; sending, by a first task scheduler in the system-on-chip, the first scheduling information to a second task scheduler in the system-on-chip for scheduling the first accelerator; scheduling the first accelerator by the second task scheduler based on the first scheduling information, and executing a first task by the first accelerator.

2. determining, based on the task set and the dependency relationship, first scheduling information for a first task executable by a first accelerator in the system-on-chip, determining a first task from the task set that is executable by the first accelerator; determining, from the task set, a related task that has a dependency relationship with the first task based on the dependency relationship; and determining first scheduling information for the first task based on the first task and the related task.

3. The step of scheduling the first accelerator by the second task scheduler based on the first scheduling information includes: determining, based on the first scheduling information, that the first task satisfies a task execution condition; analyzing the first scheduling information by the second task scheduler to determine first configuration information required for execution of the first task; 2. The method of claim 1, further comprising: scheduling the first accelerator by the second task scheduler based on the first configuration information.

4. determining, by a third task scheduler for scheduling a second accelerator in the system-on-chip, second scheduling information of a second task executable by the second accelerator in the system-on-chip; determining, by the second task scheduler, a result of execution of the first task; sending third scheduling information to the third task scheduler by the second task scheduler based on the execution result of the first task and the first scheduling information; 4. The method for scheduling tasks based on a system-on-chip according to claim 1, further comprising: scheduling the second accelerator by the third task scheduler based on the second scheduling information and the third scheduling information, and executing a second task, which is a next task of the first task, by the second accelerator.

5. The step of scheduling the second accelerator by the third task scheduler based on the second scheduling information and the third scheduling information includes: determining, based on the second scheduling information, a predecessor task having a dependency relationship with the second task by the third task scheduler; determining an execution result of the preceding task based on the third scheduling information; and scheduling the second accelerator by the third task scheduler based on the execution result of the preceding task and the second scheduling information.

6. The step of scheduling the second accelerator by the third task scheduler based on the execution result of the preceding task and the second scheduling information includes: analyzing the second scheduling information by the third task scheduler to determine second configuration information required for execution of the second task; and scheduling the second accelerator by the third task scheduler based on the execution result of the preceding task and the second configuration information.

7. determining, by the first task scheduler, fourth scheduling information of a third task that needs to be executed by a processor in the system-on-chip; determining, by the second task scheduler, a result of execution of the first task; sending fifth scheduling information to the first task scheduler by the second task scheduler based on the execution result of the first task and the first scheduling information; 4. The method for task scheduling based on a system-on-chip according to claim 1, further comprising: scheduling the processor by the first task scheduler based on the fourth scheduling information and the fifth scheduling information, and executing the third task by the processor.

8. a processor, a first accelerator, a first task scheduler, and a second task scheduler, the processor being coupled to the second task scheduler via the first task scheduler, the second task scheduler being coupled to the first accelerator; The processor is used to determine a set of tasks that need to be executed by the system on chip and dependencies between each task in the set of tasks, and to determine initial scheduling information for a first task executable by the first accelerator based on the set of tasks and the dependencies; The first task scheduler is used to determine first scheduling information for the first task based on the initial scheduling information and send the first scheduling information to a second task scheduler for scheduling the first accelerator; the second task scheduler is used to schedule the first accelerator based on the first task scheduler; The first accelerator is used to execute the first task.

9. a second accelerator; and a third task scheduler for scheduling the second accelerator, the first task scheduler being coupled to the second accelerator via the third task scheduler; the third task scheduler is used to determine second scheduling information for a second task executable by the second accelerator; The second task scheduler is also used to determine an execution result of the first task and to send third scheduling information to the third task scheduler based on the execution result of the first task and the first scheduling information; the third task scheduler is also used to schedule the second accelerator based on the second scheduling information and the third scheduling information; 10. The system on a chip of claim 8, wherein the second accelerator is used to execute the second task, which is a subsequent task to the first task.

10. 13. A computer-readable storage medium having stored thereon a computer program for executing the system-on-chip based task scheduling method according to claim 1.

11. A processor; a memory for storing instructions executable by the processor; 2. An electronic device, comprising: a processor for implementing the method for scheduling tasks based on a system-on-chip according to claim 1 by reading and executing the instructions from the memory.

Citation Information

Patent Citations

  • Graphics calculation process scheduling

    JP2013546098A

  • Method and system for accelerating task control flow

    JP2018507474A

  • Method and task scheduler for scheduling a hardware accelerator

    JP2023519405A