Task scheduling method and device applied to system, computer equipment and storage medium

By calculating storage usage and capacity, memory pressure indicators are determined, solving the real-time and low-latency problems of task type determination in existing technologies, and achieving efficient task scheduling.

CN121636087APending Publication Date: 2026-03-10SHANGHAI SMARTLOGIC TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies cannot determine in real time and with low latency whether a task is memory-constrained or computationally-constrained, leading to inefficient resource scheduling.

Method used

By obtaining the storage occupancy and storage capacity of each storage unit, the total occupancy rate and occupancy range are calculated to determine the memory pressure index, which is then compared with the preset index threshold to determine the task type.

Benefits of technology

It enables efficient task type determination at the hardware level, improves the real-time performance and low latency of task type determination, and enhances the overall throughput and energy efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636087A_ABST
    Figure CN121636087A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task scheduling method and device applied to a system, computer equipment and a storage medium, and the method comprises the steps: for a plurality of storage banks in a target system, obtaining the storage bank occupation and the storage bank capacity of each storage bank; determining the total occupancy rate and occupancy range of all the memory banks based on the memory bank occupancy and memory bank capacity of each memory bank; determining a memory pressure index according to the total occupancy rate and the occupancy range of all memory banks; and comparing the memory pressure index with a preset index threshold, determining a task type suitable for scheduling of the target system according to a comparison result, and counting memory bank occupation of the plurality of memory banks and a difference between the maximum memory bank occupation and the minimum memory bank occupation. And the memory pressure index is determined according to the difference and the memory bank occupation of the plurality of memory banks, so that whether the current target system is more suitable for scheduling a memory limited task or calculating a limited task can be efficiently judged on a hardware level.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of processors, in particular to a task scheduling method and device applied to a system, a computer device and a storage medium. BACKGROUND

[0002] In modern AI accelerators and graphics processors, chips usually integrate multiple computing cores and multiple memory banks to form on-chip high-speed memory modules, such as static random access memory, embedded dynamic random access memory, or through-silicon via stacked random access memory. Since different tasks have different dependencies on storage access bandwidth and computing resources, it is an important problem for resource schedulers to reasonably determine whether a task is a memory-limited task or a computation-limited task.

[0003] Resource schedulers rely on software layer performance analysis or the standard deviation of memory occupancy rates of multiple storage banks based on floating-point unit calculations, which cannot make real-time and low-latency decisions on the type of tasks suitable for scheduling by the system. SUMMARY

[0004] The present application provides a task scheduling method and device applied to a system, a computer device and a storage medium.

[0005] In a first aspect of the present application, a task scheduling method applied to a system is provided, comprising: For a plurality of storage banks in a target system, the storage bank occupancy and the storage bank capacity of each storage bank are obtained; Based on the storage bank occupancy and the storage bank capacity of each storage bank, the total occupancy rate and the occupancy range of all storage banks are determined; The memory pressure index is determined according to the total occupancy rate and the occupancy range of all storage banks; The memory pressure index is compared with a preset index threshold, and the type of task suitable for scheduling by the target system is determined according to the comparison result.

[0006] In an optional embodiment of the present application, the total occupancy rate and the occupancy range of all storage banks are determined based on the storage bank occupancy and the storage bank capacity of each storage bank, comprising: The total occupancy rate of all storage banks is determined according to the storage bank occupancy and the storage bank capacity of each storage bank and the number of all storage banks; The occupancy range of all storage banks is determined according to the storage bank occupancy of each storage bank.

[0007] In an optional embodiment of the present application, the total occupancy rate of all storage banks is determined according to the storage bank occupancy and the storage bank capacity of each storage bank and the number of all storage banks by the following expression:

[0008] wherein, is a total occupancy of all memory banks, is a memory bank occupancy of the i-th memory bank, is a number of all memory banks, is a memory bank capacity of each memory bank.

[0009] In an optional embodiment of the present application, the occupancy range of all memory banks is determined according to the memory bank occupancy of each memory bank by the following expression:

[0010] wherein, is an occupancy range of all memory banks, is a largest memory bank occupancy of all memory banks, is a smallest memory bank occupancy of all memory banks.

[0011] In an optional embodiment of the present application, the memory pressure indicator is determined according to the total occupancy of all memory banks and the occupancy range by the following expression:

[0012] wherein, is a total occupancy of all memory banks, is an occupancy range of all memory banks, is a memory bank capacity of each memory bank, and are both preset values.

[0013] In an optional embodiment of the present application, the comparison of the memory pressure indicator with the preset indicator threshold value determines the type of task suitable for scheduling by the target system according to the comparison result, comprising: comparing the memory pressure indicator with a first preset indicator threshold value and a second preset indicator threshold value respectively; in the case that the memory pressure indicator is greater than the first preset indicator threshold value, determining that the type of task to be scheduled is a memory-constrained task; in the case that the memory pressure indicator is less than the second preset indicator threshold value, determining that the type of task to be scheduled is a computation-constrained task; in the case that the memory pressure indicator is less than or equal to the first preset indicator threshold value and greater than or equal to the second preset indicator threshold value, comparing the total occupancy of all memory banks and the occupancy range used to determine the current memory pressure indicator with a preset occupancy threshold value and a preset occupancy range threshold value respectively; If the total utilization rate of all storage units under the current memory pressure index is greater than the preset utilization rate threshold and the utilization range of all storage units under the current memory pressure index is less than or equal to the preset utilization range threshold, increase the number of task cores or increase scheduling for computationally constrained tasks. If the total utilization rate of all storage units under the current memory pressure metric is less than or equal to the preset utilization rate threshold and the utilization range of all storage units under the current memory pressure metric is greater than the preset utilization range threshold, schedule the memory-constrained task with the highest memory consumption.

[0014] In an optional embodiment of this application, the first preset threshold is the memory pressure index when the total occupancy rate and occupancy range of all memory banks are at their maximum values. The second preset threshold is the memory pressure indicator when the total occupancy rate and occupancy range of all storage units are at their minimum values.

[0015] A second aspect of this application provides a task scheduling device for a system, comprising: The acquisition module is used to acquire the storage occupancy and storage capacity of each storage unit in the target system. The first determining module is used to determine the total occupancy rate and occupancy range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank; The second determination module is used to determine memory pressure indicators based on the total occupancy rate and occupancy range of all memory banks. The comparison module is used to compare memory pressure indicators with preset indicator thresholds and determine the type of task suitable for scheduling on the target system based on the comparison results.

[0016] A third aspect of this application provides a computer device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above-mentioned task scheduling methods applied to the system.

[0017] A fourth aspect of the embodiments of this application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the task scheduling method applied to a system as described above.

[0018] Compared with the prior art, the technical solutions provided in this application have at least some or all of the following advantages: The task scheduling method applied to the system described in this application involves obtaining the storage occupancy and storage capacity of each storage unit in a target system; determining the total occupancy rate and occupancy range of all storage units based on the storage occupancy and storage capacity of each storage unit; determining a memory pressure index based on the total occupancy rate and occupancy range of all storage units; comparing the memory pressure index with a preset threshold; determining the task type suitable for scheduling in the target system based on the comparison result; and determining the memory pressure index by statistically analyzing the storage occupancy of multiple storage units and the difference between the maximum and minimum storage occupancy, and based on this difference and the storage occupancy of multiple storage units. This method can efficiently determine at the hardware level whether the current target system is more suitable for scheduling memory-constrained tasks or computationally-constrained tasks. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a task scheduling method applied to a system according to an embodiment of this application; Figure 2 A flowchart for determining the type of task suitable for scheduling for a target system, provided as an embodiment of this application; Figure 3 This is a schematic diagram of a task scheduling device structure applied to a system according to an embodiment of this application; Figure 4 This is a schematic diagram of a computer device structure provided in one embodiment of this application. Detailed Implementation

[0020] In the process of developing this application, the inventors discovered that current task scheduling methods are not suitable for the types of tasks that can be scheduled in a real-time and low-latency decision-making system.

[0021] To address the aforementioned issues, this application provides a task scheduling method, apparatus, computer device, and storage medium for use in a system, thereby improving the real-time performance and low latency of task type determination.

[0022] The solutions in this application embodiment can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0023] To make the technical solutions and advantages of the embodiments of this application clearer, the exemplary embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not an exhaustive list of all embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0024] Please see Figure 1 The task scheduling method for a system provided in this application includes the following steps S100~S400: S100: For multiple storage units in the target system, obtain the storage unit occupancy and storage unit capacity of each storage unit; S200, determine the total utilization rate and utilization range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank; S300 determines memory pressure metrics based on the total utilization rate and utilization range of all memory banks; S400 compares memory pressure metrics with preset threshold metrics and determines the type of task suitable for scheduling on the target system based on the comparison results.

[0025] In one optional embodiment of this application, the target system includes, but is not limited to, high-performance system-on-a-chip and scheduling systems in heterogeneous computing chips.

[0026] In an optional embodiment of this application, the resource types of multiple storage entities in the target system may be the same or different, and the resource types of the storage entities include, but are not limited to, registers, shared memory and global memory.

[0027] In an optional embodiment of this application, the storage usage of each storage unit is recorded by a memory usage counter. The memory usage counter records the access frequency or usage duration of each storage unit, quantifies the degree of resource contention, and triggers the memory usage counter to increment with each memory access. Different weights are assigned according to access latency, data type, or thread priority, and the counting weights are dynamically adjusted to reflect the importance of different access behaviors.

[0028] In one optional embodiment of this application, the storage capacity of each memory bank may be the same.

[0029] In an optional embodiment of this application, the determination of the total occupancy rate and occupancy range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank is implemented by summation logic and maximum / minimum comparator, respectively.

[0030] In an optional embodiment of this application, the memory pressure index is determined based on the total occupancy rate and occupancy range of all memory banks, and this is achieved using a shift operation.

[0031] The task scheduling method applied to the system in this application is entirely based on addition, comparators, and shift operations. It combines the total occupancy rate and the imbalance of memory to calculate the memory pressure index. It has low logical complexity, does not require floating-point division, is suitable for rapid hardware implementation, and efficiently and comprehensively judges memory bottlenecks. It has the characteristics of real-time sampling and pipeline parallelism, and is suitable for integration into scheduler modules in high-performance SoCs or heterogeneous computing chips. It compares the memory pressure index with a preset index threshold, and determines the task type suitable for scheduling the target system based on the comparison result. This allows the scheduler to adaptively switch task types based on the memory pressure index, thereby improving the overall throughput and energy efficiency of the target system.

[0032] In an optional embodiment of this application, step S200, determining the total occupancy rate and occupancy range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank, includes: The total utilization rate of all storage units is determined based on the storage unit occupancy and storage capacity of each storage unit, as well as the total number of all storage units. The occupancy range of all memory banks is determined based on the occupancy of each memory bank.

[0033] In an optional embodiment of this application, summation logic is used to determine the total occupancy of all memory banks based on the memory bank occupancy and capacity of each memory bank and the total number of all memory banks.

[0034] In an optional embodiment of this application, a maximum / minimum comparator is used to determine the occupancy range of all memory banks based on the memory bank occupancy of each memory bank.

[0035] The task scheduling method applied to the system in this application determines the occupancy range of all memory banks based on the memory bank occupancy of each memory bank. It uses the range instead of the standard deviation to measure memory imbalance, which can reduce resource consumption and adapt to real-time scheduling. The method uses summation logic to determine the total occupancy rate of all memory banks based on the memory bank occupancy, memory bank capacity and the number of all memory banks. The method uses a maximum / minimum comparator to determine the occupancy range of all memory banks based on the memory bank occupancy of each memory bank. The method has low logic complexity, does not require floating-point operations, and is suitable for rapid hardware implementation.

[0036] In an optional embodiment of this application, the total utilization rate of all memory banks is determined by the following expression, based on the memory bank occupancy and capacity of each memory bank and the total number of memory banks:

[0037] in, The total utilization rate of all memory units. The storage space occupied by the i-th storage unit. The number of all storage units, The storage capacity of each memory bank.

[0038] In an optional embodiment of this application, when summing the storage occupancy of multiple storage entities in an expression, a summation logic can be used.

[0039] In an optional embodiment of this application, where the storage capacity of each memory bank is the same, The storage capacity of each memory bank, and the case where the storage capacity of each memory bank is different. This represents the average storage capacity of all storage units.

[0040] The task scheduling method applied to the system in this application sums the memory usage of multiple memory banks and divides the sum by the average of the number of all memory banks and the storage capacity of all memory banks to obtain the total memory usage rate of all memory banks in the target system. This total usage rate is used as a parameter to evaluate memory pressure, making the memory pressure indicator more objective. The summation logic is used to sum the memory usage of multiple memory banks, which has low logical complexity, does not require floating-point division, and is suitable for rapid hardware implementation.

[0041] In an optional embodiment of this application, the occupancy range of all memory banks is determined based on the memory bank occupancy of each memory bank using the following expression:

[0042] in, The occupancy of all memory banks is extremely poor. This is the largest storage volume among all storage volumes. It represents the smallest storage volume among all storage volumes.

[0043] In an optional embodiment of this application, the largest and smallest memory occupancy are selected from all memory occupancy, and this is implemented in hardware using a two-level comparator tree structure. The largest and smallest comparators in the two levels can both adopt a linear scan or a tree structure.

[0044] The task scheduling method applied to the system in this application measures memory imbalance by comparing the standard deviation of the occupancy of all memory banks with the related technology. This application uses the occupancy range of all memory banks, which can reduce resource consumption and adapt to real-time scheduling.

[0045] In an optional embodiment of this application, the memory pressure index is determined based on the total occupancy and occupancy range of all memory banks using the following expression:

[0046] in, The total utilization rate of all memory units. The occupancy of all memory banks is extremely poor. The storage capacity of each memory bank. and All are preset values.

[0047] In an optional embodiment of this application, a shift operation is used to achieve the total occupancy of all memory banks relative to a preset value. The multiplication between them and the range of occupied memory across all memory banks versus the preset value Multiplication between them.

[0048] The task scheduling method applied to the system in this application uses the total occupancy rate of all memory units and a preset value. The multiplication between them and the range of occupied memory across all memory banks versus the preset value The multiplication of the two values ​​yields a memory pressure metric, which serves as a parameter for evaluating memory pressure, making the memory pressure metric more objective. The multiplication process is implemented using bit shifting operations, resulting in low logical complexity and eliminating the need for floating-point operations, making it suitable for rapid hardware implementation.

[0049] In an optional embodiment of this application, see [link to relevant documentation]. Figure 2 The comparison of memory pressure metrics with preset threshold values, and the determination of suitable task types for scheduling by the target system based on the comparison results, includes: S210, compare the memory pressure index with the first preset index threshold and the second preset index threshold respectively; S220, if the memory pressure index is greater than the first preset index threshold, determine that the task type to be scheduled is a memory-constrained task. S230, if the memory pressure index is less than the second preset index threshold, determine the task type to be scheduled as a computationally restricted task. S240, when the memory pressure index is less than or equal to the first preset index threshold and greater than or equal to the second preset index threshold, the total occupancy rate and occupancy range of all storage units used to determine the current memory pressure index are compared with the preset occupancy rate threshold and the preset occupancy range threshold, respectively. S241, when the total utilization rate of all storage units of the current memory pressure index is greater than the preset utilization rate threshold and the utilization range of all storage units of the current memory pressure index is less than or equal to the preset utilization range threshold, increase the number of task cores or increase the scheduling of computationally limited tasks. The preset utilization rate threshold and the preset utilization range threshold can be preset. S242, If the total occupancy rate of all storage units under the current memory pressure index is less than or equal to the preset occupancy rate threshold and the occupancy range of all storage units under the current memory pressure index is greater than the preset occupancy range threshold, schedule the memory-constrained task with the largest memory occupancy.

[0050] In an optional embodiment of this application, assuming H is a first preset threshold and L is a second preset threshold, if the memory pressure index is greater than H, it is determined that the memory of the current target system is limited, making it suitable for scheduling tasks with high computing resource requirements and low memory requirements. If the memory pressure index is less than L, it is determined that the memory of the current target system is idle, making it suitable for scheduling tasks with high memory requirements. If the memory pressure index is greater than or equal to L and less than or equal to H, and the total utilization rate is greater than a preset utilization rate threshold, it is determined that the total memory space is small; if the utilization range is less than or equal to a preset utilization range threshold, it is determined that the memory space size of different storage units is small, making it suitable for scheduling tasks with high computing resource requirements and low memory requirements. The number of task cores can be increased or computing-limited tasks can be added. If the memory pressure index is greater than or equal to L and less than or equal to H, and the total utilization rate is less than or equal to a preset utilization rate threshold, it is determined that the total memory space is large; if the utilization range is greater than a preset utilization range threshold, it is determined that the memory space size of different storage units is large, making it suitable for scheduling tasks with particularly high memory requirements.

[0051] In an optional embodiment of this application, after determining the task type suitable for scheduling by the target system based on the comparison results, the method further includes: The target system selects the task type that is suitable for scheduling as the target task type. The target task is selected according to the priority and waiting time of each task in the preset ready queue corresponding to the target task type. The preset ready queue consists of multiple tasks, and the status of the multiple tasks is ready. The target task is scheduled and executed. If the target task fails to execute, the target task is set to a suspended state, removed from the ready queue and moved to the suspended queue, and the target task is monitored in real time to see if the preset rescheduling conditions are met. If the target task meets the preset rescheduling conditions, the target task's status is set to ready, the target task is removed from the suspended queue and moved into the ready queue, and the target task is rescheduled and executed until the target task is successfully executed.

[0052] In an optional embodiment of this application, the preset rescheduling condition is a cooldown period or a preset number of retries, and the real-time monitoring of whether the target task meets the rescheduling condition includes: Record the timestamp of the target task failing. With the preset rescheduling condition being a cooldown period, the timer starts from the timestamp of the target task's execution failure. If the timer reaches the cooldown period, the target task is determined to meet the rescheduling condition. If the preset rescheduling condition is the number of retries, the number of retries for the target task is accumulated starting from the timestamp of the target task's execution failure. If the accumulated number of retries reaches the preset number of retries, the target task is determined to meet the rescheduling condition.

[0053] In an optional embodiment of this application, the step of selecting a target task based on the priority and waiting time of each task in a preset ready queue includes: Following the order of scheduling from front to back, all tasks are sorted according to the priority and waiting time of each task in the preset ready queue to obtain the sorted queue. The task at the front of the sorted queue is taken as the target task.

[0054] In an optional embodiment of this application, the step of sorting all tasks according to the priority and waiting time of each task in the preset ready queue to obtain a sorted queue includes: The following expression determines the queue sorting value based on the priority and waiting time of each task in the preset ready queue:

[0055] Where O is the queue sorting value of the current task, P is the priority of the current task, and T is the waiting time of the current task. and These are the weights for priority and waiting time, respectively, both of which are positive numbers. Sort all tasks in the preset ready queue according to the queue sorting value to obtain the sorted queue.

[0056] In an optional embodiment of this application, the method further includes: For the first task that fails to execute, obtain the initial priority of the first task. During the process of removing the first task from the suspended queue and moving it into the ready queue, reduce the initial priority of the first task. Use the reduced priority as the priority of the first task after it is moved into the ready queue. For the second task in the ready queue, obtain the initial priority of the second task. If the waiting time of the second task exceeds the preset time threshold, increase the initial priority of the second task and use the increased priority as the updated priority of the second task.

[0057] In an optional embodiment of this application, the priority of each task in the preset ready queue is determined according to the system state used for scheduling and executing tasks; The waiting time for each task in the preset ready queue is the time it takes for the task to enter the preset ready queue.

[0058] In an optional embodiment of this application, the system state is determined by the following steps: For multiple storage banks in the target system, the memory pressure index of the target system is determined based on the total occupancy rate and occupancy range of all storage banks. The target task types suitable for scheduling are determined based on the target system's memory pressure indicators and preset indicator thresholds. The task corresponding to the target task type is designated as the highest priority task.

[0059] The task scheduling method applied to the system in this application, when the memory pressure index is less than or equal to a first preset index threshold and greater than or equal to a second preset index threshold, further refines the tasks suitable for scheduling in the current target system by comparing each parameter used to calculate the memory pressure index with the corresponding parameter threshold, thereby making the task scheduling of the entire target system more accurate.

[0060] In an optional embodiment of this application, the first preset threshold is the memory pressure index when the total occupancy rate and occupancy range of all memory banks are at their maximum values. The second preset threshold is the memory pressure indicator when the total occupancy rate and occupancy range of all storage units are at their minimum values.

[0061] In an optional embodiment of this application, the maximum value of the total occupancy rate and occupancy range of all storage units is input into the memory pressure index calculation expression, and the resulting memory pressure index is the first preset index threshold.

[0062] In an optional embodiment of this application, the minimum value of the total occupancy rate and occupancy range of all storage units is input into the memory pressure index calculation expression, and the resulting memory pressure index is the second preset index threshold.

[0063] In an optional embodiment of this application, the maximum value of the total occupancy rate and occupancy range of all memory banks, as well as the minimum value of the total occupancy rate and occupancy range of all memory banks, can be preset.

[0064] The task scheduling method applied to the system in this application calculates a first preset index threshold by the maximum value of the total occupancy rate and occupancy range of all memory banks, and calculates a second preset index threshold by the minimum value of the total occupancy rate and occupancy range of all memory banks. It can determine the type of task suitable for scheduling in the current target system by comparing the memory pressure index with the first preset index threshold and the second preset index threshold respectively, based on the comparison result.

[0065] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0066] Please see Figure 3 One embodiment of this application provides a task scheduling device 300 applied to a system, comprising: The acquisition module 310 is used to acquire the storage occupancy and storage capacity of each storage unit in the target system. The first determining module 320 is used to determine the total occupancy rate and occupancy range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank; The second determination module 330 is used to determine the memory pressure index based on the total occupancy rate and occupancy range of all memory banks. The comparison module 340 is used to compare memory pressure indicators with preset indicator thresholds and determine the type of task suitable for scheduling on the target system based on the comparison results.

[0067] In an optional embodiment of this application, in the first determining module, determining the total occupancy rate and occupancy range of all memory banks based on the memory bank occupancy and memory bank capacity of each memory bank includes: The total utilization rate of all storage units is determined based on the storage unit occupancy and storage capacity of each storage unit, as well as the total number of all storage units. The occupancy range of all memory banks is determined based on the occupancy of each memory bank.

[0068] In an optional embodiment of this application, in the first determining module, the total occupancy rate of all memory banks is determined based on the memory bank occupancy and capacity of each memory bank and the total number of all memory banks using the following expression:

[0069] in, The total utilization rate of all memory units. The storage space occupied by the i-th storage unit. The number of all storage units, The storage capacity of each memory bank.

[0070] In an optional embodiment of this application, in the first determining module, the occupancy range of all memory banks is determined based on the memory bank occupancy of each memory bank using the following expression:

[0071] in, The occupancy of all memory banks is extremely poor. This is the largest storage volume among all storage volumes. It represents the smallest storage volume among all storage volumes.

[0072] In an optional embodiment of this application, in the second determining module, the memory pressure index is determined based on the total occupancy rate and occupancy range of all memory banks using the following expression:

[0073] in, The total utilization rate of all memory units. The occupancy of all memory banks is extremely poor. The storage capacity of each memory bank. and All are preset values.

[0074] In an optional embodiment of this application, the comparison module, which compares the memory pressure index with a preset index threshold and determines the task type suitable for scheduling by the target system based on the comparison result, includes: The memory pressure index is compared with the first preset index threshold and the second preset index threshold respectively; If the memory pressure index exceeds the first preset threshold, the task type to be scheduled is determined to be a memory-constrained task. If the memory pressure index is less than the second preset index threshold, the task type to be scheduled is determined to be a computationally restricted task. When the memory pressure index is less than or equal to the first preset index threshold and greater than or equal to the second preset index threshold, the total occupancy rate and occupancy range of all storage units used to determine the current memory pressure index are compared with the preset occupancy rate threshold and the preset occupancy range threshold, respectively. If the total utilization rate of all storage units under the current memory pressure index is greater than the preset utilization rate threshold and the utilization range of all storage units under the current memory pressure index is less than or equal to the preset utilization range threshold, increase the number of task cores or increase scheduling for computationally constrained tasks. If the total utilization rate of all storage units under the current memory pressure metric is less than or equal to the preset utilization rate threshold and the utilization range of all storage units under the current memory pressure metric is greater than the preset utilization range threshold, schedule the memory-constrained task with the highest memory consumption.

[0075] In an optional embodiment of this application, in the comparison module, the first preset index threshold is the memory pressure index when the total occupancy rate and occupancy range of all memory banks are at their maximum values. The second preset threshold is the memory pressure indicator when the total occupancy rate and occupancy range of all storage units are at their minimum values.

[0076] For specific limitations regarding the aforementioned device 300, please refer to the limitations on the task scheduling method applied to the system above, which will not be repeated here. Each module in the aforementioned device 300 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0077] In one embodiment, a computer device is provided, the internal structure of which can be as shown in the figure. Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a task scheduling method applied to the system as described above. It includes: memory and a processor; the memory stores a computer program; and the processor executes the computer program to implement any step of the task scheduling method applied to the system as described above.

[0078] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, can perform any of the steps in the task scheduling method applied to the system as described above.

[0079] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0080] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0082] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0083] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0084] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A task scheduling method applied to a system, characterized in that, The method comprises the following steps: For a plurality of memory banks in a target system, obtaining the memory bank occupancy and memory bank capacity of each memory bank; Based on the memory bank occupancy and memory bank capacity of each memory bank, determining the total occupancy rate and occupancy range of all memory banks; According to the total occupancy rate and occupancy range of all memory banks, determining a memory pressure index; Comparing the memory pressure index with a preset index threshold, and determining the type of task suitable for scheduling of the target system according to the comparison result.

2. The method of claim 1, wherein, The method comprises the following steps: According to the memory bank occupancy and memory bank capacity of each memory bank and the number of all memory banks, determining the total occupancy rate of all memory banks; According to the memory bank occupancy of each memory bank, determining the occupancy range of all memory banks.

3. The method of claim 2, wherein, According to the memory bank occupancy and memory bank capacity of each memory bank and the number of all memory banks, the total occupancy rate of all memory banks is determined by the following expression: ; wherein, is the total occupancy of all banks, is the bank occupancy of the i-th bank, is the number of all banks, is the bank capacity of each bank.

4. The method of claim 2, wherein, According to the memory bank occupancy of each memory bank, the occupancy range of all memory banks is determined by the following expression: ; wherein, is the occupancy range for all banks, is the maximum bank occupancy among all banks, is the minimum bank occupancy among all banks.

5. The method of claim 1, wherein, According to the total occupancy rate and occupancy range of all memory banks, the memory pressure index is determined by the following expression: ; wherein, is the total occupancy of all memory banks, is the occupancy range of all memory banks, is the memory bank capacity of each memory bank, and are preset values.

6. The method of claim 1, wherein, The method comprises the following steps: Comparing the memory pressure index with a first preset index threshold and a second preset index threshold respectively; In the case that the memory pressure index is greater than the first preset index threshold, determining that the type of task to be scheduled is a memory-constrained task; In the case that the memory pressure index is less than the second preset index threshold, determining that the type of task to be scheduled is a computation-constrained task; In the case that the memory pressure index is less than or equal to the first preset index threshold and greater than or equal to the second preset index threshold, comparing the total occupancy rate and occupancy range of all memory banks used to determine the current memory pressure index with a preset occupancy rate threshold and a preset occupancy range threshold respectively; In the case that the total occupancy rate of all memory banks of the current memory pressure index is greater than the preset occupancy rate threshold and the occupancy range of all memory banks of the current memory pressure index is less than or equal to the preset occupancy range threshold, expanding the number of task cores or increasing the scheduling of computation-constrained tasks; In the case that the total occupancy rate of all memory banks of the current memory pressure index is less than or equal to the preset occupancy rate threshold and the occupancy range of all memory banks of the current memory pressure index is greater than the preset occupancy range threshold, scheduling the memory-constrained task with the largest memory occupancy.

7. The method of claim 6, wherein, The first preset index threshold is the memory pressure index when the total occupancy rate and occupancy range of all memory banks are maximum values; The second preset index threshold is the memory pressure index when the total occupancy rate and occupancy range of all memory banks are minimum values.

8. A task scheduling apparatus applied to a system, characterized by comprising: The method comprises the following steps: A obtaining module is configured to, for a plurality of memory banks in a target system, obtain the memory bank occupancy and memory bank capacity of each memory bank; A first determining module is configured to, based on the memory bank occupancy and memory bank capacity of each memory bank, determine the total occupancy rate and occupancy range of all memory banks; A second determining module is configured to, according to the total occupancy rate and occupancy range of all memory banks, determine a memory pressure index; A third determining module is configured to compare the memory pressure index with a preset index threshold, and determine the type of task suitable for scheduling of the target system according to the comparison result. A comparison module is configured to compare the memory pressure indicator with a preset indicator threshold, and determine a type of task suitable for scheduling of the target system according to a comparison result.

9. A computer device comprising: A memory and a processor, wherein the memory stores a computer program, and wherein the processor executes the computer program to implement the steps of the task scheduling method for the system according to any one of claims 1 to 7.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the task scheduling method for the system according to any one of claims 1 to 7.