Computing resource processing method and device and storage medium

By maintaining the dormant state transition prediction information of physical computing resource objects, combining resource scheduling and sleep control, the problem of CPU frequent entry and exit of sleep state is solved, and power consumption saving and operating frequency improvement of other CPUs is achieved.

CN120216153APending Publication Date: 2025-06-27HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311817214.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-26
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

In the prior art, CPUs frequently enter and exit the sleep state, resulting in increased power consumption, which cannot effectively save power consumption and affect other CPUs to obtain higher operating frequency.

Method used

By maintaining the dormant state transition prediction information of physical computing resource objects, combining resource scheduling and sleep control, the task is scheduled to physical computing resource objects with relatively shallow or busy sleep states, thereby reducing the frequency of entering and exiting the dormant state.

Benefits of technology

It effectively reduces the frequency of physical computing resource objects entering and leaving the sleep state, saves power consumption, and increases the operating frequency of other CPUs, reducing the problems caused by prediction errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120216153A_ABST
    Figure CN120216153A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a computing resource processing method and device and a storage medium. In the embodiment of the invention, the resource scheduling of the physical computing resource objects and the dormancy control of the physical computing resource objects are combined, and the dormancy state transfer prediction information corresponding to the physical computing resource objects is maintained; the physical computing resource objects are scheduled according to the maintained dormant state transfer prediction information, so that tasks can be scheduled to the physical computing resource objects with relatively shallow dormant states or relatively busy dormant states as much as possible, and part of the physical computing resource objects are enabled to be in deep dormant states as long as possible; parts of physical computing resource objects are busy as much as possible, and the frequency of entering and exiting the dormant state of the physical computing resource objects is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular, to a method, device, and storage medium for processing computing resources. Background Art

[0002] With the development of cloud computing technology, more and more users choose to use cloud servers as their infrastructure. Cloud servers usually adopt multi-core processors (Central Processing Unit, CPU), such as 4-core processors or 8-core processors, to provide users with higher computing performance.

[0003] In order to reduce device power consumption while achieving higher computing performance, the Advanced Configuration and Power Management Interface (ACPI) specification defines the CPU sleep state. When the CPU is idle, entering the sleep state can save power and is beneficial for other CPUs to work at a higher frequency.

[0004] However, the prior art faces the problem that the CPU will frequently enter and exit the sleep state. Since entering and exiting the sleep state itself consumes additional power, if the CPU frequently enters and exits the sleep state, not only can power not be saved, but even other CPUs cannot obtain a higher frequency. Summary of the Invention

[0005] Multiple aspects of this application provide a method, device, and storage medium for processing computing resources to reduce the frequency of physical computing resource objects entering and exiting the sleep state.

[0006] An embodiment of this application provides a physical machine. An operating system runs on the hardware resources of the physical machine. The hardware resources include multiple physical computing resource objects. The multiple physical computing resource objects support multiple sleep states with different sleep depths. The operating system includes: a target resource scheduler and a target sleep controller; the target sleep controller is used to maintain the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects. The sleep state transition prediction information includes the probability information of the corresponding physical computing resource object entering each sleep state when going to sleep next time after being awakened from any sleep state; the target resource scheduler is used to select a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and schedule the target task to be scheduled to the target physical computing resource object.

[0007] The embodiment of the present application further provides a computing resource processing method, including: maintaining the prediction information of the sleep state transition corresponding to each of a plurality of physical computing resource objects, where the prediction information of the sleep state transition includes the probability information of the corresponding physical computing resource object entering each of the plurality of sleep states when going to sleep next time after being awakened from any one of the plurality of sleep states; selecting a target physical computing resource object according to the prediction information of the sleep state transition corresponding to each of the plurality of physical computing resource objects; and scheduling a target task to be scheduled to the target physical computing resource object.

[0008] The embodiment of the present application further provides a multi-core processor system, including a plurality of processor cores and a memory, where the memory is used to store the program code of the operating system, and the plurality of processor cores are used to run the program code of the operating system to implement the steps in the above computing resource processing method.

[0009] The embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is caused to implement the steps in the above computing resource processing method.

[0010] In this embodiment, the resource scheduling of the physical computing resource object is combined with the sleep control of the physical computing resource object. By maintaining the prediction information of the sleep state transition corresponding to each of the plurality of physical computing resource objects and scheduling the physical computing resource object according to the maintained prediction information of the sleep state transition, the task can be scheduled to the physical computing resource object with a relatively shallow sleep state or a relatively busy state as much as possible, which is beneficial to keeping some physical computing resource objects in the deep sleep state for a relatively long time and keeping some physical computing resource objects in a busy state as much as possible, reducing the frequency of the physical computing resource object entering and exiting the sleep state, and further reducing the frequency of predicting the sleep state and reducing the problems caused by prediction errors. Description of the Drawings

[0011] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0012] Figure 1a It is a schematic diagram of the sleep state conversion provided by an exemplary embodiment of the present application;

[0013] Figure 1b It is a schematic diagram of the sleep power consumption provided by an exemplary embodiment of the present application;

[0014] Figure 2 It is a software-hardware architecture diagram of a physical machine provided by another exemplary embodiment of the present application;

[0015] Figure 3 Schematic diagram of the process for controlling a physical computing resource object to enter the third sleep state provided by another exemplary embodiment of the present application;

[0016] Figure 4 Schematic diagram of the control logic of the menu sleep controller provided by another exemplary embodiment of the present application;

[0017] Figure 5 Schematic diagram of the process of the computing resource processing method provided by another exemplary embodiment of the present application;

[0018] Figure 6a Schematic diagram of the deployment and implementation of the computing resource processing method provided by another exemplary embodiment of the present application in an actual application scenario;

[0019] Figure 6b Schematic diagram of the process for updating a data structure provided by another exemplary embodiment of the present application;

[0020] Figure 6c Schematic diagram of the process for selecting a sleep state provided by another exemplary embodiment of the present application;

[0021] Figure 6d Schematic diagram of the process for the target resource scheduler to perform scheduling provided by another exemplary embodiment of the present application;

[0022] Figure 7 Schematic diagram of the computing resource processing device provided by another exemplary embodiment of the present application;

[0023] Figure 8 Schematic diagram of the electronic device provided by another exemplary embodiment of the present application. Detailed implementation manners

[0024] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0025] 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 for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse. Additionally, various models (including but not limited to language models or large models) involved in this application comply with the relevant laws and standards.

[0026] Taking the multi-core processor scenario as an example, in the ACPI specification, the power states that each CPU core in a multi-core processor can be in can be defined, such as power state C0, power state C1, power state C2... power state Cn. Among them, power state C0 is the effective power state for the CPU core to execute instructions, and power states C1 - Cn are the sleep states of the CPU core. The sleep state is a low-load power state. In the multi-core processor scenario, when the CPU core is not required to execute tasks, any one of the sleep states can be controlled for the CPU core through the API (Application Programming Interface) provided by the CPU firmware. Compared with the CPU core being in the C0 state, this can reduce the overall power consumption of the multi-core processor, that is, consume less power and emit less heat. Among them, from sleep state C1 - sleep state Cn, with the same sleep time, the power consumption saved by each sleep state increases in turn.

[0027] As Figure 1a shown in the sleep state transition schematic diagram, when the CPU core is in power state C0, ACPI can change the overall performance of the multi-core processor through the defined throttling logic and the sleep state transition logic defined by ACPI. For example, the multi-core processor can start the throttling logic, and thus use the sleep state transition logic to issue a command to enter C1, so that the CPU core enters sleep state C1 from power state C0. When the CPU core receives a sleep interrupt instruction, it can exit this sleep state C1 and return to power state C0. Additionally, the ways of entering / exit sleep states C2 and C3 are the same as the ways of entering / exit sleep state C1 described above, and will not be elaborated here.

[0028] It should be noted that from the sleep state C1 to the sleep state Cn, the power consumption saved in each sleep state increases successively. It can also be understood that from the sleep state C1 to the sleep state Cn is a process of the sleep state changing from "shallow" to "deep". When some CPU cores enter a deeper sleep state, other CPU cores can obtain a higher operating frequency. As shown in Table 1, taking a certain multi-core processor as an example, this processor has a total of 48 CPU cores. Assuming that the sleep state C6 is the deepest sleep state supported by this multi-core processor, Table 1 below gives the corresponding relationship between the number of CPU cores not in the sleep state C6 and the operating frequency that other CPU cores can obtain. It can be seen from Table 1 that the fewer the number of CPU cores not in the sleep state C6, the more CPU cores are in the sleep state C6, and the higher the operating frequency that other cores can obtain.

[0029] Table 1

[0030]

[0031]

[0032] As can be seen from the above, the CPU core can save power when entering the sleep state in the idle state and can be awakened and exit the sleep state when being scheduled again. As Figure 1b shown, the CPU core consumes power and requires time when entering or exiting a certain sleep state. Among them, the time required to exit the sleep state can be called the exit delay time. In addition, as the depth of the sleep state increases, the power consumption and time consumed for entering or exiting the sleep state will gradually increase. Thus, it can be seen that if an inappropriate sleep state cannot be selected for the CPU core, it will cause the CPU core to frequently enter and exit the sleep state. Entering and exiting the sleep state itself consumes additional power, resulting in other CPU cores not being able to obtain a higher frequency, which not only does not bring power savings but also causes waste of power resources and response delays. For example, in some cases, if the actual sleep time of the CPU core is shorter than the expected sleep time and a deeper sleep state is wrongly selected for the CPU core according to the expected sleep time, since the actual sleep time of the CPU core in this sleep state is shorter, the power saved by sleeping is less than the power consumed for entering and exiting this sleep state, which not only wastes the CPU power but also has a longer response delay. Another example is that in some other cases, the actual sleep time of the CPU core is longer than the expected sleep time and a shallower sleep state is wrongly selected for the CPU core according to the expected sleep time, which will cause the CPU core to wake up from the sleep state prematurely, wasting the CPU power. In addition, since the CPU core fails to enter a deeper sleep state, other cores cannot obtain a higher frequency.

[0033] In the embodiments of the present application, based on the relevant content of the above multi-core processor, the concept of the sleep state is introduced into various physical computing resource objects. The physical computing resource objects may include various other physical computing resource objects similar to the CPU, such as the CPU, DPU (Data Processing Unit), or TPU (Tensor Processing Unit). When the sleep state is introduced into various physical computing resource objects, in the scenario where multiple physical computing resource objects cooperate, technical problems such as power consumption waste, response delay, and the inability of other CPUs to obtain a higher operating frequency due to frequent entry and exit from the sleep state will also be faced.

[0034] To address the above problems, in the embodiments of the present application, it is proposed to combine the resource scheduling of physical computing resource objects with the sleep control of physical computing resource objects. By maintaining the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects and scheduling the physical computing resource objects according to the maintained sleep state transition prediction information, tasks can be scheduled to physical computing resource objects with a relatively shallow sleep state or relatively busy ones as much as possible, which is beneficial for keeping some physical computing resource objects in a deep sleep state for a relatively long time, keeping some physical computing resource objects in a busy state, reducing the frequency of physical computing resource objects entering and exiting the sleep state, giving full play to the advantages of the sleep state, saving power consumption, and enabling other physical computing resource objects that are not in a deep sleep state to obtain a higher operating frequency as much as possible. Additionally, since the frequency of physical computing resource objects entering and exiting the sleep state is reduced, it means that the frequency of predicting the sleep state is also reduced, which is beneficial for reducing problems caused by prediction errors and solving the above technical problems.

[0035] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0036] Figure 2 The software-hardware architecture diagram of the physical machine provided by an exemplary embodiment of the present application is shown in Figure 2 As shown, the physical machine includes an application layer 21, a kernel layer (i.e., the operating system) 22, and a hardware resource layer 23.

[0037] Among them, the hardware resource layer 23 includes various hardware resources of the physical machine. The hardware resources of the physical machine include multiple physical computing resource objects, and multiple physical computing resource objects cooperate with each other. Multiple physical computing resource objects can be integrated on a single chip but are not limited to this. Taking the physical computing resource object as the CPU as an example, multiple physical computing resource objects can be implemented as a multi-core CPU. In addition, the hardware resources of the physical machine also include a memory, a communication component, a display, a power supply component, an audio component, and various external devices, etc., which are not shown in Figure 2 Here. Additionally,Figure 2 Only the physical computing resource objects are schematically shown, and the number of physical computing resource objects is not limited.

[0038] In this embodiment, for multiple physical computing resource objects, multiple sleep states with different sleep depths are supported. Depending on the type and manufacturer of the physical computing resource objects, the number of supported sleep states of the physical computing resource objects will vary. Additionally, the power consumption and time consumed for entering and exiting each sleep state will also vary. For example, some physical computing resource objects provided by certain manufacturers may support sleep state C1, sleep state C2, and sleep state C3, while some physical computing resource objects provided by other manufacturers may support sleep state C1, sleep state C2, sleep state C3, sleep state C4, sleep state C5, and sleep state C6, and this is not limited. Regardless of the type of physical computing resource object and regardless of which manufacturer provides the physical computing resource object, for the multiple sleep states supported by the physical computing resource objects, the sleep depths of different sleep states will be different. Optionally, for ease of description, the sleep depth of the sleep state can be represented by the number after C. As the number after C increases, the sleep depth of the sleep state increases sequentially. Correspondingly, the power consumption and time consumed for entering and exiting these sleep states will also increase sequentially.

[0039] In this embodiment, an operating system, i.e., the kernel layer 22, runs on the hardware resources of the physical machine. Above the operating system is the application layer 21, and the application layer 21 includes various application programs running on the physical machine. Depending on the application scenario and implementation form of the physical machine, there will be slight differences in the implementation of the application programs. Taking the physical machine implemented as terminal devices such as mobile phones and computers as an example, the application programs running on the physical machine can be e-commerce shopping applications, various video applications, email applications, instant messaging applications, various office applications, etc. Taking the physical machine implemented as server devices such as conventional servers, cloud servers, and server clusters as an example, the application programs running on the physical machine can be various databases or data warehouses, streaming computing applications, log processing applications, distributed computing, various virtual machines or containers, etc.

[0040] For an application, an operating system is a set of interrelated system software programs that manage and control various operations of a physical machine, utilize and run hardware and software resources, and provide common services to organize user interactions. In the embodiments of the present application, the operating system serves as a bridge between the application and the hardware resources. The operating system includes drivers for various hardware resources to drive the corresponding hardware resources. In addition, the operating system of this embodiment further includes: a sleep controller for controlling the sleep state of physical computing resource objects, and a resource scheduler for scheduling physical computing resource objects. In this embodiment, in order to enable physical computing resource objects to enter and exit the sleep state reasonably, a new sleep controller and a new resource scheduler are provided. For the convenience of description and distinction, the new sleep controller and the new resource scheduler provided in the embodiments of the present application are respectively referred to as the target sleep controller 11 and the target resource scheduler 12. It should be noted here that the operating system may only include the target sleep controller 11 and the target resource scheduler 12, or may include other sleep controllers and other resource schedulers, which can be determined according to specific application requirements and application scenarios, and are not limited thereto. Next, the process of the target sleep controller 11 and the target resource scheduler 12 cooperating with each other to control the sleep state and schedule resources of physical computing resource objects will be introduced in detail.

[0041] In this embodiment, the target sleep controller 11 can maintain the sleep state transition prediction information corresponding to each of multiple physical computing resource objects. Among them, the sleep state transition prediction information corresponding to any one physical computing resource object is used to predict the state transition situation of the physical computing resource object in different sleep states. The sleep state transition prediction information may include the probability information of the corresponding physical computing resource object entering each sleep state during the next sleep when being awakened from any sleep state. Among them, the probability information can be implemented as a probability value or as a weight, and is not limited thereto. For example, assume that a physical computing resource object supports sleep state C0, sleep state C1, and sleep state C2. The sleep state transition prediction information corresponding to the physical computing resource object may include: when the physical computing resource object is awakened from sleep state C0, the probability of entering sleep state C0 during the next sleep is, for example, 70%, the probability of entering sleep state C1 is, for example, 15%, and the probability of entering sleep state C2 is, for example, 15%; when the physical computing resource object is awakened from sleep state C1, the probability of entering sleep state C0 during the next sleep is, for example, 30%, the probability of entering sleep state C1 is, for example, 40%, and the probability of entering sleep state C2 is, for example, 20%; when the physical computing resource object is awakened from sleep state C2, the probability of entering sleep state C0 during the next sleep is, for example, 50%, the probability of entering sleep state C1 is, for example, 15%, and the probability of entering sleep state C2 is, for example, 30%.

[0042] In this embodiment, the target sleep controller 11 may disclose the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects it maintains to the target resource scheduler 12. Optionally, the target sleep controller 11 may actively provide the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects it maintains to the target resource scheduler 12, or the target resource scheduler 12 may also actively request it from the target sleep controller 11, and the target sleep controller 11 provides the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects it maintains to the target resource scheduler 12 according to this request. For the target resource scheduler 12, when performing task scheduling, it can select the target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, and schedule the target task to be scheduled to the target physical computing resource object. For example, the target resource scheduler 12 can select the physical computing resource object D1 as the target physical computing resource object from the physical computing resource object D1, the physical computing resource object D2, the physical computing resource object D3, and the physical computing resource object D4 according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, and schedule the target task to the target physical computing resource object.

[0043] In the embodiment of the present application, the process of the target resource scheduler 12 performing resource scheduling according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects is based on the scheduling principle of preferentially scheduling physical computing resource objects that are not in the sleep state, in a relatively shallow sleep state, or have a relatively high probability of entering a relatively shallow sleep state. In this way, the resource scheduling of physical computing resource objects can be combined with the sleep control of physical computing resource objects, and the physical computing resource objects can be scheduled according to the maintained sleep state transition prediction information, so as to try to schedule tasks to physical computing resource objects with a relatively shallow sleep state or relatively busy state, which is beneficial to making some physical computing resource objects stay in the deep sleep state for a relatively long time or have more opportunities, and making some physical computing resource objects stay in a busy state as much as possible, thereby reducing the frequency of physical computing resource objects entering and exiting the sleep state, achieving power consumption savings, and enabling other physical computing resource objects to obtain a relatively high operating frequency as much as possible.

[0044] In some alternative embodiments, as the operating state of the physical computing resource object changes, for example, from the sleep state to the working state, or from the working state to a certain sleep state, the predicted information on the sleep state transition of each physical computing resource object will change. Therefore, it is also possible to update the predicted information on the sleep state transition of the physical computing resource object, so as to obtain more accurate predicted information on the sleep state transition, for subsequent more accurate resource scheduling based on the predicted information on the sleep state transition. Among them, the update operation of the predicted information on the sleep state transition can be executed by the target sleep controller 11 during the maintenance process.

[0045] Specifically, when the target sleep controller 11 maintains the predicted information on the sleep state transition corresponding to each of the multiple physical computing resource objects, it can monitor the operating states of the multiple physical computing resource objects. Here, the operating states can include: the working state and the sleep state, and the sleep state can include multiple sleep states with different sleep depths; when it is monitored that any physical computing resource object is awakened from the first sleep state, it can obtain the actual sleep time of the physical computing resource object in the first sleep state. Among them, the first sleep state can be any sleep state, that is to say, when the target sleep controller 11 monitors that any physical computing resource object is awakened from any sleep state, it can obtain the actual sleep time of the physical computing resource object in that any sleep state; furthermore, according to the actual sleep time of the physical computing resource object in the first sleep state and the exit delay time of the first sleep state, it updates the predicted information on the sleep state transition corresponding to any physical computing resource object.

[0046] Among them, the actual sleep time of the physical computing resource object in the first sleep state can be obtained through the following steps R1 - step R2:

[0047] Step R1, the target sleep controller 11 can obtain the first time when the physical computing resource object enters the first sleep state, and the second time when it is awakened from the first sleep state by the wake-up event. Among them, the wake-up event can be a timer arrival event or an interrupt event, etc. An interrupt event means that when the physical computing resource object executes a normal program, some urgently needed abnormal situations or special requests occur in the system, and the physical computing resource object temporarily suspends the task being run and turns to process a more urgent task that occurs randomly.

[0048] Step R2. Calculate the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time. The embodiments of the present application do not limit the implementation manner of calculating the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time. Optionally, the target sleep controller 11 may calculate the difference between the second time and the first time as the actual sleep time of any physical computing resource object in the first sleep state; or, the target sleep controller 11 may also correct the difference between the second time and the first time by using a preset difference correction rule, and use the corrected difference as the actual sleep time of any physical computing resource object in the first sleep state; or, the target sleep controller 11 may also perform weighted summation on the second time and the first time according to their respective preset weights to obtain the actual sleep time of any physical computing resource object in the first sleep state.

[0049] After obtaining the actual sleep time of any physical computing resource object in the first sleep state, the target sleep controller 11 may update the sleep state transition prediction information corresponding to any physical computing resource object according to the actual sleep time and the exit delay time of the first sleep state. Specifically, according to the different matching situations between the actual sleep time of any physical computing resource object in the first sleep state and the exit delay time of the first sleep state, the manner of updating the sleep state transition prediction information corresponding to any physical computing resource object will also be different. In the embodiments of the present application, the manner of defining whether the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state is not limited, and it may be flexibly defined according to application requirements. Among them, the target sleep controller 11 may determine whether the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state in any of the following ways.

[0050] Method 1. The target sleep controller 11 may determine whether the actual sleep time of any physical computing resource object in the first sleep state is the same as the exit delay time of the first sleep state. If they are the same, the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state. If they are not the same, the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state.

[0051] Method 2: The target sleep controller 11 can also calculate the error between the actual sleep time of any physical computing resource object in the first sleep state and the exit delay time of the first sleep state. If the error is within the preset error range, the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state. If the error is not within the preset error range, the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state.

[0052] Method 3: The target sleep controller 11 can determine whether the actual sleep time of any physical computing resource object in the first sleep state is within a certain multiple range of the exit delay time of the first sleep state. If so, the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state. If not, the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state.

[0053] Method 4: The target sleep controller 11 can also determine whether the actual sleep time of any physical computing resource object in the first sleep state is greater than the exit delay time of the first sleep state. If so, it further determines whether the difference between the actual sleep time of any physical computing resource object in the first sleep state and the exit delay time of the first sleep state is greater than the set difference threshold. If so, the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state. If any of the above judgment operations is negative, the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state.

[0054] Regardless of how it is defined whether the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state, it can be divided into two cases: one is the case where the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state, and the other is the case where the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state. The following will introduce the cases separately.

[0055] Case 1: When the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state, it indicates that the first sleep state is a relatively better sleep state for any physical computing resource object. Therefore, the probability information that any physical computing resource object enters the first sleep state again during the next sleep when it is awakened from the first sleep state can be relatively increased, so that it can enter the first sleep state again with a higher probability when sleep is needed next time.

[0056] Further optionally, the implementation method for the target sleep controller 11 to relatively increase the probability information that any physical computing resource object enters the first sleep state again during the next sleep when it is awakened from the first sleep state includes: separately increasing the probability information that any physical computing resource object enters the first sleep state again during the next sleep when it is awakened from the first sleep state; or, separately reducing the probability information that any physical computing resource object enters other sleep states during the next sleep when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state; or, it is also possible to reduce the probability information that any physical computing resource object enters other sleep states during the next sleep when it is awakened from the first sleep state while increasing the probability information that any physical computing resource object enters the first sleep state again during the next sleep when it is awakened from the first sleep state.

[0057] For example, assume that any physical computing resource object is awakened from the sleep state C0 (the sleep state C0 is an example of the first sleep state). Before updating the sleep state transition prediction information corresponding to any physical computing resource object, when any physical computing resource object is awakened from the sleep state C0, the probabilities of entering the sleep state C0, the sleep state C1, and the sleep state C2 during the next sleep are 70%, 15%, and 15% respectively. If the actual sleep time of any physical computing resource object in the sleep state C0 matches the exit delay time of the sleep state C0, when the target sleep controller 11 updates the sleep state transition prediction information, it can either increase the probability of entering the sleep state C0 from 70% to 80% when awakened from the sleep state C0 during the next sleep, or it can also decrease the probabilities of entering the sleep state C1 and the sleep state C2 from 15% to 10% when awakened from the sleep state C0 during the next sleep. Or, increase the probability of entering the sleep state C0 from 70% to 80% when awakened from the sleep state C0 during the next sleep, and decrease the probabilities of entering the sleep state C1 and the sleep state C2 from 15% to 10%. Here, it should be noted that in the previous example, the amplitudes of the decreases in the two probabilities of entering the sleep state C1 and the sleep state C2 are the same as an example, but they can also be different. For example, the probability of entering the sleep state C1 is decreased by 10%, and the probability of entering the sleep state C2 is decreased by 5%.

[0058] Case 2: When the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state, it indicates that the first sleep state is not a relatively optimal sleep state for any physical computing resource object. Therefore, a sleep state whose exit delay time matches the actual sleep time can be determined and denoted as the second sleep state. The second sleep state is a relatively optimal sleep state for any physical computing resource object. Therefore, the probability information of any physical computing resource object entering the second sleep state during the next sleep when awakened from the first sleep state is relatively increased, so that it can enter the second sleep state with a higher probability when sleep is required next time. Here, the second sleep state is a sleep state whose exit delay time matches the actual sleep time. That is to say, when the actual sleep time does not match the exit delay time of the first sleep state, the target sleep controller 11 can relatively increase the probability information corresponding to the sleep state whose exit delay time matches the actual sleep time, so as to update the sleep state transition prediction information more accurately.

[0059] Specifically, in Case 2, the target sleep controller 11 can relatively increase the probability information of any physical computing resource object entering the second sleep state during the next sleep when awakened from the first sleep state based on the following several implementation manners:

[0060] Embodiment 1: Individually increase the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state. For example, assume that any physical computing resource object is awakened from the sleep state C0 (the sleep state C0 is an example of the first sleep state). Before updating the sleep state transition prediction information corresponding to any physical computing resource object, the probability that any physical computing resource object enters the sleep state C0 during the next sleep when being awakened from the sleep state C0 (the first sleep state) is 70%, the probability of entering the sleep state C1 (the second sleep state) is 15%, and the probability of entering the sleep state C2 is 15%. Then, when the actual sleep time of any physical computing resource object in the sleep state C0 does not match the exit delay time of the sleep state C0, the target sleep controller 11 can increase the probability that any physical computing resource object enters the sleep state C1 during the next sleep when being awakened from the sleep state C0 (the first sleep state) from 15% to 70%.

[0061] Embodiment 2: Increase the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state, and decrease the probability information that any physical computing resource object enters other sleep states during the next sleep when being awakened from the first sleep state. Here, the other sleep states refer to the sleep states other than the second sleep state (including the first sleep state). Continuing with the previous example, when the actual sleep time of any physical computing resource object in the sleep state C0 does not match the exit delay time of the sleep state C0, increase the probability that any physical computing resource object enters the sleep state C1 during the next sleep when being awakened from the sleep state C0 (the first sleep state) from 15% to 70%, and correspondingly decrease the probabilities of entering the sleep states C0 and C2. For example, the probability that any physical computing resource object enters the sleep state C0 during the next sleep when being awakened from the sleep state C0 (the first sleep state) can be decreased from 70% to 20%, and the probability that any physical computing resource object enters the sleep state C2 during the next sleep when being awakened from the sleep state C0 (the first sleep state) can be decreased from 15% to 10%.

[0062] Embodiment 3: Individually decrease the probability information that any physical computing resource object enters the first sleep state during the next sleep when being awakened from the first sleep state. Continuing with the previous example, when the actual sleep time of any physical computing resource object in the sleep state C0 does not match the exit delay time of the sleep state C0, the target sleep controller 11 can decrease the probability that any physical computing resource object enters the sleep state C0 during the next sleep when being awakened from the sleep state C0 from 70% to 15%.

[0063] Embodiment 4: Reduce the probability information that any physical computing resource object enters the first sleep state during the next sleep when it is awakened from the first sleep state, and increase the probability information that any physical computing resource object enters other sleep states during the next sleep when it is awakened from the first sleep state. Here, the other sleep states refer to sleep states other than the first sleep state (including the second sleep state). Continuing with the previous example, when the actual sleep time of any physical computing resource object in sleep state C0 does not match the exit delay time of sleep state C0, the probability that it enters sleep state C0 (the first sleep state) during the next sleep when awakened from sleep state C0 is reduced from 70% to 20%, and the probabilities of entering sleep states C1 and C2 are increased accordingly. For example, the probability that it enters sleep state C1 during the next sleep when awakened from sleep state C0 (the first sleep state) can be increased from 15% to 60%, and the probability that it enters sleep state C2 during the next sleep when awakened from sleep state C0 (the first sleep state) can be increased from 15% to 20%.

[0064] Embodiment 5: Independently reduce the probability information that any physical computing resource object enters other sleep states during the next sleep when it is awakened from the first sleep state. Here, the other sleep states refer to sleep states other than the first sleep state and the second sleep state. Continuing with the previous example, the target sleep controller 11 can reduce the probability that any physical computing resource object enters sleep state C2 during the next sleep when awakened from sleep state C0 from 15% to 5%.

[0065] Through the above methods, the target sleep controller can dynamically update the sleep state transition prediction information according to the operating state of the physical computing resource object, so as to maintain more accurate sleep state transition prediction information. On the one hand, it is convenient to more accurately select the sleep state that the physical computing resource object needs to enter when it needs to sleep next time. On the other hand, it can also provide a more accurate data basis for resource scheduling based on the sleep state transition prediction information.

[0066] In the above embodiments of the present application, there is no limitation on the specific manner in which the target sleep controller maintains the sleep state transition prediction information. In some alternative embodiments, the target sleep controller may create data structures corresponding to each of the multiple physical computing resource objects during the initialization process; initialize the data structures corresponding to each of the multiple physical computing resource objects to obtain the initial values of the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and then, as the operating states of the physical computing resource objects change, the sleep state transition prediction information recorded in the data structures can be dynamically updated according to the manner described above. Among them, the data structure is used to store the sleep state transition prediction information corresponding to the corresponding physical computing resource object. Among them, the data structure refers to a data structure capable of storing information, including but not limited to: arrays, lists, linked lists, queues, etc. The embodiments of the present application will take an array as an example for illustrative purposes and refer to this array as the sleep state weight array, but do not limit the form of the data structure.

[0067] Specifically, the target sleep controller may create sleep state weight arrays corresponding to each of the multiple physical computing resource objects during the initialization process. The sleep state weight array is a multi-dimensional array including multiple rows and multiple columns, as shown in Table 2. Among them, one row in the sleep state weight array represents a possible sleep state when the corresponding physical computing resource object is awakened, and one column represents a possible sleep state when the corresponding physical computing resource object enters the next sleep. The array element at the intersection of the row and the column represents the weight of the corresponding physical computing resource object entering the sleep state represented by this column when waking up from the sleep state represented by this row. The higher the weight, the greater the probability. It should be noted that before initialization, the element values of the sleep state weight array should be null values.

[0068] Next, the target sleep controller 11 can initialize the sleep state weight arrays corresponding to multiple physical computing resource objects respectively to obtain the initial values of the sleep state transition prediction information corresponding to multiple physical computing resource objects respectively. In an alternative embodiment, the target sleep controller 11 can initialize the array elements with the same number of rows and columns to a first value, and initialize the array elements with different numbers of rows and columns to a second value, where the first value is greater than the second value, and the sum of the first value and the second value in the same row is a third value. As shown in Table 2, the third value can be 100, and the sum of the first value and the second value in the same row is 100. In addition, the third value can also be any value, such as 90, 120 or 150, etc., which is not limited in this embodiment. Correspondingly, the first value and the second value can also be any values as long as they meet the two conditions of "the first value is greater than the second value" and "the sum of the first value and the second value in the same row is the third value", which is not limited in this embodiment. In Table 2, an example is illustrated with the first value being 70 and the second value being 15. The following table is the multi-dimensional array after initialization, which is only used for exemplary illustration to better describe the meanings of rows and columns respectively.

[0069] Table 2

[0070] C0 (First column) C1 (Second column) C2 (Third column) C0 (First row) 70 15 15 C1 (Second row) 15 70 15 C2 (Third row) 15 15 70

[0071] That is to say, in the sleep state weight array shown in Table 2 above, the row where the sleep state C0 is located can represent that when the corresponding physical computing resource object is awakened from the sleep state C0, the weight of entering the sleep state C0 during the next sleep is 70%, the weight of entering the sleep state C1 during the next sleep is 15%, and the weight of entering the sleep state C2 during the next sleep is 15%; the row where the sleep state C1 is located can represent that when the corresponding physical computing resource object is awakened from the sleep state C1, the weight of entering the sleep state C0 during the next sleep is 15%, the weight of entering the sleep state C1 during the next sleep is 70%, and the weight of entering the sleep state C2 during the next sleep is 15%; the row where the sleep state C2 is located can represent that when the corresponding physical computing resource object is awakened from the sleep state C2, the weight of entering the sleep state C0 during the next sleep is 15%, the weight of entering the sleep state C1 during the next sleep is 15%, and the weight of entering the sleep state C2 during the next sleep is 70%.

[0072] On this basis, in combination with the sleep state weight array and the above-listed initialization methods, an exemplary description is given of the adjustment methods for probability information such as "relatively increasing the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state" and "the target sleep controller relatively increasing the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state" mentioned in the foregoing embodiments. It should be noted that no matter how the multi-dimensional array is updated, the sum of the values in the same row of the multi-dimensional array after increasing or decreasing is still the preset third value. The following will further explain.

[0073] Optionally, when the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state, the target sleep controller 11 can relatively increase the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state. Among them, the target sleep controller 11 can relatively increase the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state to a fourth value, and relatively decrease the probability information that any physical computing resource object will enter other sleep states during the next sleep when awakened from the first sleep state to a fifth value. The fourth value can be greater than the fifth value, and the sum of the values in the same row is still the third value in the foregoing embodiments.

[0074] Optionally, when the actual sleep time of any physical computing resource object in the first sleep state does not match the exit delay time of the first sleep state, the target sleep controller 11 can relatively increase the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state. Among them, the target sleep controller 11 can relatively increase the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state to a sixth value, and relatively decrease the probability information that any physical computing resource object will enter other sleep states during the next sleep when awakened from the first sleep state to a seventh value. The sixth value can be greater than the seventh value, and the sum of the values in the same row is still the third value in the foregoing embodiments.

[0075] In this way, based on the data structure after the foregoing initialization, the target sleep controller 11 can use the data structure to more quickly update the sleep state transition prediction information corresponding to any physical computing resource object.

[0076] In some alternative embodiments, in addition to maintaining the sleep state transition prediction information corresponding to each physical computing resource object, the target sleep controller 11 may also monitor the task queue in any physical computing resource object. When the task queue in the physical computing resource object is empty, or when the task queue in the physical computing resource object is empty and remains so for a preset time, the target sleep controller 11 may determine that the physical computing resource object needs to enter the sleep state. When it is detected that the physical computing resource object needs to enter the sleep state, the target sleep controller 11 may determine the third sleep state according to the sleep state transition prediction information corresponding to the physical computing resource object, and control any physical computing resource object to enter the third sleep state. Herein, the third sleep state is any one of multiple sleep states, which is the sleep state that the physical computing resource object needs to enter this time. The following will further illustrate the above process in combination with Figure 3 the internal architecture and working principle of the operating system shown.

[0077] As Figure 3 shown, in the first step (as shown by ① in Figure 3 ), the ACPI specification can be used to configure the sleep state. Specifically, the physical machine can obtain a fixed ACPI description table, which defines the ACPI information of various fixed hardware. Various sleep states supported by any physical computing resource object and the exit delay time corresponding to each sleep state are obtained from this description table. In the second step (as shown by ② in Figure 3 ), the target resource scheduler 12 can perform resource scheduling for each physical computing resource object; in the third step (as shown by ③ in Figure 3 ), during the resource scheduling process, if it is detected that the task queue in any physical computing resource object is empty, or the task queue in the physical computing resource object is empty and remains so for a preset time, the target sleep controller 11 may determine the third sleep state that the physical computing resource object needs to enter according to the maintained sleep state transition prediction information of the physical computing resource object, and provide the third sleep state to the sleep management and control module 13. The sleep management and control module 13 selects the corresponding driver module 14 of the physical computing resource object, and uses the driver module 14 to control the physical computing resource object to enter the third sleep state through the firmware corresponding to the physical computing resource object, as shown by ④ in Figure 3 . Herein, in Figure 3 , taking the operating system internally including the target sleep controller 11, the target resource scheduler 12, the sleep management and control module 13, and the driver module 14 as an example for illustration is only a schematic description of the internal architecture of the operating system, and the internal implementation architecture of the operating system is not limited thereto.

[0078] Specifically, when the target sleep controller 11 determines the third sleep state according to the sleep state transition prediction information corresponding to the physical computing resource object, it can be implemented based on the following steps Y1 - Y4:

[0079] Step Y1: Obtain the most recently exited sleep state of any physical computing resource object as the fourth sleep state. For example, if the sleep states exited by the physical computing resource object at historical moments are successively sleep state C1 and sleep state C2, the target sleep controller 11 can use the most recently exited sleep state C2 of the physical computing resource object as the fourth sleep state.

[0080] Step Y2: Obtain, from the sleep state transition prediction information corresponding to any physical computing resource object, the probability information of entering each sleep state during the next sleep when awakened from the fourth sleep state.

[0081] Step Y3: According to the probability information of entering each sleep state during the next sleep when awakened from the fourth sleep state, select the sleep state with the largest probability information as the candidate sleep state.

[0082] For example, the probability information obtained by the target sleep controller 11 of entering each sleep state during the next sleep when awakened from the fourth sleep state is as follows: 15% for sleep state C0, 70% for sleep state C1, and 15% for sleep state C2. Therefore, the target sleep controller 11 can select the sleep state C1 with the largest probability information as the candidate sleep state.

[0083] Step Y4: When the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system, use the candidate sleep state as the third sleep state. The maximum tolerable exit delay time of the system can be a preset fixed value, a value dynamically configured by the system according to the system operation situation, or a value custom - set by the user. This embodiment does not make any restrictions.

[0084] In addition to the situation in the above - mentioned step Y4 where "the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system", when the exit delay time of the candidate sleep state is greater than or equal to the maximum tolerable exit delay time of the system, the target sleep controller 11 can also select another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state. Among them, when there is only one sleep state with an exit delay time less than the maximum tolerable exit delay time of the system, the target sleep controller 11 can use this sleep state as the third sleep state. When there are multiple sleep states with an exit delay time less than the maximum tolerable exit delay time of the system, the target sleep controller 11 can select the sleep state with an exit delay time less than the maximum tolerable exit delay time of the system and the largest probability information as the third sleep state.

[0085] In the above manner, the target sleep controller 11 can more accurately determine the third sleep state according to the sleep state transition prediction information corresponding to the physical computing resource object.

[0086] Based on the corresponding execution logic of the target sleep controller 11 introduced in the foregoing embodiments, the target resource scheduler 12 can also cooperate with the target sleep controller to complete the joint scheduling of the target task, which will be further described below.

[0087] When the target resource scheduler 12 selects a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it can be implemented based on the following steps U1 - U2:

[0088] Step U1: Respond to the resource scheduling trigger event, and generate the sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects. Among them, the resource scheduling trigger event includes: time interruption, peripheral interruption, the current application actively gives up running, or a higher-priority application needs to run, etc.

[0089] Step U2: Select a target physical computing resource object from the multiple physical computing resource objects according to the sleep habit information corresponding to each of the multiple physical computing resource objects.

[0090] In the above manner, the target resource scheduler 12 can more accurately select a target physical computing resource object from the multiple physical computing resource objects based on the sleep habit information corresponding to each of the multiple physical computing resource objects.

[0091] In some alternative embodiments, when the target resource scheduler 12 executes the above step U1, it can generate the sleep habit information corresponding to each of the multiple physical computing resource objects based on the following steps U11 - U12:

[0092] Step U11: For any physical computing resource object, obtain the probability information that the physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep from the sleep state transition prediction information corresponding to the physical computing resource object.

[0093] Step U12: Generate the sleep habit information corresponding to any physical computing resource object according to the probability information that the physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep. Among them, the target resource scheduler 12 can construct a data structure and write the probability information that the physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep into the data structure to obtain the sleep habit information corresponding to the physical computing resource object.

[0094] Among them, the data structure includes but is not limited to: arrays, lists, linked lists, queues, etc. The target resource scheduler 12 can also directly use the probability information of any physical computing resource object exiting from any sleep state and entering the sleep state again during the next sleep as the sleep habit information corresponding to the physical computing resource object.

[0095] For example, assume there are three sleep states: sleep state C0, sleep state C1, and sleep state C2. The target resource scheduler 12 can obtain from the sleep state transition prediction information corresponding to any physical computing resource object that the probability of the physical computing resource object exiting from sleep state C0 and entering sleep state C0 again during the next sleep is 40%, the probability of exiting from sleep state C1 and entering sleep state C1 again during the next sleep is 35%, and the probability of exiting from sleep state C2 and entering sleep state C2 again during the next sleep is 60%. Based on this, the target resource scheduler 12 can use the above probability information as the sleep habit information corresponding to any physical computing resource object.

[0096] In some other alternative embodiments, when the target resource scheduler 12 executes the above step U1, it can also divide the sleep habit information into two sleep habit types: light sleep habit or deep sleep habit in the following way to obtain the sleep habit information. Among them, if the sleep habit type corresponding to a certain physical computing resource object is a light sleep habit, it means that the physical computing resource object is accustomed to being in a light sleep state; if the sleep habit type corresponding to a certain physical computing resource object is a deep sleep habit, it means that the physical computing resource object is accustomed to being in a deep sleep state. The following will further explain.

[0097] If the probability information of any physical computing resource object exiting from the shallowest sleep state and entering the shallowest sleep state during the next sleep is the largest, the target resource scheduler 12 can determine that the sleep habit type corresponding to any physical computing resource is a light sleep habit, and generate the sleep probability of any physical computing resource object under the light sleep habit according to the largest probability information. Among them, the target resource scheduler 12 can directly use the largest probability information as the sleep probability of any physical computing resource object under the light sleep habit; it can also multiply the largest probability information by a preset probability coefficient to obtain the sleep probability of any physical computing resource object under the light sleep habit; it can also add a preset correction value to the largest probability information to obtain the sleep probability of any physical computing resource object under the light sleep habit. This embodiment does not make any restrictions.

[0098] If the probability information that any physical computing resource object exits from the deepest sleep state and enters the deepest sleep state in the next sleep is the largest, determine that the sleep habit type corresponding to any physical computing resource object is the deep sleep habit, and generate the sleep probability of any physical computing resource under the deep sleep habit according to the largest probability information. The manner of generating the sleep probability of any physical computing resource under the deep sleep habit according to the largest probability information is the same as the manner of generating the sleep probability of any physical computing resource object under the shallow sleep habit described above, and will not be elaborated here.

[0099] In this way, the target resource scheduler 12 can not only obtain the sleep habit information more accurately, but also divide the sleep habit information more accurately into two types: shallow sleep habit or deep sleep habit.

[0100] In some alternative embodiments, when the target resource scheduler 12 selects a target physical computing resource object from multiple physical computing resource objects, it can determine at least one candidate physical computing resource object corresponding to the shallow sleep habit according to the sleep habit information corresponding to each of the multiple physical computing resource objects. For example, there are 5 physical computing resource objects, namely physical computing resource object D1 - physical computing resource object D5, and the sleep habit information corresponding to each of them corresponds to the shallow sleep habit, the shallow sleep habit, the deep sleep habit, the deep sleep habit, and the deep sleep habit respectively. The target resource scheduler 12 can use physical computing resource object D1 and physical computing resource object D2 as candidate physical computing resource objects.

[0101] After the target resource scheduler 12 determines at least one candidate physical computing resource object corresponding to the shallow sleep habit, it can select a candidate physical computing resource object with a sleep probability meeting the requirements as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.

[0102] Specifically, the target resource scheduler 12 can select a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit, in combination with other auxiliary information. Among them, the other auxiliary information may include at least one of the following: the type of the resource scheduling trigger event, the current running state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object. The following will be described in different cases.

[0103] Optionally, taking other auxiliary information as an example of the type of resource scheduling trigger event, when the target resource scheduler 12 selects a target physical computing resource object from at least one candidate physical computing resource object, it can select the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit and the type of resource scheduling trigger event. Among them, the target resource scheduler 12 can first select at least one target candidate physical computing resource object from at least one candidate physical computing resource object according to the type of resource scheduling trigger event. The corresponding relationship between the type of resource scheduling trigger event and its corresponding physical computing resource object can be maintained by the target resource scheduler 12. Then, the target resource scheduler 12 can select the candidate physical computing resource object with the highest sleep probability from at least one target candidate physical computing resource object as the target physical computing resource object.

[0104] Optionally, taking other auxiliary information as an example of the current running state of the candidate physical computing resource object, when the target resource scheduler 12 selects a target physical computing resource object from at least one candidate physical computing resource object, it can select the target physical computing resource object according to the current running state of at least one candidate physical computing resource object and the sleep probability under the light sleep habit. Among them, the target resource scheduler 12 can first select at least one target candidate physical computing resource object whose running state meets the preset state conditions from at least one candidate physical computing resource object according to the current running state of at least one candidate physical computing resource object, and select the candidate physical computing resource object with the highest sleep probability from at least one target candidate physical computing resource object as the target physical computing resource object.

[0105] Optionally, taking other auxiliary information as an example of the current utilization rate of the candidate physical computing resource object, when the target resource scheduler 12 selects a target physical computing resource object from at least one candidate physical computing resource object, it can select the candidate physical computing resource object whose utilization rate meets the requirements and has the highest sleep probability as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit and the current utilization rate. The requirements corresponding to the utilization rate can be set to any conditions according to actual needs, such as not greater than 80%, not greater than 70%, or not greater than 60%, etc., which are not limited in this embodiment.

[0106] Through the above method, since other auxiliary information is combined, the target resource scheduler 12 can more accurately select a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit.

[0107] Based on the above various embodiments, the multiple physical computing resource objects mentioned in the foregoing embodiments may be multi-core processors. Additionally, the physical machines mentioned in the foregoing embodiments may be applicable to vertical / specialized application scenarios. In the case of being applied to vertical / specialized scenarios, the operating system of the physical machine may only include a target resource scheduler and a target sleep controller to implement the above various embodiments.

[0108] In addition, the physical machine can also be configured to be applied to various general scenarios. In general scenarios, the operating system mentioned in the foregoing embodiments may further include other resource schedulers and other sleep controllers. The sleep control logics of different sleep controllers are different, and the resource scheduling logics of different resource schedulers are different. Moreover, users are allowed to flexibly select which sleep controller and which resource scheduler to use according to application requirements.

[0109] For example, the operating system may include several other resource schedulers, several other sleep controllers, as well as the target sleep controller and the target resource scheduler in the foregoing embodiments. Different other resource schedulers and different other sleep controllers are independent of each other. The concept of being independent means that each other resource scheduler can perform resource scheduling according to its own scheduling logic, and each other sleep controller can perform sleep control according to its own sleep control logic. That is to say, the resource scheduling process of other resource schedulers does not depend on the sleep control process of any other sleep controller, and other resource schedulers and other sleep controllers are decoupled. Among them, users can use any combination among several other resource schedulers and several other sleep controllers. Specifically, the physical machine can determine a resource scheduler and a sleep controller from several other resource schedulers and several other sleep controllers in response to the user's selection operation, and the selected resource scheduler and sleep controller are configured to take effect, so as to schedule target tasks based on the resource scheduler and the sleep controller. The embodiments of the present application do not limit the sleep control logic of any other sleep controller, nor the resource scheduling logic of any other resource scheduler. The physical machine can also select the target resource scheduler and the target sleep controller to cooperate in scheduling target tasks in response to the user's selection operation, that is, the target resource scheduler and the target sleep controller are configured to take effect. Compared with other resource schedulers and other sleep controllers, the target resource scheduler and the target sleep controller need to be used in combination and are associated with each other and will affect each other. It should be noted that when any resource scheduler among other resource schedulers and any sleep controller among other sleep controllers are configured to take effect, the target resource scheduler and the target sleep controller are configured to be invalid.

[0110] The following will take the Linux operating system as an example to exemplarily illustrate the sleep control logic of other sleep controllers.

[0111] In the Linux system, multiple sleep controllers such as menu (literally translated as menu), timer events - oriented (teo), and ladder (literally translated as ladder) can usually be configured. Among them, the menu sleep controller is a sleep controller that attempts to predict the idle duration and uses the predicted value to select a sleep state for the physical computing resource object. For the detailed sleep control logic of the menu sleep controller, refer to the description in the following embodiments. The teo sleep controller is a sleep controller that attempts to find the deepest sleep state suitable for the given conditions. Specifically, the teo sleep controller monitors the idle duration of each physical computing resource object, attempts to compare the observed idle duration value with the available sleep states, and uses this information to select the sleep state that is most likely to "match" the upcoming idle interval of the physical computing resource object. Among them, the ladder sleep controller is a sleep controller that enters various sleep states gradually from shallow to deep, that is, it preferentially enters the shallowest sleep state and determines whether to enter the next deeper sleep state according to the sleep duration.

[0112] In the embodiments of this application, it is assumed that the user selects to use other sleep controllers and other resource schedulers. Taking the menu sleep controller and the CFS (Completely Fair Scheduler) resource scheduler as examples, as Figure 4 shown, the working logics between the two are decoupled. The CFS performs resource scheduling on the physical computing resource objects according to its own resource scheduling strategy. During this process, the menu performs sleep control according to its own sleep control logic. The specific sleep control logic is as follows:

[0113] (1) The sleep controller menu can record each historical actual sleep time for predicting the next sleep time.

[0114] (2) The sleep controller menu can calculate a correction factor based on the above - mentioned historical actual sleep times. This correction factor can be used to predict the impact of factors such as I / O (Input / Output) on the actual sleep time so as to correct these impacts in the subsequent steps. Specifically, the sleep controller can calculate the correction factor according to the following formula:

[0115] Correction factor = 1024×Actual sleep time÷Expected sleep time

[0116] (3) If the historical actual sleep times meet the following conditions: standard deviation < 20 and variance <= 400, then the sleep controller menu can take the average value of the historical actual sleep times as the next sleep time.

[0117] (4) The sleep controller menu can obtain the number of threads in the I / O wait state, where the I / O wait state refers to the state of waiting for the disk I / O request to be completed.

[0118] (5) The sleep controller menu can correct the next sleep time according to the number of threads in the I / O wait state and the correction factor.

[0119] (6) The sleep controller menu can obtain the exit delay time set by pm qos (power management quality of service) within the device and system range, and select the minimum value as the first delay tolerance latency_req. Then, the sleep controller can predict the second delay tolerance based on the following formula:

[0120] Second delay tolerance = predicted next sleep time ÷ (10 × number of threads in I / O wait state + 1) (Formula 2)

[0121] (7) The sleep controller menu may use the second delay tolerance to correct the first delay tolerance, that is, select the minimum value from the second delay tolerance and the first delay tolerance as the corrected target tolerance.

[0122] (8) The sleep controller menu can select the deepest sleep state with an exit delay time less than or equal to the target tolerance from multiple preset sleep states, and then the sleep controller can control the physical computing resource object to enter the sleep state.

[0123] It should be noted that the control logic of the menu sleep controller introduced above has many defects, such as the inability to link with the resource scheduler to reduce the number of times the physical computing resource object enters and exits the sleep state, and the frequent number of physical computing resource objects entering and exiting the sleep state leads to high power consumption. In addition, the high failure rate of predicting the sleep state will also lead to waste of power. This also verifies from another perspective the technical effect produced by the linkage between the target resource scheduler and the target sleep controller in the aforementioned embodiments of the present application.

[0124] In addition to the physical machines provided in the above embodiments, the embodiments of the present application also provide a computing resource processing method, which will be described below in conjunction with the accompanying drawings.

[0125] Figure 5 is a flowchart of a computing resource processing method provided by an exemplary embodiment of the present application, which may include: Figure 5 Steps shown:

[0126] Step 51: Maintain the sleep state transition prediction information corresponding to each of multiple physical computing resource objects. The sleep state transition prediction information includes the probability information that the corresponding physical computing resource object enters each of multiple sleep states when going to sleep next time after being awakened from any one of the multiple sleep states.

[0127] Step 52: Select a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects.

[0128] Step 53: Schedule the target task to be scheduled to the target physical computing resource object.

[0129] It should be noted that the execution subject of the embodiments of this method can be an operating system, specifically, the target resource scheduler and the target sleep controller in the operating system. The execution subjects of different steps can be different. For example, some steps can be executed by the target resource scheduler, and some steps can be executed by the target sleep controller. This embodiment does not make any restrictions.

[0130] In this embodiment, the resource scheduling of physical computing resource objects can be combined with the sleep control of physical computing resource objects. By maintaining the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects and scheduling the physical computing resource objects according to the maintained sleep state transition prediction information, the task can be scheduled to the physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial to keeping some physical computing resource objects in the deep sleep state for a relatively long time and keeping some physical computing resource objects in the busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.

[0131] In some optional embodiments, maintaining the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects includes: when it is monitored that any physical computing resource object is awakened from the first sleep state, obtaining the actual sleep time of any physical computing resource object in the first sleep state, where the first sleep state is any one of the sleep states; and updating the sleep state transition prediction information corresponding to any physical computing resource object according to the actual sleep time and the exit delay time of the first sleep state.

[0132] In some optional embodiments, when it is monitored that any physical computing resource object is awakened from the first sleep state, obtaining the actual sleep time of any physical computing resource object in the first sleep state includes: obtaining the first time when any physical computing resource object enters the first sleep state and the second time when it is awakened from the first sleep state by the wake-up event; and calculating the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time.

[0133] In some alternative embodiments, according to the actual sleep time and the exit delay time of the first sleep state, the sleep state transition prediction information corresponding to any physical computing resource object is updated, including: when the actual sleep time matches the exit delay time of the first sleep state, relatively increasing the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increasing the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state, where the second sleep state is the sleep state in which the exit delay time matches the actual sleep time.

[0134] In some alternative embodiments, relatively increasing the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state includes: increasing the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state; and / or, decreasing the probability information that any physical computing resource object enters other sleep states during the next sleep when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.

[0135] In some alternative embodiments, relatively increasing the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state includes: increasing the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state; and / or, decreasing the probability information that any physical computing resource object enters the first sleep state during the next sleep when being awakened from the first sleep state; and / or, decreasing the probability information that any physical computing resource object enters other sleep states during the next sleep when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state and the second sleep state.

[0136] In some alternative embodiments, the method further includes: during the initialization process, creating data structures corresponding to each of the multiple physical computing resource objects, where the data structures are used to store the sleep state transition prediction information corresponding to the corresponding physical computing resource objects; initializing the data structures corresponding to each of the multiple physical computing resource objects to obtain initial values of the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects.

[0137] In some alternative embodiments, data structures corresponding to multiple physical computing resource objects are created, including: creating a sleep state weight array corresponding to each of the multiple physical computing resource objects, where the sleep state weight array is a multi-dimensional array including multiple rows and multiple columns; wherein, one row represents a possible sleep state when the corresponding physical computing resource object is awakened, and one column represents a possible sleep state when the corresponding physical computing resource object enters the next sleep; the array element at the intersection of the row and the column represents the weight of the corresponding physical computing resource object entering the sleep state represented by the column when awakened from the sleep state represented by the row, and the higher the weight, the higher the probability.

[0138] In some alternative embodiments, the data structures corresponding to multiple physical computing resource objects are initialized, including: initializing the array elements with the same number of rows and columns to a first value, and initializing the array elements with different numbers of rows and columns to a second value; wherein, the first value is greater than the second value, and the sum of the first value and the second value in the same row is a third value.

[0139] In some alternative embodiments, the method further includes: when it is monitored that any physical computing resource object needs to sleep, determining a third sleep state according to the sleep state transition prediction information corresponding to the any physical computing resource object; controlling the any physical computing resource object to enter the third sleep state.

[0140] In some alternative embodiments, determining the third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object includes: obtaining the most recently exited sleep state of the any physical computing resource object as a fourth sleep state; obtaining, from the sleep state transition prediction information corresponding to the any physical computing resource object, the probability information of entering each sleep state when awakened from the fourth sleep state; selecting the sleep state with the largest probability information as a candidate sleep state according to the probability information of entering each sleep state when awakened from the fourth sleep state; and taking the candidate sleep state as the third sleep state when the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system.

[0141] In some alternative embodiments, the method further includes: when the exit delay time of the candidate sleep state is greater than or equal to the maximum tolerable exit delay time of the system, selecting another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state.

[0142] In some alternative embodiments, selecting another sleep state with an opt-out delay time less than the maximum tolerable system exit delay time as the third sleep state includes: when there are multiple sleep states with an opt-out delay time less than the maximum tolerable system exit delay time, selecting the sleep state with the opt-out delay time less than the maximum tolerable system exit delay time and the maximum probability information as the third sleep state.

[0143] In some alternative embodiments, selecting a target physical computing resource object according to the sleep state transition prediction information corresponding to multiple physical computing resource objects includes: in response to a resource scheduling trigger event, generating sleep habit information corresponding to multiple physical computing resource objects according to the sleep state transition prediction information corresponding to multiple physical computing resource objects; and selecting a target physical computing resource object from multiple physical computing resource objects according to the sleep habit information corresponding to multiple physical computing resource objects.

[0144] In some alternative embodiments, generating sleep habit information corresponding to multiple physical computing resource objects according to the sleep state transition prediction information corresponding to multiple physical computing resource objects includes: for any physical computing resource object, obtaining, from the sleep state transition prediction information corresponding to the any physical computing resource object, the probability information that the any physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep; and generating the sleep habit information corresponding to the any physical computing resource object according to the probability information that the any physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep.

[0145] In some alternative embodiments, generating the sleep habit information corresponding to any physical computing resource object according to the probability information that the any physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep includes: if the probability information that the any physical computing resource object exits from the shallowest sleep state and enters the shallowest sleep state again during the next sleep is the largest, determining that the sleep habit type corresponding to the any physical computing resource is the shallow sleep habit, and generating the sleep probability of the any physical computing resource object under the shallow sleep habit according to the largest probability information; if the probability information that the any physical computing resource object exits from the deepest sleep state and enters the deepest sleep state again during the next sleep is the largest, determining that the sleep habit type corresponding to the any physical computing resource object is the deep sleep habit, and generating the sleep probability of the any physical computing resource under the deep sleep habit according to the largest probability information.

[0146] In some alternative embodiments, selecting a target physical computing resource object from multiple physical computing resource objects according to the respective sleep habits information of the multiple physical computing resource objects includes: determining at least one candidate physical computing resource object corresponding to a light sleep habit according to the respective sleep habits information of the multiple physical computing resource objects; and selecting a candidate physical computing resource object with a sleep probability meeting the requirements as the target physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit.

[0147] In some alternative embodiments, selecting a candidate physical computing resource object with a sleep probability meeting the requirements as the target physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit includes: selecting a target physical computing resource object from the at least one candidate physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit in combination with other auxiliary information; wherein the other auxiliary information includes at least one of the type of resource scheduling trigger event, the current running state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.

[0148] In some alternative embodiments, selecting a target physical computing resource object from the at least one candidate physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit in combination with other auxiliary information includes: selecting a candidate physical computing resource object with a utilization rate meeting the requirements and the maximum sleep probability as the target physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit and the current utilization rate.

[0149] The detailed implementation manners and beneficial effects of the steps in the method of this embodiment have been described in detail in the foregoing embodiments, and will not be elaborated herein.

[0150] Next, taking a multi-core CPU and the CPU cores it contains as an example, in combination with Figure 6a 、 Figure 6b 、 Figure 6c and Figure 6d the implementation manners of the embodiments in the method shown above will be described in detail. Figure 5 Shown

[0151] Among them, Figure 6a is a schematic diagram of the deployment and implementation of the computing resource processing method provided by the embodiment of the present application in an actual application scenario.

[0152] Among them, the target sleep controller can be initialized and create a data structure for each CPU core (i.e., the physical computing resource object in the previous text) during initialization, such as an array with the format weight[][], where one row represents a possible sleep state when the corresponding physical computing resource object is awakened, one column represents a possible sleep state when the corresponding physical computing resource object enters the next sleep, and the array element at the intersection of the row and column represents the weight of the corresponding physical computing resource object entering the sleep state represented by this column when awakening from the sleep state represented by this row. The higher the weight, the higher the probability.

[0153] The target sleep controller can initialize this data structure. Specifically, when the subscripts of the array i and j are the same, the target sleep controller can initialize the element at the intersection of this row and column to 70. When the subscripts of the array i and j are different, the target sleep controller can initialize these elements to (100 - 70) / 2 = 15. It should be noted that whether through initialization or subsequent element update process, each element in each row should always meet the condition of adding up to 100. Figure 6a An exemplary initialized data structure is shown in []. Taking three sleep states C0 - C2 as an example for illustration and eight CPU cores as an example for illustration, Figure 6a The eight CPU cores shown in [] are core 0 - core 7 respectively.

[0154] After initialization, the target sleep controller can also monitor the status of each CPU core and update the data structure according to the status monitoring results. The following will be combined with Figure 6b to illustrate this update process.

[0155] As Figure 6b shown, the target resource scheduler can start the sleep process when the task queue in the physical computing resource object is empty, and query the last entered sleep state and the exit delay time corresponding to this sleep state. The target sleep controller can determine the actual sleep time according to the time of the last entry into the sleep state and the time of being awakened by the wake-up event. The wake-up event can be a timer arrival event or an interrupt event. Then, the target sleep controller can determine the sleep state that best matches the actual duration of this sleep.

[0156] When the target sleep controller determines that the actual sleep time matches the last predicted sleep state, it can increase the weight value of this sleep state by 20 and decrease the other weights by 10; when it determines that the actual sleep time does not match the last predicted sleep state, it can increase the weight value of the sleep state that best matches the actual duration of this sleep by 15 and decrease the last predicted sleep state by 15.

[0157] As Figure 6bAs shown, in this way, the target sleep controller can update the data structure more accurately.

[0158] Based on the above, the target sleep controller can more accurately select a sleep state from multiple sleep states based on the data structure. The following will be combined with Figure 6c for further explanation.

[0159] As Figure 6c shown, for a CPU core that needs to enter the sleep state again after being awakened, the target sleep controller can obtain its most recently exited sleep state (i.e., Figure 6b "obtain the last sleep state exited last time" in ), and take this sleep state as a row, and determine the sleep state with the highest weight among the elements in the corresponding multiple columns of this row as the state to enter for the next sleep. After that, the target sleep controller can determine whether the exit delay time of this sleep state is less than the maximum tolerable exit delay event of the system. If not, the target sleep controller continues to select a shallower sleep state and continues to determine whether the exit delay time of the selected sleep state is less than the maximum tolerable exit delay time of the system; if so, the selection of the sleep state can be completed.

[0160] Based on the corresponding execution logic of the target sleep controller introduced above, the target resource scheduler can also cooperate with the target sleep controller to complete the joint scheduling of target tasks. The following will be combined with Figure 6d for further explanation.

[0161] As Figure 6d shown, the target resource scheduler can respond to events such as time interrupt, peripheral interrupt, the current application actively giving up running, or a higher-priority application needing to run, and read the data structure (weight[][] array) of each CPU core. For any CPU core, the target resource scheduler can determine whether the deepest sleep state of this CPU core has the highest weight. If so, the target resource scheduler can continue to find the CPU core in the shallowest sleep state and with the highest weight, and schedule the target task on the CPU core in the deepest sleep state to this CPU core in the shallowest sleep state and with the highest weight. Furthermore, it can run the task at the head of the task queue on the CPU core in the shallowest sleep state and with the highest weight. In this way, it is possible to schedule tasks to physical computing resource objects with relatively shallower sleep states or relatively busy states as much as possible, which is beneficial to keeping some physical computing resource objects in the deep sleep state for a relatively long time, keeping some physical computing resource objects in a busy state, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.

[0162] It should be noted that in some of the processes described in the above embodiments and the accompanying drawings, there are multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order in which they appear herein or may be executed in parallel. The operation numbers such as 51, 52, etc. are only used to distinguish different operations, and the numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions such as "first" and "second" in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, nor do they limit that "first" and "second" are of different types.

[0163] The embodiment of the present application also provides a computing resource processing device, as Figure 7 shown. The device includes: a maintenance module 701, configured to: maintain the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, where the sleep state transition prediction information includes the probability information of the corresponding physical computing resource object entering each of the multiple sleep states when going to sleep next time after being awakened from any one of the multiple sleep states; a selection module 702, configured to: select a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; a scheduling module 703, configured to: schedule the target task to be scheduled to the target physical computing resource object.

[0164] In some optional embodiments, when the maintenance module 701 maintains the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it is specifically configured to: when it is monitored that any physical computing resource object is awakened from the first sleep state, obtain the actual sleep time of any physical computing resource object in the first sleep state, where the first sleep state is any one of the sleep states; update the sleep state transition prediction information corresponding to any physical computing resource object according to the actual sleep time and the exit delay time of the first sleep state.

[0165] In some optional embodiments, when the maintenance module 701 obtains the actual sleep time of any physical computing resource object in the first sleep state when it is monitored that any physical computing resource object is awakened from the first sleep state, it is specifically configured to: obtain the first time when any physical computing resource object enters the first sleep state, and the second time when the awakening event wakes up from the first sleep state; calculate the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time.

[0166] In some alternative embodiments, when the maintenance module 701 updates the sleep state transition prediction information corresponding to any physical computing resource object according to the actual sleep time and the exit delay time of the first sleep state, it is specifically configured to: when the actual sleep time matches the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state, where the second sleep state is the sleep state in which the exit delay time matches the actual sleep time.

[0167] In some alternative embodiments, when the maintenance module 701 relatively increases the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state, it is specifically configured to: increase the probability information that any physical computing resource object will enter the first sleep state again during the next sleep when awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object will enter other sleep states during the next sleep when awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.

[0168] In some alternative embodiments, when the maintenance module 701 relatively increases the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state, it is specifically configured to: increase the probability information that any physical computing resource object will enter the second sleep state during the next sleep when awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object will enter the first sleep state during the next sleep when awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object will enter other sleep states during the next sleep when awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state and the second sleep state.

[0169] In some alternative embodiments, the maintenance module 701 is further configured to: during the initialization process, create data structures corresponding to multiple physical computing resource objects respectively, where the data structures are used to store the sleep state transition prediction information corresponding to the corresponding physical computing resource objects; initialize the data structures corresponding to multiple physical computing resource objects respectively to obtain the initial values of the sleep state transition prediction information corresponding to multiple physical computing resource objects respectively.

[0170] In some alternative embodiments, when the maintenance module 701 creates data structures corresponding to multiple physical computing resource objects respectively, it is specifically configured to: create a sleep state weight array corresponding to each of the multiple physical computing resource objects, where the sleep state weight array is a multi-dimensional array including multiple rows and multiple columns; wherein, one row represents a possible sleep state when the corresponding physical computing resource object is awakened, and one column represents a possible sleep state when the corresponding physical computing resource object enters the next sleep; the array element at the intersection of the row and the column represents the weight of the corresponding physical computing resource object entering the sleep state represented by the column when awakened from the sleep state represented by the row, and the higher the weight, the higher the probability.

[0171] In some alternative embodiments, when the maintenance module 701 initializes data structures corresponding to multiple physical computing resource objects respectively, it is specifically configured to: initialize array elements with the same number of rows and columns to a first value, and initialize array elements with different numbers of rows and columns to a second value; wherein, the first value is greater than the second value, and the sum of the first value and the second value in the same row is a third value.

[0172] In some alternative embodiments, the selection module 702 is further configured to: when it is detected that any physical computing resource object needs to sleep, determine a third sleep state according to the sleep state transition prediction information corresponding to the any physical computing resource object; control the any physical computing resource object to enter the third sleep state.

[0173] In some alternative embodiments, when the selection module 702 determines the third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object, it is specifically configured to: obtain the most recently exited sleep state of the any physical computing resource object as a fourth sleep state; obtain the probability information of entering each sleep state when awakened from the fourth sleep state from the sleep state transition prediction information corresponding to the any physical computing resource object; select the sleep state with the largest probability information as a candidate sleep state according to the probability information of entering each sleep state when awakened from the fourth sleep state; and when the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system, use the candidate sleep state as the third sleep state.

[0174] In some alternative embodiments, the selection module 702 is further configured to: when the exit delay time of the candidate sleep state is greater than or equal to the maximum tolerable exit delay time of the system, select another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state.

[0175] In some alternative embodiments, when the selection module 702 selects another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state, it is specifically configured to: when there are multiple sleep states with an exit delay time less than the maximum tolerable exit delay time of the system, select the sleep state with the shortest exit delay time and the largest probability information as the third sleep state.

[0176] In some alternative embodiments, when the selection module 702 selects a target physical computing resource object according to the sleep state transition prediction information corresponding to multiple physical computing resource objects, it is specifically configured to: in response to a resource scheduling trigger event, generate sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and select a target physical computing resource object from the multiple physical computing resource objects according to the sleep habit information corresponding to each of the multiple physical computing resource objects.

[0177] In some alternative embodiments, when the selection module 702 generates sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it is specifically configured to: for any physical computing resource object, obtain, from the sleep state transition prediction information corresponding to the physical computing resource object, the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep; and generate the sleep habit information corresponding to the physical computing resource object according to the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep.

[0178] In some alternative embodiments, when the selection module 702 generates sleep habit information corresponding to any physical computing resource object according to the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep, it is specifically configured to: if the probability information that the physical computing resource object exits from the shallowest sleep state and enters the shallowest sleep state again during the next sleep is the largest, determine that the sleep habit type corresponding to the physical computing resource is a shallow sleep habit, and generate the sleep probability of the physical computing resource object under the shallow sleep habit according to the largest probability information; if the probability information that the physical computing resource object exits from the deepest sleep state and enters the deepest sleep state again during the next sleep is the largest, determine that the sleep habit type corresponding to the physical computing resource object is a deep sleep habit, and generate the sleep probability of the physical computing resource under the deep sleep habit according to the largest probability information.

[0179] In some alternative embodiments, when the selection module 702 selects a target physical computing resource object from multiple physical computing resource objects according to the respective sleep habits information of the multiple physical computing resource objects, it is specifically configured to: determine at least one candidate physical computing resource object corresponding to the light sleep habit according to the respective sleep habits information of the multiple physical computing resource objects; and select, as the target physical computing resource object, a candidate physical computing resource object whose sleep probability meets the requirements according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit.

[0180] In some alternative embodiments, when the selection module 702 selects, as the target physical computing resource object, a candidate physical computing resource object whose sleep probability meets the requirements according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit, it is specifically configured to: select the target physical computing resource object from the at least one candidate physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit in combination with other auxiliary information; wherein the other auxiliary information includes at least one of the type of the resource scheduling trigger event, the current operating state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.

[0181] In some alternative embodiments, when the selection module 702 selects the target physical computing resource object from the at least one candidate physical computing resource object according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit in combination with other auxiliary information, it is specifically configured to: select, as the target physical computing resource object, a candidate physical computing resource object whose utilization rate meets the requirements and whose sleep probability is the highest according to the sleep probability of the at least one candidate physical computing resource object under the light sleep habit and the current utilization rate.

[0182] In this embodiment, the resource scheduling of the physical computing resource object is combined with the sleep control of the physical computing resource object. By maintaining the respective sleep state transition prediction information of the multiple physical computing resource objects and scheduling the physical computing resource objects according to the maintained sleep state transition prediction information, it is possible to schedule tasks to physical computing resource objects with a relatively light sleep state or relatively busy state as much as possible, which is beneficial to keeping some physical computing resource objects in the deep sleep state for a relatively long time and keeping some physical computing resource objects in the busy state as much as possible, and reducing the frequency of the physical computing resource objects entering and exiting the sleep state.

[0183] Figure 8 The following is a schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. As Figure 8 shown, the device includes: a memory 801 and a processor 802. Among them, the electronic device includes, but is not limited to, the physical machine in the foregoing embodiments, and this embodiment is not limited.

[0184] A memory 801 for storing computer programs and configurable to store various other data to support operations on an electronic device. Examples of such data include instructions for any application or method for operating on the electronic device, etc.

[0185] In some embodiments, a processor 802, coupled to the memory 801, is configured to execute the computer program in the memory 801 for: maintaining sleep state transition prediction information corresponding to each of a plurality of physical computing resource objects, the sleep state transition prediction information including probability information of the corresponding physical computing resource object entering each of the plurality of sleep states when going to sleep next time after being awakened from any one of the plurality of sleep states; selecting a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects; and scheduling a target task to be scheduled to the target physical computing resource object.

[0186] In some alternative embodiments, when maintaining the sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects, the processor 802 is specifically configured to: when detecting that any one of the physical computing resource objects is awakened from a first sleep state, obtain the actual sleep time of any one of the physical computing resource objects in the first sleep state, where the first sleep state is any one of the plurality of sleep states; and update the sleep state transition prediction information corresponding to any one of the physical computing resource objects according to the actual sleep time and the exit delay time of the first sleep state.

[0187] In some alternative embodiments, when obtaining the actual sleep time of any one of the physical computing resource objects in the first sleep state when detecting that any one of the physical computing resource objects is awakened from the first sleep state, the processor 802 is specifically configured to: obtain a first time when any one of the physical computing resource objects enters the first sleep state, and a second time when the awakening event wakes up from the first sleep state; and calculate the actual sleep time of any one of the physical computing resource objects in the first sleep state according to the second time and the first time.

[0188] In some alternative embodiments, when the processor 802 updates the sleep state transition prediction information corresponding to any physical computing resource object according to the actual sleep time and the exit delay time of the first sleep state, it is specifically configured to: when the actual sleep time matches the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state, where the second sleep state is the sleep state whose exit delay time matches the actual sleep time.

[0189] In some alternative embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state, it is specifically configured to: increase the probability information that any physical computing resource object enters the first sleep state again during the next sleep when being awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object enters other sleep states during the next sleep when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.

[0190] In some alternative embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state, it is specifically configured to: increase the probability information that any physical computing resource object enters the second sleep state during the next sleep when being awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object enters the first sleep state during the next sleep when being awakened from the first sleep state; and / or, decrease the probability information that any physical computing resource object enters other sleep states during the next sleep when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state and the second sleep state.

[0191] In some alternative embodiments, the processor 802 is further configured to: during the initialization process, create data structures corresponding to each of the multiple physical computing resource objects, where the data structures are used to store the sleep state transition prediction information corresponding to the corresponding physical computing resource objects; initialize the data structures corresponding to each of the multiple physical computing resource objects to obtain the initial values of the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects.

[0192] In some alternative embodiments, when the processor 802 creates data structures corresponding to multiple physical computing resource objects respectively, it is specifically configured to: create a sleep state weight array corresponding to each of the multiple physical computing resource objects, where the sleep state weight array is a multi-dimensional array including multiple rows and multiple columns; wherein, one row represents a possible sleep state when the corresponding physical computing resource object is awakened, and one column represents a possible sleep state when the corresponding physical computing resource object enters the next sleep; the array element at the intersection of the row and the column represents the weight of the corresponding physical computing resource object entering the sleep state represented by the column when awakened from the sleep state represented by the row, and the higher the weight, the higher the probability.

[0193] In some alternative embodiments, when the processor 802 initializes data structures corresponding to multiple physical computing resource objects respectively, it is specifically configured to: initialize the array elements with the same number of rows and columns to a first value, and initialize the array elements with different numbers of rows and columns to a second value; wherein, the first value is greater than the second value, and the sum of the first value and the second value in the same row is a third value.

[0194] In some alternative embodiments, the processor 802 is further configured to: when it is detected that any physical computing resource object needs to enter the sleep state, determine a third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object; control any physical computing resource object to enter the third sleep state.

[0195] In some alternative embodiments, when the processor 802 determines the third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object, it is specifically configured to: obtain the most recently exited sleep state of any physical computing resource object as a fourth sleep state; obtain the probability information of entering each sleep state when awakened from the fourth sleep state from the sleep state transition prediction information corresponding to any physical computing resource object; select the sleep state with the largest probability information as the candidate sleep state according to the probability information of entering each sleep state when awakened from the fourth sleep state; when the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system, use the candidate sleep state as the third sleep state.

[0196] In some alternative embodiments, the processor 802 is further configured to: when the exit delay time of the candidate sleep state is greater than or equal to the maximum tolerable exit delay time of the system, select another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state.

[0197] In some alternative embodiments, when the processor 802 selects another sleep state with an exit delay time less than the maximum tolerable exit delay time of the system as the third sleep state, it is specifically configured to: when there are multiple sleep states with an exit delay time less than the maximum tolerable exit delay time of the system, select the sleep state with the shortest exit delay time and the maximum probability information less than the maximum tolerable exit delay time of the system as the third sleep state.

[0198] In some alternative embodiments, when the processor 802 selects a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it is specifically configured to: in response to a resource scheduling trigger event, generate sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and select a target physical computing resource object from the multiple physical computing resource objects according to the sleep habit information corresponding to each of the multiple physical computing resource objects.

[0199] In some alternative embodiments, when the processor 802 generates sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it is specifically configured to: for any physical computing resource object, obtain, from the sleep state transition prediction information corresponding to the physical computing resource object, the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep; and generate the sleep habit information corresponding to the physical computing resource object according to the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep.

[0200] In some alternative embodiments, when the processor 802 generates sleep habit information corresponding to any physical computing resource object according to the probability information that the physical computing resource object exits from any sleep state and enters the same sleep state again during the next sleep, it is specifically configured to: if the probability information that the physical computing resource object exits from the shallowest sleep state and enters the shallowest sleep state again during the next sleep is the largest, determine that the sleep habit type corresponding to the physical computing resource is a shallow sleep habit, and generate the sleep probability of the physical computing resource object under the shallow sleep habit according to the largest probability information; if the probability information that the physical computing resource object exits from the deepest sleep state and enters the deepest sleep state again during the next sleep is the largest, determine that the sleep habit type corresponding to the physical computing resource object is a deep sleep habit, and generate the sleep probability of the physical computing resource under the deep sleep habit according to the largest probability information.

[0201] In some alternative embodiments, when the processor 802 selects a target physical computing resource object from multiple physical computing resource objects according to the respective sleep habit information corresponding to the multiple physical computing resource objects, it is specifically configured to: determine at least one candidate physical computing resource object corresponding to the light sleep habit according to the respective sleep habit information corresponding to the multiple physical computing resource objects; and select a candidate physical computing resource object with a sleep probability meeting the requirements as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit.

[0202] In some alternative embodiments, when the processor 802 selects a candidate physical computing resource object with a sleep probability meeting the requirements as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit, it is specifically configured to: select a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit and in combination with other auxiliary information; wherein the other auxiliary information includes at least one of the type of the resource scheduling trigger event, the current operating state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.

[0203] In some alternative embodiments, when the processor 802 selects a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit and in combination with other auxiliary information, it is specifically configured to: select a candidate physical computing resource object with a utilization rate meeting the requirements and the maximum sleep probability as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the light sleep habit and the current utilization rate.

[0204] Further, as Figure 8 shown, the electronic device further includes: other components such as a communication component 803, a display 804, and a power supply component 805. Figure 8 Only some components are schematically shown in Figure 8 and it does not mean that the electronic device only includes Figure 8 the components shown. Additionally, Figure 8 the components within the dashed box inFigure 8 Components within the dashed box.

[0205] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, it can implement each step executable by an electronic device in the method embodiment shown above. Figure 5 Steps shown in the method embodiment.

[0206] Accordingly, an embodiment of the present application further provides a multi-core processor system, including a plurality of processor cores and a memory. The memory is used to store the program code of the operating system, and the plurality of processor cores are used to run the program code of the operating system to implement the steps in the method embodiment shown above. Figure 5 Steps shown in the method embodiment.

[0207] In this embodiment, the resource scheduling of physical computing resource objects is combined with the sleep control of physical computing resource objects. By maintaining the sleep state transition prediction information corresponding to each physical computing resource object, and scheduling the physical computing resource objects according to the maintained sleep state transition prediction information, tasks can be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial to keeping some physical computing resource objects in a deep sleep state for a relatively long time and keeping some physical computing resource objects in a busy state, reducing the frequency of physical computing resource objects entering and exiting the sleep state.

[0208] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0209] The above communication component is configured to facilitate communication, either wired or wireless, between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (BT) technology and other technologies.

[0210] The above display includes a screen, and the screen can include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions, but also detect the duration and pressure associated with the touch or swipe operation.

[0211] The above power supply component provides power for various components of the device where the power supply component is located. The power supply component can include a power management system, one or more power supplies, and other components associated with generating, managing and distributing power for the device where the power supply component is located.

[0212] The above audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), and when the device where the audio component is located is in an operation mode, such as a call mode, a recording mode and a voice recognition mode, the microphone is configured to receive external audio signals. The received audio signals can be further stored in the memory or sent via the communication component. In some embodiments, the audio component further includes a speaker for outputting audio signals.

[0213] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk memory, Compact Disc Read-Only Memory (CD-ROM), optical memory, etc.) that contain computer-usable program code.

[0214] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram can be implemented by computer program instructions, and the combination of the flows and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0215] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0217] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), an input / output interface, a network interface, and a memory.

[0218] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (Random Access Memory, RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0219] Computer readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0220] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0221] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for processing computing resources, characterized in that, Including: Maintaining the predicted information on the transition of the sleep states corresponding to multiple physical computing resource objects respectively, where the predicted information on the transition of the sleep states includes the probability information on the entry of the corresponding physical computing resource object into each of the multiple sleep states when going to sleep next time after being awakened from any one of the multiple sleep states; Selecting a target physical computing resource object according to the predicted information on the transition of the sleep states corresponding to the multiple physical computing resource objects respectively; Scheduling the target task to be scheduled to the target physical computing resource object.

2. The method according to claim 1, characterized in that, Maintaining the predicted information on the transition of the sleep states corresponding to multiple physical computing resource objects respectively, including: When it is monitored that any one of the physical computing resource objects is awakened from the first sleep state, obtaining the actual sleep time of the any one of the physical computing resource objects in the first sleep state, where the first sleep state is any one of the sleep states; Updating the predicted information on the transition of the sleep states corresponding to the any one of the physical computing resource objects according to the actual sleep time and the exit delay time of the first sleep state.

3. The method according to claim 2, wherein Updating the predicted information on the transition of the sleep states corresponding to the any one of the physical computing resource objects according to the actual sleep time and the exit delay time of the first sleep state, including: When the actual sleep time matches the exit delay time of the first sleep state, relatively increasing the probability information on the re-entry of the any one of the physical computing resource objects into the first sleep state when going to sleep next time after being awakened from the first sleep state; When the actual sleep time does not match the exit delay time of the first sleep state, relatively increasing the probability information on the entry of the any one of the physical computing resource objects into the second sleep state when going to sleep next time after being awakened from the first sleep state, where the second sleep state is the sleep state whose exit delay time matches the actual sleep time.

4. The method according to claim 1, characterized in that, Further including: During the initialization process, creating data structures corresponding to the multiple physical computing resource objects respectively, where the data structures are used to store the predicted information on the transition of the sleep states corresponding to the corresponding physical computing resource objects; Initializing the data structures corresponding to the multiple physical computing resource objects respectively to obtain the initial values of the predicted information on the transition of the sleep states corresponding to the multiple physical computing resource objects respectively.

5. The method according to claim 4, wherein Creating the data structures corresponding to the multiple physical computing resource objects respectively, including: Creating a sleep state weight array corresponding to each of the multiple physical computing resource objects, where the sleep state weight array is a multi-dimensional array including multiple rows and multiple columns; Wherein, one row represents a sleep state in which the corresponding physical computing resource object may be when awakened, and one column represents a sleep state in which the corresponding physical computing resource object may enter when going to sleep next time; The array element at the intersection of the row and the column represents the weight of the corresponding physical computing resource object entering the sleep state represented by the column when going to sleep next time after being awakened from the sleep state represented by the row, and the higher the weight, the higher the probability.

6. The method according to claim 5, wherein Initializing the data structures corresponding to the multiple physical computing resource objects respectively, including: Initialize the array elements with the same number of rows and columns to the first value, and initialize the array elements with different numbers of rows and columns to the second value; Wherein, the first value is greater than the second value, and the sum of the first value and the second value in the same row is the third value.

7. The method according to claim 1, wherein Further comprising: When it is detected that any physical computing resource object needs to enter the sleep state, determine the third sleep state according to the sleep state transition prediction information corresponding to the any physical computing resource object; Control the any physical computing resource object to enter the third sleep state.

8. The method according to claim 7, wherein Determining the third sleep state according to the sleep state transition prediction information corresponding to the any physical computing resource object includes: Obtain the sleep state that the any physical computing resource object recently exited as the fourth sleep state; Obtain, from the sleep state transition prediction information corresponding to the any physical computing resource object, the probability information of entering each sleep state during the next sleep when being awakened from the fourth sleep state; According to the probability information of entering each sleep state during the next sleep when being awakened from the fourth sleep state, select the sleep state with the largest probability information as the candidate sleep state; When the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system, use the candidate sleep state as the third sleep state.

9. The method according to any one of claims 1-8, characterized in that, Selecting the target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects includes: In response to a resource scheduling trigger event, generate sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; Select a target physical computing resource object from the multiple physical computing resource objects according to the sleep habit information corresponding to each of the multiple physical computing resource objects.

10. The method according to claim 9, characterized in that, Generating the sleep habit information corresponding to each of the multiple physical computing resource objects according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects includes: For any physical computing resource object, obtain, from the sleep state transition prediction information corresponding to the any physical computing resource object, the probability information that the any physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep; Generate the sleep habit information corresponding to the any physical computing resource object according to the probability information that the any physical computing resource object exits from any sleep state and enters the sleep state again during the next sleep.

11. A physical machine, characterized in that, An operating system runs on the hardware resources of the physical machine. The hardware resources include multiple physical computing resource objects. The multiple physical computing resource objects support multiple sleep states with different sleep depths. The operating system includes: a target resource scheduler and a target sleep controller; The target sleep controller is used to maintain the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects. The sleep state transition prediction information includes the probability information of entering each sleep state during the next sleep when the corresponding physical computing resource object is awakened from any sleep state; The target resource scheduler is configured to select a target physical computing resource object according to the respective sleep state transition prediction information corresponding to the multiple physical computing resource objects, and schedule a target task to be scheduled to the target physical computing resource object.

12. The physical machine according to claim 11, wherein The operating system further includes other resource schedulers and other sleep controllers, and the sleep control logics of different sleep controllers are different, and the resource scheduling logics of different resource schedulers are different.

13. The physical machine according to claim 12, wherein When any one of the other resource schedulers and any one of the other sleep controllers are configured to be effective, the target resource scheduler and the target sleep controller are configured to be ineffective; Wherein, any one of the other resource schedulers and any one of the other sleep controllers are independent of each other; the target resource scheduler and the target sleep controller are associated.

14. A multi-core processor system, characterized in that, It includes multiple processor cores and a memory, and the memory is used to store the program code of the operating system, and the multiple processor cores are used to run the program code of the operating system to implement the steps in the method according to any one of claims 1-10.

15. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to be able to implement the steps in the method according to any one of claims 1-10.

Citation Information

Cited By

  • Computing resource processing method, device, and storage medium

    WO2025139217A1