Layered scheduling method for hybrid deep neural network tasks in embedded real-time systems

By constructing a task model and optimization methods, layer-by-layer scheduling of hybrid deep neural network tasks in embedded real-time systems was realized, solving the problem of uneven resource utilization and improving the real-time performance and schedulability of the system.

CN117348989BActive Publication Date: 2026-05-08NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
Filing Date
2023-09-12
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Embedded real-time systems suffer from limited computing resources, poor real-time performance, and long response times when scheduling deep neural network tasks. They cannot meet the timing guarantees under the worst-case scenario, resulting in unreliability of the system, especially in multi-tasking scenarios where resources are not fully utilized.

Method used

By constructing deep neural network task models and layer task models, and designing optimization methods, we can achieve layer-by-layer scheduling of hybrid deep neural network tasks, optimize the allocation of CPU and GPU resources, ensure that the time overhead and worst response time of tasks on heterogeneous platforms meet the constraints, and improve task utilization.

Benefits of technology

Under the condition of short worst-case response time, a balanced utilization of heterogeneous CPU and GPU resources is achieved, which improves the real-time performance and task schedulable performance of embedded real-time systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117348989B_ABST
    Figure CN117348989B_ABST
Patent Text Reader

Abstract

The application discloses a method for layer scheduling of mixed deep neural network tasks in an embedded real-time system. The method considers the limited CPU and GPU resources of the embedded real-time system, the basic conditions of task scheduling, the time limit of task scheduling and other factors, and designs a scheduling mechanism for layer distribution of mixed deep neural network tasks for the embedded real-time system. The method builds a deep neural network task model and a layer task model, mathematically calculates the task scheduling overhead, the worst response time, the utilization sum of the task under the minimum layer task mapping scheduling, sets an optimization function and a constraint condition solving method, and realizes more balanced utilization of the heterogeneous CPU and GPU computing resources in the real-time system under the condition of shorter worst response time, and improves the real-time performance and schedulability of deep neural network tasks in the embedded real-time system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of big data processing technology, specifically the field of real-time system task scheduling, and in particular, a method for layer-by-layer scheduling of hybrid deep neural network tasks in embedded real-time systems. Background Technology

[0002] In modern IoT, applications such as autonomous driving, smart roadside infrastructure, computer vision, smart cities, smart homes, and aerospace all rely on the scheduling of deep neural networks in embedded real-time systems. These applications require real-time systems to support the execution of multiple deep neural network tasks. However, embedded real-time systems have limited computing resources, leading to poor real-time performance and long response times when scheduling these deep learning tasks. They cannot provide worst-case timing guarantees for deep neural network tasks, making embedded real-time system applications unreliable and potentially causing safety hazards in autonomous driving. While current embedded real-time system hardware platforms increasingly feature heterogeneous CPU and GPU cores to improve the average-case response time of deep neural network tasks during inference, these cores are often underutilized when multiple deep neural network tasks are requested simultaneously, and their benefits are less significant in the worst-case scenario than in the average-case scenario. Furthermore, neural network tasks include real-time tasks and optimal-response tasks. Embedded real-time systems, in scheduling and executing hybrid neural network tasks, need to adhere to task scheduling time constraints and achieve good schedulable performance with short response times. Summary of the Invention

[0003] Purpose of the invention: This invention provides a hierarchical scheduling method for hybrid deep neural network tasks in embedded real-time systems. It mainly solves the problem of allocating and scheduling hybrid deep neural network tasks in embedded real-time systems by formalizing the optimization-based allocation and scheduling problem, and realizes a hierarchical allocation and scheduling mechanism in embedded edge real-time system environments and heterogeneous CPU and GPU resource environments.

[0004] Technical Solution: A layer-based scheduling method for hybrid deep neural network tasks in embedded real-time systems. This method divides the hybrid deep neural network tasks into real-time tasks and optimal response tasks. By modeling the deep neural network tasks and neural network layer tasks, and using optimization methods to consider the total execution time of tasks on heterogeneous CPU and GPU computing resources, the time overhead of layer-based mapping scheduling, and the worst response time, a sum function of the task utilization rate of hybrid deep neural network task mapping layer scheduling can be obtained. Under the constraint of minimizing the response time, the optimal scheme for layer-based allocation of deep neural network tasks is found to achieve balanced utilization of heterogeneous CPU and GPU computing resources.

[0005] Furthermore, the method implementation steps include:

[0006] (1) Construct a deep neural network task model for task scheduling and execution in embedded real-time systems. The neural network task is composed of τ i =(C i ,T i D i ,L i ,R i ,S i This indicates the worst-case execution time, runtime, number of task levels, and ready and start times for periodic tasks.

[0007] (2) Construct a deep neural network task layer task model, where the layer tasks are... This includes the worst-case execution time when running on CPU and GPU clusters and their quantization models, as well as the maximum sum of the corresponding quantization inputs and quantization outputs;

[0008] (3) Construct a layer-by-layer allocation and scheduling mechanism for deep neural network tasks to solve the optimal solution for scheduling and executing hybrid deep neural network tasks on CPU or GPU platforms at each layer. The optimal solution includes designing allocation mapping groups, calculating the total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms, the overhead of deep neural network tasks on CPU and GPU clusters, the total overhead on CPU and GPU heterogeneous systems, the worst response time of deep neural network tasks, and the utilization rate of individual tasks.

[0009] (4) Construct an optimization function for layer-by-layer allocation of deep neural network tasks, including the objective equation for mapping deep neural network tasks to heterogeneous CPU and GPU resources, and set basic schedulability conditions, task start time constraints, task completion time constraints, and resource constraints.

[0010] Specifically, the deep neural network task described in step (1) includes a real-time task and an optimal response task, if the deep neural network task τ i If it is a real-time task, then the task is subject to a deadline, i.e., it follows the D... i ≤T i Furthermore, once a task is accepted into the system, the deadline should always be met; if the deep neural network task τ i If it is a best-response task, then some of the tasks at certain levels within this task might miss their deadlines. When the best-response task τ... i When there is no specific deadline requirement, the deadline can be D. i Set to ∞;

[0011] In embedded real-time systems, real-time tasks and optimal response tasks follow these rules:

[0012] 1) Real-time tasks take precedence over best-response tasks;

[0013] 2) Real-time tasks can preempt the best-response task on the same CPU or GPU cluster at any time;

[0014] 3) The preemption condition is that the previous task is the best-response task and its response time is greater than T. i Then the real-time task can preempt the best-responding task, so that the running real-time task D... i Less than or equal to T i .

[0015] Step (3) is to design layer-by-layer allocation scheduling based on the characteristics of neural network task structure;

[0016] The layer-by-layer allocation of deep neural networks is the distribution of execution across GPUs or CPUs. This allocation is represented by ρ, and the task mapped onto the CPU cluster is represented by ρ(τ). i,j When ) = 0, the task mapped on the GPU cluster is represented as ρ(τ). i, j) = 1;

[0017] The total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms is expressed as follows:

[0018]

[0019] Represents task τ i Mapped across k consecutive layers of the CPU platform, Represents task τ i Mapped across k consecutive layers on the GPU platform;

[0020] Deep neural network task τ i The overhead on a CPU cluster is the overhead of the first and last layers of a deep neural network task, expressed as:

[0021]

[0022] Deep neural network task τ i The overhead on a GPU cluster represents the overhead of the first and last layers of a deep neural network task, as shown below:

[0023]

[0024] Deep neural network task τ i The total overhead on a CPU and GPU heterogeneous system is represented as follows:

[0025]

[0026] Deep neural network task τ i The worst-case response time after mapping is expressed as follows:

[0027] w i =C i +S i,j=layerlast +B i,j=layerlast -R i

[0028] The utilization u of a single deep neural network task is expressed as follows:

[0029]

[0030] Among them, T i This indicates the shortest arrival time, or cycle time, for a periodic task.

[0031] The optimization function for layer-by-layer scheduling in step (4) is the scheduling scheme that minimizes the total utilization of tasks, and its mathematical representation is as follows:

[0032]

[0033] The optimization function follows these constraints:

[0034] The basic condition for schedulability is represented by w. i ≤T i (1≤i≤I,1≤j≤L i ,0 <C i <D i ≤T i );

[0035] The condition that the task start time is greater than the ready time is represented by S. i >R i ;

[0036] The condition that the start time of each task level is greater than or equal to the completion time of the previous task is denoted as S. i,j ≥S i-1 +C i-1 ;

[0037] The condition that the task completion time is less than or equal to the latest deadline is represented by C. i +S i,j=layerlast +B i,j=layerlast ≤R i +D i ;

[0038] The resource constraint that only one task can run on the CPU and GPU at a time is expressed as:

[0039]

[0040]

[0041] Finally, the allocation group of deep neural network tasks by layer is obtained by optimization method. In the embedded real-time system, different layer tasks are executed on different GPUs according to the layer task allocation.

[0042] Beneficial effects: Compared with the prior art, the method described in this invention constructs a deep neural network task model and a layer task model, mathematically defines task scheduling overhead, worst response time, and the total utilization of tasks under the minimization of layer task mapping scheduling, sets optimization functions and constraint solution methods, and achieves more balanced utilization of heterogeneous CPU and GPU computing resources in real-time systems under the condition of short worst response time, thereby improving the real-time performance and schedulable performance of deep neural network tasks in embedded real-time systems. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of the method flow described in this invention;

[0044] Figure 2 This is a diagram of the layer-by-layer scheduling framework for hybrid neural network tasks;

[0045] Figure 3 This example shows the changes and comparisons of the total task utilization of the scheduling algorithm under different task set sizes.

[0046] Figure 4 This example illustrates the changes in the schedulable rate of task scheduling under different task volumes.

[0047] Figure 5 This shows how the worst-case response time of task scheduling varies with the number of times different tasks are executed, as illustrated in the example.

[0048] Figure 6 This is the trend of the running time of the present invention as a function of the number of tasks in the embodiments;

[0049] Figure 7 This refers to the CPU and GPU resource utilization of the task scheduling method described in this invention. Detailed Implementation

[0050] To illustrate the technical solution disclosed in this invention in detail, further specific details are provided below.

[0051] This invention provides a layer-by-layer scheduling method for hybrid deep neural network tasks in embedded real-time systems. By constructing a deep neural network task model and a layer task model, it seeks a layer-by-layer allocation scheme that minimizes the total utilization of tasks, thereby enabling more balanced utilization of heterogeneous CPU and GPU computing resources in real-time systems to complete task scheduling even when the worst-case response time is short.

[0052] This method mainly includes the following:

[0053] S1. Construct a deep neural network task model.

[0054] Based on the actual characteristics of deep neural network task scheduling, a deep neural network task model is constructed. The execution of one layer of a single deep neural network task is considered as a single layer task. The entire execution of a deep neural network task is a single task execution, and deep neural network tasks are executed periodically and are preemptively scheduled. This deep neural network task model will be used for task scheduling and execution in embedded real-time systems.

[0055] S2. Construct a deep neural network task layer task model.

[0056] Because deep neural networks have a complex structure consisting of an input layer, multiple hidden layers, and an output layer, model construction for deep neural network layer tasks is an important part of the layer allocation mechanism. Based on the characteristics of neural network layer tasks, a four-tuple representation layer task is established.

[0057] S3. Construct a deep neural network task allocation and scheduling mechanism based on layers.

[0058] To find an optimal scheme for scheduling the execution of hybrid deep neural network tasks on CPU or GPU platforms at each layer, it is necessary to design allocation mapping groups, calculate the total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms, the overhead of deep neural network tasks on CPU and GPU clusters, the total overhead on CPU and GPU heterogeneous systems, the worst response time of deep neural network tasks, and the utilization of individual tasks.

[0059] S4. Design an optimization function for layer-by-layer allocation of deep neural network tasks. Using optimization methods, design an objective equation for mapping deep neural network tasks layer by layer to heterogeneous CPU and GPU resources, setting basic schedulability conditions, task start time constraints, task completion time constraints, and resource limitations. Solve the relevant constraints and optimization function to obtain the optimal mapping scheme for layer-by-layer allocation of deep neural network tasks.

[0060] Specifically, the present invention will be described in detail below with reference to the accompanying drawings and specific examples.

[0061] The key problem addressed by this invention is designing a hierarchical scheduling scheme for hybrid deep neural network tasks in embedded real-time systems, while strictly meeting the time constraints of real-time systems, and efficiently and balancedly utilizing heterogeneous CPU and GPU computing resources when executing neural network tasks on edge real-time systems. The architecture diagram of the entire scheme is shown below. Figure 1 As shown, hybrid deep neural network tasks are divided into real-time tasks and optimal response tasks. By modeling the deep neural network tasks and neural network layer tasks, and using optimization methods to consider the total execution time of tasks on heterogeneous CPU and GPU computing resources, the time overhead of layer-by-layer mapping scheduling, and the worst response time, a sum function of task utilization of hybrid deep neural network task mapping layer scheduling can be obtained. Under constraints such as minimizing response time, the optimal scheme for layer-by-layer allocation of deep neural network tasks is found. The specific implementation process is as follows:

[0062] Step 1: Construct a deep neural network task model

[0063] Based on the classic three-parameter task model and combined with the characteristics of deep neural network tasks, the first step is to symbolically represent the deep neural network tasks. The method described in this invention represents each deep neural network task as τ. i =(C i ,T i D i ,L i ,R i ,S i ), 1≤i≤I, 0 <C i <D i ≤T i C i T represents the worst-case execution time when a single task runs independently, i.e., without external interference from other tasks. i This represents the shortest arrival time, or cycle time, for a periodic task. L i This indicates the number of layers in the deep neural network model used in each task. R i This represents the readiness time of a periodic task, specifically the minimum value R between two consecutive tasks. i+1 -R i ≥T i S i This indicates the start time of each task.

[0064] Furthermore, hybrid deep neural network tasks are divided into two categories: real-time tasks and optimal response tasks. If the deep neural network task τ i If it is a real-time task, then the task is subject to a deadline, i.e., it follows the D... i ≤T iFurthermore, once a task is accepted into the system, its deadline should always be met. If the deep neural network task τ i If it is a best-response task, then some of the tasks at certain levels within this task might miss their deadlines. When the best-response task τ... i When there is no specific deadline requirement, the deadline can be D. i Set to ∞. Furthermore, hybrid deep neural network tasks follow these rules when executed:

[0065] 1) Real-time tasks are strictly prioritized over best-response tasks;

[0066] 2) Real-time tasks can preempt the best-response task on the same CPU or GPU cluster at any time;

[0067] 3) The preemption condition is that the previous task is the best-response task and its response time is greater than T. i Then the real-time task can preempt the best-responding task, so that the running real-time task D... i Less than or equal to T i .

[0068] Step 2: Construct the deep neural network task layer task model

[0069] Due to the characteristics of deep neural networks, tasks within each layer of a deep neural network are not preemptible; they must be executed by the previous layer before the next layer can execute.

[0070] Each layer of a deep neural network performs a task, i.e., task τ. i The j-th layer, τ i,j ∈V i Construct a quadruple to represent the features in This represents the worst-case execution time when running on a CPU cluster and its quantization model. Represents task τ i,j The maximum time from GPU core FP32 execution to CPU core QUnit8 quantization input, and task τ i,j The maximum sum of quantized times from GPU kernel FP32 execution to CPU kernel QUnit8. This represents the worst-case execution time when running on a GPU cluster and its quantization model. Indicates the task of copying input τ i,j The maximum time from host (CPU) memory to device (GPU) memory, and the copy output task τ i,j The sum of the maximum time from the device (GPU) back to the host memory (CPU).

[0071] Step 3: Construct a deep neural network task allocation and scheduling mechanism based on layers

[0072] The set of mappings for deep neural network tasks is denoted as ρ, and the deep neural network tasks mapped on the CPU cluster are denoted as ρ(τ). i,j ) = 0, and the deep neural network task mapped on the GPU cluster is ρ(τ) i,j )=1,ρ={ρ(τ i,j )}and τ i ∈τ. That is, for a set of n deep neural network tasks τ={τ1,τ2,…,τ…} n}, then there are n corresponding allocations:

[0073]

[0074] The total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms is C. i :

[0075]

[0076] use Represents task τ i Mapped across k consecutive layers of the CPU platform, Represents task τ i Mapped across k consecutive layers on a GPU platform. Deep neural network task τ i The overhead on a CPU cluster is the overhead of the first and last layers of a deep neural network task:

[0077]

[0078] Deep neural network task τ i The overhead on a GPU cluster is the overhead of the first and last layers of a deep neural network task:

[0079]

[0080] The deep neural network task is mapped at each layer, including mapping to the CPU and mapping to the GPU. Let ρ represent the mapping; then the mapping of the j-th layer of deep neural network task i can be represented as ρ(τ). i,j The value mapped to the GPU is 1, and the value mapped to the CPU is 0.

[0081]

[0082] Deep neural network task τ i The total overhead on a CPU and GPU heterogeneous system is the sum of the overhead allocated to the CPU and the overhead allocated to the GPU:

[0083]

[0084] Deep neural network task τ i The worst response time after mapping is:

[0085] w i =C i +S i,j=layerlast +B i,j=layerlast -R i

[0086] The utilization u of a single deep neural network task is:

[0087]

[0088] Step 4: Design the optimization function for layer-by-layer assignment of deep neural network tasks

[0089] Based on the following optimization equations and constraints, the mapping scheduling scheme that minimizes the total utilization of tasks under deep neural network task mapping scheduling is calculated:

[0090]

[0091] The sum of the utilization rates of all deep neural network tasks, U, is given by (where I is the total number of deep neural network tasks). (·) This indicates that deep neural network tasks are hybrid tasks.

[0092] St.w i ≤T i (1≤i≤I,1≤j≤L i ,0 <C i <D i ≤T i (Schedulability Basic Conditions)

[0093] S i >R i (Task start time is greater than ready time)

[0094] S i,j ≥S i-1 +C i-1 (The start time of each level of the task is greater than or equal to the completion time of the previous task)

[0095] C i +S i,j=layerlast +B i,j=layerlast ≤R i +D i (Task completion time is less than or equal to the latest deadline)

[0096] A real-time system has only one CPU and one GPU device, and only one task can run on the CPU and GPU at any given time, satisfying the following resource constraints, where hp represents the task execution timeout:

[0097]

[0098]

[0099] By solving the layer allocation group of deep neural network tasks through optimization methods, different layer tasks are executed on different GPUs and CPUs according to the layer task allocation in the embedded real-time system, making full use of heterogeneous GPU and CPU computing resources and improving the system's scheduling performance.

[0100] Example

[0101] The total number of hybrid deep neural network tasks was set to [2, 3, 4, 5, 6, 7, 8, 9, 10, 11], and the task set was randomly generated. Heterogeneous computing resources included CPU and GPU computing resources, each with a quantity of 1. The experiment compared this layer-by-layer scheduling method for hybrid deep neural network tasks with the earliest deadline first algorithm and an algorithm for scheduling tasks with fixed priorities. The layer-by-layer scheduling method for hybrid deep neural network tasks was evaluated based on three performance metrics: total task utilization, task schedulability, and task execution time.

[0102] Figure 3 The overall task utilization of the scheduling algorithms was compared under different task sets. As the number of tasks increased, the overall utilization of the three algorithms showed an upward trend, and the overall utilization trend of the hybrid deep neural network task layer scheduling method was smaller than that of the other two algorithms, indicating that this method has better performance in terms of resource consumption in task scheduling. Figure 4 The schedulability of tasks was compared under different task volumes. As the number of tasks increased, the schedulability of all three algorithms decreased to varying degrees. Overall, the layer-by-layer scheduling method for hybrid deep neural network tasks outperformed the other two algorithms in terms of schedulability. Although this method exhibited a slow, fluctuating decline, its schedulability remained stable at around 70%-90%, demonstrating good task schedulability. Figure 5 The worst-case response time of task scheduling was compared with the number of times different tasks were executed. As the number of scheduled tasks increased, the worst-case response time of the three algorithms generally increased, but the layer-by-layer scheduling method for hybrid deep neural network tasks was generally lower than the other two methods. Since the worst-case response time affects the response speed of deep neural network tasks in embedded real-time systems, this method outperforms the other two algorithms in terms of response time for multi-task scheduling.

[0103] Figure 6 This paper presents the trend of runtime variation of a layer-by-layer scheduling method for hybrid deep neural network tasks with the number of tasks. The runtime of this method generally exhibits a fluctuating upward trend, with fluctuations mainly influenced by differences in task overhead and execution time; however, the overall runtime is reasonable and fast. Finally, Figure 7 The CPU and GPU resource utilization rates for task scheduling using this method are presented. Overall, GPU utilization is higher than CPU utilization. However, as the number of tasks increases, the two lines tend to converge, indicating that the resource allocation and utilization of CPU and GPU are similar. This demonstrates that the heterogeneous resource utilization of this method is balanced and will not result in extreme system resource consumption.

Claims

1. A layer-by-layer scheduling method for hybrid deep neural network tasks in an embedded real-time system, characterized in that, This method divides hybrid deep neural network tasks into real-time tasks and optimal response tasks. By modeling deep neural network tasks and neural network layer tasks, it uses optimization methods to consider the total execution time of tasks on heterogeneous CPU and GPU computing resources, the time overhead of layer-by-layer mapping scheduling, and the worst response time. It obtains a sum function of task utilization of hybrid deep neural network task mapping layer scheduling. Under the constraint of minimizing response time, it finds the optimal scheme for layer-by-layer allocation of deep neural network tasks to achieve balanced utilization of heterogeneous CPU and GPU computing resources. (1) Construct a deep neural network task model for task scheduling and execution in embedded real-time systems. The neural network task is generated by... This indicates the worst-case execution time, including the execution time of a single task. Operating cycle ,expiration date Task Level Readiness time of periodic tasks and start time ; (2) Construct a deep neural network task layer model, where the layer tasks are... This includes the worst-case execution time when running on CPU and GPU clusters and their quantization models. and And the corresponding maximum time for quantization input and quantization output. , sum; (3) Construct a layer-by-layer scheduling mechanism for deep neural network tasks to solve the optimal solution for scheduling and executing hybrid deep neural network tasks on CPU or GPU platforms at each layer. The optimal solution includes designing allocation mapping groups, calculating the total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms, the overhead of deep neural network tasks on CPU and GPU clusters, the total overhead on CPU and GPU heterogeneous systems, the worst response time of deep neural network tasks, and the utilization rate of individual tasks. (4) Construct an optimization function for the layer-by-layer allocation of deep neural network tasks, including the objective equation for mapping deep neural network tasks to heterogeneous CPU and GPU resources, and set basic schedulability conditions, task start time constraints, task completion time constraints, and resource constraints.

2. The layer-by-layer scheduling method for hybrid deep neural network tasks in an embedded real-time system according to claim 1, characterized in that, The deep neural network task described in step (1) includes real-time tasks and optimal response tasks. If it is a real-time task, then the task is subject to a deadline, i.e., it follows a set timeframe. Furthermore, once a task is accepted into the system, the deadline should always be met; if it is a deep neural network task... If it's a best-response task, then some of the tasks within this task might miss their deadlines during execution. When there is no specific deadline requirement, the deadline can be... Set as ; In embedded real-time systems, real-time tasks and optimal response tasks follow these rules: 1) Real-time tasks take precedence over best-response tasks; 2) Real-time tasks can preempt the best-response task on the same CPU or GPU cluster at any time; 3) The preemption condition is that if the previous task is the best-responding task and its response time is greater than 100 seconds. Then, the real-time task can preempt the best-responding task, making the running real-time task... Less than or equal to .

3. The layer-by-layer scheduling method for hybrid deep neural network tasks in an embedded real-time system according to claim 1, characterized in that, Step (3) is to design layer-by-layer allocation scheduling based on the characteristics of neural network task structure; The layer-by-layer allocation of deep neural networks is to allocate execution on GPUs or CPUs, and this allocation mapping is represented as follows: And the tasks mapped on the CPU cluster are represented as The task mapped on the GPU cluster is represented as ; The total execution time of deep neural network tasks on heterogeneous CPU and GPU platforms is expressed as follows: = Indicates task Mapped across k consecutive layers of the CPU platform, Indicates task Mapped across k consecutive layers on the GPU platform; Deep Neural Network Tasks The overhead on a CPU cluster is the overhead of the first and last layers of a deep neural network task, expressed as: Deep Neural Network Tasks The overhead on a GPU cluster represents the overhead of the first and last layers of a deep neural network task, as shown below: Deep Neural Network Tasks The total overhead on a CPU and GPU heterogeneous system is represented as follows: Deep Neural Network Tasks The worst-case response time after mapping is expressed as follows: Utilization of a single deep neural network task It is expressed as follows: in, This indicates the shortest arrival time, or cycle time, for a periodic task.

4. The layer-by-layer scheduling method for hybrid deep neural network tasks in an embedded real-time system according to claim 1, characterized in that, The optimization function for layer-by-layer scheduling in step (4) is the scheduling scheme that minimizes the total utilization of tasks, and its mathematical expression is as follows: Min The optimization function follows these constraints: The basic condition for schedulability is expressed as follows: ( , , ); The condition that the task start time is greater than the ready time is expressed as follows: ; The condition that the start time of each task level is greater than or equal to the completion time of the previous task is expressed as follows: ; The condition that the task completion time is less than or equal to the latest deadline is expressed as follows: ; The resource constraint that only one task can run on the CPU and GPU at a time is expressed as: Finally, the allocation group of deep neural network tasks by layer is obtained by optimization method. In the embedded real-time system, different layer tasks are executed on different GPUs according to the layer task allocation.