CPU scheduling method, electronic equipment and storage medium

By receiving scheduling requests in the dual-system terminal device, determining the scheduling values ​​of the target control group and the parent level, and ensuring that the target scheduling value is used for CPU scheduling when it is greater than the default scheduling value, the problem of poor accuracy caused by scheduling value conflicts is solved, and the accuracy of CPU scheduling is improved.

CN121387508APending Publication Date: 2026-01-23CHENGDU TD TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410990863.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

In dual-system terminal devices, when the operating systems share hardware resources, scheduling conflicts can lead to poor CPU scheduling accuracy.

Method used

By receiving scheduling requests, the target scheduling value in the target control group is determined, and CPU scheduling is performed based on the target scheduling value and the default scheduling value of the parent level. The target scheduling value is used for CPU scheduling when it is greater than the default scheduling value.

Benefits of technology

It improves the accuracy of CPU scheduling and avoids the problem of low execution efficiency caused by scheduling value conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387508A_ABST
    Figure CN121387508A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a CPU scheduling method, electronic equipment and a storage medium. The method comprises the steps that a scheduling request is received, the scheduling request comprises a calculation task, a target task type corresponding to the calculation task and a target operating system identifier, and the target operating system identifier is an operating system identifier corresponding to a target operating system of a calculation task source in the double operating systems; according to the target task type and the target operating system identifier, a target scheduling value in a target control group is determined, and the target scheduling value is a minimum utilization rate threshold value of a CPU; determining a default scheduling value corresponding to the parent hierarchy of the target control group; and according to the scheduling request, if the target scheduling value is greater than the default scheduling value, executing CPU scheduling corresponding to the calculation task through the target scheduling value. According to the scheme, through the indication of the scheduling request, correct scheduling is realized when the target scheduling value is greater than the default scheduling value, so that the accuracy of CPU scheduling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of operating system technology, and in particular to a CPU scheduling method, electronic device, and storage medium. Background Technology

[0002] As terminal devices become increasingly feature-rich, they can handle various business scenarios. Based on this, dual-system terminal devices have been developed. In a dual-system terminal device, one operating system runs in the foreground, while the other can run in the background or be shut down. The user can switch the operating system's running state at any time.

[0003] In dual-system terminal devices, the operating systems share the terminal device's hardware resources, including but not limited to: the Central Processing Unit (CPU) or the Graphics Processing Unit (GPU).

[0004] Before the CPU can execute processing, it needs to be scheduled based on scheduling values ​​to improve CPU processing efficiency. However, in a dual-system hierarchical directory, both the operating system's level and its parent level contain scheduling values. Conflicts in these scheduling values ​​lead to poor accuracy in CPU scheduling. Summary of the Invention

[0005] This application provides a CPU scheduling method, an electronic device, and a storage medium to improve the accuracy of CPU scheduling.

[0006] In a first aspect, embodiments of this application provide a CPU scheduling method, comprising: receiving a scheduling request, the scheduling request including a computing task, a target task type corresponding to the computing task, and a target operating system identifier, wherein the target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in a dual operating system; determining a target scheduling value in a target control group based on the target task type and the target operating system identifier, wherein the target scheduling value is a minimum CPU utilization threshold; determining a default scheduling value corresponding to the parent level of the target control group; and, according to the scheduling request, if the target scheduling value is greater than the default scheduling value, executing CPU scheduling corresponding to the computing task through the target scheduling value.

[0007] In one possible implementation, determining the target scheduling value in the target control group based on the target task type and the target operating system identifier includes: determining the target control group based on the target operating system identifier, wherein the target control group is the control group corresponding to the target operating system; determining a plurality of candidate scheduling values ​​in the target control group; and determining the target scheduling value from the plurality of candidate scheduling values ​​based on the target task type.

[0008] In one possible implementation, determining multiple candidate scheduling values ​​in the target control group includes: determining multiple candidate paths in the target control group, each candidate path containing one candidate scheduling value; determining the multiple candidate scheduling values ​​based on the multiple candidate paths; and determining the target scheduling value from the multiple candidate scheduling values ​​based on the target task type, including: determining a target path from the multiple candidate paths, the path information of the target path including the target task type; and determining the candidate scheduling value under the target path as the target scheduling value.

[0009] In one possible implementation, determining the default scheduling value corresponding to the parent level of the target control group includes: determining the topology corresponding to the target control group; determining the path of the parent level based on the topology and the target path; and determining the default scheduling value from the path of the parent level.

[0010] In one possible implementation, the method further includes: if the target scheduling value is greater than the default scheduling value, obtaining available CPU resource information; determining whether the available resource information supports the target scheduling value; if yes, executing CPU scheduling corresponding to the computing task using the target scheduling value; if no, executing CPU scheduling corresponding to the computing task using the default scheduling value.

[0011] In one possible implementation, the method further includes: if the target scheduling value is less than or equal to the default scheduling value, then executing the CPU scheduling corresponding to the computing task using the target scheduling value or the default scheduling value.

[0012] In one possible implementation, the method further includes: acquiring a CPU scheduling record, the CPU scheduling record including multiple historical task types and a historical scheduling value corresponding to each historical task type; determining whether the multiple historical task types include a historical task type that is the same as the target task type; if so, executing the CPU scheduling corresponding to the computing task using the historical scheduling value corresponding to the historical task type that is the same as the target task type.

[0013] Secondly, embodiments of this application provide a CPU scheduling device, comprising: a receiving module, configured to receive a scheduling request, the scheduling request including a computing task, a target task type corresponding to the computing task, and a target operating system identifier, wherein the target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in a dual-operating system; a searching module, configured to determine a target scheduling value in a target control group based on the target task type and the target operating system identifier, wherein the target scheduling value is a minimum utilization threshold of the CPU; a determining module, configured to determine a default scheduling value corresponding to the parent level of the target control group; and an execution module, configured to, based on the scheduling request, execute CPU scheduling corresponding to the computing task through the target scheduling value if the target scheduling value is greater than the default scheduling value.

[0014] In one possible implementation, the search module is specifically configured to determine the target control group based on the target operating system identifier, wherein the target control group is the control group corresponding to the target operating system; the search module is further configured to determine a plurality of candidate scheduling values ​​in the target control group; the search module is further configured to determine the target scheduling value from the plurality of candidate scheduling values ​​based on the target task type.

[0015] In one possible implementation, the search module is specifically configured to determine multiple candidate paths in the target control group, each candidate path containing one candidate scheduling value; the search module is further configured to determine the multiple candidate scheduling values ​​based on the multiple candidate paths; the search module is further configured to determine a target path from the multiple candidate paths, the path information of the target path including the target task type; and the search module is further configured to determine the candidate scheduling value under the target path as the target scheduling value.

[0016] In one possible implementation, the apparatus further includes: a structure module for determining the topology corresponding to the target control group; the structure module is further configured to determine the path of the parent level based on the topology and the target path; and the structure module is further configured to determine the default scheduling value from the path of the parent level.

[0017] In one possible implementation, the apparatus further includes: a resource module, configured to acquire available CPU resource information if the target scheduling value is greater than the default scheduling value; the resource module is further configured to determine whether the available resource information supports the target scheduling value; the resource module is further configured to execute CPU scheduling corresponding to the computing task according to the target scheduling value if yes; and the resource module is further configured to execute CPU scheduling corresponding to the computing task according to the default scheduling value if no.

[0018] In one possible implementation, the apparatus further includes a determination module, configured to execute CPU scheduling corresponding to the computing task based on the target scheduling value or the default scheduling value if the target scheduling value is less than or equal to the default scheduling value.

[0019] In one possible implementation, the apparatus further includes: a recording module, configured to acquire CPU scheduling records, the CPU scheduling records including multiple historical task types and historical scheduling values ​​corresponding to each historical task type; the recording module is further configured to determine whether the multiple historical task types include a historical task type that is the same as the target task type; the recording module is further configured to, if so, execute the CPU scheduling corresponding to the computing task using the historical scheduling value corresponding to the historical task type that is the same as the target task type.

[0020] Thirdly, embodiments of this application provide a CPU scheduling device, including: a memory and a processor;

[0021] The memory stores computer-executed instructions;

[0022] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0023] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0024] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0025] The CPU scheduling method, electronic device, and storage medium provided in this application include: receiving a scheduling request, the scheduling request including a computing task, a target task type corresponding to the computing task, and a target operating system identifier, wherein the target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in a dual-operating system; determining a target scheduling value in a target control group based on the target task type and the target operating system identifier, the target scheduling value being a minimum CPU utilization threshold; determining a default scheduling value corresponding to the parent level of the target control group; and, according to the scheduling request, if the target scheduling value is greater than the default scheduling value, executing CPU scheduling corresponding to the computing task using the target scheduling value. This scheme, through the indication of the scheduling request, achieves correct scheduling when the target scheduling value is greater than the default scheduling value, thereby improving the accuracy of CPU scheduling. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0027] Figure 1 This is a schematic diagram illustrating an application scenario of a CPU scheduling method provided in an embodiment of this application;

[0028] Figure 2 A flowchart illustrating a CPU scheduling method provided in an embodiment of this application;

[0029] Figure 3 A flowchart illustrating a CPU scheduling method provided in an embodiment of this application;

[0030] Figure 4 This is a schematic diagram illustrating the determination of multiple candidate scheduling values ​​provided in an embodiment of this application;

[0031] Figure 5 A schematic diagram of the default scheduling values ​​provided in the embodiments of this application;

[0032] Figure 6 A schematic diagram of a reference CPU scheduling record provided for an embodiment of this application;

[0033] Figure 7 This is a schematic diagram of the structure of a CPU scheduling device provided in an embodiment of this application;

[0034] Figure 8 This is a schematic diagram of the structure of a CPU scheduling device provided in an embodiment of this application;

[0035] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0036] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0037] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0038] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, have taken necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation portals for users to choose to authorize or refuse.

[0039] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.

[0040] It should be noted that the CPU scheduling method, apparatus, electronic device and storage medium of this application can be used in the field of operating system technology, or in any field other than operating systems. The application field of the CPU scheduling method, apparatus, electronic device and storage medium of this application is not limited.

[0041] Figure 1 This is a schematic diagram illustrating an application scenario of a CPU scheduling method provided in an embodiment of this application. Using the illustrated scenario as an example: For any given computation task, the kernel determines the corresponding scheduling instruction based on the computation task, and the CPU executes the computation task according to the scheduling instruction to obtain the computation result.

[0042] Specifically, the kernel determines the scheduling value based on the information of the computing task, and generates a scheduling instruction that the CPU can recognize based on the scheduling value. This information includes the amount of computing or the CPU requirements, etc.

[0043] In practical applications, user space can compute task information and pass it to the kernel, which assists the kernel in scheduling. Tasks relevant to user experience and requiring rapid completion are run on the CPU's large cores for quick execution, while background tasks or tasks with low CPU demands are run on the CPU's small cores. This achieves a balance between power consumption and performance, saving system power and improving the user experience.

[0044] However, in a dual-system device, two operating systems are mounted at the same level. The parent directory of this level contains a default scheduling value that conflicts with information in user space, causing the kernel to fail to generate the correct scheduling instruction.

[0045] The CPU scheduling method provided in this application aims to solve the above-mentioned technical problems in the prior art.

[0046] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0047] Figure 2 This is a flowchart illustrating a CPU scheduling method provided in an embodiment of this application. The method includes the following steps:

[0048] S201. Receive a scheduling request. The scheduling request includes a computing task, the target task type corresponding to the computing task, and the target operating system identifier. The target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in the dual operating system.

[0049] As an example, the execution entity of this embodiment can be a CPU scheduling device, which can be implemented in various ways. For example, it can be program software, or a medium storing the relevant computer program, such as a USB flash drive; or, the device can also be a physical device that integrates or installs the relevant computer program, such as a chip, a smart terminal, a computer, a server, etc.

[0050] The computation task is the task to be computed, and the computation is performed by the CPU. Target task types include, but are not limited to: graphics processing, numerical computation, signal processing, or background tasks.

[0051] With the example scenario, the dual system includes operating system A and operating system B. If operating system A generates computing tasks during runtime, the operating system identifier of operating system A will be determined as the target operating system identifier.

[0052] Optionally, a dual-system architecture can be implemented using container technology, with each operating system corresponding to a container.

[0053] S202. Based on the target task type and the target operating system identifier, determine the target scheduling value in the target control group. The target scheduling value is the minimum CPU utilization threshold.

[0054] For example, CPU utilization can be controlled through a utilization claamping (Uclamp) mechanism. This allows for finer-grained control over process scheduling behavior on the CPU via user-space programs, particularly regarding CPU affinity (i.e., which CPU cores a process tends to run on) and task runtime constraints. This mechanism enables automatic control over process runtime on the CPU, by setting minimum or maximum utilization thresholds to constrain process CPU usage, thereby optimizing system performance and responsiveness.

[0055] With the help of scenario examples, the minimum utilization threshold is used to determine the minimum limit for CPU usage, so as to avoid the small cores of the CPU from performing computationally intensive tasks, thereby improving the execution efficiency of computing tasks.

[0056] S203. Determine the default scheduling value corresponding to the parent level of the target control group.

[0057] For example, in control group (cgroup) technology, processes are organized into groups, and resource usage rules are set for these groups, providing resource management and control capabilities.

[0058] With the example scenario, in the control group, each operating system corresponds to a level, and the parent level directory of the operating system's level contains a default scheduling value.

[0059] S204. According to the scheduling request, if the target scheduling value is greater than the default scheduling value, the CPU scheduling corresponding to the computing task shall be executed according to the target scheduling value.

[0060] With the aid of scenario examples, the operating system determines a target scheduling value based on the computational task, enabling efficient execution of the task. However, if the target scheduling value is greater than the default scheduling value, executing the task using the default value leads to inefficiency. This application improves CPU scheduling accuracy by instructing the user to request a scheduling request, thus avoiding the execution of computationally intensive tasks using the default scheduling value.

[0061] The CPU scheduling method provided in this application receives a scheduling request, which includes a computing task, a target task type corresponding to the computing task, and a target operating system identifier. The target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in a dual-operating system scenario. Based on the target task type and the target operating system identifier, a target scheduling value is determined in a target control group. The target scheduling value is the minimum CPU utilization threshold. A default scheduling value corresponding to the parent level of the target control group is determined. If the target scheduling value is greater than the default scheduling value, the CPU scheduling corresponding to the computing task is executed according to the scheduling request. This scheme improves the accuracy of CPU scheduling by achieving correct scheduling when the target scheduling value is greater than the default scheduling value, as indicated by the scheduling request.

[0062] Based on any of the above embodiments, the following, in conjunction with Figure 3 This section provides a detailed explanation of the CPU scheduling process.

[0063] Figure 3 This is a flowchart illustrating a CPU scheduling method provided in an embodiment of this application. Figure 3 As shown, the method includes:

[0064] S301. Receive a scheduling request. The scheduling request includes a computing task, the target task type corresponding to the computing task, and the target operating system identifier. The target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in the dual operating system.

[0065] It should be noted that the execution process of S301 is the same as that of S201, and will not be repeated here.

[0066] S302. Determine the target control group based on the target operating system identifier. The target control group is the control group corresponding to the target operating system.

[0067] Each operating system corresponds to one control group.

[0068] For example, there is a one-to-one correspondence between the operating system and the control group, and the target control group is determined through this correspondence.

[0069] With the help of scenario examples, the target operating system identifier can be used to identify a unique corresponding operating system, thereby accurately determining the corresponding target control group.

[0070] S303. Determine multiple candidate paths in the target control group, with each candidate path containing one candidate scheduling value.

[0071] Different candidate scheduling values ​​are used for different computing scenarios.

[0072] With the help of scenario examples, it can be seen that different computing scenarios have different CPU utilization requirements. Setting multiple candidate scheduling values ​​can accurately match the corresponding computing scenarios.

[0073] Optionally, a list of candidate scheduling values ​​can be configured in the target control group, which stores all scheduling values ​​corresponding to the operating system.

[0074] S304. Based on multiple candidate paths, determine multiple candidate scheduling values.

[0075] For example, in the control group technology, each operating system corresponds to a subsystem control tool cpuctl. The functions of cpuctl include managing scheduling values ​​and managing multiple candidate scheduling values ​​corresponding to the operating system.

[0076] Below, in conjunction with Figure 4 The process of determining multiple candidate scheduling values ​​is explained.

[0077] Figure 4 This is a schematic diagram illustrating the determination of multiple candidate scheduling values ​​provided in an embodiment of this application. For example... Figure 4 As shown, taking operating system A as an example, operating system A corresponds to path A, and multiple candidate scheduling values ​​are determined from path A. The same applies to operating system B.

[0078] S305. Determine the target path from multiple candidate paths. The path information of the target path includes the target task type.

[0079] To illustrate with a scenario example, consider operating system A with path A: / dev / cpuctl / lxc / vp1, and operating system B with path B: / dev / cpuctl / lxc / vp2. Path A includes several candidate paths, including / dev / cpuctl / lxc / vp1 / graphic / cpu.uclamp.min, where "graphic" represents the target task type, i.e., graphics processing. We will select / dev / cpuctl / lxc / vp1 / graphic / cpu.uclamp.min as the target path.

[0080] It is understandable that the target path can be accurately determined by the task type field in the path information.

[0081] S306. Determine the candidate scheduling value under the target path as the target scheduling value.

[0082] With the example scenario, one candidate scheduling value is stored under each candidate path. The candidate scheduling value cpu.uclamp.min under the target path, i.e., / dev / cpuctl / lxc / vp1 / graphic / cpu.uclamp.min, is determined as the target scheduling value.

[0083] It is understandable that the task type corresponding to the target path is the same as the task type of the computation task. Therefore, the target scheduling value under the target path matches the computational workload of the computation task, thereby improving the accuracy of CPU scheduling.

[0084] S307. Determine the default scheduling value corresponding to the parent level of the target control group.

[0085] One feasible implementation method is to determine the default scheduling value by: determining the topology corresponding to the target control group; determining the parent level path based on the topology and the target path; and determining the default scheduling value from the parent level path.

[0086] The topology reflects the connection relationships between different levels, and the hierarchical relationships can be accurately determined through the topology.

[0087] Below, in conjunction with Figure 5 The default scheduling values ​​are explained.

[0088] Figure 5 This is a schematic diagram illustrating the default scheduling values ​​provided in the embodiments of this application. For example... Figure 5 As shown, operating system A corresponds to path A, operating system B corresponds to path B, and the common upper-level path of paths A and B is the parent path. The default scheduling value is obtained from the parent path.

[0089] With the example scenario, the parent level path is / dev / cpuctl / lxc / , and the default scheduling value is obtained under this path.

[0090] In this feasible implementation, the default scheduling value can be accurately obtained through the hierarchical relationship, thereby improving the accuracy of CPU scheduling.

[0091] S308. According to the scheduling request, if the target scheduling value is greater than the default scheduling value, the CPU scheduling corresponding to the computing task shall be executed according to the target scheduling value.

[0092] It should be noted that the execution process of S308 is the same as that of S204, and will not be repeated here.

[0093] One feasible implementation method for CPU scheduling further includes: if the target scheduling value is greater than the default scheduling value, obtaining the available resource information of the CPU; determining whether the available resource information supports the target scheduling value; if so, executing the CPU scheduling corresponding to the computing task according to the target scheduling value; if not, executing the CPU scheduling corresponding to the computing task according to the default scheduling value.

[0094] The available resource information can include the number of available CPU cores, spare capacity, etc. The CPU can process multiple tasks simultaneously, and each task will occupy CPU resources. The available resource information represents the CPU's current remaining idle resources. Only idle resources can be used to execute computing tasks.

[0095] To illustrate with a scenario example, if the target scheduling value is greater than the default scheduling value, it indicates that the computational task requires significant CPU resources. In this case, it's determined whether the available resources meet the requirements corresponding to the target scheduling value. If they do, the available resources are sufficient to execute the CPU scheduling corresponding to the target scheduling value, and the CPU scheduling is executed using the target scheduling value. If not, the target scheduling value exceeds the available resources, and continuing execution would result in a failure. Therefore, the CPU scheduling is executed using the default scheduling value to avoid this failure.

[0096] In this feasible implementation, by judging the available resource information, execution failures caused by insufficient CPU resources can be avoided, thereby improving the reliability of CPU scheduling.

[0097] One feasible implementation method for CPU scheduling is to further include: if the target scheduling value is less than or equal to the default scheduling value, then the CPU scheduling corresponding to the computation task is executed using the target scheduling value or the default scheduling value.

[0098] The default scheduling value is a value obtained by combining multiple task types.

[0099] With the example of the scenario, if the target scheduling value is less than or equal to the default scheduling value, it means that the computational workload of the task is small and a large scheduling value is not required. In this case, CPU scheduling can be accurately achieved by using either the target scheduling value or the default scheduling value.

[0100] In this feasible implementation, for scenarios where the computational workload of a task is relatively small, either the target scheduling value or the default scheduling value can be used to match the computational workload, thereby improving the accuracy of CPU scheduling.

[0101] One feasible implementation method for CPU scheduling further includes: obtaining CPU scheduling records, which include multiple historical task types and historical scheduling values ​​corresponding to each historical task type; determining whether the multiple historical task types include a historical task type that is the same as the target task type; if so, executing CPU scheduling for the computation task using the historical scheduling value corresponding to the historical task type that is the same as the target task type.

[0102] Each time a CPU scheduling operation is completed, the task type and scheduling value corresponding to that CPU scheduling are recorded to obtain a CPU scheduling record. The CPU scheduling record contains only feasible scheduling schemes.

[0103] Below, in conjunction withFigure 6 The reference CPU scheduling record is explained.

[0104] Figure 6 This is a schematic diagram of a reference CPU scheduling record provided for an embodiment of this application. For example... Figure 6 As shown, to determine the target task type corresponding to the computation task, the CPU scheduling record is first consulted. If the CPU scheduling record contains the target task type, it means that a task of the same type has already been successfully scheduled by the CPU. In this case, CPU scheduling is performed using the corresponding historical scheduling value, without comparing the target scheduling value and the default scheduling value. If the CPU scheduling record does not contain the target task type, it means that a task of the same type has not been scheduled by the CPU. In this case, the target scheduling value and the default scheduling value need to be compared to obtain an accurate scheduling value, and CPU scheduling is performed based on the accurate scheduling value.

[0105] In this feasible implementation, by referring to the CPU scheduling record, the scheduling value of a successfully completed CPU scheduling can be directly used, thereby improving the efficiency of CPU scheduling.

[0106] Figure 7 This is a schematic diagram of a CPU scheduling device provided in an embodiment of this application. Figure 7 As shown, the CPU scheduling device 70 may include: a receiving module 71, a searching module 72, a determining module 73, and an execution module 74, wherein...

[0107] The receiving module 71 is used to receive a scheduling request. The scheduling request includes a computing task, the target task type corresponding to the computing task, and the target operating system identifier. The target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in the dual operating system.

[0108] The lookup module 72 is used to determine the target scheduling value in the target control group based on the target task type and the target operating system identifier. The target scheduling value is the minimum CPU utilization threshold.

[0109] The determination module 73 is used to determine the default scheduling value corresponding to the parent level of the target control group.

[0110] The execution module 74 is used to execute the CPU scheduling corresponding to the computing task according to the scheduling request if the target scheduling value is greater than the default scheduling value.

[0111] Optionally, the receiving module 71 can perform... Figure 2 S201 in the embodiment.

[0112] Optionally, the lookup module 72 can be executed. Figure 2 S202 in the embodiment.

[0113] Optionally, module 73 can be executed. Figure 2 S203 in the embodiment.

[0114] Optionally, execution module 74 can execute Figure 2 S204 in the embodiment.

[0115] It should be noted that the CPU scheduling device shown in the embodiments of this application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, so they will not be described again here.

[0116] In one possible implementation, the lookup module 72 is specifically used for:

[0117] Based on the target operating system identifier, determine the target control group, which is the control group corresponding to the target operating system; determine multiple candidate scheduling values ​​in the target control group; and determine the target scheduling value from the multiple candidate scheduling values ​​based on the target task type.

[0118] In one possible implementation, the lookup module 72 is specifically used for:

[0119] Identify multiple candidate paths in the target control group, each candidate path containing one candidate scheduling value; determine multiple candidate scheduling values ​​based on the multiple candidate paths; determine the target path from the multiple candidate paths, the path information of the target path including the target task type; and determine the candidate scheduling value under the target path as the target scheduling value.

[0120] Figure 8 This is a schematic diagram of a CPU scheduling device provided in an embodiment of this application. Figure 7 Based on the illustrated embodiments, as Figure 8 As shown, the CPU scheduling device 80 further includes: a structure module 75, a resource module 76, a judgment module 77, and a recording module 78, wherein:

[0121] Structural module 75, used for:

[0122] Determine the topology corresponding to the target control group; based on the topology and the target path, determine the path of the parent level; determine the default scheduling value from the path of the parent level.

[0123] Resource module 76 is used for:

[0124] If the target scheduling value is greater than the default scheduling value, obtain the available CPU resource information; determine whether the available resource information supports the target scheduling value; if yes, execute the CPU scheduling corresponding to the computing task according to the target scheduling value; if no, execute the CPU scheduling corresponding to the computing task according to the default scheduling value.

[0125] Module 77 is used for:

[0126] If the target scheduling value is less than or equal to the default scheduling value, then the CPU scheduling corresponding to the computation task will be executed according to either the target scheduling value or the default scheduling value.

[0127] Recording module 78 is used for:

[0128] Retrieve CPU scheduling records, which include multiple historical task types and the historical scheduling value corresponding to each historical task type; determine whether the multiple historical task types include a historical task type that is the same as the target task type; if so, execute the CPU scheduling corresponding to the computation task using the historical scheduling value corresponding to the historical task type that is the same as the target task type.

[0129] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 9 As shown, the electronic device includes:

[0130] The electronic device includes a processor 291 and a memory 292; it may also include a communication interface 293 and a bus 294. The processor 291, memory 292, and communication interface 293 can communicate with each other via the bus 294. The communication interface 293 can be used for information transmission. The processor 291 can invoke logical instructions stored in the memory 292 to execute the methods of the above embodiments.

[0131] Furthermore, the logic instructions in the aforementioned memory 292 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0132] The memory 292, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this application. The processor 291 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 292, thereby implementing the methods in the above-described method embodiments.

[0133] The memory 292 may include a program storage area and a data storage area. The program storage area may store the operating system and application programs required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 292 may include high-speed random access memory and may also include non-volatile memory.

[0134] This application provides a non-transitory computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods described in the foregoing embodiments.

[0135] This application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in the foregoing embodiments.

[0136] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.

[0137] It should be further noted 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 restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart 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.

[0138] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.

[0139] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.

[0140] When the integrated unit / module is implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. The processor can be any suitable hardware processor, such as CPU, GPU, FPGA, DSP, and ASIC. The storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.

[0141] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0142] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0143] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0144] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A CPU scheduling method, characterized in that, include: Receive a scheduling request, the scheduling request including a computing task, a target task type corresponding to the computing task, and a target operating system identifier, wherein the target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in the dual operating system; Based on the target task type and the target operating system identifier, a target scheduling value is determined in the target control group, wherein the target scheduling value is the minimum CPU utilization threshold. Determine the default scheduling value corresponding to the parent level of the target control group; If the target scheduling value is greater than the default scheduling value according to the scheduling request, then the CPU scheduling corresponding to the computing task is executed according to the target scheduling value.

2. The method according to claim 1, characterized in that, Based on the target task type and the target operating system identifier, determine the target scheduling value in the target control group, including: The target control group is determined based on the target operating system identifier, and the target control group is the control group corresponding to the target operating system; Determine multiple candidate scheduling values ​​in the target control group; The target scheduling value is determined from the plurality of candidate scheduling values ​​based on the target task type.

3. The method according to claim 2, characterized in that, Determining multiple candidate scheduling values ​​in the target control group includes: Multiple candidate paths are determined in the target control group, and each candidate path contains one candidate scheduling value; Based on the multiple candidate paths, determine the multiple candidate scheduling values; Determining the target scheduling value from the plurality of candidate scheduling values ​​based on the target task type includes: A target path is determined from the plurality of candidate paths, wherein the path information of the target path includes the target task type; The candidate scheduling value under the target path is determined as the target scheduling value.

4. The method according to claim 3, characterized in that, Determining the default scheduling value corresponding to the parent level of the target control group includes: Determine the topology corresponding to the target control group; Based on the topology and the target path, determine the path of the parent level; The default scheduling value is determined from the path of the parent level.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: If the target scheduling value is greater than the default scheduling value, then obtain the available CPU resource information; Determine whether the available resource information supports the target scheduling value; If so, then the CPU scheduling corresponding to the computing task is executed according to the target scheduling value; If not, the CPU scheduling corresponding to the computing task will be executed using the default scheduling value.

6. The method according to any one of claims 1-4, characterized in that, The method further includes: If the target scheduling value is less than or equal to the default scheduling value, then the CPU scheduling corresponding to the computing task is executed using either the target scheduling value or the default scheduling value.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Obtain CPU scheduling records, which include multiple historical task types and historical scheduling values ​​corresponding to each historical task type; Determine whether the plurality of historical task types includes a historical task type that is the same as the target task type; If so, the CPU scheduling corresponding to the computing task is executed using the historical scheduling value corresponding to the historical task type that is the same as the target task type.

8. A CPU scheduling device, characterized in that, include: The receiving module is used to receive a scheduling request, the scheduling request including a computing task, a target task type corresponding to the computing task, and a target operating system identifier, wherein the target operating system identifier is the operating system identifier corresponding to the target operating system from which the computing task originates in the dual operating system; The lookup module is used to determine the target scheduling value in the target control group based on the target task type and the target operating system identifier, wherein the target scheduling value is the minimum utilization threshold of the CPU; The determination module is used to determine the default scheduling value corresponding to the parent level of the target control group; The execution module is configured to, based on the scheduling request, if the target scheduling value is greater than the default scheduling value, execute the CPU scheduling corresponding to the computing task according to the target scheduling value.

9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.