Task queue scheduling method, processing method, processor, electronic equipment and storage medium

By hierarchically configuring hardware execution resource slots and optimizing scheduling strategies in the processor, frequent offloading and loading problems caused by oversubscription of task queues are solved, and the overall processing efficiency and resource utilization of the processor are improved, ensuring high priority and resident Stable operation of tasks.

CN119201403APending Publication Date: 2024-12-27CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411383010.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

When existing processors are multitasking, due to oversubscription of task queues, the queues are frequently unloaded and loaded, which reduces the overall processing efficiency, especially high priority and resident tasks are interrupted, affecting resource utilization.

Method used

By configuring at least two hardware execution resource slots in the processor, used for normal and high priority task queues, the hardware scheduling module only performs unloading and loading operations on the normal task queue when the task queue is oversubscribed, while maintaining high priority The resource slot state of the task queue remains unchanged, and broadcast marking is used to optimize the unloading and loading process to reduce frequent switching.

Benefits of technology

It improves the overall processing efficiency of the processor under high load conditions, ensures the stable operation of high priority and resident tasks, reduces the need for frequent unloading and loading, and improves resource utilization and task scheduling fluency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201403A_ABST
    Figure CN119201403A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task queue scheduling method, a task queue processing method, a processor, electronic equipment and a storage medium, relates to the technical field of processor resource management, and is convenient for effectively improving the overall processing efficiency of multi-task operation. The processor comprises at least two hardware execution resource slots, at least one first hardware execution resource slot is configured to execute a first type of task queue, and at least one second hardware execution resource slot is configured to execute a second type of task queue, the time slice length or priority of the hardware execution resource slot occupied by the second type of task queue is higher than that of the first type of task queue; and the hardware scheduling module is configured to perform task queue unloading operation on the at least one first hardware execution resource slot and keep the state of the at least one second hardware execution resource slot unchanged when the number of the received task queues is greater than the number of the hardware execution resource slots. The method and the device are suitable for chip hardware design, configuration and task job processing scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of processor resource management, and in particular to a task queue scheduling method, a processing method, a processor, an electronic device and a storage medium. Background Art

[0002] The processor is an important hardware resource in a device with computing power. It can execute multiple job tasks in parallel to improve processing efficiency. When executing multiple job tasks, a hardware queue resource pool will be configured in the processor to support the task queue processing tasks. Among them, the hardware queue resource pool includes at least one hardware execution resource slot, which is used to process at least one task queue. When the number of task queues exceeds the number of available hardware execution resource slots, the processor will allocate and schedule the task queues, which mainly involves determining the matching relationship between the task queues and the hardware execution resource slots, and notifying the working queues to unload in turn, while allowing the unworking task queues to load.

[0003] The current scheduling strategies mainly include time slice scheduling and priority preemptive scheduling. Although the execution efficiency of frequent work tasks can be improved by opening a high-priority command path, these solutions still require continuous unloading and loading of queues, which may cause the working queues to be interrupted, reducing the overall processing efficiency. Summary of the invention

[0004] In view of this, embodiments of the present application provide a task queue scheduling method, a processing method, a processor, an electronic device, and a storage medium, which are convenient for effectively improving the overall processing efficiency of multi-task operations.

[0005] In order to achieve the above application purpose, the following technical solutions are adopted: An embodiment of the present application provides a processor, comprising: at least two hardware execution resource slots, wherein at least one first hardware execution resource slot is configured to execute a first type of task queue, and at least one second hardware execution resource slot is configured to execute a second type of task queue, and the second type of task queue occupies a time slice length or has a higher priority than the first type of task queue occupies the hardware execution resource slot. The hardware scheduling module is configured to, when the number of received task queues is greater than the number of hardware execution resource slots, unload the task queue operation on at least one of the first hardware execution resource slots and keep the state of at least one of the second hardware execution resource slots unchanged.

[0007] According to a specific implementation of an embodiment of the present application, the hardware scheduling module is configured to unload the task queue operation on at least one of the first hardware execution resource slots when the number of received task queues is greater than the number of hardware execution resource slots, including: Query the properties of all current hardware resource slots to obtain the occupancy status of each of the hardware execution resource slots; Determine whether the number of currently received task queues is greater than the number of currently idle hardware execution resource slots; If yes, then according to the occupation status of at least one of the first hardware execution resource slots, determine to enable the corresponding broadcast mark; wherein the broadcast mark is at least used for the marked first hardware execution resource slot; An uninstallation notification is sent to the corresponding first hardware execution resource slot according to the broadcast tag to uninstall the corresponding first type of task queue, and the first type of task queue uninstalled this time is sent to the scheduling sorting list.

[0008] According to a specific implementation of an embodiment of the present application, the hardware scheduling module is further configured to, when the number of received task queues is greater than the number of hardware execution resource slots, perform a task queue loading operation on at least one of the first hardware execution resource slots, including: Query the occupation status of all current first hardware execution resource slots to determine whether there is an idle first hardware execution resource slot; If yes, select the first type of task queue to be loaded from the scheduling sort list; The first type of task queue is matched with an idle first hardware execution resource slot, and the occupation status of the first hardware execution resource slot is updated.

[0009] According to a specific implementation of the embodiment of the present application, after matching the first type of task queue with the idle first hardware execution resource slot, the hardware scheduling module is further configured to: query whether the occupation status of all first hardware execution resource slots has been updated in the current scheduling cycle; If yes, then the scheduling task in the current cycle is terminated; If not, then poll the occupancy status of all current first hardware execution resource slots. In a second aspect, the present application also provides an embodiment of a task queue scheduling method, including: when the number of received task queues is greater than the number of hardware execution resource slots, unloading the task queue operation on at least one first hardware execution resource slot, keeping the occupancy state of at least one second hardware execution resource slot unchanged; wherein, the at least one first hardware execution resource slot is configured to execute a first type of task queue, and the at least one second hardware execution resource slot is configured to execute a second type of task queue, and the second type of task queue occupies a higher time slice length or priority of the hardware execution resource slot than the first type of task queue occupies a higher time slice length or priority of the hardware execution resource slot.

[0010] According to a specific implementation of an embodiment of the present application, when the number of received task queues is greater than the number of hardware execution resource slots, performing an unloading task queue operation on at least one of the first hardware execution resource slots includes: Query the properties of all current hardware resource slots to obtain the occupancy status of each of the hardware execution resource slots; Determine whether the number of currently received task queues is greater than the number of currently idle hardware execution resource slots; If yes, then according to the occupation status of at least one of the first hardware execution resource slots, determine to enable the corresponding broadcast mark; wherein the broadcast mark is at least used for the marked first hardware execution resource slot; An uninstallation notification is sent to the corresponding first hardware execution resource slot according to the broadcast tag to uninstall the corresponding first type of task queue, and the first type of task queue uninstalled this time is sent to the scheduling sorting list.

[0011] According to a specific implementation of the embodiment of the present application, the method further includes: when the number of received task queues is greater than the number of hardware execution resource slots, performing a task queue loading operation on at least one of the first hardware execution resource slots, including: querying the occupation status of all current first hardware execution resource slots to determine whether there is an idle first hardware execution resource slot; If yes, select the first type of task queue to be loaded from the scheduling sort list; The first type of task queue is matched with an idle first hardware execution resource slot.

[0012] According to a specific implementation of the embodiment of the present application, after matching the first type of task queue with the idle first hardware execution resource slot, it also includes: querying whether the occupation status of all first hardware execution resource slots has been updated in the current scheduling cycle; If yes, then the scheduling task in the current cycle is terminated; If not, then poll the occupancy status of all current first hardware execution resource slots.

[0013] In a third aspect, the present application also provides a task job processing method, including: creating at least one task queue according to the received task job, each task queue carrying attribute information; the attribute information includes: an identity identifier, a timestamp and a priority of the task queue; According to the attribute information, determining the type of the hardware execution resource slot applied for by the at least one task queue currently created; the type of the hardware execution resource slot is related to the time slice length or priority of the task queue; According to the determined type of the hardware execution resource slot, the hardware execution resource slot of the type is matched with the at least one task queue.

[0014] According to a specific implementation of an embodiment of the present application, matching the type of the hardware execution resource slot with the at least one task queue according to the determined type of the hardware execution resource slot includes: If the first hardware execution resource slot is determined according to the type of the hardware execution resource slot, determining whether there is an idle first hardware execution resource slot; If the second hardware execution resource slot is determined to be a second hardware execution resource slot according to the type of the hardware execution resource slot, a legitimacy check is performed on the current application event of the second hardware execution resource slot; the legitimacy check is used to detect whether the current application quantity of the second hardware execution resource slot exceeds a threshold; If it is legal, continue to determine whether there is a second hardware execution resource slot in an idle state; If it is illegal, it will feedback that the application for the second hardware execution resource slot has failed.

[0015] According to a specific implementation of the embodiment of the present application, after continuing to determine whether there is an idle second hardware execution resource slot, it also includes: if there is an idle second hardware execution resource slot, selecting an idle second hardware execution resource slot; If there is no idle second hardware execution resource slot, unloading a first hardware execution resource slot to make it idle; Changing the type attribute configuration of the first hardware execution resource slot that has become idle to a second hardware execution resource slot; And, matching the changed second hardware execution resource slot with the at least one task queue.

[0016] According to a specific implementation of the embodiment of the present application, after the feedback of the failure of applying for the second hardware execution resource slot is given, it also includes: applying for the first hardware execution resource slot for the at least one task queue for matching, and continuing to determine whether there is an idle first hardware execution resource slot; If there is an idle first hardware execution resource slot, the idle first hardware execution resource slot is matched with the at least one task queue, and the occupation status of the first hardware execution resource slot is updated.

[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, including: One or more processors; Memory; The memory stores one or more executable program codes, and the one or more processors read the executable program codes stored in the memory and run programs corresponding to the executable program codes to execute any of the task queue scheduling methods described in the second aspect; or To be used to execute any task operation processing method described in the third aspect.

[0018] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to execute any of the task queue scheduling methods described in the second aspect; or, To be used to execute any task operation processing method described in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A schematic diagram of a typical architecture and task operation flow of a GPU embodiment; Figure 2 Schematic diagram of the oversubscription problem.

[0021] Figure 3 This is a schematic block diagram of a processor structure according to an embodiment of the present application.

[0022] Figure 4 This is a schematic diagram of an embodiment of the first hardware execution resource slot and the second hardware execution resource slot of the present application.

[0023] Figure 5 This is a schematic block diagram of the processor structure of another embodiment of the present application; Figure 6 This is a flowchart of a task queue scheduling method according to an embodiment of the present application; Figure 7This is a schematic diagram of broadcasting a notification to the first hardware to execute resource slot unloading in an embodiment of the present application; Figure 8 for Figure 7 Schematic diagram of loading the first hardware execution resource slot Fig. 9 A schematic diagram of broadcasting notification of unloading of the first hardware execution resource slot and the second hardware execution resource slot according to an embodiment of the present application; Fig.10 This is a flowchart of a task queue scheduling method according to another embodiment of the present application; Fig.11 This is a flowchart of a task queue scheduling method according to an embodiment of the present application; Fig.12 This is a flowchart of a task operation processing method according to an embodiment of the present application; Fig.13 This is a flowchart of a task operation processing method according to another embodiment of the present application; Fig.14 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. DETAILED DESCRIPTION

[0024] The embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0025] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0026] Processors are very important hardware resources in some devices with data processing and computing capabilities, including: CPU (Central Processing Unit), FPGA (Field-Programmable Gate Array), ASIC (Application Specific Integrated Circuit) and GPU (Graphics Processing Unit). In the following description, GPU is used as an example of a processor.

[0027] GPU is a heterogeneous computing device that can process large amounts of data in parallel. User programs (a task job, such as a calculation, a control process, etc.) will be split into several parallel task queues through ecological software to improve work efficiency.

[0028] The tasks in each task queue need to be executed serially, while different task queues can be executed in parallel. There will be a small hardware queue resource pool in the GPU, which usually contains some hardware execution resource slots to support the work of the task queue. The GPU will also include at least one hardware scheduling module, which can match a hardware execution resource slot with a task queue. When the pairing is successful, the GPU hardware can parse the tasks contained in the software queue and send the parsed tasks to the GPU's computing module for calculation. Its architecture and typical workflow are as follows: Figure 1 shown.

[0029] See also Figure 2 When the number of task queues is greater than the number of hardware execution resource slots, due to insufficient resources, the GPU's task queues will be over-subscribed. Wherein, over-subscription refers to: when the number of task queues is greater than the number of hardware execution resource slots, the task queues need to be time-shared or preempted. When the task queue is over-subscribed, the GPU will allocate and schedule the current task queue through the hardware scheduling module, determine the matching relationship between the task queue and the hardware execution resource slot, and notify the queues that have been working to unload in turn, and then let the queues that are not working to load in turn. Through different job scheduling mechanisms, more software task queues can use limited hardware resources in a time-sharing manner.

[0030] In the current popular GPU ecological environment architecture, two main job scheduling mechanisms are used: time slice scheduling and priority preemption.

[0031] Time slice scheduling mechanism: When the number of software task queues is greater than the number of hardware execution resource slots, the GPU will unload the queues that have been working at regular intervals, and then load the queues to be worked on, constantly rotating and changing to ensure that each queue can work. When unloading a queue, the current work content needs to be saved; when loading a queue, the previous work needs to be restored.

[0032] Priority preemptive scheduling mechanism: Provides a specific software interface for creating high-priority queues. Specific software programs need to be bound to priorities. High-priority queues are processed first, and ordinary queues need to wait for the high-priority queues to be executed before they can be executed. When ordinary task queues are executed, if there are tasks with high priority, they can preempt ordinary task queues. When preempting, the current work queue also needs to be unloaded and the queue waiting for work needs to be loaded.

[0033] However, both of the above scheduling mechanisms require the current working task queue to be continuously unloaded and then the unloaded task queue to be loaded. During the scheduling process, the task queue cannot work. Moreover, the unloading and loading process may frequently interrupt the working queue, thus affecting the overall processing efficiency of the job task.

[0034] In order to solve the problem of the above two scheduling mechanisms frequently interrupting the working task queues in the oversubscription problem, some solutions open a separate path to handle the dedicated task queue. However, for scenarios where multiple queues need to work frequently, multiple corresponding dedicated paths need to be opened to handle them accordingly, resulting in major hardware changes.

[0035] Figure 3 This is a schematic block diagram of the processor structure of an embodiment of the present application. Figure 3 and Figure 4 For the situation where the number of task queues is greater than the number of hardware execution resource slots and over-subscription occurs, an embodiment of the present application provides a processor that can be applied to chip hardware design, configuration, and task job processing scenarios. The processor includes a hardware queue pool 110, and the hardware queue pool 110 includes at least two hardware execution resource slots, wherein at least one first hardware execution resource slot 111 is configured to execute a first type of task queue, and the first type of task queue can be an ordinary task queue. Such tasks are generally tasks that have low computing resource requirements, short processing cycles, and do not require continuous operation, and do not occupy processor hardware resources for a long time. For example, data batch processing, scheduled report generation, log analysis, etc. These tasks can be scheduled and executed during idle periods, and can be flexibly unloaded and loaded.

[0036] At least one second hardware execution resource slot 112 is configured to execute a second type of task queue, which is suitable for executing a resident task queue and some tasks with higher priority, which usually have high real-time requirements and need to run continuously and cannot be interrupted. For example, real-time video stream processing, online game servers, financial transaction systems, etc. For such tasks, the second hardware execution resource slot 112 needs to remain occupied during the entire processing process.

[0037] The hardware scheduling module 120 is configured to unload the task queue operation on at least one of the first hardware execution resource slots 111 when the number of received task queues is greater than the number of hardware execution resource slots, while the occupancy status of at least one second hardware execution resource slot 112 remains unchanged.

[0038] There are two occupation states of the hardware execution resource slots, one is idle (or not working), and the other is occupied (or working).

[0039] Specifically, when the number of task queues exceeds the number of available hardware execution resource slots, that is, when oversubscription occurs, the hardware scheduling module 120 will preferentially perform an unloading operation on the first hardware execution resource slot 111. For example, the hardware scheduling module 120 will choose to unload a common task queue currently running in the first hardware execution resource slot 111. Since the common task queue itself needs to occupy resources for a short time, the state of the hardware execution resource slot can be switched normally and flexibly, and the occupation state of at least one second hardware execution resource slot 112 remains unchanged, so as to ensure that the resident tasks and tasks with higher priority being processed will not be affected.

[0040] The processor provided in the embodiment of the present application configures the attributes of the hardware execution resource slots in a hierarchical manner, uses the first hardware execution resource slot 111 to match the task queue for executing ordinary tasks, and uses the second hardware execution resource slot 112 to specifically match the task queue for executing resident or higher priority tasks. When over-subscription occurs, the hardware scheduling module 120 only performs unloading or loading operations on the first hardware execution resource slot 111, and does not operate on the second hardware execution resource slot 112. In this way, the execution of ordinary tasks (belonging to the first type of task queue) can be flexibly adjusted without affecting the running resident tasks (i.e., belonging to the second type of task queue), so that the processor gives priority to ensuring that the execution of resident tasks is not interrupted under high load conditions, and avoids the need for resident tasks and higher priority tasks to occupy the hardware resources of the ordinary task queue, which leads to frequent unloading and loading of the ordinary task queue. As a result, the processor can reduce the need for frequent unloading and loading of task queues to a certain extent, thereby improving the overall processing efficiency when over-subscription occurs.

[0041] In addition, by configuring the hardware execution resource slots in a hierarchical manner, the state stability of the second hardware execution resource slot 112 can be maintained so that resident tasks will not be frequently interrupted by high-priority tasks. At the same time, high-priority tasks can continue to run without being affected, avoiding performance losses caused by frequent switching, thereby achieving more efficient resource utilization and smoother task scheduling, and further improving overall task processing efficiency.

[0042] The time slice length or priority of the second type of task queue occupying the hardware execution resource slot is higher than the time slice length or priority of the first type of task queue occupying the hardware execution resource slot.

[0043] See also Figure 5 The processor further includes: a computing unit 130 configured to receive the task queues sent by the first hardware execution resource slot 111 and the second hardware execution resource slot 112, and perform calculation processing.

[0044] In the present application, task scheduling is optimized by hierarchically configuring the type attributes of the hardware execution resource slots. However, in some instances, when the number of received task queues exceeds the number of available hardware execution resource slots, the utilization of hardware resources must also be considered in addition to reducing the problem of frequent unloading and loading of task queues.

[0045] Therefore, see Figure 6 In some embodiments, the hardware scheduling module 120 is configured to perform an unloading task queue operation on at least one of the first hardware execution resource slots 111 when the number of received task queues is greater than the number of hardware execution resource slots, including: Query the properties of all current hardware resource slots to obtain the occupancy status of each hardware execution resource slot, that is, obtain the occupancy status of the first hardware execution resource slot 111 and the second hardware execution resource slot 112; Determine whether the number of currently received task queues is greater than the number of currently idle hardware execution resource slots, that is, determine whether it is in the hardware scheduling logic; If so, then determine to enable the corresponding broadcast tag based on the status of at least one of the first hardware execution resource slots 111; wherein the broadcast tag is at least used for the marked first hardware execution resource slot 111; in other words, when in the hardware scheduling logic, only enable the broadcast tag to the first hardware execution resource slot 111, enable unloading of the ordinary task queue being executed, and the status of the second hardware execution resource slot 112 remains unchanged.

[0046] Send an uninstall notification to the corresponding first hardware execution resource slot 111 according to the broadcast tag to uninstall the corresponding first type of task queue, such as Figure 7 As shown, the first type of task queue of this unloading is sent to the scheduling sort list, such as Figure 8 shown.

[0047] If not, that is, it is not in the hardware scheduling logic, it indicates that there is no over-subscription at present, and the number of hardware execution resource slots is sufficient for the task queue to match. Enable the flags of all hardware execution resource slots in the broadcast flag, send a broadcast to inform the unloading of the task queues of the first hardware execution resource slot 111 and the second hardware execution resource slot 112, such as Fig. 9 shown.

[0048] Among them, task queue loading refers to matching the information of the software queue to the hardware slot so that the hardware slot can process the tasks contained in the software queue. Task queue unloading refers to deleting the information of the software queue from the hardware slot to release the hardware slot.

[0049] It is understandable that frequent unloading and loading operations will lead to increased context switching overhead and affect processor performance. In this embodiment, by judging whether the number of currently received task queues is greater than the number of hardware execution resource slots, that is, whether it is in the hardware scheduling logic, different task queue unloading strategies are executed to ensure that when over-subscription occurs, resident tasks and high-priority tasks are not affected, and at the same time optimize the processing flow of ordinary tasks, and send the unloaded tasks to the scheduling sort list. When there are idle hardware execution resource slots, it is convenient to rearrange the unloaded tasks for matching. Thus, not only the stable operation of the current high-priority or resident tasks is guaranteed, but also the opportunity for rescheduling is provided for ordinary tasks, thereby improving the overall resource utilization.

[0050] In addition, in an embodiment of the present application, by pre-configuring a hierarchical broadcast mechanism, when it is necessary to unload or load a task queue, all first hardware execution resource slots 111 or all hardware execution resource slots (including the first hardware execution resource slot 111 and the second hardware execution resource slot 112) can be broadcast and unloaded according to the scheduling logic, thereby achieving more efficient task management.

[0051] Specifically, the hardware scheduling module 120 can modify the broadcast mark (Mask) to determine which hardware slots to broadcast notifications to, thereby unloading multiple task queues at one time. By configuring the broadcast mark mechanism, it is allowed to quickly and efficiently manage resources when facing a large number of task processing. Compared with unloading one by one, the unloading method in the embodiment of the present application significantly reduces the scheduling time and operation complexity, allowing the system to respond quickly under high load conditions and release hardware resources more effectively and quickly.

[0052] In addition, the broadcast mark is configured to be in a modifiable state so that the type of hardware execution resource slot that needs to be unloaded can be flexibly selected according to the actual situation of the task queue, thereby realizing dynamic adjustment of hardware resources.

[0053] In a high-concurrency computing environment, the efficiency of task scheduling directly affects the overall performance of the system. In order to ensure that tasks can be processed in a timely manner, especially when the number of task queues exceeds the number of available hardware execution resource slots, the hardware scheduling module 120 needs to effectively manage the usage of resource slots.

[0054] To this end, in the embodiment of the present application, the loading process of the task queue is optimized. Fig.10 Specifically, the hardware scheduling module 120 is further configured to, when the number of received task queues is greater than the number of hardware execution resource slots, perform a task queue loading operation on at least one of the first hardware execution resource slots 111, including: querying the occupancy status of all current first hardware execution resource slots 111, and determining whether there is an idle first hardware execution resource slot 111; If yes, select the first type of task queue to be loaded from the scheduling sort list; The first type of task queue is matched with the idle first hardware execution resource slot 111, and the occupation status of the first hardware execution resource slot is updated.

[0055] In this embodiment, the loading operation is performed only on the first hardware execution resource slot 111 to avoid interference with resident tasks or high-priority tasks, thereby improving the overall processing efficiency.

[0056] Exemplarily, in a high-concurrency data processing system, it is assumed that there are currently five tasks to be processed, and there are only three available first hardware execution resource slots 111 for matching ordinary task queues, and over-subscription occurs. In this case, the hardware scheduling module 120 queries the status of all five hardware execution resource slots and finds that two of them are idle. Then, the two ordinary task queues with the highest priority are selected from the tasks to be processed, and they are respectively assigned to the two idle hardware execution resource slots for processing. As a result, the system can only unload and load the first hardware execution resource slot 111 while ensuring efficient use of resources, reducing performance losses caused by frequent unloading and loading, thereby improving overall processing efficiency.

[0057] Continue to view Fig.10 Specifically, after matching the first type of task queue with the idle first hardware execution resource slot 111, the hardware scheduling module 120 is further configured to: query whether the status of all first hardware execution resource slots 111 has been updated in the current scheduling cycle; if so, end the scheduling task in the current cycle; if not, poll the status of all current first hardware execution resource slots 111.

[0058] See also Fig.11 The present application also provides a task queue scheduling method in an embodiment, including: S200, when the number of received task queues is greater than the number of hardware execution resource slots, unload the task queue operation on at least one first hardware execution resource slot 111, and keep the state of at least one second hardware execution resource slot 112 unchanged; wherein, The at least one first hardware execution resource slot 111 is configured to execute a first type of task queue, and the at least one second hardware execution resource slot 112 is configured to execute a second type of task queue.

[0059] See again Figure 6In some embodiments, when the number of received task queues is greater than the number of hardware execution resource slots, an unloading task queue operation is performed on at least one of the first hardware execution resource slots 111, including: querying the type attributes of all current hardware resource slots to obtain the status of the first hardware execution resource slot 111 and the second hardware execution resource slot 112; determining whether the number of currently received task queues is greater than the number of hardware execution resource slots; if so, determining to enable the corresponding broadcast tag based on the status of at least one of the first hardware execution resource slots 111; wherein the broadcast tag is at least used for the marked first hardware execution resource slot 111; sending an unloading notification to the corresponding first hardware execution resource slot 111 according to the broadcast tag to unload the corresponding first type of task queue, and sending the unloaded first type of task queue to the scheduling sorting list.

[0060] See again Figures 7 to 10 In some other embodiments, the method further includes: when the number of received task queues is greater than the number of hardware execution resource slots, performing a task queue loading operation on at least one of the first hardware execution resource slots 111, including: querying the occupancy status of all current first hardware execution resource slots 111 to determine whether there are any idle first hardware execution resource slots 111; if so, selecting the first type of task queue to be loaded from the scheduling sort list; and matching the first type of task queue with the idle first hardware execution resource slot 111.

[0061] Continue to view Fig.10 In some embodiments, after matching the first type of task queue with the idle first hardware execution resource slot 111, it also includes: querying whether the status of all first hardware execution resource slots 111 has been updated in the current scheduling cycle; if so, ending the scheduling task in the current cycle; if not, polling the status of all current first hardware execution resource slots 111.

[0062] The task queue scheduling method provided by the embodiment of the present application, when over-subscription occurs, only the first hardware execution resource slot 111 matching the ordinary task queue is unloaded or loaded, and the second hardware execution resource slot 112 is not operated, that is, the second hardware execution resource slot 112 that needs to execute the resident task can always work, and the ordinary task queue that does not need to be resident can also have the opportunity to use the first hardware resource slot. This can reduce the need for frequent unloading or loading of task queues to a certain extent, and improve the overall processing efficiency when over-subscription occurs in multi-task jobs.

[0063] See also Figure 1The attribute configuration of the hardware execution resource slot can be completed on the ecological software of the hardware resource management end. Specifically, a category attribute configuration function can be added to the hardware execution resource slot attribute, and each hardware execution resource slot can be configured as a first hardware execution resource slot 111 (a common type hardware slot) or a second hardware execution resource slot 112 (a resident type hardware slot) before use.

[0064] In order to realize the aforementioned hierarchical broadcast uninstallation function, it is necessary to configure the hierarchical broadcast function on the ecological software, so that when the hardware scheduling module 120 uninstalls the queue, it can uninstall all common hardware slots or all hardware slots (including common and resident hardware slots) at one time by broadcasting. The broadcast function can determine which hardware slots to broadcast notifications by modifying the broadcast mark (broadcast MASK).

[0065] See also Fig.12 Specifically, the present application also provides a task operation processing method S300, which is applied to the ecological software of the hardware resource management end. The method S300 includes: S310, creating at least one task queue according to the received task job, each task queue carrying attribute information; the attribute information includes: an identity identifier, a timestamp and a priority of the task queue; S320. Determine, based on the attribute information, the type of the hardware execution resource slot applied for by the at least one task queue currently created; the type of the hardware execution resource slot is related to the time slice length or priority of the task queue; wherein the time slice length can be calculated based on the timestamp.

[0066] S330. According to the determined type of the hardware execution resource slot, match the hardware execution resource slot of this type with the at least one task queue.

[0067] See also Fig.13 After the ecological software runs, the software program is converted by the ecological software, and multiple task queues are created according to the characteristics of the software tasks, and the corresponding types of hardware execution resource slots are applied for matching according to their attribute information. The hardware execution resource slots are divided into a first hardware execution resource slot 111 and a second hardware execution resource slot 112, wherein the first hardware execution resource slot 111 mainly matches ordinary task queues, and the second hardware execution resource slot 112 mainly matches resident task queues or high-priority task queues.

[0068] The required hardware execution resource slot type is determined based on the priority of each task queue and the estimated time slice length, that is, whether to apply for a common hardware execution resource slot or a resident hardware execution resource slot.

[0069] The ecological software of the embodiment of the present application can effectively perform hierarchical scheduling management on multiple task queues through the above steps, so that the ordinary task queue is allocated to the first hardware execution resource slot 111, and the high-priority or resident task queue is allocated to the second hardware execution resource slot 112, so as to realize hierarchical scheduling management at the software level. When the aforementioned over-subscription occurs, the impact of frequent unloading or loading of task queues on resident or high-priority task queues can be avoided, thereby optimizing the overall resource utilization and improving the parallel processing efficiency of multiple task queues.

[0070] Continue to view Fig.13 In some embodiments, matching the determined type of the hardware execution resource slot with the at least one task queue includes: If the type of the hardware execution resource slot is determined to be the first hardware execution resource slot 111, determining whether there is an idle first hardware execution resource slot 111; If the second hardware execution resource slot 112 is determined according to the type of the hardware execution resource slot, a legitimacy check is performed on the current application event of the second hardware execution resource slot 112; the legitimacy check is used to detect whether the current application quantity of the second hardware execution resource slot 112 exceeds a threshold; If it is legal, continue to determine whether there is an idle second hardware execution resource slot 112; If it is illegal, then a feedback is given that the application for the second hardware execution resource slot 112 has failed.

[0071] In some other embodiments, after continuing to determine whether there is an idle second hardware execution resource slot 112, the method further includes: if there is an idle second hardware execution resource slot 112, selecting an idle second hardware execution resource slot 112; If there is no idle second hardware execution resource slot 112, then unload a first hardware execution resource slot 111 to make it idle; Changing the type attribute configuration of the first hardware execution resource slot 111 that has become idle to the second hardware execution resource slot 112; And, matching the changed second hardware execution resource slot 112 with the at least one task queue.

[0072] Specifically, after the feedback that the application for the second hardware execution resource slot 112 fails, the method further includes: applying for the first hardware execution resource slot 111 for the at least one task queue for matching, and continuing to determine whether there is an idle first hardware execution resource slot 111; If there is an idle first hardware execution resource slot 111, its type attribute is configured unchanged, that is, its type attribute is still configured as the first hardware execution resource slot for executing the first type of task queue, and the idle first hardware execution resource slot 111 is matched with the at least one task queue.

[0073] It should be noted that the task operation processing method provided in the embodiment of the present application can interact with the processor and task queue scheduling method provided in the aforementioned embodiment as a preparatory work stage before task queue scheduling.

[0074] Fig.14 This is a schematic block diagram of the architecture of an embodiment of the electronic device of the present application; based on the same technical concept as the above-mentioned embodiment 1, the electronic device provided by the embodiment of the present application includes: one or more processors; a memory; the memory stores one or more executable program codes, and the one or more processors read the executable program codes stored in the memory to run the program corresponding to the executable program codes, so as to execute any of the task queue scheduling methods or task job processing methods described in embodiment 1. Fig.14 As shown, the step flow of the task queue scheduling method or task job processing method described in any of the aforementioned embodiments of the present application can be implemented.

[0075] The above-mentioned electronic device may include: a shell 41, a processor 42, a memory 43, a circuit board 44 and a power supply circuit 45, wherein the circuit board 44 is arranged inside the space enclosed by the shell 41, and the processor 42 and the memory 43 are arranged on the circuit board 44; the power supply circuit 45 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 43 is used to store executable program codes; the processor 42 runs the program corresponding to the executable program code by reading the executable program code stored in the memory 43, so as to execute the task queue scheduling method or task job processing method described in any of the aforementioned embodiments.

[0076] The specific execution process of the processor 42 for the above steps and the steps further executed by the processor 42 by running the executable program code can be found in the description of Example 1 of the present application, which will not be repeated here.

[0077] The electronic device exists in many forms, including but not limited to: (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, feature phones, and low-end phones.

[0078] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access features. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0079] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0080] (4) Server: A device that provides computing services. The server consists of a processor, hard disk, memory, system bus, etc. The server is similar to a general-purpose computer architecture, but because it needs to provide highly reliable services, it has higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0081] (5) Other electronic devices with data interaction functions.

[0082] The present application also provides a computer-readable storage medium in an embodiment, wherein the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to execute the task queue scheduling method or task job processing method described in any of the aforementioned embodiments.

[0083] In summary, the task queue scheduling method, task job processing method, processor, electronic device and storage medium provided in the embodiments of the present application can reduce the need for frequent unloading and loading of task queues to a certain extent by hierarchically configuring the attributes of hardware execution resource slots, thereby improving the overall processing efficiency when over-subscription occurs.

[0084] Furthermore, while avoiding interference of frequent unloading and loading of task queues on resident tasks or high-priority tasks, the present application ensures that other task queues have a fairer opportunity to efficiently use the remaining hardware execution resource slots, thereby improving resource utilization.

[0085] It should be noted that, in this article, the emphasis of the scheme described between the various embodiments is different, but the various embodiments have a certain interrelated relationship. When understanding the scheme of the present application, the various embodiments can refer to each other; in addition, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or measurement control unit including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, article or measurement control unit. In the absence of more restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or measurement control unit including the elements.

[0086] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A processor, characterized in that: include: At least two hardware execution resource slots, wherein at least one first hardware execution resource slot is configured to execute a first type of task queue, and at least one second hardware execution resource slot is configured to execute a second type of task queue; the second type of task queue occupies a hardware execution resource slot with a time slice length or a priority higher than the first type of task queue occupies a hardware execution resource slot with a time slice length or a priority; The hardware scheduling module is configured to, when the number of received task queues is greater than the number of currently idle hardware execution resource slots, unload the task queue operation on at least one of the first hardware execution resource slots and keep the occupancy state of at least one of the second hardware execution resource slots unchanged.

2. The processor according to claim 1, wherein: The hardware scheduling module is configured to perform an unloading task queue operation on at least one of the first hardware execution resource slots when the number of received task queues is greater than the number of currently idle hardware execution resource slots, including: Query the properties of all current hardware resource slots to obtain the occupancy status of each of the hardware execution resource slots; Determine whether the number of currently received task queues is greater than the number of hardware execution resource slots; If yes, determining to enable a corresponding broadcast mark according to the occupation status of at least one of the first hardware execution resource slots; wherein the broadcast mark is at least used to mark the corresponding first hardware execution resource slot; According to the broadcast tag, an uninstallation notification is sent to a first hardware execution resource slot corresponding to the broadcast tag to uninstall the corresponding first type of task queue, and the first type of task queue uninstalled this time is sent to a scheduling sort list.

3. The processor according to claim 1, wherein: The hardware scheduling module is further configured to, when the number of received task queues is greater than the number of hardware execution resource slots, perform a task queue loading operation on at least one of the first hardware execution resource slots, including: Query the occupation status of all current first hardware execution resource slots to determine whether there is an idle first hardware execution resource slot; If yes, select the first type of task queue to be loaded from the scheduling sort list; The first type of task queue is matched with an idle first hardware execution resource slot, and the occupation status of the first hardware execution resource slot is updated.

4. The processor according to claim 3, wherein: After matching the first type of task queue with the idle first hardware execution resource slot, the hardware scheduling module is further configured to: query whether the occupation status of all first hardware execution resource slots has been updated in the current scheduling cycle; If yes, then the scheduling task in the current cycle is terminated; If not, then poll the occupancy status of all current first hardware execution resource slots.

5. A task queue scheduling method, characterized in that: When the number of received task queues is greater than the number of hardware execution resource slots, an unloading task queue operation is performed on at least one first hardware execution resource slot, and the occupation state of at least one second hardware execution resource slot remains unchanged; wherein, The at least one first hardware execution resource slot is configured to execute a first type of task queue, and the at least one second hardware execution resource slot is configured to execute a second type of task queue, and the second type of task queue occupies a higher time slice length or has a higher priority than the first type of task queue occupies the hardware execution resource slot.

6. The task queue scheduling method according to claim 5, characterized in that: When the number of received task queues is greater than the number of hardware execution resource slots, performing an unloading task queue operation on at least one of the first hardware execution resource slots includes: Query the properties of all current hardware resource slots to obtain the occupancy status of each of the hardware execution resource slots; Determine whether the number of currently received task queues is greater than the number of currently idle hardware execution resource slots; If yes, then according to the occupation status of at least one of the first hardware execution resource slots, determine to enable the corresponding broadcast mark; wherein the broadcast mark is at least used for the marked first hardware execution resource slot; An uninstallation notification is sent to the corresponding first hardware execution resource slot according to the broadcast mark to uninstall the corresponding first type of task queue, and the first type of task queue uninstalled this time is sent to the scheduling sort list.

7. The task queue scheduling method according to claim 5, characterized in that: The method further includes: when the number of received task queues is greater than the number of hardware execution resource slots, performing a task queue loading operation on at least one of the first hardware execution resource slots, including: Query the occupation status of all current first hardware execution resource slots to determine whether there is an idle first hardware execution resource slot; If yes, select the first type of task queue to be loaded from the scheduling sort list; The first type of task queue is matched with an idle first hardware execution resource slot, and the occupation status of the first hardware execution resource slot is updated.

8. The task queue scheduling method according to claim 7, characterized in that: After matching the first type of task queue with the idle first hardware execution resource slot, the method further includes: querying whether the occupation status of all first hardware execution resource slots has been updated in the current scheduling cycle; If yes, then the scheduling task in the current cycle is terminated; If not, then poll the occupancy status of all current first hardware execution resource slots.

9. A task operation processing method, characterized in that: The method comprises: Create at least one task queue according to the received tasks, each task queue carries attribute information; the attribute information includes: an identity identifier, a timestamp and a priority of the task queue; According to the attribute information, determining the type of the hardware execution resource slot applied for by the at least one task queue currently created; the type of the hardware execution resource slot is related to the time slice length or priority of the task queue; According to the determined type of the hardware execution resource slot, the hardware execution resource slot of the type is matched with the at least one task queue.

10. The task operation processing method according to claim 9, characterized in that: The step of matching the type of the hardware execution resource slot with the at least one task queue according to the determined type of the hardware execution resource slot includes: If the first hardware execution resource slot is determined according to the type of the hardware execution resource slot, determining whether there is an idle first hardware execution resource slot; If the second hardware execution resource slot is determined to be a second hardware execution resource slot according to the type of the hardware execution resource slot, a legitimacy check is performed on the current application event of the second hardware execution resource slot; the legitimacy check is used to detect whether the current application quantity of the second hardware execution resource slot exceeds a threshold; If it is legal, continue to determine whether there is a second hardware execution resource slot in an idle state; If it is illegal, it will feedback that the application for the second hardware execution resource slot has failed.

11. The task operation processing method according to claim 10, characterized in that: After continuing to determine whether there is an idle second hardware execution resource slot, the method further includes: if there is an idle second hardware execution resource slot, selecting an idle second hardware execution resource slot; If there is no idle second hardware execution resource slot, unloading a first hardware execution resource slot to make it idle; Changing the type attribute configuration of the first hardware execution resource slot that has become idle to a second hardware execution resource slot; And, matching the changed second hardware execution resource slot with the at least one task queue.

12. The task operation processing method according to claim 10, characterized in that: After the second hardware execution resource slot application fails, the method further includes: applying for a first hardware execution resource slot for the at least one task queue for matching, and continuing to determine whether there is an idle first hardware execution resource slot; If there is an idle first hardware execution resource slot, the idle first hardware execution resource slot is matched with the at least one task queue.

13. An electronic device, characterized in that: include: One or more processors; Memory; The memory stores one or more executable program codes, and the one or more processors read the executable program codes stored in the memory and run programs corresponding to the executable program codes to execute the task queue scheduling method according to any one of claims 5 to 8; or Used to execute the task operation processing method described in any one of claims 9 to 12.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to execute the task queue scheduling method according to any one of claims 5 to 8; or Used to execute the task operation processing method described in any one of claims 9 to 12.