Task scheduling system, method, device, equipment and medium
By introducing modules such as instruction prefetching components and scheduling components in the task scheduling system, automatic cleaning and resource recovery during process switching and task stoppage in the chip is achieved, and the problem of low scheduling efficiency in the existing technology is solved, ensuring that The chip is running normally.
Patent Information
- Application Number
- CN202410893414.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-11-05
AI Technical Summary
In the prior art, the task scheduling system cannot clean up the calculation tasks in the scheduling process when the process running in the chip is switched from the current running process to the new process, and cannot clean up the relevant calculation tasks when the current running process is forced to stop. This results in low scheduling efficiency and seriously affects the normal operation of the chip.
A task scheduling system is designed, including instruction prefetching components, scheduling components, dependent task processing components, synchronous task transmission components, hardware scheduler, resource management components and scheduling execution components. Through the coordinated work of these components, the treatment of switching or Automatic cleaning and resource recovery of calculation instructions for the pending process.
It improves the efficiency of task scheduling, ensures the normal operation of the chip during process switching and task stopping, avoids resource accumulation during scheduling, and improves system stability.
Smart Images

Figure CN118897729A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a task scheduling system, method, device, equipment and medium. Background Art
[0002] The chip is provided with a plurality of heterogeneous units for executing computing instructions. Computing tasks are generated in the processes running in the chip. The computing tasks contain one or more computing instructions. During the use of the chip, it is necessary to schedule the computing tasks generated by the processes running in the chip, and execute the computing instructions in the computing tasks through the heterogeneous units. When the process running in the chip needs to switch from the current running process to a new process, it is necessary to stop scheduling the computing tasks related to the current running process, and clear the computing instructions in the computing tasks related to the current running process that are in the scheduling process. When it is necessary to forcibly stop the computing tasks related to the current running process, it is necessary to stop scheduling the computing tasks related to the current running process, and clear the computing instructions in the computing tasks related to the current running process.
[0003] In the related art, the commonly used task scheduling scheme is: through the scheduling software in the chip, the computing instructions in the computing tasks generated by the currently running process are allocated to the corresponding heterogeneous units, the computing instructions in the computing tasks are executed by the heterogeneous units, and when the process running in the chip needs to switch from the current running process to a new process, the computing tasks related to the currently running process are stopped from being scheduled, and when the computing tasks related to the currently running process need to be forcibly stopped, the computing tasks related to the currently running process are stopped from being scheduled. The scheduling software in the chip cannot clean up the computing instructions in the computing tasks related to the currently running process that are in the scheduling process when the process running in the chip needs to switch from the current running process to a new process, and cannot clean up the computing instructions in the computing tasks related to the currently running process when the computing tasks related to the currently running process need to be forcibly stopped, resulting in low scheduling efficiency and seriously affecting the normal operation of the chip. Summary of the invention
[0004] The present invention provides a task scheduling system, method, device, equipment and medium to solve the problem that the task scheduling scheme in the related technology cannot clean up the calculation instructions in the calculation tasks related to the currently running process in the scheduling process when the process running in the chip needs to switch from the currently running process to a new process, and cannot clean up the calculation instructions in the calculation tasks related to the currently running process when the calculation tasks related to the currently running process need to be forcibly stopped, resulting in low scheduling efficiency and seriously affecting the normal operation of the chip.
[0005] According to one aspect of the present invention, there is provided a task scheduling system, comprising: an instruction prefetch component, a scheduling component, a dependent task processing component, a dependent task emission component, a synchronous task emission component, a preset number of hardware schedulers, a resource management component, a scheduling execution component, and at least two heterogeneous units;
[0006] The instruction pre-fetch component is used to store the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake instruction in the task storage space into the local storage space of the scheduling component;
[0007] The scheduling component is used to obtain a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduling task; if the current scheduling task is a dependent task instruction package, the dependent task instruction package is sent to the dependent task processing component; if the current scheduling task is a synchronous task instruction package, the synchronous task instruction package is sent to the synchronous task transmitting component; if the current scheduling task is a process switching instruction, the instruction prefetch component is controlled to stop obtaining the dependent task instruction package and the synchronous task instruction package related to the process to be switched corresponding to the process switching instruction, and the local storage space, the dependent task instruction package, the synchronous task instruction package, the process switching ... The task processing component and the computing instructions related to the process to be switched in the synchronous task emission component are cleaned up; if the current scheduled task is a task brake instruction, the instruction pre-fetch component is controlled to stop acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be stopped corresponding to the task brake instruction, and the computing instructions related to the process to be stopped in the local storage space, the hardware scheduler corresponding to the process to be stopped, the dependent task processing component, the dependent task emission component and the synchronous task emission component are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit are recycled;
[0008] The dependent task processing component is used to send each calculation instruction in the dependent task instruction package to the dependent task transmitting component according to a pre-designed value;
[0009] The dependent task transmitting component is used to send each computing instruction in the dependent task instruction package to the hardware scheduler corresponding to the process to which the dependent task instruction package belongs;
[0010] The synchronization task transmitting component is used to send each computing instruction in the synchronization task instruction packet to the hardware scheduler corresponding to the process to which the synchronization task instruction packet belongs;
[0011] Each of the hardware schedulers is used to, after receiving each computing instruction in the dependent task instruction packet, obtain the resource status of each of the heterogeneous units from the resource management component, determine the available heterogeneous units of the dependent task instruction packet according to the task information of the dependent task instruction packet and the resource status of each of the heterogeneous units; send the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet to the resource management component; after receiving the application success prompt information fed back by the resource management component, send each computing instruction in the dependent task instruction packet, the available heterogeneous units of the dependent task instruction packet, and the resource status of each of the heterogeneous units. The identification information of each computing instruction is sent to the scheduling execution component; after receiving each computing instruction in the synchronization task instruction package, the resource status of each heterogeneous unit is obtained from the resource management component, and the available heterogeneous units of each computing instruction are determined according to the task information of each computing instruction and the resource status of each heterogeneous unit; the heterogeneous unit application request corresponding to the available heterogeneous unit of each computing instruction is sent to the resource management component; after receiving the application success prompt information fed back by the resource management component, the identification information of each computing instruction and the available heterogeneous unit of each computing instruction is sent to the scheduling execution component;
[0012] The resource management component is used to manage the resource status of each of the heterogeneous units; after receiving the heterogeneous unit application request sent by each of the hardware schedulers, according to the resource status of each of the heterogeneous units, feedback application success prompt information or application failure prompt information to each of the hardware schedulers;
[0013] The scheduling execution component is used to send each computing instruction in the dependent task instruction packet to the available heterogeneous unit of the dependent task instruction packet according to the identification information of the available heterogeneous unit of the dependent task instruction packet after receiving each computing instruction in the dependent task instruction packet and the identification information of the available heterogeneous unit of the dependent task instruction packet; after receiving each computing instruction and the identification information of the available heterogeneous unit of each computing instruction, send each computing instruction to the available heterogeneous unit of each computing instruction according to the identification information of the available heterogeneous unit of each computing instruction;
[0014] Each of the heterogeneous units is used to execute each computing instruction in the dependent task instruction package in sequence after receiving each computing instruction in the dependent task instruction package; and execute the computing instruction after receiving the computing instruction in the synchronous task instruction package.
[0015] According to another aspect of the present invention, a task scheduling method is provided, which is applied to a scheduling component in a task scheduling system, comprising:
[0016] Obtain dependent task instruction packages, synchronous task instruction packages, process switching instructions or task brake instructions from the local storage space as the current scheduling task;
[0017] If the currently scheduled task is a dependent task instruction packet, sending the dependent task instruction packet to a dependent task processing component;
[0018] If the currently scheduled task is a synchronous task instruction packet, the synchronous task instruction packet is sent to the synchronous task transmitting component;
[0019] If the currently scheduled task is a process switching instruction, the control instruction prefetch component stops acquiring dependent task instruction packets and synchronous task instruction packets related to the process to be switched corresponding to the process switching instruction, and cleans up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronous task emission component;
[0020] If the currently scheduled task is a task brake instruction, the control instruction pre-fetch component stops acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction, and cleans up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task emission component and the synchronous task emission component, and recycles the computing instructions related to the process to be braked that have been sent to the heterogeneous units.
[0021] According to another aspect of the present invention, there is provided a task scheduling device, which is configured in a scheduling component in a task scheduling system, and includes:
[0022] A task acquisition module is used to acquire a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from a local storage space as a current scheduling task;
[0023] A dependent task scheduling module, configured to send the dependent task instruction package to a dependent task processing component if the currently scheduled task is a dependent task instruction package;
[0024] A synchronization task scheduling module, configured to send the synchronization task instruction packet to the synchronization task transmitting component if the current scheduling task is a synchronization task instruction packet;
[0025] A process switching instruction execution module, which is used to control the instruction pre-fetching component to stop acquiring dependent task instruction packets and synchronous task instruction packets related to the process to be switched corresponding to the process switching instruction if the current scheduled task is a process switching instruction, and to clean up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronous task transmitting component;
[0026] The task brake instruction execution module is used to control the instruction pre-fetch component to stop acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction if the currently scheduled task is a task brake instruction, and to clean up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task transmitting component and the synchronous task transmitting component, and recycle the computing instructions related to the process to be braked that have been sent to the heterogeneous units.
[0027] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0028] at least one processor;
[0029] and a memory communicatively coupled to the at least one processor;
[0030] The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the task scheduling method described in any embodiment of the present invention.
[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task scheduling method described in any embodiment of the present invention when executed.
[0032] In the technical solution of the embodiment of the present invention, the scheduling component obtains a dependent task instruction package, a synchronization task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduling task; if the current scheduling task is a dependent task instruction package, the scheduling component sends the dependent task instruction package to the dependent task processing component; if the current scheduling task is a synchronization task instruction package, the scheduling component sends the synchronization task instruction package to the synchronization task transmitting component; if the current scheduling task is a process switching instruction, the scheduling component controls the instruction prefetch component to stop obtaining the dependent task instruction package and the synchronization task instruction package related to the process to be switched corresponding to the process switching instruction, and cleans up the calculation instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronization task transmitting component; if the current scheduling task is a task brake instruction, the scheduling component controls the instruction prefetch component to stop obtaining the dependent task instruction package and the synchronization task instruction package related to the process to be stopped corresponding to the task brake instruction, and cleans up the local storage space, the hardware scheduler corresponding to the process to be stopped, and the dependent task processing component. The computing instructions related to the process to be stopped in the processing component, the dependent task emission component and the synchronous task emission component are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous units are recycled, so as to solve the problem that the task scheduling scheme in the related technology cannot clean up the computing instructions in the computing tasks related to the currently running process in the scheduling process when the process running in the chip needs to switch from the currently running process to the new process, and cannot clean up the computing instructions in the computing tasks related to the currently running process when the computing tasks related to the currently running process need to be forced to stop, resulting in low scheduling efficiency and seriously affecting the normal operation of the chip. When the process running in the chip needs to switch from the currently running process to the new process, the computing instructions in the computing tasks related to the currently running process in the scheduling process can be automatically cleaned up, and when the computing tasks related to the currently running process need to be forced to stop, the computing instructions in the computing tasks related to the currently running process can be automatically cleaned up, thereby improving the scheduling efficiency and ensuring the normal operation of the chip.
[0033] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 A structural diagram of a task scheduling system provided in Embodiment 1 of the present invention.
[0036] Figure 2 A flowchart of a task scheduling method provided in Embodiment 2 of the present invention.
[0037] Figure 3 A structural diagram of a task scheduling device provided in Embodiment 3 of the present invention.
[0038] Figure 4 A schematic diagram of the structure of an electronic device for implementing the task scheduling method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "target", "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprise", "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Embodiment 1
[0042] Figure 1 This is a structural diagram of a task scheduling system provided in the first embodiment of the present invention. This embodiment is applicable to the case where computing tasks generated by processes running in a chip are scheduled. Figure 1 As shown, the task scheduling system may specifically include: an instruction prefetch component 101, a scheduling component 102, a dependent task processing component 103, a dependent task emission component 104, a synchronous task emission component 105, a preset number of hardware schedulers 106, a resource management component 107, a scheduling execution component 108 and at least two heterogeneous units 109, and its structure and function are described below.
[0043] The instruction pre-fetch component 101 is used to store the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake instruction in the task storage space into the local storage space of the scheduling component 102 .
[0044] The scheduling component 102 is used to obtain a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduling task; if the current scheduling task is a dependent task instruction package, the dependent task instruction package is sent to the dependent task processing component 103; if the current scheduling task is a synchronous task instruction package, the synchronous task instruction package is sent to the synchronous task transmitting component 105; if the current scheduling task is a process switching instruction, the control instruction prefetching component 101 stops obtaining the dependent task instruction package and the synchronous task instruction package related to the process to be switched corresponding to the process switching instruction, and performs local storage space, dependent task processing component 103, and the dependent ... dependent task processing component 103; if the current scheduling task is a synchronous task instruction package, the synchronous task instruction package is sent to the synchronous task transmitting component 105; if the current scheduling task is a process switching instruction, the control instruction prefetching component 101 stops obtaining the dependent task instruction package and the synchronous task instruction package related to the process to be switched corresponding to the process switching instruction, and performs 103 and the calculation instructions related to the process to be switched in the synchronous task emission component 105; if the current scheduled task is a task brake instruction, the control instruction pre-fetch component 101 stops obtaining the dependent task instruction package and the synchronous task instruction package related to the process to be stopped corresponding to the task brake instruction, and cleans up the calculation instructions related to the process to be stopped in the local storage space, the hardware scheduler 106 corresponding to the process to be stopped, the dependent task processing component 103, the dependent task emission component 104 and the synchronous task emission component 105, and recycles the calculation instructions related to the process to be stopped that have been sent to the heterogeneous unit 109.
[0045] The dependent task processing component 103 is used to send each calculation instruction in the dependent task instruction package to the dependent task transmitting component 104 according to a pre-designed value.
[0046] The dependent task transmitting component 104 is used to send each computing instruction in the dependent task instruction package to the hardware scheduler 106 corresponding to the process to which the dependent task instruction package belongs.
[0047] The synchronization task transmitting component 105 is used to send each computing instruction in the synchronization task instruction packet to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs.
[0048] Each hardware scheduler 106 is used to obtain the resource status of each heterogeneous unit 109 from the resource management component 107 after receiving each computing instruction in the dependent task instruction packet, and determine the available heterogeneous units of the dependent task instruction packet according to the task information of the dependent task instruction packet and the resource status of each heterogeneous unit 109; send the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet to the resource management component 107; after receiving the application success prompt information fed back by the resource management component 107, send each computing instruction in the dependent task instruction packet and the available heterogeneous units of the dependent task instruction packet to the resource management component 107; The identification information is sent to the scheduling execution component 108; after receiving each computing instruction in the synchronization task instruction package, the resource status of each heterogeneous unit 109 is obtained from the resource management component 107, and the available heterogeneous units of each computing instruction are determined according to the task information of each computing instruction and the resource status of each heterogeneous unit 109; the heterogeneous unit application request corresponding to the available heterogeneous unit of each computing instruction is sent to the resource management component 107; after receiving the application success prompt information fed back by the resource management component 107, the identification information of each computing instruction and the available heterogeneous units of each computing instruction is sent to the scheduling execution component 108.
[0049] The resource management component 107 is used to manage the resource status of each heterogeneous unit 109; after receiving the heterogeneous unit application request sent by each hardware scheduler 106, it feeds back application success prompt information or application failure prompt information to each hardware scheduler 106 according to the resource status of each heterogeneous unit 109.
[0050] The scheduling execution component 108 is used for, after receiving each computing instruction in the dependent task instruction package and the identification information of the available heterogeneous units of the dependent task instruction package, sending each computing instruction in the dependent task instruction package to the available heterogeneous units of the dependent task instruction package according to the identification information of the available heterogeneous units of the dependent task instruction package; after receiving each computing instruction and the identification information of the available heterogeneous units of each computing instruction, sending each computing instruction to the available heterogeneous units of each computing instruction according to the identification information of the available heterogeneous units of each computing instruction.
[0051] Each heterogeneous unit 109 is used to execute each computing instruction in the dependent task instruction package in sequence after receiving each computing instruction in the dependent task instruction package; and execute the computing instruction after receiving the computing instruction in the synchronous task instruction package.
[0052] Optionally, the task storage space may be a queue set in the chip for storing task instruction packages of computing tasks generated by the currently running process and scheduling control instructions for computing tasks generated by the currently running process. The currently running process may refer to the process running in the chip at the current moment. A process may be a program used to implement a specified function after running. A computing task will be generated in the process running in the chip. The computing task includes one or more computing instructions. The computing instruction may be an instruction for instructing to perform a specified computing process according to specified data to obtain a computing process result. The task instruction package of the computing task may be a data packet obtained by packaging the computing instructions contained in the computing task.
[0053] Optionally, the task instruction package is a dependent task instruction package or a synchronous task instruction package. The dependent task instruction package may refer to a task instruction package in which each computing instruction contained therein has a dependency relationship and needs to be executed in sequence in a specified order. Each computing instruction in the dependent task instruction package includes a digital number of the computing instruction, an execution sequence number, a heterogeneous unit type, and identification information of the process to which the computing instruction belongs. The digital number of the computing instruction may be a pre-set digital number for uniquely identifying the process. The execution sequence number of the computing instruction may be a pre-set sequence number for characterizing the execution order of the computing instruction. A heterogeneous unit is required to execute each computing instruction in the dependent task instruction package in order from small to large according to the execution sequence number. The heterogeneous unit type of each computing instruction may be a type of a heterogeneous unit for executing each computing instruction. The heterogeneous unit type of the computing instruction may be a computing engine, a data engine, a general processor, or an image and video processing unit. The heterogeneous unit types of the computing instructions in the same dependent task instruction package are the same. The identification information of the process to which the computing instruction belongs may be the identification information of the process that generates the computing instruction. The synchronous task instruction package may refer to a task instruction package in which each computing instruction contained therein has no dependency relationship and can be executed synchronously. Each computing instruction in the synchronous task instruction packet includes the digital number of the computing instruction, the type of the heterogeneous unit, and the identification information of the process to which the computing instruction belongs.
[0054] Optionally, the scheduling control instruction for the computing task generated by the currently running process may be a process switching instruction or a task brake instruction. The process switching instruction may be an instruction for indicating that the process running in the chip needs to switch from the currently running process to the new process, needs to stop scheduling the computing tasks related to the currently running process, and clears the computing instructions in the computing tasks related to the currently running process in the scheduling process. The process switching instruction contains identification information of the process to be switched and the new process. The process to be switched may be the process running in the chip before the switch, that is, the currently running process. The new process may be the process that will run in the chip after the switch. The identification information of the process may be a pre-set digital number or string for uniquely identifying the process. The task brake instruction may be an instruction for indicating that the computing tasks related to the currently running process need to be forcibly braked, that the computing tasks related to the currently running process need to be stopped from being scheduled, and the computing instructions in the computing tasks related to the currently running process need to be cleared. The task brake instruction contains identification information of the process to be braked. The process to be braked may be a process running in the chip that needs to be forcibly stopped, that is, the currently running process.
[0055] Optionally, the task instruction package of the computing task generated by the current running process in the task storage space and the scheduling control instruction for the computing task generated by the current running process can be stored in the task storage space by the scheduling software. The scheduling software can be software set in the chip for managing the processes running in the chip. When the current running process generates a computing task and there is a dependency relationship between the various computing instructions contained in the generated computing task, the scheduling software can package the various computing instructions contained in the generated computing task to obtain a dependent task instruction package, and then store the dependent task instruction package in the task storage space. When the current running process generates a computing task and there is no dependency relationship between the various computing instructions contained in the generated computing task, the scheduling software can package the various computing instructions contained in the generated computing task to obtain a synchronization task instruction package, and then store the synchronization task instruction package in the task storage space. When the process running in the chip needs to switch from the current running process to a new process, it is necessary to stop scheduling the computing tasks related to the current running process, and clean up the computing instructions in the computing tasks related to the current running process in the scheduling process, the scheduling software can store the process switching instruction in the task storage space. When it is necessary to forcibly stop the computing tasks related to the currently running process, stop scheduling the computing tasks related to the currently running process, and clear the computing instructions in the computing tasks related to the currently running process, the scheduling software can store the task stop instructions in the task storage space.
[0056] Optionally, the instruction prefetch component 101 is connected to the scheduling component 102. The instruction prefetch component 101 may be a component set in the chip for acquiring the dependent task instruction package, synchronous task instruction package, process switching instruction or task brake instruction stored in the task storage space when it is detected that the scheduling software stores the dependent task instruction package, synchronous task instruction package, process switching instruction or task brake instruction in the task storage space, and storing the acquired dependent task instruction package, synchronous task instruction package, process switching instruction or task brake instruction in the local storage space of the scheduling component 102. The scheduling component 102 may be a component set in the chip for scheduling the computing tasks generated by the process running in the chip. Exemplarily, the scheduling component 102 is a processor set in the chip for scheduling the computing tasks generated by the process running in the chip. The local storage space of the scheduling component 102 may be a queue set in the scheduling component 102 for storing the dependent task instruction package, synchronous task instruction package, process switching instruction and task brake instruction that need to be processed.
[0057] Optionally, the instruction prefetch component 101 can monitor whether the scheduling software stores the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake stop instruction in the task storage space. When the instruction prefetch component 101 monitors that the scheduling software stores the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake stop instruction in the task storage space, it can obtain the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake stop instruction stored in the task storage space, and store the obtained dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake stop instruction in the local storage space of the scheduling component 102. Each information stored in the local storage space is arranged in the order of storage time. The information first stored in the local storage space is arranged in front, and the information stored in the local storage space later is arranged in the back. The current scheduling task is the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake stop instruction that the scheduling component 102 needs to process at the current moment. After the last currently scheduled task is processed, the scheduling component 102 can determine the information ranked first in the local storage space as the current scheduled task. The information ranked first is a dependent task instruction package, a synchronous task instruction package, a process switching instruction, or a task brake instruction. In the initial state, the scheduling component 102 has not yet started to process the dependent task instruction package, the synchronous task instruction package, the process switching instruction, and the task brake instruction, and can directly determine the information ranked first in the local storage space as the current scheduled task.
[0058] Optionally, the scheduling component 102 is connected to the dependent task processing component 103. The dependent task processing component 103 is connected to the dependent task transmitting component 104. If the current scheduled task is a dependent task instruction packet, the scheduling component 102 sends the dependent task instruction packet to the dependent task processing component 103. The dependent task processing component 103 may be a component set in the chip for sending each calculation instruction in the dependent task instruction packet to the dependent task transmitting component 104 according to a pre-designed value, so that the dependent task transmitting component 104 sends each calculation instruction in the dependent task instruction packet to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs.
[0059] Optionally, the dependent task processing component 103 is provided with processing units corresponding to each process. The processing unit corresponding to each process may be a software module for extracting each computing instruction in the dependent task instruction package of the computing task generated by the process, and sending each computing instruction in the dependent task instruction package of the computing task generated by the process to the dependent task transmitting component 104 according to a pre-designed value. The scheduling component 102 may determine the process to which the dependent task instruction package belongs according to the identification information of the process to which the computing instructions contained in the computing instructions in the dependent task instruction package belong, and send the dependent task instruction package to the processing unit corresponding to the process to which the dependent task instruction package belongs in the dependent task processing component 103, so that the processing unit corresponding to the process to which the dependent task instruction package belongs extracts each computing instruction in the dependent task instruction package, and sends each computing instruction in the dependent task instruction package of the computing task generated by the process to the dependent task transmitting component 104 according to the pre-designed value. The process to which the dependent task instruction package belongs is the process that generates each computing instruction in the dependent task instruction package.
[0060] Optionally, after receiving the dependent task instruction packet, the processing unit extracts each calculation instruction in the dependent task instruction packet, and controls a counter set in the processing unit to count from 0, and then after the count value of the counter reaches a pre-designed value, sends each calculation instruction in the dependent task instruction packet to the dependent task transmitting component 104. The pre-designed value may be a pre-set count value greater than 0.
[0061] Optionally, the dependent task emission component 104 may be a component set in the chip for sending each computing instruction in the dependent task instruction packet to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs. The preset number of hardware schedulers 106 may be a plurality of hardware components set in the chip for scheduling the computing instructions in the dependent task instruction packet or the synchronization task instruction packet. The preset number is greater than or equal to two. Each hardware scheduler 106 includes a hardware scheduler 106 corresponding to each process. The hardware scheduler 106 corresponding to each process is a hardware component for scheduling the computing instructions in the dependent task instruction packet or the synchronization task instruction packet of the computing task generated by the process. The dependent task emission component 104 is connected to each hardware scheduler 106 respectively. After receiving each computing instruction in the dependent task instruction packet, the dependent task emission component 104 can determine the process to which the dependent task instruction packet belongs according to the identification information of the process to which the computing instructions contained in the computing instructions in the dependent task instruction packet belong, and then send each computing instruction in the dependent task instruction packet to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs.
[0062] Optionally, after receiving each computing instruction in the dependent task instruction packet, the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs obtains the resource status of each heterogeneous unit 109 from the resource management component 107, and determines the available heterogeneous units of the dependent task instruction packet according to the task information of the dependent task instruction packet and the resource status of each heterogeneous unit 109. Then, the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet is sent to the resource management component 107. After receiving the application success prompt information fed back by the resource management component 107, the identification information of each computing instruction in the dependent task instruction packet and the available heterogeneous units of the dependent task instruction packet is sent to the scheduling execution component 108.
[0063] Optionally, each heterogeneous unit 109 is a plurality of heterogeneous units arranged in the chip for executing computing instructions. Each heterogeneous unit 109 may include a specified number of computing engines, data engines, general-purpose processors, and image and video processing units. The specified number is greater than or equal to two. The heterogeneous unit 109 may be a computing engine, a data engine, a general-purpose processor, or an image and video processing unit. Accordingly, the type of the heterogeneous unit 109 is a computing engine, a data engine, a general-purpose processor, or an image and video processing unit. The identification information of the heterogeneous unit 109 may be a pre-set digital number for uniquely identifying the heterogeneous unit 109.
[0064] Optionally, the resource management component 107 may be a hardware component provided in the chip for managing the resource status of each heterogeneous unit 109, and updating the resource status of each heterogeneous unit 109 stored in the resource management component 107 according to a heterogeneous unit application request or a heterogeneous unit return request corresponding to each heterogeneous unit 109. The resource management component 107 is connected to each heterogeneous unit 109. The resource management component 107 is connected to the scheduling component 102.
[0065] Optionally, the resource management component 107 stores the resource status of each heterogeneous unit 109. The resource status of the heterogeneous unit 109 is information used to characterize whether the heterogeneous unit 109 is executing a computing instruction. The resource status of the heterogeneous unit 109 is idle or working. The resource status of the heterogeneous unit 109 is idle, indicating that the heterogeneous unit 109 is not executing a computing instruction. The resource status of the heterogeneous unit 109 is working, indicating that the heterogeneous unit 109 is executing a computing instruction. Each hardware scheduler 106 is connected to the resource management component 107. Each hardware scheduler 106 can obtain the resource status of each heterogeneous unit 109 from the resource management component 107. After receiving each computing instruction in the dependent task instruction packet, the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs can obtain the resource status of each heterogeneous unit 109 from the resource management component 107.
[0066] Optionally, based on the task information of the dependent task instruction packet and the resource status of each heterogeneous unit 109, the available heterogeneous units of the dependent task instruction packet are determined, including: based on the resource status of each heterogeneous unit 109, determining each idle heterogeneous unit in each heterogeneous unit 109; based on the task information of the dependent task instruction packet, determining the available heterogeneous units of the dependent task instruction packet in each idle heterogeneous unit.
[0067] Optionally, a heterogeneous unit whose resource status is idle in each heterogeneous unit 109 is determined as an idle heterogeneous unit, thereby determining each idle heterogeneous unit in each heterogeneous unit 109. An idle heterogeneous unit is a heterogeneous unit 109 that is not executing a computing instruction.
[0068] Optionally, the task information of the dependent task instruction packet may refer to the heterogeneous unit type of each computing instruction in the dependent task instruction packet. According to the task information of the dependent task instruction packet, the available heterogeneous units of the dependent task instruction packet are determined in each idle heterogeneous unit, including: extracting the heterogeneous unit type of the computing instruction from any one of the computing instructions in the dependent task instruction packet, thereby obtaining the task information of the dependent task instruction packet; in each idle heterogeneous unit, querying the idle heterogeneous unit of the same type as the task information of the dependent task instruction packet; randomly obtaining an idle heterogeneous unit from the idle heterogeneous units of the same type as the task information of the dependent task instruction packet as the available heterogeneous unit of the dependent task instruction packet. The available heterogeneous unit of the dependent task instruction packet is a heterogeneous unit 109 used to execute each computing instruction in the dependent task instruction packet.
[0069] Optionally, the heterogeneous unit application request corresponding to the specified heterogeneous unit is a request for requesting to use the specified heterogeneous unit to execute a computing instruction. A heterogeneous unit application request template is stored in each hardware scheduler 106. The heterogeneous unit application request template is a template for generating a heterogeneous unit application request corresponding to the specified heterogeneous unit. The heterogeneous unit application request template is a heterogeneous unit application request that does not contain the identification information of the specified heterogeneous unit. After adding the identification information of the specified heterogeneous unit to the identification information addition position in the heterogeneous unit application request template, the heterogeneous unit application request corresponding to the specified heterogeneous unit can be obtained. The identification information addition position in the heterogeneous unit application request template is the position in the heterogeneous unit application request template for adding the identification information of the specified heterogeneous unit.
[0070] Optionally, the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs can obtain the identification information of the available heterogeneous units of the dependent task instruction packet from the available heterogeneous units of the dependent task instruction packet, add the identification information of the available heterogeneous units of the dependent task instruction packet to the identification information adding position in the heterogeneous unit application request template, obtain the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet, and then send the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet to the resource management component 107.
[0071] Optionally, after receiving the heterogeneous unit application request corresponding to the available heterogeneous unit of the dependent task instruction package, the resource management component 107 feeds back application success prompt information or application failure prompt information to the hardware scheduler 106 corresponding to the process to which the dependent task instruction package belongs, based on the resource status of each heterogeneous unit 109.
[0072] Optionally, after receiving the heterogeneous unit application request corresponding to the available heterogeneous unit of the dependent task instruction packet, the resource management component 107 determines whether the resource status of the available heterogeneous unit of the dependent task instruction packet stored by the resource management component 107 is idle. If the resource status is idle, indicating that the available heterogeneous unit of the dependent task instruction packet can be used to execute a new computing instruction, then the application success prompt information is fed back to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs, and the resource status of the available heterogeneous unit of the dependent task instruction packet stored by the resource management component 107 is updated to working. If the resource status is working, indicating that the available heterogeneous unit of the dependent task instruction packet cannot be used to execute a new computing instruction, then the application failure prompt information is fed back to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs. The application success prompt information can be information set in the resource management component 107 to prompt the hardware scheduler 106 that the heterogeneous unit requested to be used can be used to execute a new computing instruction. The application failure prompt information may be information set in the resource management component 107 to prompt the hardware scheduler 106 that the heterogeneous unit requested to be used cannot be used to execute the new computing instruction.
[0073] Optionally, after receiving the application success prompt information feedback from the resource management component 107, the hardware scheduler 106 corresponding to the process to which the dependent task instruction package belongs determines that the available heterogeneous units of the dependent task instruction package can be used to execute each computing instruction in the dependent task instruction package, and sends the identification information of each computing instruction in the dependent task instruction package and the available heterogeneous units of the dependent task instruction package to the scheduling execution component 108.
[0074] Optionally, the scheduling execution component 108 may be a component set in the chip for sending computing instructions to heterogeneous units that execute computing instructions. The scheduling execution component 108 is connected to each hardware scheduler 106 and each heterogeneous unit 109 respectively. After receiving each computing instruction in the dependent task instruction packet and the identification information of the available heterogeneous units of the dependent task instruction packet, the scheduling execution component 108 determines the available heterogeneous units of the dependent task instruction packet according to the identification information of the available heterogeneous units of the dependent task instruction packet, and then sends each computing instruction in the dependent task instruction packet to the available heterogeneous units of the dependent task instruction packet.
[0075] Optionally, after receiving each computing instruction in the dependent task instruction packet, the available heterogeneous unit of the dependent task instruction packet executes each computing instruction in the dependent task instruction packet in order from small to large according to the execution sequence number. After each computing instruction is executed, the available heterogeneous unit of the dependent task instruction packet sends a completion prompt message to the scheduling execution component 108. The completion prompt message may be information pre-set in the available heterogeneous unit of the dependent task instruction packet to indicate that the available heterogeneous unit of the dependent task instruction packet has completed the received computing instruction. After receiving the completion prompt message, the scheduling execution component 108 sends the completion prompt message to the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs. After receiving the completion prompt message, the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs determines that the available heterogeneous unit of the dependent task instruction packet has completed the execution of each computing instruction in the dependent task instruction packet, and then sends the heterogeneous unit return request corresponding to the available heterogeneous unit of the dependent task instruction packet to the resource management component 107.
[0076] Optionally, the heterogeneous unit return request corresponding to the specified heterogeneous unit is a request for requesting to stop using the specified heterogeneous unit to execute computing instructions. A heterogeneous unit return request template is stored in each hardware scheduler 106. The heterogeneous unit return request template is a template for generating a heterogeneous unit return request corresponding to the specified heterogeneous unit. The heterogeneous unit return request template is a heterogeneous unit return request that does not contain the identification information of the specified heterogeneous unit. After adding the identification information of the specified heterogeneous unit to the identification information addition position in the heterogeneous unit return request template, the heterogeneous unit return request corresponding to the specified heterogeneous unit can be obtained. The identification information addition position in the heterogeneous unit return request template is the position in the heterogeneous unit return request template for adding the identification information of the specified heterogeneous unit.
[0077] Optionally, after the hardware scheduler 106 corresponding to the process to which the dependent task instruction packet belongs adds the identification information of the available heterogeneous units of the dependent task instruction packet to the identification information adding position in the heterogeneous unit return request template, it obtains the heterogeneous unit return request corresponding to the available heterogeneous units of the dependent task instruction packet, and then sends the heterogeneous unit return request corresponding to the available heterogeneous units of the dependent task instruction packet to the resource management component 107. After receiving the heterogeneous unit return request corresponding to the available heterogeneous units of the dependent task instruction packet, the resource management component 107 updates the resource status of the available heterogeneous units of the dependent task instruction packet stored in the resource management component 107 to idle.
[0078] Optionally, after receiving the application failure prompt information fed back by the resource management component 107, the hardware scheduler 106 corresponding to the process to which the dependent task instruction package belongs re-executes the operation of obtaining the resource status of each heterogeneous unit 109 from the resource management component 107, determines the available heterogeneous units of the dependent task instruction package according to the task information of the dependent task instruction package and the resource status of each heterogeneous unit 109, and sends the heterogeneous unit 109 application request corresponding to the available heterogeneous units of the dependent task instruction package to the resource management component 107, until receiving the application success prompt information fed back by the resource management component 107.
[0079] Optionally, the scheduling component 102 is connected to the synchronization task transmission component 105. If the current scheduling task is a synchronization task instruction packet, the scheduling component 102 sends the synchronization task instruction packet to the synchronization task transmission component 105. The synchronization task transmission component 105 can be a component set in the chip for sending each calculation instruction in the synchronization task instruction packet to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs. The synchronization task transmission component 105 is connected to each hardware scheduler 106 respectively. After receiving the synchronization task instruction packet, the synchronization task transmission component 105 can extract each calculation instruction in the synchronization task instruction packet, determine the process to which the synchronization task instruction packet belongs according to the identification information of the process to which the calculation instruction contained in the calculation instruction in the synchronization task instruction packet belongs, and then send each calculation instruction in the synchronization task instruction packet to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs. The process to which the synchronization task instruction packet belongs is the process that generates each calculation instruction in the synchronization task instruction packet.
[0080] Optionally, after receiving each computing instruction in the synchronization task instruction packet, the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs obtains the resource status of each heterogeneous unit 109 from the resource management component 107, and determines the available heterogeneous units of each computing instruction according to the task information of each computing instruction and the resource status of each heterogeneous unit 109. Then, the heterogeneous unit application request corresponding to the available heterogeneous unit of each computing instruction is sent to the resource management component 107. After receiving the application success prompt information fed back by the resource management component 107, the identification information of each computing instruction and the available heterogeneous unit of each computing instruction is sent to the scheduling execution component 108.
[0081] Optionally, based on the task information of each computing instruction and the resource status of each heterogeneous unit 109, the available heterogeneous units for each computing instruction are determined, including: based on the resource status of each heterogeneous unit 109, each idle heterogeneous unit in each heterogeneous unit 109 is determined; the digital number of each computing instruction is extracted from each computing instruction, and each computing instruction is sorted from small to large according to the digital number, and then starting from the computing instruction ranked first, the available heterogeneous units for each computing instruction are determined in each idle heterogeneous unit according to the task information of each computing instruction.
[0082] Optionally, the task information of each computing instruction may refer to the heterogeneous unit type of each computing instruction. The following operations are performed for each computing instruction: among the remaining idle heterogeneous units, query the idle heterogeneous units of the same type as the task information of the computing instruction; randomly obtain an idle heterogeneous unit from the idle heterogeneous units of the same type as the task information of the computing instruction as the available heterogeneous unit of the computing instruction. The remaining idle heterogeneous units are all idle heterogeneous units that have not yet been determined as available heterogeneous units for other computing instructions. The available heterogeneous units of the computing instruction are the heterogeneous units 109 used to execute the computing instruction.
[0083] Optionally, the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs can obtain the identification information of the available heterogeneous units of each computing instruction from the available heterogeneous units of each computing instruction, add the identification information of the available heterogeneous units of each computing instruction to the identification information adding position in the heterogeneous unit application request template, obtain the heterogeneous unit application request corresponding to the available heterogeneous units of each computing instruction, and then send the heterogeneous unit application request corresponding to the available heterogeneous units of each computing instruction to the resource management component 107. After receiving the heterogeneous unit application request corresponding to the available heterogeneous units of each computing instruction, the resource management component 107 feeds back application success prompt information or application failure prompt information to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs according to the resource status of each heterogeneous unit 109.
[0084] Optionally, the resource management component 107 determines whether the resource status of the available heterogeneous units of each computing instruction stored in the resource management component 107 is idle. If the available heterogeneous units of each computing instruction are all idle, it indicates that the available heterogeneous units of each computing instruction can be used to execute new computing instructions, and then feedback application success prompt information is fed back to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs, and the resource status of the available heterogeneous units of each computing instruction stored in the resource management component 107 is updated to work. If there are available heterogeneous units with a resource status of working among the available heterogeneous units of each computing instruction, it indicates that there are heterogeneous units among the available heterogeneous units of each computing instruction that cannot be used to execute new computing instructions, and then feedback application failure prompt information is fed back to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs.
[0085] Optionally, after receiving the application success prompt information fed back by the resource management component 107, the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs determines that the available heterogeneous units of each computing instruction can be used to execute each computing instruction, and sends the identification information of each computing instruction and the available heterogeneous units of each computing instruction to the scheduling execution component 108. After receiving the identification information of each computing instruction and the available heterogeneous units of each computing instruction, the scheduling execution component 108 determines the available heterogeneous units of each computing instruction according to the identification information of the available heterogeneous units of each computing instruction, and then sends each computing instruction to the available heterogeneous units of each computing instruction respectively.
[0086] Optionally, after receiving the computing instruction, the available heterogeneous unit of each computing instruction executes the computing instruction. After the computing instruction is executed, the completion prompt information is sent to the scheduling execution component 108. After receiving the completion prompt information sent by the available heterogeneous unit of each computing instruction, the scheduling execution component 108 sends the completion prompt information sent by the available heterogeneous unit of each computing instruction to the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs. After receiving the completion prompt information sent by the available heterogeneous unit of each computing instruction, the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs sends the heterogeneous unit return request corresponding to the available heterogeneous unit of each computing instruction to the resource management component 107.
[0087] Optionally, after the hardware scheduler 106 corresponding to the process to which the synchronization task instruction packet belongs adds the identification information of the available heterogeneous units of each computing instruction to the identification information adding position in the heterogeneous unit return request template, it obtains the heterogeneous unit return request corresponding to the available heterogeneous units of each computing instruction, and then sends the heterogeneous unit return request corresponding to the available heterogeneous units of each computing instruction to the resource management component 107. After receiving the heterogeneous unit return request corresponding to the available heterogeneous units of each computing instruction, the resource management component 107 updates the resource status of the available heterogeneous units of each computing instruction stored in the resource management component 107 to idle.
[0088] Optionally, after receiving the application failure prompt information fed back by the resource management component 107, the hardware scheduler 106 corresponding to the process to which the synchronization task instruction package belongs re-executes the operation of obtaining the resource status of each heterogeneous unit 109 from the resource management component 107, determines the available heterogeneous units of each computing instruction according to the task information of each computing instruction and the resource status of each heterogeneous unit 109, and sends the heterogeneous unit application request corresponding to the available heterogeneous units of each computing instruction to the resource management component 107, until receiving the application success prompt information fed back by the resource management component 107.
[0089] Optionally, if the currently scheduled task is a process switching instruction, the scheduling component 102 controls the instruction prefetch component 101 to stop acquiring dependent task instruction packages and synchronous task instruction packages related to the process to be switched corresponding to the process switching instruction, and cleans up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component 103 and the synchronous task emission component 105.
[0090] Optionally, the process to be switched corresponding to the process switching instruction is the process to be switched in the process switching process represented by the process switching instruction. The new process corresponding to the process switching instruction is the new process in the process switching process represented by the process switching instruction. The process switching instruction contains identification information of the process to be switched and the new process. The dependent task instruction package and the synchronization task instruction package related to the process may refer to the dependent task instruction package and the synchronization task instruction package of the computing task generated by the process. The computing instructions in the dependent task instruction package and the synchronization task instruction package related to the process will contain the identification information of the process. The dependent task instruction package and the synchronization task instruction package containing the identification information of the process are the dependent task instruction package and the synchronization task instruction package related to the process.
[0091] Optionally, the scheduling component 102 controls the instruction prefetch component 101 to stop acquiring dependent task instruction packets and synchronization task instruction packets related to the process to be switched corresponding to the process switching instruction, including: the scheduling component 102 extracts the identification information of the process to be switched from the process switching instruction, and stores the identification information of the process to be switched in the stop process identification list in the instruction prefetch component 101. The stop process identification list can be a list set in the instruction prefetch component 101 for storing the identification information of each process that needs to stop acquiring related dependent task instruction packets and synchronization task instruction packets. After the identification information of the process is stored in the stop process identification list, the instruction prefetch component 101 will not acquire the dependent task instruction packet or synchronization task instruction packet containing the identification information of the process when it is detected that the dependent task instruction packet or synchronization task instruction packet containing the identification information of the process is stored in the task storage space, and record the storage position of the dependent task instruction packet or synchronization task instruction packet of the identification information of the process in the task storage space.
[0092] Optionally, the computing instructions related to the process to be switched in the local storage space, the dependent task processing component 103 and the synchronous task emission component 105 are cleaned up, including: stopping the dispatching of dependent task instruction packages and synchronous task instruction packages related to the process to be switched in the local storage space; if the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component 103, and the processing unit in the dependent task processing component 103 is processing the dispatched dependent task instruction package, then the counting information and resource information related to the dispatched dependent task instruction package are recorded, the processing unit is released, and the process switching completion prompt information is sent to the scheduling software; the instruction prefetch component 101 and the dependent task processing component 103 are configured according to the status information, counting information and resource information of the new process corresponding to the process switching instruction.
[0093] Optionally, stopping dispatching dependent task instruction packages and synchronization task instruction packages related to the process to be switched in the local storage space includes: extracting the dependent task instruction packages and synchronization task instruction packages containing the identification information of the process to be switched from the local storage space; storing the extracted dependent task instruction packages and synchronization task instruction packages containing the identification information of the process to be switched in a stop dispatch queue, and deleting the dependent task instruction packages and synchronization task instruction packages containing the identification information of the process to be switched stored in the local storage space. The stop dispatch queue can be a queue set in the scheduling component 102 for storing the dependent task instruction packages and synchronization task instruction packages that the scheduling component 102 stops dispatching. After the scheduling component 102 transfers the dependent task instruction package and the synchronization task instruction package containing the identification information of the process to be switched from the local storage space to the stop dispatch queue, it will no longer obtain the dependent task instruction package or the synchronization task instruction package containing the identification information of the process to be switched as the current scheduling task, thereby stopping dispatching the dependent task instruction package or the synchronization task instruction package containing the identification information of the process to be switched as the current scheduling task to the dependent task processing component 103 or the synchronization task transmitting component 105 for processing, and stopping dispatching the dependent task instruction package and the synchronization task instruction package related to the process to be switched in the local storage space.
[0094] Optionally, the scheduling component 102 stores record information of each dependent task instruction package that has been dispatched to the dependent task processing component 103 for processing. The record information of each dependent task instruction package may include the type of heterogeneous units contained in the calculation instructions in each dependent task instruction package and the identification information of the process to which the calculation instruction belongs. The scheduling component 102 can detect whether the record information of each dependent task instruction package that has been dispatched to the dependent task processing component 103 for processing stored by the scheduling component 102 contains the identification information of the process to be switched. If the record information of each dependent task instruction package that has been dispatched to the dependent task processing component 103 for processing stored by the scheduling component 102 contains the identification information of the process to be switched, it can be determined that the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component 103. If the record information of each dependent task instruction package that has been dispatched to the dependent task processing component 103 for processing stored by the scheduling component 102 does not contain the identification information of the process to be switched, it can be determined that the dependent task instruction package related to the process to be switched has not been dispatched to the dependent task processing component 103.
[0095] Optionally, if the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component 103, the scheduling component 102 can determine the processing unit corresponding to the process to be switched in the dependent task processing component 103 according to the identification information of the process to be switched, and detect whether the processing unit corresponding to the process to be switched is processing the dependent task instruction package. If so, it is determined that the processing unit in the dependent task processing component 103 is processing the dispatched dependent task instruction package. If not, it is determined that the processing unit in the dependent task processing component 103 is not processing the dispatched dependent task instruction package.
[0096] Optionally, if the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component 103, and the processing unit in the dependent task processing component 103 is processing the dispatched dependent task instruction package, then the counting information and resource information related to the dispatched dependent task instruction package are recorded, the processing unit is released, and the process switching completion prompt information is sent to the scheduling software. Then, according to the state information, counting information and resource information of the new process corresponding to the process switching instruction, the instruction prefetch component 101 and the dependent task processing component 103 are configured. The counting information related to the dispatched dependent task instruction package can refer to the count value of the counter in the processing unit corresponding to the process to be switched at the current moment. The resource information related to the dispatched dependent task instruction package can refer to the dispatched dependent task instruction package and the calculation instructions extracted from the dispatched dependent task instruction package. Recording the counting information and resource information related to the dispatched dependent task instruction packages, including: storing the identification information of the process to be switched, the counting information and resource information related to the dispatched dependent task instruction packages in the dependent task instruction package record file. The dependent task instruction package record file can be a file set in the scheduling component 102 for storing the counting information and resource information related to the dependent task instruction package. Releasing the processing unit, including: clearing the dispatched dependent task instruction packages in the processing unit and the calculation instructions extracted from the dispatched dependent task instruction packages, and controlling the counter in the processing unit to be cleared. The process switching completion prompt information can be the information pre-set in the scheduling component 102 to indicate that the process switching instruction has been executed.
[0097] Optionally, the status information of the new process may be information used to characterize whether the new process has been run in the chip. The status information of the new process may be not run or run. If the status information of the new process is not run, it indicates that the new process has not been run in the chip. If the status information of the new process is run, it indicates that the new process has been run in the chip. The process switching instruction may include the status information of the new process. According to the status information, counting information and resource information of the new process corresponding to the process switching instruction, the instruction prefetch component 101 and the dependent task processing component 103 are configured, including: if the status information of the new process corresponding to the process switching instruction is not run, it is determined that there is no need to configure the instruction prefetch component 101 and the dependent task processing component 103.
[0098] Optionally, the instruction prefetch component 101 and the dependent task processing component 103 are configured according to the state information, count information and resource information of the new process corresponding to the process switching instruction, including: if the state information of the new process corresponding to the process switching instruction is already running, then detecting whether the stop process identification list in the instruction prefetch component 101 contains the identification information of the new process; if it is detected that the stop process identification list contains the identification information of the new process, then deleting the identification information of the new process in the stop process identification list; then detecting whether the counting information and resource information of the new process are stored in the dependent task instruction package record file; if it is detected that the counting information and resource information of the new process are stored in the dependent task instruction package record file, then configuring the dependent task processing component 103 according to the counting information and resource information of the new process stored in the dependent task instruction package record file. After the configuration is completed, it is determined that the configuration process ends. The counting information and resource information of the new process can be the counting information and resource information of the dependent task instruction package of the computing task generated by the new process. If it is detected that the counting information and resource information of the new process are not stored in the dependent task instruction package record file, it is determined that the configuration process ends.
[0099] Optionally, detect whether the identification information of each process stored in the dependent task instruction package record file contains the identification information of the new process. If so, determine that the counting information and resource information of the new process are stored in the dependent task instruction package record file. If not, determine that the counting information and resource information of the new process are not stored in the dependent task instruction package record file.
[0100] Optionally, the counting information and resource information corresponding to the identification information of the new process are obtained from the dependent task instruction package record file, thereby obtaining the counting information and resource information of the new process. According to the identification information of the new process, the processing unit corresponding to the new process in the dependent task processing component 103 is determined, the counting information of the new process is set to the count value of the counter in the processing unit corresponding to the new process, and the resource information of the new process is stored in the processing unit corresponding to the new process.
[0101] Optionally, if it is detected that the stopped process identification list does not contain the identification information of the new process, it is detected whether the counting information and resource information of the new process are stored in the dependent task instruction package record file. If so, the dependent task processing component 103 is configured according to the counting information and resource information of the new process stored in the dependent task instruction package record file. If not, it is determined that the configuration process ends.
[0102] Optionally, after stopping dispatching dependent task instruction packages and synchronization task instruction packages related to the process to be switched in the local storage space, it also includes: if the synchronization task instruction package related to the process to be switched has been dispatched to the synchronization task launching component 105, then detecting whether there are computing instructions related to the process to be switched in the synchronization task launching component 105; after detecting that there are no computing instructions related to the process to be switched in the synchronization task launching component 105, sending the process switching completion prompt information to the scheduling software.
[0103] Optionally, the scheduling component 102 stores record information of each synchronization task instruction package that has been dispatched to the synchronization task emission component 105 for processing. The record information of each synchronization task instruction package may include the type of heterogeneous units contained in the calculation instructions in each synchronization task instruction package and the identification information of the process to which the calculation instructions belong. The scheduling component 102 can detect whether the record information of each synchronization task instruction package that has been dispatched to the synchronization task emission component 105 for processing and stored in the scheduling component 102 contains the identification information of the process to be switched. If so, it can be determined that the synchronization task instruction package related to the process to be switched has been dispatched to the synchronization task emission component 105. If not, it can be determined that the synchronization task instruction package related to the process to be switched has not been dispatched to the synchronization task emission component 105.
[0104] Optionally, the computing instruction related to the process to be switched is a computing instruction in a dependent task instruction package or a synchronous task dependent instruction package of the computing task generated by the process to be switched. The computing instruction related to the process to be switched will include the identification information of the process to be switched. If the synchronous task instruction package related to the process to be switched has been dispatched to the synchronous task emission component 105, the scheduling component 102 can detect whether each computing instruction in the synchronous task emission component 105 contains the identification information of the process to be switched. If a computing instruction containing the identification information of the process to be switched is detected, it indicates that the computing instruction is the computing instruction related to the process to be switched. It can be determined that there are computing instructions related to the process to be switched in the synchronous task emission component 105, and the computing instruction containing the identification information of the process to be switched is deleted, and then the identification information of the process to be switched is re-detected. The computing instructions in the synchronous task emission component 105 are included, and the identification information of the process to be switched is not included until it is detected that the identification information of the process to be switched is not included in each computing instruction in the synchronous task emission component 105. After detecting that none of the computing instructions in the synchronization task emission component 105 contains the identification information of the process to be switched, it can be determined that there are no computing instructions related to the process to be switched in the synchronization task emission component 105, and then the process switching completion prompt information is sent to the scheduling software.
[0105] Optionally, after stopping the distribution of dependent task instruction packages and synchronization task instruction packages related to the process to be switched in the local storage space, it also includes: if the dependent task instruction package related to the process to be switched is not distributed to the dependent task processing component 103, and the synchronization task instruction package related to the process to be switched is not distributed to the synchronization task transmitting component 105, then the process switching completion prompt information is sent to the scheduling software.
[0106] Optionally, if the current scheduled task is a task brake instruction, the scheduling component 102 controls the instruction pre-fetch component 101 to stop acquiring dependent task instruction packages and synchronous task instruction packages related to the process to be braked corresponding to the task brake instruction, and cleans up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler 106 corresponding to the process to be braked, the dependent task processing component 103, the dependent task emission component 104 and the synchronous task emission component 105, and recycles the computing instructions related to the process to be braked that have been sent to the heterogeneous unit 109.
[0107] Optionally, the process to be stopped corresponding to the task brake instruction is the process to be stopped represented by the task brake instruction. The task brake instruction contains identification information of the process to be stopped. The control instruction pre-fetch component 101 stops acquiring dependent task instruction packages and synchronous task instruction packages related to the process to be stopped corresponding to the task brake instruction, including: the scheduling component 102 extracts the identification information of the process to be stopped from the task brake instruction, and stores the identification information of the process to be stopped in the stop process identification list in the instruction pre-fetch component 101.
[0108] Optionally, the computing instructions related to the process to be stopped in the local storage space, the hardware scheduler 106 corresponding to the process to be stopped, the dependent task processing component 103, the dependent task transmitting component 104 and the synchronous task transmitting component 105 are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109 are recycled, including: stopping the dispatching of dependent task instruction packages and synchronous task instruction packages related to the process to be stopped in the local storage space; turning off the hardware scheduler 106 corresponding to the process to be stopped, and turning on the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped; if the dependent task instruction package related to the process to be stopped has been dispatched to the dependent task processing component 103, clearing the computing instructions related to the process to be stopped in the dependent task processing component 103; clearing Remove the calculation instructions related to the process to be stopped in the dependent task emission component 104; clear the calculation instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped; re-enable the hardware scheduler 106 corresponding to the process to be stopped; query whether the number of calculation instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task emission component 104 is 0; if the number of calculation instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task emission component 104 is 0, turn off the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped; recycle the calculation instructions related to the process to be stopped that have been sent to the heterogeneous unit 109; after the resource recovery is completed, send the task braking completion prompt information to the scheduling software.
[0109] Optionally, stopping dispatching dependent task instruction packages and synchronous task instruction packages related to the process to be stopped in the local storage space includes: extracting dependent task instruction packages and synchronous task instruction packages containing the identification information of the process to be stopped from the local storage space; storing the extracted dependent task instruction packages and synchronous task instruction packages containing the identification information of the process to be stopped in a stop dispatch queue, and deleting the dependent task instruction packages and synchronous task instruction packages containing the identification information of the process to be stopped stored in the local storage space.
[0110] Optionally, the scheduling component 102 can shut down each hardware scheduler 106, and can also re-enable each hardware scheduler 106. Each hardware scheduler 106 stops receiving information, processing information, and sending information after being shut down. Each hardware scheduler 106 continues to receive information, process information, and send information after being re-enabled. The task filtering switch in each hardware scheduler 106 can be a switch set in each hardware scheduler 106 to determine whether to schedule the computing instructions in the dependent task instruction packet or the synchronous task instruction packet of the computing task generated by the process corresponding to each hardware scheduler 106. The scheduling component 102 can turn on the task filtering switch in each hardware scheduler 106, and can also turn off the task filtering switch in each hardware scheduler 106. If the task filtering switch in the hardware scheduler 106 is turned on, the hardware scheduler 106 does not schedule the computing instructions in the dependent task instruction packet or the synchronous task instruction packet of the computing task generated by the process corresponding to each hardware scheduler 106. If the task filtering switch in the hardware scheduler 106 is turned off, the hardware scheduler 106 schedules the computing instructions in the dependent task instruction packets or synchronous task instruction packets of the computing tasks generated by the processes corresponding to each hardware scheduler 106 .
[0111] Optionally, the scheduling component 102 can determine the hardware scheduler 106 corresponding to the process to be stopped based on the identification information of the process to be stopped, turn off the hardware scheduler 106 corresponding to the process to be stopped, and turn on the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped.
[0112] Optionally, the scheduling component 102 can detect whether the record information of each dependent task instruction package that has been distributed to the dependent task processing component 103 for processing and stored in the scheduling component 102 contains the identification information of the process to be stopped. If the record information of each dependent task instruction package that has been distributed to the dependent task processing component 103 for processing and stored in the scheduling component 102 contains the identification information of the process to be stopped, it can be determined that the dependent task instruction package related to the process to be stopped has been distributed to the dependent task processing component 103. If the record information of each dependent task instruction package that has been distributed to the dependent task processing component 103 for processing and stored in the scheduling component 102 does not contain the identification information of the process to be stopped, it can be determined that the dependent task instruction package related to the process to be stopped has not been distributed to the dependent task processing component 103.
[0113] Optionally, if the dependent task instruction package related to the process to be stopped has been dispatched to the dependent task processing component 103, the scheduling component 102 clears the calculation instructions related to the process to be stopped in the dependent task processing component 103. The calculation instructions related to the process to be stopped are the calculation instructions in the dependent task instruction package of the calculation task generated by the process to be stopped or the calculation instructions in the synchronous task dependent instruction package. The calculation instructions related to the process to be stopped will contain the identification information of the process to be stopped. The scheduling component 102 can delete all the calculation instructions containing the identification information of the process to be stopped in the dependent task processing component 103, thereby clearing the calculation instructions related to the process to be stopped in the dependent task processing component 103.
[0114] Optionally, the scheduling component 102 may delete all computing instructions containing identification information of the process to be stopped in the dependent task emission component 104, thereby clearing the computing instructions related to the process to be stopped in the dependent task emission component 104. The scheduling component 102 may delete all computing instructions containing identification information of the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped, thereby clearing the computing instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped. After clearing the computing instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped, the scheduling component 102 re-enables the hardware scheduler 106 corresponding to the process to be stopped.
[0115] Optionally, querying whether the number of computing instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104 is 0 includes: detecting whether there are computing instructions containing the identification information of the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104; if it is detected that there are no computing instructions containing the identification information of the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104, determining that the number of computing instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104 is 0; if it is detected that there are computing instructions containing the identification information of the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104, deleting the computing instructions containing the identification information of the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104, and after the deletion is completed, determining that the number of computing instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104 is 0.
[0116] Optionally, if the number of computing instructions related to the process to be stopped in the dependent task processing component 103 and the dependent task transmitting component 104 is 0, the scheduling component 102 turns off the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped, and then recycles the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109, and after the resource recycling is completed, sends the task stop completion prompt information to the scheduling software. The task stop completion prompt information can be information pre-set in the scheduling component 102 to indicate that the task stop instruction has been executed.
[0117] Optionally, after closing the hardware scheduler 106 corresponding to the process to be stopped and turning on the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped, it also includes: if the synchronization task instruction package related to the process to be stopped has been dispatched to the synchronization task transmitting component 105, then clearing the calculation instructions related to the process to be stopped in the synchronization task transmitting component 105; clearing the calculation instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped; re-enabling the hardware scheduler 106 corresponding to the process to be stopped; querying whether the number of calculation instructions related to the process to be stopped in the synchronization task transmitting component 105 is 0; if the number of calculation instructions related to the process to be stopped in the synchronization task transmitting component 105 is 0, then turning off the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped; performing resource recovery on the calculation instructions related to the process to be stopped that have been sent to the heterogeneous unit 109; after the resource recovery is completed, sending the task braking completion prompt information to the scheduling software.
[0118] Optionally, the scheduling component 102 can detect whether the record information of each synchronization task instruction packet that has been sent to the synchronization task transmitting component 105 for processing and stored in the scheduling component 102 contains the identification information of the process to be stopped. If so, it can be determined that the synchronization task instruction packet related to the process to be stopped has been sent to the synchronization task transmitting component 105. If not, it can be determined that the synchronization task instruction packet related to the process to be stopped has not been sent to the synchronization task transmitting component 105.
[0119] Optionally, the scheduling component 102 may delete all computing instructions containing the identification information of the process to be stopped in the synchronization task emission component 105, thereby clearing the computing instructions related to the process to be stopped in the synchronization task emission component 105. The scheduling component 102 may determine the hardware scheduler 106 corresponding to the process to be stopped based on the identification information of the process to be stopped, and delete all computing instructions containing the identification information of the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped, thereby clearing the computing instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped. After clearing the computing instructions related to the process to be stopped in the hardware scheduler 106 corresponding to the process to be stopped, the scheduling component 102 re-enables the hardware scheduler 106 corresponding to the process to be stopped.
[0120] Optionally, query whether the number of computing instructions related to the process to be stopped in the synchronization task launching component 105 is 0, including: detecting whether there are computing instructions containing the identification information of the process to be stopped in the synchronization task launching component 105; if it is detected that there are no computing instructions containing the identification information of the process to be stopped in the synchronization task launching component 105, determining that the number of computing instructions related to the process to be stopped in the synchronization task launching component 105 is 0; if it is detected that there are computing instructions containing the identification information of the process to be stopped in the synchronization task launching component 105, deleting the computing instructions containing the identification information of the process to be stopped in the synchronization task launching component 105, and after the deletion is completed, determining that the number of computing instructions related to the process to be stopped in the synchronization task launching component 105 is 0.
[0121] Optionally, if the number of computing instructions related to the process to be stopped in the synchronous task emission component 105 is 0, the scheduling component 102 turns off the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped, and recycles the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109. After the resource recovery is completed, the task stopping completion prompt information is sent to the scheduling software.
[0122] Optionally, after closing the hardware scheduler corresponding to the process to be stopped and turning on the task filtering switch of the hardware scheduler corresponding to the process to be stopped, it also includes: if the dependent task instruction package related to the process to be stopped is not dispatched to the dependent task processing component 103, and the synchronous task instruction package related to the process to be stopped is not dispatched to the synchronous task transmitting component 105, then re-enabling the hardware scheduler 106 corresponding to the process to be stopped; turning off the task filtering switch of the hardware scheduler 106 corresponding to the process to be stopped; sending the process switching completion prompt information to the scheduling software.
[0123] Optionally, resource recovery is performed on the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109, including: detecting whether the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109 have been executed; if it is detected that the computing instructions have been executed, and the heterogeneous unit 109 that executes the computing instructions has released the resources used when executing the computing instructions, then determining that the resource recovery is completed; if it is detected that the computing instructions are executed abnormally, then controlling the heterogeneous unit 109 that executes the computing instructions to stop executing the computing instructions and release the resources used when executing the computing instructions, and after determining that the resource release is completed, determining that the resource recovery is completed. The scheduling component 102 can monitor the process of each heterogeneous unit 109 executing the computing instructions, and can control each heterogeneous unit 109 to stop executing the computing instructions and release the resources used when executing the computing instructions.
[0124] Optionally, detecting whether the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109 are executed completely includes: detecting whether there are computing instructions containing the identification information of the process to be stopped in the computing instructions to be executed in each heterogeneous unit 109 and the currently executed instructions; if there are computing instructions containing the identification information of the process to be stopped in the target heterogeneous unit, monitoring the execution process of the computing instructions containing the identification information of the process to be stopped in the target heterogeneous unit; after monitoring that the target heterogeneous unit has completed the execution of the computing instructions containing the identification information of the process to be stopped, and the target heterogeneous unit has released the resources used to execute the computing instructions containing the identification information of the process to be stopped, determining that the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit have been executed completely, and the heterogeneous unit 109 that executes the computing instructions has released the resources used to execute the computing instructions; after monitoring that the time length for the target heterogeneous unit to complete the execution of the computing instructions containing the identification information of the process to be stopped is greater than the preset time length, determining that the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit 109 are executed abnormally. The target heterogeneous unit is one or more heterogeneous units 109 that contain computing instructions containing identification information of the process to be stopped. The resources used by the heterogeneous unit 109 when executing the computing instructions include, but are not limited to, computing units and memory units in the chip. The computing unit may be a hardware component for performing calculation operations on data. The storage unit may be a subspace divided from the memory space of the chip for storing data. Releasing resources may mean stopping the use of resources. The preset duration may be a pre-set duration. Normally, if the duration for the heterogeneous unit 109 to execute the computing instruction is greater than the preset duration, it indicates that the duration for the heterogeneous unit 109 to execute the computing instruction is too long and the computing instruction execution is abnormal.
[0125] In the technical solution of the embodiment of the present invention, the scheduling component obtains a dependent task instruction package, a synchronization task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduling task; if the current scheduling task is a dependent task instruction package, the scheduling component sends the dependent task instruction package to the dependent task processing component; if the current scheduling task is a synchronization task instruction package, the scheduling component sends the synchronization task instruction package to the synchronization task transmitting component; if the current scheduling task is a process switching instruction, the scheduling component controls the instruction prefetch component to stop obtaining the dependent task instruction package and the synchronization task instruction package related to the process to be switched corresponding to the process switching instruction, and cleans up the calculation instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronization task transmitting component; if the current scheduling task is a task brake instruction, the scheduling component controls the instruction prefetch component to stop obtaining the dependent task instruction package and the synchronization task instruction package related to the process to be stopped corresponding to the task brake instruction, and cleans up the local storage space, the hardware scheduler corresponding to the process to be stopped, and the dependent task processing component. The computing instructions related to the process to be stopped in the processing component, the dependent task emission component and the synchronous task emission component are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous units are recycled, so as to solve the problem that the task scheduling scheme in the related technology cannot clean up the computing instructions in the computing tasks related to the currently running process in the scheduling process when the process running in the chip needs to switch from the currently running process to the new process, and cannot clean up the computing instructions in the computing tasks related to the currently running process when the computing tasks related to the currently running process need to be forced to stop, resulting in low scheduling efficiency and seriously affecting the normal operation of the chip. When the process running in the chip needs to switch from the currently running process to the new process, the computing instructions in the computing tasks related to the currently running process in the scheduling process can be automatically cleaned up, and when the computing tasks related to the currently running process need to be forced to stop, the computing instructions in the computing tasks related to the currently running process can be automatically cleaned up, thereby improving the scheduling efficiency and ensuring the normal operation of the chip.
[0126] Embodiment 2
[0127] Figure 2 This is a flowchart of a task scheduling method provided in the second embodiment of the present invention. This embodiment is applicable to the case of scheduling computing tasks generated by processes running in a chip. This method can be applied to the scheduling component in the task scheduling system provided in the above embodiment of the present invention. Figure 2 As shown, the method of this embodiment specifically includes:
[0128] Step 201: Obtain a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from a local storage space as a current scheduling task.
[0129] Step 202: If the currently scheduled task is a dependent task instruction package, the dependent task instruction package is sent to the dependent task processing component.
[0130] Step 203: If the current scheduled task is a synchronous task instruction packet, the synchronous task instruction packet is sent to the synchronous task transmitting component.
[0131] Step 204: If the currently scheduled task is a process switching instruction, the control instruction prefetch component stops acquiring dependent task instruction packages and synchronous task instruction packages related to the process to be switched corresponding to the process switching instruction, and cleans up the computing instructions related to the process to be switched in the local storage space, dependent task processing component and synchronous task emission component.
[0132] Optionally, computing instructions related to the process to be switched in the local storage space, dependent task processing component and synchronous task emission component are cleaned up, including: stopping the dispatching of dependent task instruction packages and synchronous task instruction packages related to the process to be switched in the local storage space; if the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component, and the processing unit in the dependent task processing component is processing the dispatched dependent task instruction package, then the counting information and resource information related to the dispatched dependent task instruction package are recorded, the processing unit is released, and the process switching completion prompt information is sent to the scheduling software; the instruction prefetch component and the dependent task processing component are configured according to the status information, counting information and resource information of the new process corresponding to the process switching instruction.
[0133] Optionally, after stopping dispatching dependent task instruction packages and synchronization task instruction packages related to the process to be switched in the local storage space, it also includes: if the synchronization task instruction package related to the process to be switched has been dispatched to the synchronization task launching component, then detecting whether there are computing instructions related to the process to be switched in the synchronization task launching component; after detecting that there are no computing instructions related to the process to be switched in the synchronization task launching component, sending a process switching completion prompt message to the scheduling software.
[0134] Step 205: If the current scheduled task is a task brake instruction, the control instruction pre-fetch component stops acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction, and cleans up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task transmitting component and the synchronous task transmitting component, and recycles the computing instructions related to the process to be braked that have been sent to the heterogeneous units.
[0135] Optionally, the computing instructions related to the process to be stopped in the local storage space, the hardware scheduler corresponding to the process to be stopped, the dependent task processing component, the dependent task transmitting component and the synchronous task transmitting component are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous units are recycled, including: stopping the dispatching of dependent task instruction packages and synchronous task instruction packages related to the process to be stopped in the local storage space; turning off the hardware scheduler corresponding to the process to be stopped, and turning on the task filtering switch of the hardware scheduler corresponding to the process to be stopped; if the dependent task instruction package related to the process to be stopped has been dispatched to the dependent task processing component, clearing the computing instructions related to the process to be stopped in the dependent task processing component; clearing Depends on the computing instructions related to the process to be stopped in the task emission component; clears the computing instructions related to the process to be stopped in the hardware scheduler corresponding to the process to be stopped; re-enables the hardware scheduler corresponding to the process to be stopped; queries whether the number of computing instructions related to the process to be stopped in the dependent task processing component and the dependent task emission component is 0; if the number of computing instructions related to the process to be stopped in the dependent task processing component and the dependent task emission component is 0, then turns off the task filtering switch of the hardware scheduler corresponding to the process to be stopped; recycles the computing instructions related to the process to be stopped that have been sent to the heterogeneous units; after the resource recovery is completed, sends the task braking completion prompt information to the scheduling software.
[0136] Optionally, after closing the hardware scheduler corresponding to the process to be stopped and turning on the task filtering switch of the hardware scheduler corresponding to the process to be stopped, it also includes: if the synchronization task instruction package related to the process to be stopped has been dispatched to the synchronization task transmitting component, then clearing the calculation instructions related to the process to be stopped in the synchronization task transmitting component; clearing the calculation instructions related to the process to be stopped in the hardware scheduler corresponding to the process to be stopped; re-enabling the hardware scheduler corresponding to the process to be stopped; querying whether the number of calculation instructions related to the process to be stopped in the synchronization task transmitting component is 0; if the number of calculation instructions related to the process to be stopped in the synchronization task transmitting component is 0, then turning off the task filtering switch of the hardware scheduler corresponding to the process to be stopped; performing resource recovery on the calculation instructions related to the process to be stopped that have been sent to the heterogeneous units; after the resource recovery is completed, sending the task braking completion prompt information to the scheduling software.
[0137] Optionally, resource recovery is performed on computing instructions related to the process to be stopped that have been sent to the heterogeneous unit, including: detecting whether the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit have been executed; if it is detected that the computing instructions have been executed and the heterogeneous unit that executes the computing instructions has released the resources used when executing the computing instructions, then determining that the resource recovery is completed; if it is detected that the computing instructions are executed abnormally, controlling the heterogeneous unit that executes the computing instructions to stop executing the computing instructions and release the resources used when executing the computing instructions, and after determining that the resource release is completed, determining that the resource recovery is completed.
[0138] The technical solution of the embodiment of the present invention can automatically clean up the computing instructions in the computing tasks related to the currently running process that are in the scheduling process when the process running in the chip needs to switch from the currently running process to a new process. It can also automatically clean up the computing instructions in the computing tasks related to the currently running process when the computing tasks related to the currently running process need to be forcibly stopped, thereby improving the scheduling efficiency and ensuring the normal operation of the chip.
[0139] Embodiment 3
[0140] Figure 3 FIG. 1 is a schematic diagram of the structure of a task scheduling device provided in Embodiment 3 of the present invention. The device may be configured in a scheduling component in the task scheduling system provided in the above-mentioned embodiment of the present invention. Figure 3 As shown, the device includes: a task acquisition module 301, a dependent task scheduling module 302, a synchronous task scheduling module 303, a process switching instruction execution module 304 and a task brake instruction execution module 305.
[0141] Among them, the task acquisition module 301 is used to obtain a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduled task; the dependent task scheduling module 302 is used to send the dependent task instruction package to the dependent task processing component if the current scheduled task is a dependent task instruction package; the synchronous task scheduling module 303 is used to send the synchronous task instruction package to the synchronous task transmitting component if the current scheduled task is a synchronous task instruction package; the process switching instruction execution module 304 is used to control the instruction pre-fetching component to stop obtaining the dependent task instruction package and synchronous task instruction package related to the process to be switched corresponding to the process switching instruction if the current scheduled task is a process switching instruction. The task brake instruction execution module 305 is used to control the instruction pre-fetching component to stop acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction if the current scheduled task is a task brake instruction, and clean up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task launching component and the synchronous task launching component, and recycle the computing instructions related to the process to be braked that have been sent to the heterogeneous unit.
[0142] The technical solution of the embodiment of the present invention can automatically clean up the computing instructions in the computing tasks related to the currently running process that are in the scheduling process when the process running in the chip needs to switch from the currently running process to a new process. It can also automatically clean up the computing instructions in the computing tasks related to the currently running process when the computing tasks related to the currently running process need to be forcibly stopped, thereby improving the scheduling efficiency and ensuring the normal operation of the chip.
[0143] In an optional implementation of an embodiment of the present invention, optionally, when the process switching instruction execution module 304 executes the operation of clearing the computing instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronous task emission component, it is specifically used to: stop dispatching the dependent task instruction package and the synchronous task instruction package related to the process to be switched in the local storage space; if the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component, and the processing unit in the dependent task processing component is processing the dispatched dependent task instruction package, then the counting information and resource information related to the dispatched dependent task instruction package are recorded, the processing unit is released, and the process switching completion prompt information is sent to the scheduling software; according to the status information, counting information and resource information of the new process corresponding to the process switching instruction, the instruction prefetch component and the dependent task processing component are configured.
[0144] In an optional implementation of an embodiment of the present invention, optionally, the process switching instruction execution module 304 is also used for: if the synchronization task instruction package related to the process to be switched has been dispatched to the synchronization task launching component, then detecting whether there are computing instructions related to the process to be switched in the synchronization task launching component, and after detecting that there are no computing instructions related to the process to be switched in the synchronization task launching component, sending the process switching completion prompt information to the scheduling software.
[0145] In an optional implementation of an embodiment of the present invention, optionally, when the task brake instruction execution module 305 performs the operation of cleaning up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task transmission component and the synchronous task transmission component, and performing resource recovery operations on the computing instructions related to the process to be braked that have been sent to the heterogeneous units, it is specifically used to: stop dispatching the dependent task instruction packages and synchronous task instruction packages related to the process to be braked in the local storage space; turn off the hardware scheduler corresponding to the process to be braked, and turn on the task filtering switch of the hardware scheduler corresponding to the process to be braked; if the dependent task instruction package related to the process to be braked has been dispatched to the dependent task processing component, clear the dependent task processing component clear the computing instructions related to the process to be stopped in the dependent task transmitting component; clear the computing instructions related to the process to be stopped in the hardware scheduler corresponding to the process to be stopped; re-enable the hardware scheduler corresponding to the process to be stopped; query whether the number of computing instructions related to the process to be stopped in the dependent task processing component and the dependent task transmitting component is 0; if the number of computing instructions related to the process to be stopped in the dependent task processing component and the dependent task transmitting component is 0, turn off the task filtering switch of the hardware scheduler corresponding to the process to be stopped; recycle the computing instructions related to the process to be stopped that have been sent to the heterogeneous units; after the resource recovery is completed, send the task braking completion prompt information to the scheduling software.
[0146] In an optional implementation of an embodiment of the present invention, optionally, the task brake instruction execution module 305 is also used for: after closing the hardware scheduler corresponding to the process to be braked and turning on the task filtering switch of the hardware scheduler corresponding to the process to be braked, it also includes: if the synchronization task instruction package related to the process to be braked has been dispatched to the synchronization task transmitting component, then clear the calculation instructions related to the process to be braked in the synchronization task transmitting component; clear the calculation instructions related to the process to be braked in the hardware scheduler corresponding to the process to be braked; re-enable the hardware scheduler corresponding to the process to be braked; query whether the number of calculation instructions related to the process to be braked in the synchronization task transmitting component is 0; if the number of calculation instructions related to the process to be braked in the synchronization task transmitting component is 0, then turn off the task filtering switch of the hardware scheduler corresponding to the process to be braked; recycle resources for the calculation instructions related to the process to be braked that have been sent to the heterogeneous unit; after the resource recovery is completed, send the task brake completion prompt information to the scheduling software.
[0147] In an optional implementation of an embodiment of the present invention, optionally, when the task brake instruction execution module 305 executes the operation of recovering resources for the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit, it is specifically used to: detect whether the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit are executed; if it is detected that the computing instructions have been executed and the heterogeneous unit that executes the computing instructions has released the resources used when executing the computing instructions, then determine that the resource recovery is completed; if it is detected that the computing instructions are executed abnormally, then control the heterogeneous unit that executes the computing instructions to stop executing the computing instructions, release the resources used when executing the computing instructions, and after determining that the resource release is completed, determine that the resource recovery is completed.
[0148] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0149] The above-mentioned task scheduling device can execute the task scheduling method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the task scheduling method.
[0150] Embodiment 4
[0151] Figure 4 The structure diagram of the electronic device 10 that can be used to implement the task scheduling method of the embodiment of the present invention is shown. The components shown herein, their connections and relationships, and their functions are only for example, and are not intended to limit the implementation of the present invention described and / or required herein.
[0152] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program built from the storage unit 18 to the random access memory (RAM) 13. In the random access memory (RAM) 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the read-only memory (ROM) 12 and the random access memory (RAM) 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0153] A number of components in the electronic device 10 are connected to an input / output (I / O) interface 15, including an input unit 16, such as a keyboard, a mouse, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0154] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a task scheduling method.
[0155] In some embodiments, the task scheduling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via a read-only memory (ROM) 12 and / or a communication unit 19. When the computer program is built into a random access memory (RAM) 13 and executed by the processor 11, one or more steps of the task scheduling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the task scheduling method in any other appropriate manner (e.g., by means of firmware).
[0156] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0157] The computer program for implementing the task scheduling method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or the block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0158] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0159] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0160] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0161] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0162] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0163] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A task scheduling system, characterized in that: include: An instruction prefetch component, a scheduling component, a dependent task processing component, a dependent task emission component, a synchronous task emission component, a preset number of hardware schedulers, a resource management component, a scheduling execution component, and at least two heterogeneous units; The instruction pre-fetch component is used to store the dependent task instruction package, the synchronous task instruction package, the process switching instruction or the task brake instruction in the task storage space into the local storage space of the scheduling component; The scheduling component is used to obtain a dependent task instruction package, a synchronous task instruction package, a process switching instruction or a task brake instruction from the local storage space as the current scheduling task; if the current scheduling task is a dependent task instruction package, the dependent task instruction package is sent to the dependent task processing component; if the current scheduling task is a synchronous task instruction package, the synchronous task instruction package is sent to the synchronous task transmitting component; if the current scheduling task is a process switching instruction, the instruction prefetch component is controlled to stop obtaining the dependent task instruction package and the synchronous task instruction package related to the process to be switched corresponding to the process switching instruction, and the local storage space, the dependent task instruction package, the synchronous task instruction package, the process switching ... The task processing component and the computing instructions related to the process to be switched in the synchronous task emission component are cleaned up; if the current scheduled task is a task brake instruction, the instruction pre-fetch component is controlled to stop acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be stopped corresponding to the task brake instruction, and the computing instructions related to the process to be stopped in the local storage space, the hardware scheduler corresponding to the process to be stopped, the dependent task processing component, the dependent task emission component and the synchronous task emission component are cleaned up, and the computing instructions related to the process to be stopped that have been sent to the heterogeneous unit are recycled; The dependent task processing component is used to send each calculation instruction in the dependent task instruction package to the dependent task transmitting component according to a pre-designed value; The dependent task transmitting component is used to send each computing instruction in the dependent task instruction package to the hardware scheduler corresponding to the process to which the dependent task instruction package belongs; The synchronization task transmitting component is used to send each computing instruction in the synchronization task instruction packet to the hardware scheduler corresponding to the process to which the synchronization task instruction packet belongs; Each of the hardware schedulers is used to, after receiving each computing instruction in the dependent task instruction packet, obtain the resource status of each of the heterogeneous units from the resource management component, determine the available heterogeneous units of the dependent task instruction packet according to the task information of the dependent task instruction packet and the resource status of each of the heterogeneous units; send the heterogeneous unit application request corresponding to the available heterogeneous units of the dependent task instruction packet to the resource management component; after receiving the application success prompt information fed back by the resource management component, send each computing instruction in the dependent task instruction packet, the available heterogeneous units of the dependent task instruction packet, and the resource status of each of the heterogeneous units. The identification information of each computing instruction is sent to the scheduling execution component; after receiving each computing instruction in the synchronization task instruction package, the resource status of each heterogeneous unit is obtained from the resource management component, and the available heterogeneous units of each computing instruction are determined according to the task information of each computing instruction and the resource status of each heterogeneous unit; the heterogeneous unit application request corresponding to the available heterogeneous unit of each computing instruction is sent to the resource management component; after receiving the application success prompt information fed back by the resource management component, the identification information of each computing instruction and the available heterogeneous unit of each computing instruction is sent to the scheduling execution component; The resource management component is used to manage the resource status of each of the heterogeneous units; after receiving the heterogeneous unit application request sent by each of the hardware schedulers, according to the resource status of each of the heterogeneous units, feedback application success prompt information or application failure prompt information to each of the hardware schedulers; The scheduling execution component is used to send each computing instruction in the dependent task instruction packet to the available heterogeneous unit of the dependent task instruction packet according to the identification information of the available heterogeneous unit of the dependent task instruction packet after receiving each computing instruction in the dependent task instruction packet and the identification information of the available heterogeneous unit of the dependent task instruction packet; after receiving each computing instruction and the identification information of the available heterogeneous unit of each computing instruction, send each computing instruction to the available heterogeneous unit of each computing instruction according to the identification information of the available heterogeneous unit of each computing instruction; Each of the heterogeneous units is used to execute each computing instruction in the dependent task instruction package in sequence after receiving each computing instruction in the dependent task instruction package; and execute the computing instruction after receiving the computing instruction in the synchronous task instruction package.
2. A task scheduling method, applied to the scheduling component in the task scheduling system as claimed in claim 1, characterized in that: include: Obtain dependent task instruction packages, synchronous task instruction packages, process switching instructions or task stop instructions from the local storage space as the current scheduling task; If the currently scheduled task is a dependent task instruction packet, sending the dependent task instruction packet to a dependent task processing component; If the currently scheduled task is a synchronous task instruction packet, the synchronous task instruction packet is sent to the synchronous task transmitting component; If the currently scheduled task is a process switching instruction, the control instruction prefetch component stops acquiring dependent task instruction packets and synchronous task instruction packets related to the process to be switched corresponding to the process switching instruction, and cleans up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronous task emission component; If the currently scheduled task is a task brake instruction, the control instruction pre-fetch component stops acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction, and cleans up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task emission component and the synchronous task emission component, and recycles the computing instructions related to the process to be braked that have been sent to the heterogeneous units.
3. The task scheduling method according to claim 2, characterized in that: Cleaning up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component, and the synchronous task emission component, including: Stop dispatching dependent task instruction packets and synchronous task instruction packets related to the process to be switched in the local storage space; If the dependent task instruction package related to the process to be switched has been dispatched to the dependent task processing component, and the processing unit in the dependent task processing component is processing the dispatched dependent task instruction package, then the counting information and resource information related to the dispatched dependent task instruction package are recorded, the processing unit is released, and the process switching completion prompt information is sent to the scheduling software; The instruction prefetch component and the dependent task processing component are configured according to the state information, count information and resource information of the new process corresponding to the process switching instruction.
4. The task scheduling method according to claim 3, characterized in that: After stopping the dispatching of the dependent task instruction packet and the synchronization task instruction packet related to the process to be switched in the local storage space, the method further includes: If the synchronization task instruction package related to the process to be switched has been dispatched to the synchronization task launching component, the synchronization task launching component is detected to see whether there are any calculation instructions related to the process to be switched. After detecting that there are no calculation instructions related to the process to be switched in the synchronization task launching component, the process switching completion prompt information is sent to the scheduling software.
5. The task scheduling method according to claim 2, characterized in that: Clean up the computing instructions related to the process to be stopped in the local storage space, the hardware scheduler corresponding to the process to be stopped, the dependent task processing component, the dependent task emission component and the synchronous task emission component, and recycle the computing instructions related to the process to be stopped that have been sent to the heterogeneous units, including: Stop dispatching dependent task instruction packets and synchronous task instruction packets related to the process to be stopped in the local storage space; Turn off the hardware scheduler corresponding to the process to be stopped, and turn on the task filtering switch of the hardware scheduler corresponding to the process to be stopped; If the dependent task instruction package related to the process to be stopped has been dispatched to the dependent task processing component, clearing the calculation instructions related to the process to be stopped in the dependent task processing component; Clearing the calculation instructions related to the waiting braking process in the dependent task launch component; Clearing the calculation instructions related to the process to be stopped in the hardware scheduler corresponding to the process to be stopped; Re-enabling the hardware scheduler corresponding to the process to be stopped; Query whether the number of computing instructions related to the waiting-to-stop process in the dependent task processing component and the dependent task transmitting component is 0; If the number of computing instructions related to the process to be stopped in the dependent task processing component and the dependent task transmitting component is 0, turning off the task filtering switch of the hardware scheduler corresponding to the process to be stopped; Recycling the computing instructions related to the process to be stopped and sent to the heterogeneous units; After resource recovery is completed, a task stop completion prompt message is sent to the scheduling software.
6. The task scheduling method according to claim 5, characterized in that: After closing the hardware scheduler corresponding to the process to be stopped and opening the task filtering switch of the hardware scheduler corresponding to the process to be stopped, the method further includes: If the synchronization task instruction packet related to the process to be stopped has been dispatched to the synchronization task transmitting component, clearing the calculation instructions related to the process to be stopped in the synchronization task transmitting component; Clearing the calculation instructions related to the process to be stopped in the hardware scheduler corresponding to the process to be stopped; Re-enabling the hardware scheduler corresponding to the process to be stopped; Query whether the number of calculation instructions related to the process to be stopped in the synchronous task transmitting component is 0; If the number of computing instructions related to the process to be stopped in the synchronous task transmitting component is 0, turning off the task filtering switch of the hardware scheduler corresponding to the process to be stopped; Recycling the computing instructions related to the process to be stopped and sent to the heterogeneous units; After resource recovery is completed, a task stop completion prompt message is sent to the scheduling software.
7. The task scheduling method according to claim 5 or 6, characterized in that: Resource recovery is performed on the computing instructions related to the process to be stopped that have been sent to the heterogeneous units, including: Detecting whether the calculation instructions related to the waiting braking process that have been sent to the heterogeneous units have been executed; If it is detected that the computing instruction has been executed and the heterogeneous unit executing the computing instruction has released the resources used when executing the computing instruction, it is determined that the resource recycling is completed; If an execution exception of the computing instruction is detected, the heterogeneous unit executing the computing instruction is controlled to stop executing the computing instruction, release the resources used when executing the computing instruction, and after determining that the resource release is completed, determine that the resource recovery is completed.
8. A task scheduling device, configured in a scheduling component in the task scheduling system according to claim 1, characterized in that: include: A task acquisition module is used to acquire dependent task instruction packages, synchronous task instruction packages, process switching instructions or task brake stop instructions from the local storage space as the current scheduling task; A dependent task scheduling module, configured to send the dependent task instruction package to a dependent task processing component if the currently scheduled task is a dependent task instruction package; A synchronization task scheduling module, configured to send the synchronization task instruction packet to the synchronization task transmitting component if the current scheduling task is a synchronization task instruction packet; A process switching instruction execution module, which is used to control the instruction pre-fetching component to stop acquiring dependent task instruction packets and synchronous task instruction packets related to the process to be switched corresponding to the process switching instruction if the current scheduled task is a process switching instruction, and to clean up the computing instructions related to the process to be switched in the local storage space, the dependent task processing component and the synchronous task transmitting component; The task brake instruction execution module is used to control the instruction pre-fetch component to stop acquiring the dependent task instruction package and the synchronous task instruction package related to the process to be braked corresponding to the task brake instruction if the currently scheduled task is a task brake instruction, and to clean up the computing instructions related to the process to be braked in the local storage space, the hardware scheduler corresponding to the process to be braked, the dependent task processing component, the dependent task transmitting component and the synchronous task transmitting component, and recycle the computing instructions related to the process to be braked that have been sent to the heterogeneous units.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the task scheduling method described in any one of claims 2 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task scheduling method according to any one of claims 2 to 7 when executed.
Citation Information
Cited By
Remote control system of PLC control cabinet
CN120335384A
A remote control system for a PLC control cabinet
CN120335384B
