Task scheduling apparatus, method, system, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-08-14
AI Technical Summary
然而,目前的任务调度方式,无法合理分配各硬件包括的计算单元的资源,可能存在硬件的部分计算单元处于空闲状态而其他计算单元过载的情况,硬件资源使用率较低,容易导致任务执行周期的延长,任务执行效率较低
[0010]本公开实施例中,针对待执行任务,可以在多个硬件中确定可执行该待执行任务的至少一个目标硬件,在待执行任务满足预设下发条件的情况下,可以获取每个目标硬件包括的各计算单元的运行状态信息,之后,结合待执行任务包括的各子任务的环境依赖信息以及计算单元的运行状态信息,确定执行每个子任务的目标计算单元,进而将各子任务下发至对应的目标计算单元中。其中,结合子任务的环境依赖信息和各计算单元的运行状态信息确定执行子任务的目标计算单元,一方面,可以确保目标计算单元具有子任务执行所依赖的运行环境,可以减少任务执行过程中因运行环境需求而造成的计算单元切换成本,有助于提高任务处理效率;另一方面,结合各计算单元的运行状态信息确定执行各子任务的目标计算单元,可以合理地分配至少一个目标硬件包括的各计算单元的计算资源,避免存在部分计算单元空闲、部分计算单元过载等资源分配不合理的情况,可以有效提高硬件中各计算单元的资源利用率,有助于提高任务处理效率。
Smart Images

Figure CN122570127A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to computer technology, and in particular to a task scheduling apparatus, method, system, electronic device, and storage medium. Background Technology
[0002] For a task set consisting of a number of tasks to be executed, such as a toolchain verification task set, which includes multiple verification tasks such as model compilation verification, model performance verification, model accuracy verification, and toolchain compatibility verification, the multiple tasks to be executed in the task set can be executed by multiple hardware devices.
[0003] In related technologies, when scheduling multiple tasks across multiple hardware devices, the tasks are typically allocated to idle hardware in a fixed priority order. However, current task scheduling methods cannot reasonably allocate the resources of the computing units within each hardware device. This can result in situations where some computing units are idle while others are overloaded, leading to low hardware resource utilization, prolonged task execution cycles, and low task execution efficiency. Summary of the Invention
[0004] To address the aforementioned technical problems, this disclosure is proposed. Embodiments of this disclosure provide a task scheduling apparatus, method, system, electronic device, and storage medium.
[0005] A first aspect of this disclosure provides a task scheduling apparatus, including a processor configured to: Identify at least one target hardware among multiple hardware components capable of performing the task to be executed; In response to the task to be executed meeting the preset delivery conditions, the running status information of each computing unit in each of the target hardware is obtained; Determine the environment dependency information of each subtask in the task to be executed, wherein the environment dependency information is used to identify the type of computing unit that can execute the subtask; Based on the environment dependency information of each subtask and the running status information of each computing unit, the target computing unit corresponding to each subtask is determined, and each subtask is sent to the target computing unit corresponding to each subtask so that the target computing unit executes the subtask.
[0006] A second aspect of this disclosure provides a task scheduling method, including: Identify at least one target hardware device among a plurality of hardware devices capable of performing the task to be performed; In response to the task to be executed meeting the preset delivery conditions, the running status information of each computing unit in each of the target hardware is obtained; Determine the environment dependency information of each subtask in the task to be executed, wherein the environment dependency information is used to identify the type of computing unit that can execute the subtask; Based on the environment dependency information of each subtask and the running status information of each computing unit, the target computing unit corresponding to each subtask is determined, and each subtask is sent to the target computing unit corresponding to each subtask so that the target computing unit executes the subtask.
[0007] A third aspect of this disclosure provides a task scheduling system, including a task scheduling device according to any of the above embodiments and a plurality of computing units, wherein the computing units are used to execute tasks to be executed.
[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the task scheduling method of any of the above embodiments.
[0009] A fifth aspect of this disclosure provides an electronic device, the electronic device comprising: Memory is used to store processor-executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method of any of the above embodiments.
[0010] In this embodiment of the disclosure, for a task to be executed, at least one target hardware capable of executing the task can be determined from multiple hardware components. When the task to be executed meets preset distribution conditions, the running status information of each computing unit included in each target hardware component can be obtained. Then, combining the environment dependency information of each subtask included in the task to be executed with the running status information of the computing units, the target computing unit for executing each subtask is determined, and each subtask is then distributed to the corresponding target computing unit. Specifically, determining the target computing unit for executing a subtask by combining the environment dependency information of the subtask and the running status information of each computing unit ensures, on the one hand, that the target computing unit has the running environment required for the subtask execution, reducing the cost of switching computing units due to running environment requirements during task execution and helping to improve task processing efficiency. On the other hand, determining the target computing unit for executing each subtask by combining the running status information of each computing unit allows for the reasonable allocation of computing resources among the computing units included in at least one target hardware component, avoiding situations where some computing units are idle and others are overloaded, thus effectively improving the resource utilization rate of each computing unit in the hardware and contributing to improved task processing efficiency.
[0011] Furthermore, for any task to be executed, at least one target hardware capable of executing the task can be identified from multiple hardware components. Within each computing unit of this target hardware, the target computing unit for executing each subtask of the task can be determined. This method allows for the rational allocation of the subtasks of the task across the target computing units of the at least one target hardware component. When scheduling multiple tasks to be executed, each task can be rationally allocated in a multi-hardware environment, effectively utilizing the computing resources of each hardware component, improving resource utilization across multiple hardware components, and thus contributing to improved task processing efficiency for multiple tasks. Attached Figure Description
[0012] Figure 1 This is a schematic diagram of the structure of a task scheduling system provided in an exemplary embodiment of the present disclosure.
[0013] Figure 2 This is an interactive schematic diagram of the interaction between a task scheduling system and a monitoring device provided in an exemplary embodiment of this disclosure.
[0014] Figure 3 This is a flowchart illustrating the process of configuring a task scheduling apparatus with a task scheduling method according to an exemplary embodiment of this disclosure.
[0015] Figure 4 This is a flowchart illustrating the process of a task scheduling apparatus configured to execute a target computing unit that determines a target task, as provided in an exemplary embodiment of this disclosure.
[0016] Figure 5 This is a schematic diagram illustrating the process of configuring a task scheduling apparatus to execute merged subtasks, as provided in an exemplary embodiment of this disclosure.
[0017] Figure 6 This is a schematic diagram illustrating the process of configuring a task scheduling device to execute split subtasks, as provided in an exemplary embodiment of this disclosure.
[0018] Figure 7 This is a flowchart illustrating the process of issuing tasks to be executed, provided in an exemplary embodiment of this disclosure.
[0019] Figure 8 This is a schematic diagram illustrating the process of a task scheduling device provided in an exemplary embodiment of the present disclosure being configured to determine that a task to be executed meets preset distribution conditions.
[0020] Figure 9 This is an interactive schematic diagram of the interaction between a task scheduling system and a monitoring device provided in another exemplary embodiment of this disclosure.
[0021] Figure 10 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0022] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0023] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0024] Application Overview In some task scheduling scenarios, multiple tasks need to be scheduled to multiple hardware devices for execution. For example, a toolchain verification task set may include multiple verification tasks such as model compilation verification, model performance verification, model accuracy verification, and toolchain compatibility verification. These multiple verification tasks need to be executed by multiple hardware devices.
[0025] In related technologies, a priority-based task scheduling method can be used, which sets task priorities for multiple tasks to be executed and schedules them in the order indicated by the task priorities. However, this method cannot be combined with the allocation of computing resources in the computing units of the hardware, resulting in low hardware resource utilization.
[0026] Alternatively, an independent task queue can be set up for each hardware device, and tasks can be distributed to each hardware device based on its task queue. However, this approach cannot perform global scheduling across multiple hardware devices, making it difficult to balance the load of multiple hardware devices. It is easy for some hardware devices to have excessively high computing units while others are idle, resulting in low hardware resource utilization.
[0027] In other words, the methods used in these technologies cannot reasonably allocate the resources of multiple hardware components, resulting in low hardware resource utilization, which can easily lead to longer task execution cycles and lower task execution efficiency.
[0028] Exemplary System This disclosure can be applied to scenarios involving task scheduling in a multi-hardware environment. Each piece of hardware includes multiple computing units. For example, the hardware can be a circuit development board, chip, electronic device, etc., integrating multiple computing units. Different hardware may have different hardware architectures (e.g., different types or numbers of computing units) or software environments (e.g., the underlying system software).
[0029] A piece of hardware can include multiple different types of computing units, each with different computing capabilities, architectures, and characteristics. For example, a computing unit can be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural Processing Unit (NPU), a Tensor Processing Unit (TPU), a Digital Signal Processor (DSP), a Field-Programmable Gate Array (FPGA), a Graphics Display Controller (GDC), and so on. For instance, hardware can be a circuit development board integrating multiple computing units from a CPU, GPU, NPU, TPU, DSP, FPGA, or GDC; a chip including multiple computing units; or an electronic device including multiple computing units.
[0030] Figure 1 A schematic diagram of the structure of a task scheduling system provided for disclosing an exemplary embodiment.
[0031] like Figure 1 As shown, the task scheduling system includes a task scheduling device 110 and multiple computing units 120, wherein the multiple computing units 120 may include different computing units in multiple hardware components. Figure 1 As shown, the multiple computing units 120 may include computing units included in each of hardware 1, hardware 2, and hardware 3. For example, hardware 1, hardware 2, and hardware 3 may be different circuit development boards integrated from different computing units. The computing units of hardware 1 may include CPU, GPU, and NPU; the computing units of hardware 2 may include NPU and TPU; and the computing units of hardware 3 may include CPU and DSP.
[0032] The task scheduling device 110 includes one or more processors. These processors can be any processor with task scheduling capabilities, such as a CPU or a microcontroller unit (MCU), and can be used to schedule tasks to be executed. In this embodiment, the processors in the task scheduling device 110, for any task to be executed in the task set, can determine the target computing unit for executing each subtask of the task to be executed from among multiple computing units included in multiple hardware components, so as to distribute each subtask to the corresponding target computing unit.
[0033] In one possible implementation, for any task to be executed, the processor can determine one or more target hardware devices among multiple hardware devices that can execute the task. When issuing the task to be executed, the processor can determine the target computing unit for executing each sub-type based on the environment dependency information of each subtask included in the task to be executed and the running status information of each computing unit included in each target hardware device, so as to issue each subtask to the corresponding target computing unit and complete the issuance of the task to be executed.
[0034] The operational status information of each computing unit can be obtained through real-time monitoring of each computing unit by the task scheduling device 110. Alternatively, as... Figure 2 As shown, each computing unit can also be monitored and acquired in real time by an external monitoring device 130 independent of the task scheduling device 110. Alternatively, each hardware unit can send its own computing unit's operating status information to the monitoring device 130 in real time or at preset time intervals. The task scheduling device 110 can then obtain the operating status information of each computing unit from the monitoring module 130. This embodiment of the present disclosure does not limit this aspect.
[0035] Based on the embodiments of this disclosure, tasks to be executed can be reasonably allocated in a multi-hardware environment, the computing resources of computing units in each hardware can be effectively utilized, the resource utilization of multiple hardware can be improved, and thus the task processing efficiency of tasks to be executed can be improved.
[0036] Exemplary device This disclosure provides a task scheduling apparatus, which includes one or more processors. For example... Figure 3 As shown, one or more processors can read executable instructions from memory used to store executable instructions and be configured to execute the executable instructions to perform the functions of steps S210-S240 as follows: S210, identify at least one target hardware among a plurality of hardware that can perform the task to be performed.
[0037] The task to be executed is the computational task to be executed by the hardware. For example, it can be a toolchain verification task (such as model compilation verification task, model performance verification task, model accuracy verification task, toolchain compatibility verification task, toolchain stability verification task, etc.), or it can be a model inference task, natural language processing task, etc.
[0038] In this embodiment of the disclosure, different hardware has different hardware architectures or software environments, and provides different task execution environments. Different types of tasks depend on different execution environments; therefore, different hardware can execute different types of tasks. After receiving a task to be executed, one or more target hardware devices can be determined from multiple hardware devices to execute the task. The target hardware has the execution environment required for the task to be executed.
[0039] For a task to be executed, the hardware types that support its execution can be pre-configured. The hardware types supporting the task can be determined based on the task's environment dependency information. This environment dependency information indicates the runtime environment configuration required for the task's execution, such as the required hardware and / or software configurations. Based on the runtime environment configuration indicated by the task's environment dependency information, the hardware type with that configuration is determined and bound to the task. Upon receiving the task, the hardware type bound to it can be retrieved. Based on this retrieved hardware type, one or more hardware devices corresponding to that type are selected from multiple hardware options as the target hardware to support the execution of the task.
[0040] For example, if the environment dependency information of the task to be executed indicates that the hardware configuration required for the task to be executed includes a CPU and an NPU, and the software configuration requirement is to be configured with toolchain version A, and the hardware belonging to hardware type A includes computing units CPU and NPU and is configured with toolchain version A, then the hardware type that supports the execution of the task to be executed can be hardware type A, and one or more hardware belonging to hardware type A can be identified as the target hardware that supports the execution of the task to be executed.
[0041] S220, in response to the task to be executed meeting the preset distribution conditions, obtains the running status information of each computing unit in each target hardware.
[0042] The preset delivery conditions are used to determine whether it is currently permissible to deliver tasks to be executed. If the tasks to be executed meet the preset delivery conditions, the delivery process for those tasks can be initiated. For example, if there are no other tasks to be executed that have not yet been delivered to the target hardware, the preset delivery conditions are met; or, if the priority of the task currently being executed on the target hardware is lower than the priority of the task to be executed, the preset delivery conditions are met.
[0043] When assigning tasks to be executed, the operating status information of each computing unit included in each target hardware component can be obtained first. The operating status information of the computing units characterizes their operational load. This information can be categorized into idle and occupied states. An idle state indicates that the computing unit can currently execute tasks, while an occupied state indicates that the computing unit is currently occupied and cannot execute other tasks.
[0044] Alternatively, the operational status information may include the current cache space utilization rate and task processing capability metrics of the computing unit. Cache space utilization rate indicates the extent to which the computing unit's cache space is occupied by valid data. Task processing capability metrics characterize the real-time task processing performance of the computing unit and may include at least one of the following: number of instructions processed per cycle, instruction throughput, and task completion rate. Based on the operational status information of the computing unit, including cache space utilization rate and task processing capability metrics, the current idle level of the computing unit can be determined.
[0045] Specifically, when one of the multiple hardware devices supports running the task to be executed, the running status information of the multiple computing units included in that target hardware can be obtained. When multiple hardware devices support running the task to be executed, the running status information of the multiple computing units included in each of the multiple target hardware devices can be obtained.
[0046] S230, determine the environment dependency information of each subtask in the task to be executed. The environment dependency information is used to identify the computing unit type of the executable subtask.
[0047] The task to be executed can be pre-divided into multiple subtasks. Executing the task can include multiple stages. Based on the task execution stage and / or the runtime environment configuration requirements corresponding to different stages, the task can be divided into multiple subtasks, with different subtasks corresponding to different stages. Each subtask has environment dependency information, which identifies the type of computing unit for the executable subtask. For example, if the subtask's environment dependency information includes CPU, it means that the subtask needs to be executed by the CPU; if the subtask's environment dependency information includes NPU, it means that the subtask needs to be executed by the NPU.
[0048] Understandably, the environment dependency information of a subtask can include one or more computing unit types. Including one computing unit type indicates that the subtask must be executed by that computing unit type. Including multiple computing unit types indicates that the subtask can be executed by any of the multiple computing unit types. For example, if the subtask's environment dependency information includes CPU and NPU, it means that the subtask can be executed by the CPU, the NPU, or both.
[0049] S240: Based on the environment dependency information of each subtask and the running status information of each computing unit, determine the target computing unit corresponding to each subtask, and send each subtask to the target computing unit corresponding to each subtask so that the target computing unit executes the subtask.
[0050] In one possible implementation, the target computing unit corresponding to each subtask can be determined separately. For any subtask, based on the environment dependency information of the subtask and the running status information of each computing unit, a target computing unit whose running environment supports running the subtask and whose running status information indicates that it can currently process the subtask can be determined from among the multiple computing units included in the target hardware. For example, based on the environment dependency information of the subtask, candidate computing units whose running environment supports running the subtask can be determined from among the multiple computing units included in the target hardware. Then, based on the running status information of each computing unit, the target computing unit that can currently process the subtask can be determined from among the candidate computing units.
[0051] When multiple target hardware units exist that can support the execution of the task to be performed, the target computing unit corresponding to the subtask can be determined from the multiple computing units included in the multiple target hardware units. The target computing units corresponding to different subtasks can belong to the same target hardware or to different target hardware units.
[0052] When there is a target hardware that supports running the task to be executed, the target computing unit corresponding to the subtask can be determined from the multiple computing units included in the target hardware. In this case, the target computing units corresponding to the different subtasks are all belonging to the target hardware.
[0053] In another possible implementation, multiple subtasks can be merged or split based on the environmental dependency information and computational requirements of each subtask to obtain multiple target tasks. Then, by combining the environmental dependency information of each subtask and the running status information of each computing unit, the target computing units of the multiple target tasks can be determined, and the multiple target tasks can be distributed to the corresponding target computing units, thereby completing the distribution of multiple subtasks.
[0054] In this embodiment of the disclosure, for a task to be executed, at least one target hardware capable of executing the task can be determined from multiple hardware components. When the task to be executed meets preset distribution conditions, the running status information of each computing unit included in each target hardware component can be obtained. Then, combining the environment dependency information of each subtask included in the task to be executed with the running status information of the computing units, the target computing unit for executing each subtask is determined, and each subtask is then distributed to the corresponding target computing unit. Specifically, determining the target computing unit for executing a subtask by combining the environment dependency information of the subtask and the running status information of each computing unit ensures, on the one hand, that the target computing unit has the running environment required for the subtask execution, reducing the cost of switching computing units due to running environment requirements during task execution and helping to improve task processing efficiency. On the other hand, determining the target computing unit for executing each subtask by combining the running status information of each computing unit allows for the reasonable allocation of computing resources among the computing units included in at least one target hardware component, avoiding situations where some computing units are idle and others are overloaded, thus effectively improving the resource utilization rate of each computing unit in the hardware and contributing to improved task processing efficiency.
[0055] Furthermore, for any task to be executed, at least one target hardware capable of executing the task can be identified from multiple hardware components. Within each computing unit of this target hardware, the target computing unit for executing each subtask of the task can be determined. This method allows for the rational allocation of the subtasks of the task across the target computing units of the at least one target hardware component. When scheduling multiple tasks to be executed, each task can be rationally allocated in a multi-hardware environment, effectively utilizing the computing resources of each hardware component, improving resource utilization across multiple hardware components, and thus contributing to improved task processing efficiency for multiple tasks.
[0056] In one possible implementation, Figure 3 Based on the embodiments, such as Figure 4 As shown, when the processor determines the target computing unit corresponding to each subtask based on the environment dependency information of each subtask and the running status information of each computing unit, it is further configured to achieve this by executing steps S2410-S2450: S2410, based on the computational requirements and preset thresholds of each subtask, merges or splits each subtask to obtain the target task.
[0057] A target task is a task obtained by merging multiple subtasks, or by splitting a single subtask. A target task obtained by merging multiple subtasks can be assigned to the same computing unit for execution. Multiple target tasks obtained by splitting subtasks can be assigned to different computing units for execution.
[0058] This involves determining whether subtasks can be merged or split based on their computational requirements and preset thresholds. The computational requirements of a subtask indicate the amount of computational resources needed to execute it, i.e., the amount of computational resources required from the computing unit. In one example, the computational requirements of a subtask can be determined based on its computational volume, which is the number of operations required to complete that subtask.
[0059] The preset threshold can be pre-defined by the developers. Alternatively, the preset threshold can be determined based on the computing resources of the computing units. For example, the average computing resources of multiple computing units included in one or more target hardware components can be determined, and the preset threshold can be determined based on the average computing resources of the multiple computing units. The preset threshold can be less than or equal to the average computing resources of the multiple computing units. If the computing requirements of a subtask are less than the preset threshold, it is determined that the subtask can be merged with other subtasks and sent to the same computing unit for processing. If the computing requirements of a subtask are greater than the preset threshold, it is determined that the subtask can be split for processing, so that different computing units can jointly execute the subtask.
[0060] S2420, Based on the environment dependency information of each subtask, determine the environment dependency information of the target task.
[0061] For a target task obtained by merging multiple subtasks, the environment dependency information of the target task can be determined based on the environment dependency information of the merged subtasks. The computing unit type identified by the environment dependency information of the target task supports running the merged subtasks.
[0062] For multiple target tasks obtained by splitting a subtask, the environment dependency information of the split subtask can be used as the environment dependency information of the multiple target tasks obtained by the splitting process.
[0063] S2430, based on the environmental dependency information of the target task, determines multiple candidate computing units that can execute the target task.
[0064] For any given target task, based on the determined environment dependency information of the target task, multiple candidate computing units that can execute the target task can be determined from among the multiple computing units included in one or more target hardware components. Each candidate computing unit can provide the runtime environment requirements for the execution of the target task.
[0065] The computational unit type identified by the environment dependency information of the target task can include one or more types, and the type of each candidate computational unit determined belongs to one or more computational unit types identified by the environment dependency information. For example, when the computational unit type identified by the environment dependency information of the target task is CPU, each CPU included in the multiple computational units can be identified as a candidate computational unit.
[0066] S2440, based on the operating status information of each computing unit, determines the operating status information of each candidate computing unit.
[0067] After identifying multiple candidate computing units, the running status information of each candidate computing unit can be obtained from the running status information of the multiple computing units.
[0068] S2450 determines the target computing unit corresponding to the target task based on the running status information of each candidate computing unit.
[0069] The operational status information of candidate computing units can be used to indicate their current idle level. Based on the idle level of the computing units indicated by the operational status information, the candidate computing units that can currently process the target task can be determined. Based on the candidate computing units that can currently process the target task, the target computing unit can be determined.
[0070] If there is only one candidate computing unit that can process the target task, that candidate computing unit can be designated as the target computing unit. If there are multiple candidate computing units that can process the target task, any one of the multiple candidate computing units can be selected as the target computing unit, or the candidate computing unit with the highest idle level among the multiple candidate computing units can be designated as the target computing unit.
[0071] In this embodiment, multiple subtasks can be split or merged to obtain multiple target tasks, and the target computing unit corresponding to each target task can be determined so that each target task can be distributed to the corresponding target computing unit. Therefore, multiple subtasks can be merged and distributed to the same target computing unit, thereby reducing the frequency of unit switching during the execution of tasks and improving task processing efficiency. Alternatively, a subtask can be split into multiple target tasks and distributed to different target computing units, which can fully utilize the computing resources of each target computing unit and improve resource utilization.
[0072] In one possible implementation, Figure 4 Based on the embodiments, such as Figure 5 As shown, the processor merges the subtasks based on their computational requirements and preset thresholds. When obtaining the target task, it is further configured to execute steps S2411-S2413 to achieve the following: S2411, based on the computational requirements of each subtask and the first preset threshold, determine the target subtask among the multiple subtasks whose computational requirements are less than the first preset threshold.
[0073] To reduce the switching frequency of computing units during the execution of tasks, multiple subtasks can be merged into one target task, which can then be distributed to the same target computing unit.
[0074] In this embodiment, it can be determined whether a subtask can be merged based on its computational requirements and a first preset threshold. The first preset threshold can be determined based on the average computational resources of the multiple computing units included in the target hardware. In one example, the first preset threshold can be less than the average computational resources of the multiple computing units; for example, the first preset threshold can be 50% of the average computational resources.
[0075] The target subtask, whose computational requirement is less than the first preset threshold, is a subtask that can be merged among multiple subtasks.
[0076] S2413, Based on the environment dependency information of each target subtask, merge multiple target subtasks with the same environment dependency information to obtain the target task.
[0077] After identifying multiple target subtasks, they can be merged based on their environmental dependency information. Specifically, multiple target subtasks with identical environmental dependencies can be merged; identical environmental dependencies refer to the same type of computational unit identified by the environmental dependency information.
[0078] Specifically, if the computational unit types marked by the environment dependency information of multiple target subtasks include the same computational unit type, it means that the multiple target subtasks can be executed by computational units of the same computational unit type. Therefore, the environment dependency information of the multiple target subtasks is considered to be the same, and the multiple target subtasks can be merged. For example, if the computational unit types marked by the environment dependency information of multiple target subtasks all include CPU, the multiple target subtasks can be merged to obtain the target task.
[0079] For the merged target task, the environment dependency information of the target task can be determined based on the environment dependency information of the multiple target subtasks obtained by merging. The computational unit type identified by the environment dependency information of the target task can be the same type of computational unit identified by the environment dependency information of multiple target subtasks. Referring to the example above, the computational unit type identified by the environment dependency information of the target task can be a CPU.
[0080] When merging multiple target subtasks with the same environmental dependencies, the computational requirements of the target subtasks can be considered. Based on the computational requirements of the multiple target subtasks, the estimated total computational requirement of the merged target task can be calculated. If the estimated total computational requirement of the merged target task is less than the computational resource amount of the computational unit corresponding to the target computational unit type, then the multiple target subtasks can be merged to obtain the target task. Here, the target computational unit type is the computational unit type jointly identified by the environmental dependencies of the multiple target subtasks.
[0081] If the estimated total computational requirement of the merged target task exceeds the computational resource requirement of the corresponding computing unit of the target computing unit type, multiple target subtasks can be merged in batches to obtain multiple target tasks. The estimated total computational requirement of each merged target task is less than the computational resource requirement of the corresponding computing unit of the target computing unit type. This ensures that the multiple subtasks included in the merged target task can be processed by a single computing unit. After the target task is distributed to the corresponding target computing unit, the target computing unit can execute the multiple subtasks included in the target task in parallel to improve the processing efficiency of multiple subtasks.
[0082] In this embodiment, multiple target subtasks with the same environmental dependency information can be merged to obtain a target task. Thus, multiple target subtasks with the same environmental dependency information can be distributed to the same target computing unit for execution, which can reduce the switching frequency of computing units during task execution and improve task processing efficiency.
[0083] In one possible implementation, Figure 4 Based on the embodiments, such as Figure 6 As shown, the processor splits each subtask based on its computational requirements and preset thresholds. When obtaining the target task, it is further configured to execute steps S2412-S2414 to achieve the following: S2412, based on the computational requirements of each subtask and the second preset threshold, determine the target subtask among multiple subtasks whose computational requirements are greater than the second preset threshold.
[0084] In this embodiment, subtasks exceeding the processing capacity of a single computing unit can be split into smaller parts to ensure the smooth execution of complex tasks. Specifically, the decision to split a subtask can be based on its computational requirements and a second preset threshold. In one example, the second preset threshold is greater than the first preset threshold, and the second preset threshold can be the average computational resource requirement of multiple computing units.
[0085] Based on the computational requirements of each subtask and a second preset threshold, the subtasks with computational requirements greater than the second preset threshold are identified as target subtasks. These target subtasks are the subtasks that need to be split among the multiple subtasks.
[0086] S2414 breaks down each target subtask into multiple target tasks.
[0087] For each target subtask that needs to be split, it can be split based on the computational requirements of the target subtask. The number of splits can be determined according to the computational requirements, so that each target task obtained after splitting can be executed by a single computing unit.
[0088] In one possible implementation, the type of computing unit that supports running the target subtask can be determined by combining the environmental dependency information of the target subtask, and the amount of free resources of multiple computing units belonging to the type of computing unit can be obtained. Based on the amount of free resources of multiple computing units, the target subtask is split into multiple target tasks to ensure that the target task can be executed by a single computing unit that supports running the target subtask.
[0089] Specifically, for the target task obtained from the decomposition, the environmental dependency information of the target task can be determined based on the environmental dependency information of the target subtasks of the target task obtained from the decomposition, so as to subsequently determine the target computing unit of the target task.
[0090] In this embodiment, subtasks that exceed the processing capacity of a single computing unit can be split and processed, allowing multiple computing units to execute the subtasks synchronously. This ensures the sequential execution of complex subtasks and improves the processing efficiency of subtasks.
[0091] In combination with the above Figure 5 , Figure 6 Examples, such as Figure 7 As shown, for multiple subtasks included in the task to be executed, task merging or task splitting can be performed to obtain multiple target tasks. The target tasks obtained by merging or splitting can be added to the task cache pool. For each target task included in the task cache pool, the processor determines the corresponding target computing unit, and then distributes the multiple target tasks included in the task cache pool to multiple computing units included in multiple hardware.
[0092] In one possible scenario, based on the computational requirements of the subtask and a preset threshold, it is determined that the subtask does not need to be merged or split. In this case, the subtask can be identified as a target task and added to the task cache pool, awaiting distribution.
[0093] In one possible implementation, Figure 1 Based on the embodiments, such as Figure 8 As shown, after the processor identifies at least one target hardware among a plurality of hardware devices capable of executing the task to be executed, it is further configured to perform the following steps: S210a, determine the task priority of the task to be executed.
[0094] When distributing multiple tasks to multiple hardware devices, the task priorities of these tasks can be considered. The task priority can be determined based on its task type. Different task types have different priority levels, which indicate the urgency of the task for that type; a higher priority indicates a higher level of urgency.
[0095] For example, task priorities are categorized as high, medium, and low. High-priority tasks have the highest urgency and require rapid response, such as toolchain compatibility verification tasks. Medium-priority tasks have moderate urgency, such as model performance verification and model accuracy verification tasks. Low-priority tasks have low urgency and can be completed gradually when resources are available, such as toolchain stability verification tasks.
[0096] S210b adds the tasks to be executed, which carry task priorities, to a task pool corresponding to at least one target hardware, wherein the multiple tasks to be executed in the task pool are arranged according to task priorities.
[0097] After determining the task priority and the target hardware capable of executing the task, the task with the priority can be added to the corresponding task pool. Different hardware can have their own dedicated task pools, and tasks with priorities can be added to the task pool corresponding to each target hardware.
[0098] Alternatively, for a task pool corresponding to the same type of hardware, where at least one target hardware belongs to the same hardware type, the task to be executed carrying the task priority can be added to the task pool corresponding to the hardware type of at least one target hardware.
[0099] When adding a task to be executed to the corresponding task pool, the task can be added to the corresponding position in the task pool according to the task priority of the task to be executed and the task priority of the tasks already existing in the task pool, so that the multiple tasks to be executed included in the task pool are arranged according to task priority.
[0100] like Figure 8 As shown, when the processor responds to the task to be executed meeting the preset distribution conditions and obtains the running status information of each computing unit in each target hardware, it is further configured to execute the following steps: S2201, in response to the task in the task pool that is ranked before the task to be executed having been sent out, and the preset sending conditions being met, the running status information of each computing unit in each target hardware is obtained.
[0101] For multiple tasks to be executed in the task pool, they can be issued sequentially according to their order. Once a task in the task pool that precedes the task to be executed has been issued, and the task to be executed meets the preset issuance conditions, it can be issued. The running status information of each computing unit in the target computing unit can be obtained.
[0102] In one possible implementation, if the tasks to be executed are added to the task pools of each target hardware, and a task in one task pool that precedes the task to be executed has already been distributed, it is determined that a preset distribution condition is met. The running status information of the computing units included in the target hardware can then be obtained to distribute the subtasks of the task to be executed to multiple computing units of the target hardware. If the subtasks of the task to be executed are successfully distributed to multiple computing units of the target hardware, the task to be executed can be deleted from the task pool corresponding to each target hardware. If the task to be executed is not successfully distributed, it remains in the task pool of each target hardware.
[0103] In another possible implementation, after adding the task to be executed carrying the task priority to the task pool corresponding to the hardware type of at least one target hardware, if the task to be executed meets the preset distribution conditions, the running status information of the computing units included in each of the target hardware can be obtained, and then the subtasks of the task to be executed can be distributed to the computing units of the same target hardware or different target hardware. After the task to be executed is successfully distributed, the task to be executed can be deleted from the task pool.
[0104] In this embodiment, based on the task priority of the tasks to be executed, each task to be executed is sent to the corresponding target hardware, so that the target hardware can prioritize the processing of tasks with higher urgency, which helps to improve the task response efficiency of high-priority tasks.
[0105] In one possible implementation, for high-priority tasks, the processor employs a preemptive scheduling strategy, allowing it to preempt computing units occupied by lower-priority tasks when a high-priority task arrives. Upon receiving a task to be executed, in response to the task's priority being lower than the priority of a currently executing task on the target hardware, the task carrying its priority is added to the task pool corresponding to the target hardware. Specifically, if there is only one target hardware capable of executing the task, and the task's priority is lower than the priority of the currently executing task on that target hardware, the task can be added to that target hardware's task pool to await dispatch. If there are multiple target hardwares capable of executing the task, and the task's priority is lower than the priority of any currently executing task on any of the target hardwares, the task can be added to the corresponding task pool to await dispatch.
[0106] In response to the fact that the priority of the task to be executed is higher than the priority of the currently executing task in the target hardware, the preset distribution conditions are met, the execution of the executing task is interrupted, and the running status information of each computing unit in the target hardware corresponding to the interruption of the executing task is obtained.
[0107] Specifically, if the priority of the task to be executed is higher than the priority of the first task currently being executed by any target hardware, the preset delivery condition is met. Then, the first task currently being executed by the target hardware can be interrupted. The first task can be any task currently being executed by the target hardware with a priority lower than that of the task to be executed. After the first task is interrupted, the running status information of each computing unit in the target hardware corresponding to the interrupted first task can be obtained to deliver the task to be executed to the computing units included in the target hardware.
[0108] If the first task is interrupted, the task status at the time of interruption can be recorded. After the pending tasks are completed, the execution of the first task can be resumed based on the recorded task status.
[0109] In this embodiment, a preemptive scheduling strategy is adopted, which allows high-priority tasks to preempt computing units currently being used by low-priority tasks, so as to respond to high-priority tasks in a timely manner and improve task response efficiency.
[0110] In one possible implementation, an aging mechanism is also introduced, in which the priority of low-priority tasks can be gradually increased when they have not been allocated computing resources for a long time, ensuring that the tasks can be processed.
[0111] In the preemptive scheduling strategy provided in the above embodiments, task interruption may occur. In one possible scenario, a lower-priority second task may be executing while multiple higher-priority tasks arrive consecutively, potentially causing multiple interruptions. In this case, the priority of the interrupted second task can be dynamically adjusted to avoid the impact on the accuracy of task processing caused by multiple interruptions of the second task.
[0112] In response to the second task's interruption count reaching a preset threshold, the task priority of the second task is increased. The second task can be any currently executing task in the target hardware that has been interrupted. The second task and the first task can be the same task or different tasks. Specifically, when the interruption count of a second task reaches the preset threshold, the task priority of the second task can be increased. This can be done incrementally; for example, after reaching the preset threshold, the second task's priority can be increased by one level, and the interruption count can be reset to zero. If the interruption count of the second task reaches the preset threshold again, the task priority of the second task can be increased by another level. Alternatively, if the task priority of the second task is increased, and the interruption count reaches the preset threshold again, the priority of the second task can be increased to the highest priority to prevent multiple interruptions.
[0113] In another possible scenario, low-priority tasks in the task pool may remain in a waiting state for an extended period without being processed. In this embodiment, the task priority of tasks to be executed can be dynamically adjusted based on the waiting time of the tasks in the task pool.
[0114] The waiting time for a task to be executed refers to the time it takes for the task to be assigned after being added to the task pool. This waiting time is positively correlated with the adjusted task priority; that is, the longer the waiting time, the higher the adjusted task priority. In one example, multiple waiting time thresholds can be preset. Each time the waiting time reaches a threshold level, the task priority can be increased by one level, up to the highest priority. For example, a first and a second waiting time threshold can be preset, with the second threshold being higher than the first. When the waiting time reaches the first threshold, the task priority can be increased by one level; when the waiting time reaches the second threshold, the priority can be increased again by one level.
[0115] In this embodiment, the task priority of the task to be executed can be dynamically adjusted according to the waiting time of the task to be executed, so as to avoid the task being in a waiting state for a long time, and to ensure that the task is processed and completed, which helps to improve the task completion rate.
[0116] In one possible implementation, the number of interruptions of the executing tasks and the waiting time of the tasks waiting to be executed in the task pool can be obtained by the processor in the task scheduling device monitoring each task. In another possible implementation, the number of interruptions of the executing tasks and the waiting time of the tasks waiting to be executed in the task pool can be obtained by... Figure 2 The monitoring device 130 in the illustrated embodiment is executed. The monitoring device 130 can monitor the waiting time of each task in the task pool and the number of interruptions of each task, and feed the monitoring information back to the task scheduling device 110 so that the processor of the task scheduling device 110 can dynamically adjust the task priority.
[0117] The adjustment of task priorities can be performed by the aforementioned processor. In other alternative implementations, such as... Figure 9 As shown, task priority adjustment can also be performed by the monitoring device 130. The monitoring device 130 acquires the waiting time of each task in the task pool and dynamically adjusts the priority of the corresponding task based on the waiting time. After acquiring the number of interruptions for each executing task, if the number of interruptions reaches a preset threshold, the priority of the corresponding task in the multi-level task request queue can be dynamically adjusted. The multi-level task request queue includes multiple task queues with different priorities. After dynamically adjusting the task priorities, the adjusted task priorities can be synchronized to the task scheduling device 110 so that the processor in the task scheduling device 110 can perform task scheduling based on the adjusted task priorities.
[0118] In some optional implementations, the monitoring device 110 can also be used to obtain the execution results of the calculation units of each subtask of the task to be executed, so as to summarize the execution results of each subtask to obtain the task execution result of the task to be executed, and can feed back the summarized task execution result to the user through a preset standardized interface, so that the user can quickly obtain the task execution result and improve the efficiency of task management.
[0119] Exemplary methods This disclosure also provides a task scheduling method. The task scheduling method of this disclosure can be executed by the task scheduling device of any embodiment of this disclosure. The task scheduling method includes: determining at least one target hardware among a plurality of hardware devices capable of executing a task to be executed; in response to the task to be executed meeting preset distribution conditions, acquiring the running status information of each computing unit in each target hardware; determining the environment dependency information of each subtask in the task to be executed, the environment dependency information being used to identify the computing unit type of the executable subtask; based on the environment dependency information of each subtask and the running status information of each computing unit, determining the target computing unit corresponding to each subtask, and sending each subtask to the target computing unit corresponding to each subtask, so that the target computing unit executes the subtask.
[0120] In some exemplary embodiments, the target computing unit corresponding to each subtask is determined based on the environmental dependency information of each subtask and the running status information of each computing unit. This includes: merging or splitting each subtask based on the computing requirements and preset thresholds corresponding to each subtask to obtain the target task; determining the environmental dependency information of the target task based on the environmental dependency information of each subtask; determining multiple candidate computing units that can execute the target task based on the environmental dependency information of the target task; determining the running status information of each candidate computing unit based on the running status information of each computing unit; and determining the target computing unit corresponding to the target task based on the running status information of each candidate computing unit.
[0121] In some exemplary embodiments, based on the computational requirements corresponding to each subtask and a preset threshold, the subtasks are merged to obtain the target task, including: based on the computational requirements corresponding to each subtask and a first preset threshold, determining the target subtask whose computational requirements are less than the first preset threshold among multiple subtasks; and based on the environmental dependency information of each target subtask, merging multiple target subtasks with the same environmental dependency information to obtain the target task. Based on the environment dependency information of each subtask, determine the environment dependency information of the target task, including: based on the environment dependency information of multiple target subtasks merged to obtain the target task, determine the environment dependency information of the target task.
[0122] In some exemplary embodiments, each subtask is split based on its computational requirements and a preset threshold to obtain a target task. This includes: determining a target subtask whose computational requirements are greater than the second preset threshold among multiple subtasks based on the computational requirements of each subtask and a second preset threshold; and splitting each target subtask to obtain multiple target tasks. Based on the environment dependency information of each subtask, determine the environment dependency information of the target task, including: determining the environment dependency information of the target task based on the environment dependency information of the target subtasks obtained from the decomposition.
[0123] In some exemplary embodiments, after determining at least one target hardware among a plurality of hardware devices capable of executing the task to be executed, the method further includes: determining the task priority of the task to be executed; adding the task to be executed carrying the task priority to a task pool corresponding to at least one target hardware, wherein the plurality of tasks to be executed in the task pool are arranged according to task priority; In response to the task to be executed meeting the preset delivery conditions, the running status information of each computing unit in each target hardware is obtained, including: in response to the task in the task pool that is arranged before the task to be executed being delivered and the preset delivery conditions being met, the running status information of each computing unit in each target hardware is obtained.
[0124] In some exemplary embodiments, adding a task to be executed carrying a task priority to a task pool corresponding to at least one target hardware includes: in response to the task priority of the task to be executed being lower than the priority of the currently executing task in the target hardware, adding the task to be executed carrying a task priority to the task pool corresponding to the target hardware. In response to the pending task meeting the preset delivery conditions, the system obtains the running status information of each computing unit in each target hardware. It also includes: in response to the pending task having a higher priority than the currently executing task in the target hardware, determining that the preset delivery conditions are met, interrupting the execution of the executing task, and obtaining the running status information of each computing unit in the target hardware after the executing task is interrupted.
[0125] In some exemplary embodiments, the method further includes: increasing the task priority of the task in execution in response to the number of interruptions of the executing task reaching a preset number threshold.
[0126] In some exemplary embodiments, after adding the task to be executed carrying the task priority to the task pool corresponding to at least one target hardware, the method further includes: dynamically adjusting the task priority of the task to be executed based on the waiting time of the task in the task pool, wherein the waiting time is positively correlated with the adjusted task priority.
[0127] The exemplary embodiments of this method correspond to the exemplary apparatus described above in terms of implementation. The corresponding content between the two can be referenced, combined, and cited, and will not be repeated here. The beneficial technical effects corresponding to the exemplary embodiments of this method can be found in the corresponding beneficial technical effects of the exemplary apparatus described above, and will not be repeated here.
[0128] Any task scheduling method provided in this disclosure can also be executed by any electronic device with data processing capabilities, including but not limited to: terminal devices or servers. Alternatively, any task scheduling method provided in this disclosure can be executed by a processor, such as by a processor calling and executing corresponding instructions stored in memory to implement any task scheduling method mentioned in this disclosure. Similarities will not be repeated.
[0129] Exemplary electronic devices Figure 10 A structural diagram of an electronic device provided in an embodiment of this disclosure includes at least one processor 10 and a memory 20.
[0130] The processor 10 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0131] The memory 20 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 10 may execute one or more computer program instructions to implement the trajectory generation methods and / or other desired functions of the various embodiments of this disclosure described above.
[0132] In one example, the electronic device may also include an input device 30 and an output device 40, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0133] The input device 30 may also include, for example, a keyboard, a mouse, etc.
[0134] The output device 40 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0135] Of course, for the sake of simplicity, Figure 10 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0136] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the task scheduling methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0137] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0138] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the task scheduling methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0139] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0140] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0141] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. A task scheduling device, comprising a processor, the processor being configured to: Identify at least one target hardware among multiple hardware components capable of performing the task to be executed; In response to the task to be executed meeting the preset delivery conditions, the running status information of each computing unit in each of the target hardware is obtained; Determine the environment dependency information of each subtask in the task to be executed, wherein the environment dependency information is used to identify the type of computing unit that can execute the subtask; Based on the environment dependency information of each subtask and the running status information of each computing unit, the target computing unit corresponding to each subtask is determined, and each subtask is sent to the target computing unit corresponding to each subtask so that the target computing unit executes the subtask.
2. The apparatus according to claim 1, wherein, The processor is further configured to: Based on the computational requirements and preset thresholds of each subtask, the subtasks are merged or split to obtain the target task. Based on the environment dependency information of each subtask, determine the environment dependency information of the target task; Based on the environmental dependency information of the target task, multiple candidate computing units that can execute the target task are identified; Based on the operating status information of each computing unit, the operating status information of each candidate computing unit is determined; Based on the running status information of each candidate computing unit, the target computing unit corresponding to the target task is determined.
3. The apparatus according to claim 2, wherein, The processor is further configured to: Based on the computational requirements of each subtask and a first preset threshold, a target subtask with a computational requirement less than the first preset threshold is determined among the multiple subtasks. Based on the environmental dependency information of each target subtask, multiple target subtasks with the same environmental dependency information are merged to obtain the target task; The processor is further configured to: Based on the merged environmental dependency information of multiple target subtasks of the target task, the environmental dependency information of the target task is determined.
4. The apparatus according to claim 2, wherein, The processor is further configured to: Based on the computational requirements corresponding to each subtask and a second preset threshold, a target subtask with a computational requirement greater than the second preset threshold is determined among the multiple subtasks. Each of the target subtasks is broken down to obtain multiple target tasks; Determining the environment dependency information of the target task based on the environment dependency information of each of the sub-tasks includes: Based on the environmental dependency information of the target subtasks obtained from the decomposition, the environmental dependency information of the target task is determined.
5. The apparatus according to any one of claims 1 to 4, wherein, After determining at least one target hardware among a plurality of hardware devices capable of executing the task to be executed, the processor is further configured to: Determine the task priority of the task to be executed; The task to be executed, carrying the task priority, is added to the task pool corresponding to the at least one target hardware, wherein the multiple tasks to be executed in the task pool are arranged according to task priority; The processor is further configured to: In response to the completion of the task in the task pool that is arranged before the task to be executed, and the determination that the preset delivery condition is met, the running status information of each computing unit in each target hardware is obtained.
6. The apparatus according to claim 5, wherein, The processor is further configured to: In response to the fact that the priority of the task to be executed is lower than the priority of the currently executing task in the target hardware, the task to be executed carrying the task priority is added to the task pool corresponding to the target hardware; The processor is further configured to: In response to the fact that the priority of the task to be executed is higher than the priority of the currently executing task in the target hardware, it is determined that the preset delivery condition is met, the execution of the executing task is interrupted, and the running status information of each computing unit in the target hardware corresponding to the interruption of the executing task is obtained.
7. The apparatus according to claim 5, wherein, The processor is also configured to: In response to the number of interruptions of an executing task reaching a preset threshold, the task priority of the executing task is increased.
8. The apparatus according to claim 5, wherein, After adding the task to be executed carrying the task priority to the task pool corresponding to the at least one target hardware, the processor is further configured to: Based on the waiting time of the task to be executed in the task pool, the task priority of the task to be executed is dynamically adjusted, wherein the waiting time is positively correlated with the adjusted task priority.
9. A task scheduling method, comprising: Identify at least one target hardware device among a plurality of hardware devices capable of performing the task to be performed; In response to the task to be executed meeting the preset delivery conditions, the running status information of each computing unit in each of the target hardware is obtained; Determine the environment dependency information of each subtask in the task to be executed, wherein the environment dependency information is used to identify the type of computing unit that can execute the subtask; Based on the environment dependency information of each subtask and the running status information of each computing unit, the target computing unit corresponding to each subtask is determined, and each subtask is sent to the target computing unit corresponding to each subtask so that the target computing unit executes the subtask.
10. A task scheduling system, comprising: The task scheduling device and multiple computing units as described in any one of claims 1 to 8; The computing unit is used to execute the task to be executed.
11. A computer-readable storage medium storing a computer program, which, when executed, implements the task scheduling method of claim 9.
12. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the task scheduling method of claim 9.