Computing resource processing method, device, and storage medium
By maintaining and utilizing the prediction information of dormant state transfer, combined with resource scheduling and dormant control, the problem of frequent entry and exit of the dormant state of physical computing resource objects is solved, and power consumption saving and response efficiency improvement is achieved.
Patent Information
- Application Number
- PCT/CN2024/125026
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-26
- Filing Date
- 2024-10-15
- Publication Date
- 2025-07-03
AI Technical Summary
In the prior art, the frequent entry and exit of physical computing resource objects in and out of the dormant state leads to waste of power consumption and response delay, which cannot effectively reduce device power consumption.
By maintaining the dormant state transition prediction information corresponding to the respective multiple physical computing resource objects, combining resource scheduling and sleep control, priority is given to physical computing resource objects with relatively shallow or busy sleep states, reducing the frequency of their entry and exit from the dormant state.
It effectively reduces the frequency of physical computing resource objects entering and exiting the dormant state, saves power consumption, reduces prediction errors, and improves the operating frequency and response efficiency of other resources.
Smart Images

Figure CN2024125026_03072025_PF_FP_ABST
Abstract
Description
Computing resource processing method, device and storage medium
[0001] This disclosure claims priority to the Chinese patent application filed with the China Patent Office on December 26, 2023, with application number 202311817214.3 and application name “Computing Resource Processing Method, Device and Storage Medium”, the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0002] The present disclosure relates to the field of cloud computing technology, and in particular to a computing resource processing method, device, and storage medium. Background Art
[0003] With the development of cloud computing technology, more and more users are choosing to use cloud servers as their infrastructure. Cloud servers typically use multi-core processors (Central Processing Unit, CPU), such as quad-core processors or octa-core processors, to provide users with high computing performance.
[0004] To achieve higher computing performance while reducing device power consumption, the Advanced Configuration and Power Management Interface (ACPI) specification defines CPU sleep states. Putting a CPU into sleep mode when idle saves power and allows other CPUs to operate at higher frequencies.
[0005] However, the existing technology faces the problem that the CPU frequently enters and exits the sleep state. Since entering and exiting the sleep state itself consumes additional power, frequent entry and exit of the sleep state not only fails to save power but may even prevent other CPUs from achieving higher frequencies.
[0006] Summary of the Invention
[0007] Various aspects of the present disclosure provide a computing resource processing method, device, and storage medium to reduce the frequency of physical computing resource objects entering and exiting a dormant state.
[0008] An embodiment of the present disclosure provides a physical machine, wherein an operating system runs on hardware resources of the physical machine, the hardware resources including multiple physical computing resource objects, and the multiple physical computing resource objects supporting 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 sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, the sleep state transition prediction information including probability information of the corresponding physical computing resource object entering each sleep state during the next sleep state when awakened from any sleep state; the target resource scheduler is used to select a target physical computing resource object based on the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, and schedule a target task to be scheduled to the target physical computing resource object.
[0009] The disclosed embodiment also provides a computing resource processing method, comprising: maintaining sleep state transfer prediction information corresponding to each of a plurality of physical computing resource objects, the sleep state transfer prediction information including probability information of the corresponding physical computing resource object entering each of the plurality of sleep states at the next sleep state when awakened from any of the plurality of sleep states; selecting a target physical computing resource object based on the sleep state transfer prediction information corresponding to each of the plurality of physical computing resource objects; and scheduling a target task to be scheduled onto the target physical computing resource object.
[0010] An embodiment of the present disclosure also provides a multi-core processor system, comprising multiple processor cores and a memory, wherein the memory is used to store the program code of an operating system, and the multiple processor cores are used to run the program code of the operating system to implement the steps in the computing resource processing method.
[0011] An embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the computing resource processing method.
[0012] An embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the computing resource processing method are implemented.
[0013] In this embodiment, resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects. By maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This allows tasks to be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible. This is beneficial for allowing some physical computing resource objects to be in a deep sleep state for as long as possible, allowing some physical computing resource objects to be in a busy state as much as possible, reducing the frequency of physical computing resource objects entering and exiting the sleep state, and thereby reducing the frequency of predicting the sleep state, thereby reducing problems caused by prediction errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0015] FIG1a is a schematic diagram of a sleep state transition provided by an exemplary embodiment of the present disclosure;
[0016] FIG1b is a schematic diagram of sleep power consumption provided by an exemplary embodiment of the present disclosure;
[0017] FIG2 is a software-hardware architecture diagram of a physical machine provided by another exemplary embodiment of the present disclosure;
[0018] FIG3 is a schematic diagram of a flow chart of controlling a physical computing resource object to enter a third dormant state according to another exemplary embodiment of the present disclosure;
[0019] FIG4 is a schematic diagram of the control logic of a menu sleep controller provided by another exemplary embodiment of the present disclosure;
[0020] FIG5 is a flow chart of a computing resource processing method provided by another exemplary embodiment of the present disclosure;
[0021] FIG6 a is a schematic diagram of the deployment and implementation of a computing resource processing method provided by another exemplary embodiment of the present disclosure in an actual application scenario;
[0022] FIG6 b is a schematic diagram of a process of updating a data structure provided by another exemplary embodiment of the present disclosure;
[0023] FIG6c is a schematic diagram of a process of selecting a sleep state according to another exemplary embodiment of the present disclosure;
[0024] FIG6 d is a schematic diagram of a scheduling process performed by a target resource scheduler according to another exemplary embodiment of the present disclosure;
[0025] FIG7 is a schematic diagram of a computing resource processing device provided by another exemplary embodiment of the present disclosure;
[0026] FIG8 is a schematic diagram of an electronic device provided by yet another exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions, and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the specific embodiments of the present disclosure and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present disclosure.
[0028] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation portals for users to choose to authorize or refuse. In addition, the various models involved in this disclosure (including but not limited to language models or large models) are in compliance with relevant laws and standards.
[0029] Taking a multi-core processor scenario as an example, the ACPI specification can define the power states that each CPU core in the multi-core processor can be in, such as power state C0, power state C1, power state C2...power state Cn. Among them, power state C0 is the effective power state of the CPU core executing instructions, and power state C1-power state Cn are the sleep states of the CPU core. The sleep state is a low-load power state. In a multi-core processor scenario, when the CPU core is not needed to perform a task, the API (Application Programming Interface) provided by the CPU firmware can be used to control the CPU core to enter any sleep state. Compared with the CPU core 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 to sleep state Cn, while maintaining the same sleep time, the power consumption saved by each sleep state increases successively.
[0030] As shown in the sleep state transition diagram of Figure 1a, 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 ACPI-defined sleep state transition logic. For example, the multi-core processor can activate the throttling logic and use the sleep state transition logic to issue an enter C1 command, thereby causing the CPU core to enter sleep state C1 from power state C0. When the CPU core receives a sleep interrupt instruction, it can exit sleep state C1 and return to power state C0. In addition, the method for entering / exiting sleep states C2 and C3 is the same as the method for entering / exiting sleep state C1 described above and will not be repeated here.
[0031] It should be noted that, from sleep state C1 to sleep state Cn, the power consumption saved in each sleep state increases successively. This can also be understood as the process of sleep states from "shallow" to "deep." When some CPU cores enter a deeper sleep state, other CPU cores can achieve a higher operating frequency. As shown in Table 1, here, taking a multi-core processor with 48 CPU cores as an example, assuming that sleep state C6 is the deepest sleep state supported by this multi-core processor, Table 1 below shows the corresponding relationship between the number of CPU cores not in sleep state C6 and the operating frequencies that other CPU cores can achieve. As shown in Table 1, the fewer CPU cores not in sleep state C6, the more CPU cores in sleep state C6, and the higher the operating frequencies that other cores can achieve.
[0032] Table 1
[0033] As can be seen from the above, entering a sleep state while idle can save power. When scheduled again, the CPU core can be awakened and exit the sleep state. As shown in Figure 1b, entering or exiting a sleep state consumes power and takes time. The time required to exit the sleep state is called the exit latency. Furthermore, as the depth of the sleep state increases, the power consumption and time consumed by entering or exiting the sleep state gradually increase. Therefore, if the appropriate sleep state is not selected for the CPU core, the CPU core will frequently enter and exit the sleep state. Entering and exiting the sleep state itself consumes additional power, preventing other CPU cores from achieving higher frequencies. This not only fails to save power, but also wastes power resources and causes response delays. For example, in some cases, if the actual sleep time of a CPU core is shorter than the expected sleep time, a deeper sleep state is mistakenly selected for the CPU core based on the expected sleep time. Since the CPU core actually sleeps for a shorter time in that sleep state, the power saved by the sleep state is less than the power consumed by entering and exiting that sleep state. This not only wastes CPU power but also results in longer response delays. For example, in other cases, the actual sleep time of the CPU core is longer than the expected sleep time. A shallower sleep state is incorrectly selected for the CPU core based on the expected sleep time, which will cause the CPU core to wake up from the sleep state prematurely, wasting CPU power consumption. In addition, since the CPU core fails to enter a deeper sleep state, other cores cannot obtain a higher frequency.
[0034] In the embodiment of the present disclosure, based on the relevant content of the above-mentioned multi-core processor, the concept of sleep state is introduced into various physical computing resource objects. Physical computing resource objects may include CPU, DPU (Data Processing Unit) or TPU (Tensor Processing Unit) and other physical computing resource objects similar to CPU. In the case of introducing the sleep state into various physical computing resource objects, in the scenario where multiple physical computing resource objects work together, there will also be technical problems such as frequent entry and exit of the sleep state leading to power consumption waste, response delay and other CPUs being unable to obtain a higher operating frequency.
[0035] In response to the above problems, in an embodiment of the present disclosure, it is proposed to combine resource scheduling of physical computing resource objects with sleep control of physical computing resource objects. By maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This can help to schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is conducive to keeping some physical computing resource objects in deep sleep states for as long as possible, keeping some physical computing resource objects in busy states as much as possible, reducing the frequency of physical computing resource objects entering and exiting sleep states, giving full play to the advantages of sleep states, saving power consumption, and allowing other physical computing resource objects that are not in deep sleep states to obtain higher operating frequencies as much as possible; in addition, since the frequency of physical computing resource objects entering and exiting sleep states is reduced, it means that the frequency of sleep state predictions is also reduced, which is conducive to reducing problems caused by prediction errors and solving the above technical problems.
[0036] The technical solutions provided by various embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0037] FIG2 is a software-hardware architecture diagram of a physical machine provided by an exemplary embodiment of the present disclosure. As shown in FIG2 , the physical machine includes an application layer 21 , a kernel layer (ie, an operating system) 22 , and a hardware resource layer 23 .
[0038] 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, which work together and can be integrated on a single chip, but are not limited to this. For example, if the physical computing resource object is a CPU, multiple physical computing resource objects can be implemented as a multi-core CPU. In addition, the hardware resources of the physical machine also include memory, communication components, displays, power components, audio components, and various external devices, which are not shown in Figure 2. Furthermore, Figure 2 only illustrates the physical computing resource objects and does not limit the number of physical computing resource objects.
[0039] In this embodiment, multiple physical computing resource objects support multiple sleep states with different sleep depths. Depending on the type and manufacturer of the physical computing resource object, the number of sleep states supported by the physical computing resource object may vary. Furthermore, the power consumption and time consumed in entering and exiting each sleep state may also vary. For example, some physical computing resource objects provided by some manufacturers may support sleep state C1, sleep state C2, and sleep state C3, while other 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, without limitation. Regardless of the type of physical computing resource object or the manufacturer providing the physical computing resource object, the sleep depths of the multiple sleep states supported by the physical computing resource object may vary. Alternatively, for ease of description, the sleep depth of the sleep state may be represented by the number following C. As the number following C increases, the sleep depth of the sleep state increases, and accordingly, the power consumption and time consumed in entering and exiting these sleep states also increase.
[0040] In this embodiment, an operating system, namely, the kernel layer 22, runs on the hardware resources of the physical machine. Above the operating system is the application layer 21, which includes various application programs running on the physical machine. Depending on the application scenario and implementation form of the physical machine, the implementation of the application program may vary slightly. For example, if the physical machine is implemented as a terminal device such as a mobile phone or computer, the applications running on the physical machine may include e-commerce shopping applications, various video applications, email applications, instant messaging applications, various office applications, and the like. For example, if the physical machine is implemented as a server device such as a conventional server, cloud server, or server cluster, the applications running on the physical machine may include various databases or data warehouses, streaming computing applications, log processing applications, distributed computing, various virtual machines or containers, and the like.
[0041] In contrast to application programs, 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 public services to organize user interactions. In the disclosed embodiment, the operating system serves as a bridge between application programs and hardware resources. The operating system includes drivers for various hardware resources, which are used to drive these hardware resources. In addition, the operating system of this embodiment also includes a sleep controller for controlling the sleep state of physical computing resource objects and a resource scheduler for scheduling them. In this embodiment, to enable physical computing resource objects to enter and exit sleep states in a reasonable manner, a new sleep controller and a new resource scheduler are provided. For ease of description and distinction, the new sleep controller and new resource scheduler provided in this disclosed embodiment are referred to as the target sleep controller 11 and the target resource scheduler 12, respectively. It should be noted that the operating system may include only the target sleep controller 11 and the target resource scheduler 12, or it may include other sleep controllers and other resource schedulers, depending on application requirements and scenarios, and is not limited to this. The following will focus on the process by which the target sleep controller 11 and the target resource scheduler 12 cooperate to control the sleep state and schedule resources for physical computing resource objects.
[0042] In this embodiment, the target sleep controller 11 may maintain sleep state transition prediction information corresponding to each of multiple physical computing resource objects. The sleep state transition prediction information corresponding to any physical computing resource object is used to predict the state transitions of that physical computing resource object between different sleep states. The sleep state transition prediction information may include probability information of the corresponding physical computing resource object entering each sleep state upon its next sleep state upon awakening from any sleep state. The probability information may be implemented as either a probability value or a weight, without limitation. For example, assuming that a physical computing resource object can support 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 is 70%, the probability of entering sleep state C1 is 15%, and the probability of entering sleep state C2 is 15% during the next sleep; when the physical computing resource object is awakened from sleep state C1, the probability of entering sleep state C0 is 30%, the probability of entering sleep state C1 is 40%, and the probability of entering sleep state C2 is 20% during the next sleep; when the physical computing resource object is awakened from sleep state C2, the probability of entering sleep state C0 is 50%, the probability of entering sleep state C1 is 15%, and the probability of entering sleep state C2 is 30% during the next sleep.
[0043] In this embodiment, the target sleep controller 11 can 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 can proactively 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. Alternatively, the target resource scheduler 12 can proactively request 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 based on the request. When performing task scheduling, the target resource scheduler 12 can select a target physical computing resource object based on 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 physical computing resource object D1 as the target physical computing resource object from physical computing resource object D1, physical computing resource object D2, physical computing resource object D3 and physical computing resource object D4 based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, and schedule the target task to the target physical computing resource object.
[0044] In the embodiment of the present disclosure, the target resource scheduler 12 performs resource scheduling based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, with the scheduling principle of giving priority to physical computing resource objects that are not in a sleep state, are in a shallow sleep state, or have a higher probability of entering a shallow sleep state. In this way, the resource scheduling of the physical computing resource objects can be combined with the sleep control of the physical computing resource objects. The physical computing resource objects are scheduled based on the maintained sleep state transfer prediction information, and tasks can be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible. This is conducive to allowing some physical computing resource objects to be in a deep sleep state for as long as possible or have more opportunities, and allowing some physical computing resource objects to be in a busy state as much as possible, thereby reducing the frequency of physical computing resource objects entering and exiting the sleep state, saving power consumption, and allowing other physical computing resource objects to obtain a higher operating frequency as much as possible.
[0045] In some optional embodiments, as the operating state of a physical computing resource object changes, such as when it enters a working state from a sleep state, or vice versa, the sleep state transition prediction information of each physical computing resource object may change. Therefore, the sleep state transition prediction information of the physical computing resource object may be updated to obtain more accurate sleep state transition prediction information, thereby enabling more accurate resource scheduling based on the sleep state transition prediction information. The update of the sleep state transition prediction information may be performed by the target sleep controller 11 during maintenance.
[0046] Specifically, when maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the target sleep controller 11 can monitor the operating status of multiple physical computing resource objects, where the operating status may include: working state and sleep state, and the sleep state may include multiple sleep states with different sleep depths; when monitoring any physical computing resource object to be awakened from a first sleep state, the actual sleep time of the physical computing resource object in the first sleep state can be obtained, wherein the first sleep state can be any sleep state, that is, when monitoring any physical computing resource object to be awakened from any sleep state, the target sleep controller 11 can obtain the actual sleep time of the physical computing resource object in any sleep state; and then, based on 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, the sleep state transfer prediction information corresponding to any physical computing resource object is updated.
[0047] The actual sleep time of the physical computing resource object in the first sleep state may be obtained by following steps R1-R2:
[0048] In step R1, the target sleep controller 11 may obtain a first time when the physical computing resource object enters the first sleep state, and a second time when it is awakened from the first sleep state by a wakeup event. The wakeup event may be a timer arrival event or an interrupt event. An interrupt event occurs when a physical computing resource object is executing a normal program and some abnormal situation or special request that requires urgent processing occurs in the system. The physical computing resource object temporarily suspends the running task and switches to processing a more urgent task that occurs randomly.
[0049] Step R2, calculate the actual sleep time of any physical computing resource object in the first sleep state based on the second time and the first time. The embodiment of the present disclosure does not limit the implementation method of calculating the actual sleep time of any physical computing resource object in the first sleep state based on the second time and the first time. Optionally, the target sleep controller 11 can 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 can also use a preset difference correction rule to correct the difference between the second time and the first time, 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 can also perform a weighted summation of 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.
[0050] After obtaining the actual sleep time of any physical computing resource object in the first sleep state, the target sleep controller 11 can update the sleep state transfer prediction information corresponding to any physical computing resource object based on the actual sleep time and the exit delay time of the first sleep state. Specifically, according to the different matching conditions 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 method of updating the sleep state transfer prediction information corresponding to any physical computing resource object will also be different. In the embodiment of the present disclosure, the method 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 can be flexibly defined according to application requirements. Among them, the target sleep controller 11 can 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 by any of the following methods.
[0051] Method 1: The target sleep controller 11 can 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.
[0052] 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 a 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.
[0053] 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 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.
[0054] 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, further determine 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 a 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 no, 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.
[0055] Regardless of how 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 situations: one is that 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 other is that 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 two situations separately.
[0056] 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 means that the first sleep state is a relatively better sleep state for any physical computing resource object. Therefore, the probability information of any physical computing resource object entering the first sleep state again 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 it needs to sleep next time.
[0057] Further optionally, the target sleep controller 11 relatively increases the probability information of any physical computing resource object entering the first sleep state again at the next sleep when it is awakened from the first sleep state. The implementation method includes: the probability information of any physical computing resource object entering the first sleep state again at the next sleep when it is awakened from the first sleep state can be increased separately; or, the probability information of any physical computing resource object entering other sleep states at the next sleep when it is awakened from the first sleep state can be reduced separately, and the other sleep states refer to sleep states other than the first sleep state; or, while increasing the probability information of any physical computing resource object entering the first sleep state again at the next sleep when it is awakened from the first sleep state, the probability information of any physical computing resource object entering other sleep states at the next sleep when it is awakened from the first sleep state can be reduced.
[0058] For example, assuming that any physical computing resource object is awakened from sleep state C0 (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, if any physical computing resource object is awakened from sleep state C0, the probability of entering sleep state C0 in the next sleep state is 70%, the probability of entering sleep state C1 is 15%, and the probability of entering sleep state C2 is 15%. If the actual sleep time of any physical computing resource object in sleep state C0 matches the exit delay time of sleep state C0, the target sleep state C0 is 15%. When the controller 11 updates the sleep state transition prediction information, it can increase the probability of entering sleep state C0 in the next sleep state after being awakened from sleep state C0 from 70% to 80%, or it can reduce the probability of entering sleep state C1 and sleep state C2 in the next sleep state after being awakened from sleep state C0 from 15% to 10%, or it can increase the probability of entering sleep state C0 in the next sleep state after being awakened from sleep state C0 from 70% to 80%, and reduce the probability of entering sleep state C1 and sleep state C2 from 15% to 10%. It is to be noted that in the above example, the reduction in the two probabilities of entering sleep state C1 and sleep state C2 is the same, but they can also be different, for example, reducing the probability of entering sleep state C1 by 10% and the probability of entering sleep state C2 by 5%.
[0059] 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 recorded as a 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 the next time it is awakened from the first sleep state is relatively increased, so that it can enter the second sleep state with a higher probability the next time it needs to sleep. The second sleep state is a sleep state whose exit delay time matches the actual sleep time. That is, 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, thereby more accurately updating the sleep state transition prediction information.
[0060] Specifically, in case 2, the target sleep controller 11 may relatively increase the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state based on the following implementation methods:
[0061] Implementation method 1: separately increase the probability information of any physical computing resource object entering the second sleep state in the next sleep state when it is awakened from the first sleep state. For example, assuming that any physical computing resource object is awakened from sleep state C0 (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, if any physical computing resource object is awakened from sleep state C0 (the first sleep state), the probability of entering sleep state C0 in the next sleep state is 70%, the probability of entering sleep state C1 (the second sleep state) is 15%, and the probability of entering sleep state C2 is 15%. If 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 target sleep controller 11 can increase the probability of entering sleep state C1 in the next sleep state when it is awakened from sleep state C0 (the first sleep state) from 15% to 70%.
[0062] Embodiment 2: Increase the probability information of any physical computing resource object entering the second sleep state at the next sleep state after being awakened from the first sleep state, and decrease the probability information of any physical computing resource object entering other sleep states at the next sleep state after being awakened from the first sleep state. Here, other sleep states refer to sleep states other than the second sleep state (including the first sleep state). Continuing with the above example, if 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 of entering sleep state C1 at the next sleep state after being awakened from sleep state C0 (the first sleep state) is increased from 15% to 70%, and the probabilities of entering sleep states C0 and C2 are correspondingly reduced. For example, the probability of entering sleep state C0 at the next sleep state after being awakened from sleep state C0 (the first sleep state) can be reduced from 70% to 20%, and the probability of entering sleep state C2 at the next sleep state after being awakened from sleep state C0 (the first sleep state) can be reduced from 15% to 10%.
[0063] Embodiment 3: Individually reducing the probability information of any physical computing resource object entering the first sleep state upon its next sleep state after being awakened from the first sleep state. Continuing with the above example, if 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 target sleep controller 11 may reduce the probability of any physical computing resource object entering sleep state C0 upon its next sleep state after being awakened from sleep state C0 from 70% to 15%.
[0064] Implementation method 4: Reduce the probability information of any physical computing resource object entering the first sleep state when it is awakened from the first sleep state, and increase the probability information of any physical computing resource object entering other sleep states when it is awakened from the first sleep state. Here, other sleep states refer to sleep states other than the first sleep state (including the second sleep state). Continuing with the above example, if 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 of entering sleep state C0 when it is awakened from sleep state C0 (first sleep state) is reduced from 70% to 20%, and the probabilities of entering sleep states C1 and C2 are increased accordingly. For example, the probability of entering sleep state C1 when it is awakened from sleep state C0 (first sleep state) can be increased from 15% to 60%, and the probability of entering sleep state C2 when it is awakened from sleep state C0 (first sleep state) can be increased from 15% to 20%.
[0065] Embodiment 5: Individually reducing the probability information of any physical computing resource object entering another sleep state upon its next sleep state after being awakened from the first sleep state. Here, another sleep state refers to a sleep state other than the first and second sleep states. Continuing with the previous example, the target sleep controller 11 can reduce the probability of any physical computing resource object entering sleep state C2 upon its next sleep state after being awakened from sleep state C0 from 15% to 5%.
[0066] Through the above method, the target sleep controller can dynamically update the sleep state transfer prediction information according to the running status of the physical computing resource object, thereby maintaining more accurate sleep state transfer 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 sleep state transfer prediction information.
[0067] In the above embodiments of the present disclosure, it is not limited to the specific method used by the target sleep controller to maintain the sleep state transfer prediction information. In some optional embodiments, the target sleep controller can create a data structure corresponding to each of the multiple physical computing resource objects during the initialization process; initialize the data structure corresponding to each of the multiple physical computing resource objects to obtain the initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects; and then as the running state of the physical computing resource object changes, the sleep state transfer prediction information recorded in the data structure can be dynamically updated according to the method described above. The data structure is used to store the sleep state transfer prediction information corresponding to the corresponding physical computing resource object. The data structure refers to a data structure that can store information, including but not limited to: arrays, lists, linked lists, and queues. The embodiment of the present disclosure will take an array as an example for illustrative explanation, and the array is called a sleep state weight array, but the form of the data structure is not limited.
[0068] Specifically, during the initialization process, the target sleep controller can create sleep state weight arrays corresponding to multiple physical computing resource objects. The sleep state weight array is a multidimensional array consisting of multiple rows and columns, as shown in Table 2. A row in the sleep state weight array represents a sleep state that the corresponding physical computing resource object may be in when awakened, and a column represents a sleep state that the corresponding physical computing resource object may enter during its next sleep state. The array elements where the rows and columns intersect represent the weight of the corresponding physical computing resource object entering the sleep state represented by the column during its next sleep state after being awakened from the sleep state represented by the row. The larger the weight, the higher the probability. It should be noted that before initialization, the element values of the sleep state weight array should be null.
[0069] Next, the target sleep controller 11 may initialize the sleep state weight arrays 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. In an optional embodiment, the target sleep controller 11 may initialize array elements with the same number of rows and columns to a first value, and initialize array elements with different number 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. As shown in Table 2, the third value may be 100, and the sum of the first value and the second value in the same row is 100. In addition, the third value may be any value, such as 90, 120, or 150, and this embodiment does not impose any restrictions. Correspondingly, the first value and the second value may also be any values if 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" are satisfied, and this embodiment does not impose any restrictions. In Table 2, the first value is 70 and the second value is 15 as an example. The following table shows the multidimensional array after initialization, which is only used for illustrative purposes to better describe the meaning of the rows and columns.
[0070] Table 2
[0071] That is, in the sleep state weight array shown in Table 2 above, the row where the sleep state C0 is located can indicate that: when the corresponding physical computing resource object is awakened from the sleep state C0, the weight of entering the sleep state C0 at the next sleep state is 70%, when it is awakened from the sleep state C0, the weight of entering the sleep state C1 at the next sleep state is 15%, and when it is awakened from the sleep state C0, the weight of entering the sleep state C2 at the next sleep state is 15%; the row where the sleep state C1 is located can indicate that: when the corresponding physical computing resource object is awakened from the sleep state C1, the weight of entering the sleep state C0 at the next sleep state is 15%. The weight is 15%, the weight of entering the sleep state C1 in the next sleep state when awakened from the sleep state C1 is 70%, and the weight of entering the sleep state C2 in the next sleep state when awakened from the sleep state C1 is 15%; the row where the sleep state C2 is located can indicate: the weight of the corresponding physical computing resource object entering the sleep state C0 in the next sleep state when awakened from the sleep state C2 is 15%, the weight of entering the sleep state C1 in the next sleep state when awakened from the sleep state C2 is 15%, and the weight of entering the sleep state C2 in the next sleep state when awakened from the sleep state C2 is 70%.
[0072] On this basis, combined with the sleep state weight array and the initialization methods listed above, the aforementioned embodiments, such as "relatively increasing the probability information of any physical computing resource object re-entering the first sleep state at the next sleep state when awakened from the first sleep state" and "relatively increasing the probability information of the target sleep controller entering the second sleep state at the next sleep state when awakened from the first sleep state," are exemplified for adjusting the probability information. It should be noted that no matter how the multidimensional array is updated, the sum of the values in the same row of the multidimensional array after increase or decrease remains the preset third value. This will be further explained below.
[0073] Optionally, the target sleep controller 11 may, 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, relatively increase the probability information of any physical computing resource object re-entering the first sleep state during the next sleep state when it is awakened from the first sleep state. The target sleep controller 11 may relatively increase the probability information of any physical computing resource object re-entering the first sleep state during the next sleep state when it is awakened from the first sleep state to a fourth value, and relatively decrease the probability information of any physical computing resource object entering other sleep states during the next sleep state when it is awakened from the first sleep state to a fifth value. The fourth value may be greater than the fifth value, and the sum of the values in the same row still equals the third value in the aforementioned embodiment.
[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 may relatively increase the probability information of any physical computing resource object entering the second sleep state when it next sleeps after being awakened from the first sleep state. Specifically, the target sleep controller 11 may relatively increase the probability information of any physical computing resource object entering the second sleep state when it next sleeps after being awakened from the first sleep state to a sixth value, and relatively decrease the probability information of any physical computing resource object entering other sleep states when it next sleeps after being awakened from the first sleep state to a seventh value. The sixth value may be greater than the seventh value, and the sum of the values in the same row still equals the third value in the aforementioned embodiment.
[0075] In this way, based on the aforementioned initialized data structure, 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 optional embodiments, in addition to maintaining the sleep state transfer 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 continues for a preset time, the target sleep controller 11 may determine that the physical computing resource object needs to sleep. When it is detected that the physical computing resource object needs to sleep, the target sleep controller 11 may determine the third sleep state based on the sleep state transfer prediction information corresponding to the physical computing resource object, and control any physical computing resource object to enter the third sleep state. The third sleep state is any one of the multiple sleep states, and is the sleep state that any physical computing resource object needs to enter this time. The above process will be further explained below in conjunction with the internal architecture and working principle of the operating system shown in Figure 3.
[0077] As shown in FIG3 , in the first step (shown in ① in FIG3 ), the ACPI specification can be used to configure the sleep state. Specifically, the physical machine can obtain a fixed ACPI description table, which defines ACPI information for various fixed hardware. From this description table, the various sleep states supported by any physical computing resource object and the corresponding exit delay times for each sleep state are obtained. In the second step (shown in ② in FIG3 ), the target resource scheduler 12 can perform resource scheduling for each physical computing resource object. In the third step (shown in ③ in FIG3 ), 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 for a preset time, the target sleep controller 11 can determine the third sleep state that the physical computing resource object needs to enter based on the sleep state transition prediction information maintained for the physical computing resource object, and provide the third sleep state to the sleep control module 13. The sleep control module 13 selects the driver module 14 corresponding to 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 in ④ in FIG3 . It is to be noted that in FIG3 , the operating system including the target sleep controller 11 , the target resource scheduler 12 , the sleep management module 13 and the driver module 14 is illustrated as an example. This is only a schematic illustration of the internal architecture of the operating system, and the internal implementation architecture of the operating system is not limited to this.
[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 to Y4:
[0079] Step Y1: Obtain the sleep state most recently exited by any physical computing resource object as the fourth sleep state. For example, if the sleep states most recently exited by the physical computing resource object are sleep state C1 and sleep state C2, the target sleep controller 11 may use the sleep state C2 most recently exited by 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, probability information of entering each sleep state in the next sleep state when awakened from the fourth sleep state.
[0081] Step Y3: Based on the probability information of entering each sleep state in the next sleep state after being awakened from the fourth sleep state, select the sleep state with the largest probability information as the candidate sleep state.
[0082] For example, the target sleep controller 11 obtains the probability information of entering each sleep state during the next sleep state when awakened from the fourth sleep state: sleep state C0 is 15%, sleep state C1 is 70%, and sleep state C2 is 15%. 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: If the exit delay time of the candidate sleep state is less than the maximum tolerable exit delay time of the system, the candidate sleep state is set 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 based on system operating conditions, or a user-defined value, and this embodiment does not impose any limitation thereto.
[0084] In addition to 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," the target sleep controller 11 may also select another sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state 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. Specifically, if there is only one sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system, the target sleep controller 11 may select that sleep state as the third sleep state. If there are multiple sleep states whose exit delay time is less than the maximum tolerable exit delay time of the system, the target sleep controller 11 may select the sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system and whose probability information is the largest as the third sleep state.
[0085] In the above manner, the target sleep controller 11 can determine the third sleep state more accurately 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 described in the above embodiments, the target resource scheduler 12 may also cooperate with the target sleep controller to complete the joint scheduling of target tasks, which will be further explained below.
[0087] The target resource scheduler 12 may select a target physical computing resource object based on the sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects, and may implement the selection based on the following steps U1-U2:
[0088] Step U1: In response to a resource scheduling trigger event, sleep habit information corresponding to each of the multiple physical computing resource objects is generated based on sleep state transition prediction information corresponding to each of the multiple physical computing resource objects. Resource scheduling trigger events include: time interruption, peripheral interruption, the current application voluntarily abandoning execution, or a higher-priority application needing to run.
[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 a plurality of physical computing resource objects based on the sleep habit information corresponding to each of the plurality of physical computing resource objects.
[0091] In some optional embodiments, when executing the above step U1, the target resource scheduler 12 may generate sleep habit information corresponding to each of the plurality of physical computing resource objects based on the following steps U11 and U12:
[0092] Step U11: For any physical computing resource object, obtain the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state in the next sleep state from the sleep state transition prediction information corresponding to the physical computing resource object.
[0093] Step U12: Based on the probability information of any physical computing resource object exiting any sleep state and re-entering that sleep state upon its next sleep state, generate sleep habit information corresponding to any physical computing resource object. The target resource scheduler 12 may construct a data structure and write the probability information of any physical computing resource object exiting any sleep state and re-entering that sleep state upon its next sleep state into the data structure to obtain the sleep habit information corresponding to the physical computing resource object.
[0094] The data structure includes but is not limited to arrays, lists, linked lists, and queues, etc. The target resource scheduler 12 can also directly use the probability information of any physical computing resource object exiting any sleep state and re-entering the sleep state at the next sleep state as the sleep habit information corresponding to the physical computing resource object.
[0095] For example, assuming 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 sleep state C0 and re-entering sleep state C0 during the next sleep is 40%, the probability of exiting sleep state C1 and re-entering sleep state C1 during the next sleep is 35%, and the probability of exiting sleep state C2 and re-entering sleep state C2 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 other optional embodiments, when executing step U1 above, the target resource scheduler 12 may further classify the sleep habit information into two sleep habit types: shallow sleep habit or deep sleep habit, to obtain the sleep habit information. If the sleep habit type corresponding to a physical computing resource object is shallow sleep habit, it indicates that the physical computing resource object is accustomed to being in a shallow sleep state; if the sleep habit type corresponding to a physical computing resource object is deep sleep habit, it indicates that the physical computing resource object is accustomed to being in a deep sleep state. This will be further explained below.
[0097] If the probability information of any physical computing resource object exiting the shallowest sleep state and entering the shallowest sleep state the next time it sleeps is the largest, the target resource scheduler 12 can determine that the sleep habit type corresponding to the any physical computing resource is a shallow sleep habit, and generate the sleep probability of any physical computing resource object under the shallow sleep habit based on the maximum probability information. Among them, the target resource scheduler 12 can directly use the maximum probability information as the sleep probability of any physical computing resource object under the shallow sleep habit; it can also multiply the maximum probability information by a preset probability coefficient to obtain the sleep probability of any physical computing resource object under the shallow sleep habit; it can also superimpose the maximum probability information with a preset correction value to obtain the sleep probability of any physical computing resource object under the shallow sleep habit, and this embodiment does not impose any restrictions.
[0098] If the probability information for any physical computing resource object exiting the deepest sleep state and then entering the deepest sleep state the next time it sleeps is the highest, the sleep habit type corresponding to the physical computing resource object is determined to be a deep sleep habit, and the sleep probability of the physical computing resource under the deep sleep habit is generated based on the highest probability information. The method for generating the sleep probability of the physical computing resource under the deep sleep habit based on the highest probability information is similar to the method for generating the sleep probability of the physical computing resource object under the shallow sleep habit described above, and will not be further described here.
[0099] In this way, the target resource scheduler 12 can not only obtain the sleep habit information more accurately, but also classify the sleep habit information more accurately into two types: light sleep habit and deep sleep habit.
[0100] In some optional embodiments, when selecting a target physical computing resource object from among multiple physical computing resource objects, the target resource scheduler 12 may determine at least one candidate physical computing resource object corresponding to a light sleep habit based on the sleep habit information corresponding to each of the multiple physical computing resource objects. For example, if there are five physical computing resource objects, namely physical computing resource object D1 through physical computing resource object D5, and their corresponding sleep habit information corresponds to a light sleep habit, a light sleep habit, a deep sleep habit, a deep sleep habit, and a deep sleep habit, respectively, the target resource scheduler 12 may select physical computing resource object D1 and physical computing resource object D2 as candidate physical computing resource objects.
[0101] After determining at least one candidate physical computing resource object corresponding to the shallow sleep habit, the target resource scheduler 12 may select a candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object based on the sleep probability of the at least one candidate physical computing resource object under the shallow sleep habit.
[0102] Specifically, the target resource scheduler 12 may select a target physical computing resource object from the at least one candidate physical computing resource object based on the sleep probability of the at least one candidate physical computing resource object in a shallow sleep state, combined with other auxiliary information. The other auxiliary information may include at least one of the type of 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. This will be described below in different scenarios.
[0103] Optionally, taking other auxiliary information as the type of resource scheduling trigger event as an example, when selecting a target physical computing resource object from at least one candidate physical computing resource object, the target resource scheduler 12 may select the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and the type of resource scheduling trigger event. Specifically, the target resource scheduler 12 may first select at least one target candidate physical computing resource object from at least one candidate physical computing resource object based on the type of resource scheduling trigger event, wherein the correspondence between the type of resource scheduling trigger event and its corresponding physical computing resource object may be maintained by the target resource scheduler 12. Thereafter, the target resource scheduler 12 may select the candidate physical computing resource object with the highest sleep probability from the at least one target candidate physical computing resource object as the target physical computing resource object.
[0104] Optionally, taking the current operating state of a candidate physical computing resource object as an example of other auxiliary information, the target resource scheduler 12 may select a target physical computing resource object from at least one candidate physical computing resource object based on the current operating state of the at least one candidate physical computing resource object and its sleep probability under a shallow sleep habit. Specifically, the target resource scheduler 12 may first select, based on the current operating state of the at least one candidate physical computing resource object, at least one target candidate physical computing resource object whose operating state meets a preset state condition from the at least one candidate physical computing resource object, and then select, from the at least one target candidate physical computing resource object, the candidate physical computing resource object with the highest sleep probability as the target physical computing resource object.
[0105] Alternatively, using the current utilization rate of a candidate physical computing resource object as an example of other auxiliary information, the target resource scheduler 12 may select, when selecting a target physical computing resource object from at least one candidate physical computing resource object, the candidate physical computing resource object with the highest utilization rate and the utilization rate that meets the utilization requirements based on the sleep probability of the at least one candidate physical computing resource object in a shallow sleep state, as the target physical computing resource object. The utilization requirement can be set to any condition based on actual needs, such as no greater than 80%, no greater than 70%, or no greater than 60%, and this embodiment does not impose any limitation thereto.
[0106] In the above manner, due to the combination of other auxiliary information, the target resource scheduler 12 can more accurately select a target physical computing resource object from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits.
[0107] Based on the above embodiments, the multiple physical computing resource objects mentioned in the above embodiments may be multi-core processors. In addition, the physical machines mentioned in the above embodiments may be applicable to vertical / dedicated application scenarios. In such vertical / dedicated scenarios, the operating system of the physical machine may only include a target resource scheduler and a target sleep controller to implement the above embodiments.
[0108] In addition, the physical machine can also be configured for various general scenarios. In general scenarios, the operating system mentioned in the above embodiments may also include other resource schedulers and other sleep controllers. Different sleep controllers have different sleep control logics, and different resource schedulers have different resource scheduling logics. It also allows users to flexibly choose 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, and the target sleep controller and target resource scheduler in the aforementioned embodiment. Different other resource schedulers and different other sleep controllers are independent of each other. The concept of mutual independence 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. In other words, 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, the user can use any combination of 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. The selected resource scheduler and sleep controller are configured to take effect, so that the target task is scheduled based on the resource scheduler and the sleep controller. The embodiment of the present disclosure does not limit the sleep control logic of any other sleep controller, nor does it limit the resource scheduling logic of any other resource scheduler. The physical machine can also select a target resource scheduler and a target sleep controller in response to a user selection operation to coordinate the scheduling of the target task. That is, the target resource scheduler and the target sleep controller are configured to be effective. Compared with other resource schedulers and other sleep controllers, the target resource scheduler and the target sleep controller need to be used in combination. The two are related and will affect each other. It should be noted that when any resource scheduler among the other resource schedulers and any sleep controller among the other sleep controllers are configured to be effective, the target resource scheduler and the target sleep controller are configured to be invalid.
[0110] The following takes the Linux operating system as an example to illustrate the sleep control logic of other sleep controllers.
[0111] In Linux systems, multiple sleep controllers such as menu (literally translated as menu), timer events oriented (TEO), and ladder (literally translated as ladder) can 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 detailed sleep control logic of the menu sleep controller, please refer to the description in the following embodiment. The TEO sleep controller is a sleep controller that attempts to find the deepest sleep state suitable for given conditions. Specifically, the TEO sleep controller monitors the idle duration of each physical computing resource object, and 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 gradually enters various sleep states from shallow to deep, that is, it will preferentially enter the shallowest sleep state, and determine whether to enter the next deeper sleep state based on the sleep duration.
[0112] In the embodiment of the present disclosure, it is assumed that the user chooses to use other sleep controllers and other resource schedulers. Taking the menu sleep controller and the CFS (Completely Fair Scheduler) resource scheduler as an example, as shown in Figure 4, the working logic between the two is decoupled. The CFS will schedule physical computing resource objects according to its own resource scheduling policy. During this process, the menu will perform sleep control according to its own sleep control logic. The sleep control logic is as follows:
[0113] (1) The sleep controller menu can record the actual sleep time of each history to predict the next sleep time.
[0114] (2) The sleep controller menu can calculate a correction coefficient based on the above-mentioned historical actual sleep time. This correction coefficient can be used to predict the impact of factors such as I / O (Input / Output) on the actual sleep time so that these impacts can be corrected in subsequent steps. Specifically, the sleep controller can calculate the correction coefficient according to the following formula:
[0115] Correction coefficient = 1024 × actual sleep time ÷ expected sleep time
[0116] (3) If the actual sleep time in each history meets the following conditions: standard deviation < 20 and variance <= 400, then the sleep controller menu can take the average value of the actual sleep time in each history 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 by 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, 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 modify the first delay tolerance, that is, select the minimum value from the second delay tolerance and the first delay tolerance as the modified target tolerance.
[0122] (8) The sleep controller menu may select the deepest sleep state from a plurality of preset sleep states and the exit delay time of which is less than or equal to the target tolerance. Thereafter, the sleep controller may 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 described above has many defects. For example, it cannot be linked with the resource scheduler to reduce the number of times physical computing resource objects enter and exit the sleep state. There is also a defect that the physical computing resource objects frequently enter and exit the sleep state, resulting in high power consumption. In addition, the high failure rate of predicting the sleep state also leads to wasteful power consumption. 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 disclosure.
[0124] In addition to the physical machines provided in the above embodiments, the embodiments of the present disclosure also provide a computing resource processing method, which will be described below with reference to the accompanying drawings.
[0125] FIG5 is a flow chart of a computing resource processing method provided by an exemplary embodiment of the present disclosure, which may include the steps shown in FIG5 :
[0126] Step 51: Maintain sleep state transition prediction information corresponding to each of the multiple physical computing resource objects. The sleep state transition prediction information includes probability information of the corresponding physical computing resource object entering each of the multiple sleep states when it is awakened from any of the multiple sleep states during the next sleep state.
[0127] Step 52: Select a target physical computing resource object according to the sleep state transfer prediction information corresponding to each of the plurality of 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 entity of this method embodiment may be an operating system, specifically the target resource scheduler and target sleep controller in the operating system. The execution entities of different steps may be different. For example, some steps may be executed by the target resource scheduler, while others may be executed by the target sleep controller. This embodiment does not impose any limitation.
[0130] In this embodiment, resource scheduling of physical computing resource objects can be combined with sleep control of physical computing resource objects. By maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This allows tasks to be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible. This is beneficial for allowing some physical computing resource objects to be in a deep sleep state for as long as possible, allowing some physical computing resource objects to be in a 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, sleep state transfer prediction information corresponding to each of a plurality of physical computing resource objects is maintained, including: when any physical computing resource object is monitored to be awakened from a 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 sleep state; and updating the sleep state transfer 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 any physical computing resource object is monitored to be awakened from a first sleep state, the actual sleep time of any physical computing resource object in the first sleep state is obtained, including: obtaining a first time when any physical computing resource object enters the first sleep state, and a second time when it is awakened from the first sleep state by a wake-up event; and calculating the actual sleep time of any physical computing resource object in the first sleep state based on the second time and the first time.
[0133] In some optional embodiments, the sleep state transfer prediction information corresponding to any physical computing resource object is updated 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, the probability information of any physical computing resource object entering the first sleep state again when it is awakened from the first sleep state at the next sleep state is relatively increased; when the actual sleep time does not match the exit delay time of the first sleep state, the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state at the next sleep state is relatively increased, and the second sleep state is a sleep state whose exit delay time matches the actual sleep time.
[0134] In some optional embodiments, relatively increasing the probability information of any physical computing resource object entering the first sleep state again when it is awakened from the first sleep state includes: increasing the probability information of any physical computing resource object entering the first sleep state again when it is awakened from the first sleep state; and / or reducing the probability information of any physical computing resource object entering other sleep states when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.
[0135] In some optional embodiments, relatively increasing the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state includes: increasing the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state; and / or, reducing the probability information of any physical computing resource object entering the first sleep state when it is awakened from the first sleep state; and / or, reducing the probability information of any physical computing resource object entering the other sleep states when it is awakened from the first sleep state, where the other sleep states refer to sleep states other than the first sleep state and the second sleep state.
[0136] In some optional embodiments, the method further includes: during the initialization process, creating a data structure corresponding to each of the multiple physical computing resource objects, the data structure being used to store sleep state transfer prediction information corresponding to the corresponding physical computing resource object; initializing the data structure corresponding to each of the multiple physical computing resource objects to obtain the initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects.
[0137] In some optional embodiments, a data structure corresponding to each of the plurality of physical computing resource objects is created, including: creating a sleep state weight array corresponding to each of the plurality of physical computing resource objects, the sleep state weight array being a multidimensional array including multiple rows and multiple columns; wherein a row represents a sleep state that the corresponding physical computing resource object may be in when awakened, and a column represents a sleep state that the corresponding physical computing resource object may enter when it sleeps next time; array elements where rows and columns intersect represent the weight of the corresponding physical computing resource object entering the sleep state represented by the column when it is awakened from the sleep state represented by the row, and the greater the weight, the higher the probability.
[0138] In some optional embodiments, initializing data structures corresponding to multiple physical computing resource objects includes: initializing array elements with the same number of rows and columns to a first value, and initializing array elements with different number 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 optional embodiments, the method further includes: when it is monitored that any physical computing resource object needs to sleep, determining a third sleep state based on sleep state transfer prediction information corresponding to any physical computing resource object; and controlling any physical computing resource object to enter the third sleep state.
[0140] In some optional embodiments, the third sleep state is determined based on the sleep state transfer prediction information corresponding to any physical computing resource object, including: obtaining the sleep state most recently exited by any physical computing resource object as the fourth sleep state; obtaining probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state from the sleep state transfer prediction information corresponding to any physical computing resource object; based on the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state, selecting 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, the candidate sleep state is used as the third sleep state.
[0141] In some optional 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 whose exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state.
[0142] In some optional embodiments, another sleep state in which the exit delay time is less than the maximum tolerable exit delay time of the system is selected as the third sleep state, including: when there are multiple sleep states in which the exit delay time is less than the maximum tolerable exit delay time of the system, selecting the sleep state in which the exit delay time is less than the maximum tolerable exit delay time of the system and the probability information is the largest as the third sleep state.
[0143] In some optional embodiments, a target physical computing resource object is selected based on sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, including: responding to a resource scheduling trigger event, generating sleep habit information corresponding to each of the multiple physical computing resource objects based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects; and selecting 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.
[0144] In some optional embodiments, sleep habit information corresponding to each of the multiple physical computing resource objects is generated based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, including: for any physical computing resource object, obtaining probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep state from the sleep state transfer prediction information corresponding to any physical computing resource object; generating sleep habit information corresponding to any physical computing resource object based on the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep state.
[0145] In some optional embodiments, sleep habit information corresponding to any physical computing resource object is generated based on the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep, including: if the probability information of any physical computing resource object exiting from the shallowest sleep state and entering the shallowest sleep state at the next sleep is the largest, determining that the sleep habit type corresponding to any physical computing resource is a shallow sleep habit, and generating the sleep probability of any physical computing resource object under the shallow sleep habit based on the largest probability information; if the probability information of any physical computing resource object exiting from the deepest sleep state and entering the deepest sleep state at the next sleep is the largest, determining that the sleep habit type corresponding to any physical computing resource object is a deep sleep habit, and generating the sleep probability of any physical computing resource under the deep sleep habit based on the largest probability information.
[0146] In some optional embodiments, a target physical computing resource object is selected from a plurality of physical computing resource objects based on the sleep habit information corresponding to each of the plurality of physical computing resource objects, including: determining at least one candidate physical computing resource object corresponding to a shallow sleep habit based on the sleep habit information corresponding to each of the plurality of physical computing resource objects; and selecting a candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object based on the sleep probability of the at least one candidate physical computing resource object under the shallow sleep habit.
[0147] In some optional embodiments, based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits, a candidate physical computing resource object with a sleep probability that meets the requirements is selected as a target physical computing resource object, including: based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits, combined with other auxiliary information, selecting the target physical computing resource object from at least one candidate physical computing resource object; wherein the other auxiliary information includes at least one of the type of resource scheduling trigger event, the current operating status of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.
[0148] In some optional embodiments, based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and combined with other auxiliary information, a target physical computing resource object is selected from at least one candidate physical computing resource object, including: based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and the current utilization rate, selecting 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.
[0149] The detailed implementation and beneficial effects of each step in the method of this embodiment have been described in detail in the aforementioned embodiments and will not be elaborated here.
[0150] The following takes a multi-core CPU and the CPU cores contained therein as an example, and describes in detail the implementation of each embodiment of the method shown in FIG. 5 in conjunction with FIG. 6 a , FIG. 6 b , FIG. 6 c and FIG. 6 d .
[0151] 6a is a schematic diagram of the deployment and implementation of the computing resource processing method provided by an embodiment of the present disclosure 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 article) during initialization, such as an array in the format of weight[][], wherein a row represents a sleep state that the corresponding physical computing resource object may be in when it is awakened, and a column represents a sleep state that the corresponding physical computing resource object may enter when it sleeps next time. The array elements where the rows and columns intersect represent the weight of the corresponding physical computing resource object entering the sleep state represented by the column when it is awakened from the sleep state represented by the row, and the larger the weight, the higher the probability.
[0153] The target sleep controller can initialize the data structure. Specifically, the target sleep controller can initialize the elements of the intersection of the row and column to 70 when the subscripts of the arrays i and j are the same. The target sleep controller can initialize these elements to (100-70) / 2=15 when the subscripts of the arrays i and j are different. It should be noted that, regardless of the initialization or the subsequent element update process, the elements of each row should always meet the condition of adding up to 100. Figure 6a shows an example of the initialized data structure, taking three sleep states C0-C2 as an example, and taking 8 CPU cores as an example. The 8 CPU cores shown in Figure 6a are core 0 to core 7.
[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 describe the update process in conjunction with Figure 6b.
[0155] As shown in Figure 6b, the target resource scheduler can initiate a sleep process when the task queue in the physical computing resource object is empty and query the last sleep state entered and the corresponding exit delay. The target sleep controller can determine the actual sleep duration based on the last sleep state entry time and the time of awakening by the wakeup event, which can be a timer arrival event or an interrupt event. The target sleep controller then determines the sleep state that best matches the actual sleep duration.
[0156] When the target sleep controller determines that the actual sleep time matches the last predicted sleep state, it can increase the weight of the sleep state by 20 and reduce 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 of the sleep state that best matches the actual duration of the sleep by 15 and reduce the last predicted sleep state by 15.
[0157] As shown in FIG6 b , 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, which will be further explained below with reference to FIG6 c.
[0159] As shown in Figure 6c, for a CPU core that needs to enter a sleep state again after being awakened, the target sleep controller can obtain the sleep state it most recently exited (i.e., "Obtain the last sleep state exited" in Figure 6b), and use this sleep state as a row. Among the multiple columns of elements corresponding to this row, the sleep state with the highest weight is determined as the state to be entered for the next sleep state. Afterwards, 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 will continue to select a sleep state at a shallower level and continue 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 sleep state selection can be completed.
[0160] Based on the corresponding execution logic of the target sleep controller described above, the target resource scheduler can also cooperate with the target sleep controller to complete the joint scheduling of the target tasks, which will be further explained below with reference to FIG6 d .
[0161] As shown in Figure 6d, the target resource scheduler can respond to events such as time interrupts, peripheral interrupts, the current application actively giving up running, or higher priority applications 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 the CPU core has the highest weight. If so, the target resource scheduler can continue to search for the CPU core in the shallowest sleep state and the highest weight, and schedule the target task on the CPU core in the deepest sleep state to the CPU core in the shallowest sleep state and the highest weight, and then run the task at the head of the task queue on the CPU core in the shallowest sleep state and the highest weight. In this way, tasks can be scheduled as much as possible to physical computing resource objects with relatively shallow sleep states or relatively busy states, which is beneficial for some physical computing resource objects to be in a deep sleep state for as long as possible, for some physical computing resource objects to be in a busy state as much as possible, and for 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, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 51, 52, etc., are only used to distinguish between different operations, and the sequence 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 of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0163] An embodiment of the present disclosure further provides a computing resource processing device, as shown in FIG7 , which includes: a maintenance module 701 for maintaining sleep state transfer prediction information corresponding to each of a plurality of physical computing resource objects, wherein the sleep state transfer prediction information includes probability information of the corresponding physical computing resource object entering each of the plurality of sleep states upon the next sleep state when awakened from any of the plurality of sleep states; a selection module 702 for selecting a target physical computing resource object based on the sleep state transfer prediction information corresponding to each of the plurality of physical computing resource objects; and a scheduling module 703 for scheduling a target task to be scheduled onto the target physical computing resource object.
[0164] In some optional embodiments, when maintaining the sleep state transfer prediction information corresponding to each of multiple physical computing resource objects, the maintenance module 701 is specifically used to: when monitoring any physical computing resource object to be awakened from a 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 sleep state; and update the sleep state transfer prediction information corresponding to any physical computing resource object based on the actual sleep time and the exit delay time of the first sleep state.
[0165] In some optional embodiments, when the maintenance module 701 monitors that any physical computing resource object is awakened from the first sleep state, it obtains the actual sleep time of any physical computing resource object in the first sleep state, and is specifically used to: obtain 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 calculate the actual sleep time of any physical computing resource object in the first sleep state based on the second time and the first time.
[0166] In some optional embodiments, when the maintenance module 701 updates the sleep state transfer prediction information corresponding to any physical computing resource object based on the actual sleep time and the exit delay time of the first sleep state, it is specifically used to: when the actual sleep time matches the exit delay time of the first sleep state, relatively increase the probability information of any physical computing resource object entering the first sleep state again when it is awakened from the first sleep state in the next sleep state; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state in the next sleep state, the second sleep state being a sleep state whose exit delay time matches the actual sleep time.
[0167] In some optional embodiments, when the maintenance module 701 relatively increases the probability information that any physical computing resource object will re-enter the first sleep state when it is awakened from the first sleep state at the next sleep state, it is specifically used to: increase the probability information that any physical computing resource object will re-enter the first sleep state when it is awakened from the first sleep state at the next sleep state; and / or, reduce the probability information that any physical computing resource object will enter other sleep states when it is awakened from the first sleep state at the next sleep state, where other sleep states refer to sleep states other than the first sleep state.
[0168] In some optional embodiments, when the maintenance module 701 relatively increases the probability information that any physical computing resource object enters the second sleep state when it next sleeps after being awakened from the first sleep state, it is specifically used to: increase the probability information that any physical computing resource object enters the second sleep state when it next sleeps after being awakened from the first sleep state; and / or, reduce the probability information that any physical computing resource object enters the first sleep state when it next sleeps after being awakened from the first sleep state; and / or, reduce the probability information that any physical computing resource object enters other sleep states when it next sleeps after 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.
[0169] In some optional embodiments, the maintenance module 701 is also used to: during the initialization process, create a data structure corresponding to each of the multiple physical computing resource objects, the data structure being used to store the sleep state transfer prediction information corresponding to the corresponding physical computing resource object; initialize the data structure corresponding to each of the multiple physical computing resource objects to obtain the initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects.
[0170] In some optional embodiments, when the maintenance module 701 creates a data structure corresponding to each of the multiple physical computing resource objects, it is specifically used 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 multidimensional array including multiple rows and multiple columns; wherein a row represents a sleep state that the corresponding physical computing resource object may be in when it is awakened, and a column represents a sleep state that the corresponding physical computing resource object may enter when it sleeps next time; the array elements where the rows and columns intersect represent the weight of the corresponding physical computing resource object entering the sleep state represented by the column when it is awakened from the sleep state represented by the row, and the larger the weight, the higher the probability.
[0171] In some optional embodiments, when the maintenance module 701 initializes the data structures corresponding to multiple physical computing resource objects, it is specifically used to: initialize array elements with the same number of rows and columns to a first value, and initialize array elements with different number 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 optional embodiments, the selection module 702 is further used to: when it is detected that any physical computing resource object needs to sleep, determine the third sleep state based on the sleep state transfer prediction information corresponding to any physical computing resource object; and control any physical computing resource object to enter the third sleep state.
[0173] In some optional embodiments, when the selection module 702 determines the third sleep state based on the sleep state transfer prediction information corresponding to any physical computing resource object, it is specifically used to: obtain the sleep state most recently exited by any physical computing resource object as the fourth sleep state; obtain the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state from the sleep state transfer prediction information corresponding to any physical computing resource object; select the sleep state with the largest probability information as the candidate sleep state based on the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state; and select 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.
[0174] In some optional 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 whose exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state.
[0175] In some optional embodiments, when the selection module 702 selects another sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state, it is specifically used to: when there are multiple sleep states whose exit delay time is less than the maximum tolerable exit delay time of the system, select the sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system and whose probability information is the largest as the third sleep state.
[0176] In some optional embodiments, when the selection module 702 selects a target physical computing resource object based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, it is specifically used to: respond to a resource scheduling trigger event, generate sleep habit information corresponding to each of the multiple physical computing resource objects based on the sleep state transfer 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 based on the sleep habit information corresponding to each of the multiple physical computing resource objects.
[0177] In some optional embodiments, when the selection module 702 generates sleep habit information corresponding to multiple physical computing resource objects based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, it is specifically used to: for any physical computing resource object, obtain the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep state from the sleep state transfer prediction information corresponding to any physical computing resource object; and generate the sleep habit information corresponding to any physical computing resource object based on the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep state.
[0178] In some optional embodiments, when the selection module 702 generates the sleep habit information corresponding to any physical computing resource object based on the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep, it is specifically used to: if the probability information of any physical computing resource object exiting from the shallowest sleep state and entering the shallowest sleep state at the next sleep is the largest, determine that the sleep habit type corresponding to any physical computing resource is a shallow sleep habit, and generate the sleep probability of any physical computing resource object under the shallow sleep habit based on the largest probability information; if the probability information of any physical computing resource object exiting from the deepest sleep state and entering the deepest sleep state at the next sleep is the largest, determine that the sleep habit type corresponding to any physical computing resource object is a deep sleep habit, and generate the sleep probability of any physical computing resource under the deep sleep habit based on the largest probability information.
[0179] In some optional embodiments, when the selection module 702 selects a target physical computing resource object from multiple physical computing resource objects based on the sleep habit information corresponding to each of the multiple physical computing resource objects, it is specifically used to: determine at least one candidate physical computing resource object corresponding to a shallow sleep habit based on the sleep habit information corresponding to each of the multiple physical computing resource objects; and select a candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.
[0180] In some optional embodiments, when the selection module 702 selects a candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit, it is specifically used to: select the target physical computing resource object from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under the shallow 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 operating status of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.
[0181] In some optional embodiments, when the selection module 702 selects a target physical computing resource object from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and other auxiliary information, it is specifically used to: select the candidate physical computing resource object whose utilization meets the requirements and has the highest sleep probability as the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and the current utilization rate.
[0182] In this embodiment, resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects. By maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This allows tasks to be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible. This is beneficial for allowing some physical computing resource objects to be in a deep sleep state for as long as possible, allowing some physical computing resource objects to be in a busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.
[0183] FIG8 is a schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present disclosure. As shown in FIG8 , the device includes a memory 801 and a processor 802. The electronic device includes but is not limited to the physical machine in the aforementioned embodiment, and this embodiment does not impose any limitation thereto.
[0184] The memory 801 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method used to operate on the electronic device.
[0185] In some embodiments, the processor 802 is coupled to the memory 801 and is configured to execute a computer program in the memory 801 to: maintain 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 during the next sleep state when awakened from any of the plurality of sleep states; select a target physical computing resource object based on the sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects; and schedule a target task to be scheduled to the target physical computing resource object.
[0186] In some optional embodiments, when the processor 802 maintains sleep state transfer prediction information corresponding to each of a plurality of physical computing resource objects, it is specifically used to: when monitoring that any physical computing resource object is awakened from a 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 sleep state; and update the sleep state transfer prediction information corresponding to any physical computing resource object based on the actual sleep time and the exit delay time of the first sleep state.
[0187] In some optional embodiments, when the processor 802 monitors that any physical computing resource object is awakened from a first sleep state, it obtains the actual sleep time of any physical computing resource object in the first sleep state, and is specifically used to: obtain 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 calculate the actual sleep time of any physical computing resource object in the first sleep state based on the second time and the first time.
[0188] In some optional embodiments, when the processor 802 updates the sleep state transfer prediction information corresponding to any physical computing resource object based on the actual sleep time and the exit delay time of the first sleep state, it is specifically used to: when the actual sleep time matches the exit delay time of the first sleep state, relatively increase the probability information of any physical computing resource object entering the first sleep state again when it is awakened from the first sleep state in the next sleep state; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state in the next sleep state, the second sleep state being a sleep state whose exit delay time matches the actual sleep time.
[0189] In some optional embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object will enter the first sleep state again when it is awakened from the first sleep state, it is specifically used to: increase the probability information that any physical computing resource object will enter the first sleep state again when it is awakened from the first sleep state; and / or reduce the probability information that any physical computing resource object will enter other sleep states when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.
[0190] In some optional embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object enters the second sleep state when it next sleeps after being awakened from the first sleep state, it is specifically used to: increase the probability information that any physical computing resource object enters the second sleep state when it next sleeps after being awakened from the first sleep state; and / or, reduce the probability information that any physical computing resource object enters the first sleep state when it next sleeps after being awakened from the first sleep state; and / or, reduce the probability information that any physical computing resource object enters other sleep states when it next sleeps after 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 optional embodiments, the processor 802 is further used to: during the initialization process, create a data structure corresponding to each of the multiple physical computing resource objects, the data structure being used to store sleep state transfer prediction information corresponding to the corresponding physical computing resource object; initialize the data structure corresponding to each of the multiple physical computing resource objects to obtain the initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects.
[0192] In some optional embodiments, when the processor 802 creates a data structure corresponding to each of the multiple physical computing resource objects, it is specifically used 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 multidimensional array including multiple rows and multiple columns; wherein a row represents a sleep state that the corresponding physical computing resource object may be in when it is awakened, and a column represents a sleep state that the corresponding physical computing resource object may enter when it sleeps next time; the array elements where the rows and columns intersect represent the weight of the corresponding physical computing resource object entering the sleep state represented by the column when it is awakened from the sleep state represented by the row, and the larger the weight, the higher the probability.
[0193] In some optional embodiments, when the processor 802 initializes the data structures corresponding to multiple physical computing resource objects, it is specifically used to: initialize array elements with the same number of rows and columns to a first value, and initialize array elements with different number 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 optional embodiments, the processor 802 is further used to: when it is detected that any physical computing resource object needs to sleep, determine the third sleep state based on the sleep state transfer prediction information corresponding to any physical computing resource object; and control any physical computing resource object to enter the third sleep state.
[0195] In some optional embodiments, when the processor 802 determines the third sleep state based on the sleep state transfer prediction information corresponding to any physical computing resource object, it is specifically used to: obtain the sleep state most recently exited by any physical computing resource object as the fourth sleep state; obtain the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state from the sleep state transfer prediction information corresponding to any physical computing resource object; select the sleep state with the largest probability information as the candidate sleep state based on the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state; and select 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.
[0196] In some optional 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 whose exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state.
[0197] In some optional embodiments, when the processor 802 selects another sleep state in which the exit delay time is less than the maximum tolerable exit delay time of the system as the third sleep state, it is specifically used to: when there are multiple sleep states in which the exit delay time is less than the maximum tolerable exit delay time of the system, select the sleep state in which the exit delay time is less than the maximum tolerable exit delay time of the system and the probability information is the largest as the third sleep state.
[0198] In some optional embodiments, when the processor 802 selects a target physical computing resource object based on the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, it is specifically used to: respond to a resource scheduling trigger event, generate sleep habit information corresponding to each of the multiple physical computing resource objects based on the sleep state transfer 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 based on the sleep habit information corresponding to each of the multiple physical computing resource objects.
[0199] In some optional embodiments, when the processor 802 generates sleep habit information corresponding to multiple physical computing resource objects based on the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, it is specifically used to: for any physical computing resource object, obtain, from the sleep state transition prediction information corresponding to any physical computing resource object, probability information that any physical computing resource object exits from any sleep state and re-enters the sleep state at the next sleep; and generate sleep habit information corresponding to any physical computing resource object based on the probability information that any physical computing resource object exits from any sleep state and re-enters the sleep state at the next sleep.
[0200] In some optional embodiments, when the processor 802 generates the sleep habit information corresponding to any physical computing resource object based on the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep, it is specifically used to: if the probability information of any physical computing resource object exiting from the shallowest sleep state and entering the shallowest sleep state at the next sleep is the largest, determine that the sleep habit type corresponding to any physical computing resource is a shallow sleep habit, and generate the sleep probability of any physical computing resource object under the shallow sleep habit based on the largest probability information; if the probability information of any physical computing resource object exiting from the deepest sleep state and entering the deepest sleep state at the next sleep is the largest, determine that the sleep habit type corresponding to any physical computing resource object is a deep sleep habit, and generate the sleep probability of any physical computing resource under the deep sleep habit based on the largest probability information.
[0201] In some optional embodiments, when the processor 802 selects a target physical computing resource object from multiple physical computing resource objects based on the sleep habit information corresponding to each of the multiple physical computing resource objects, it is specifically used to: determine at least one candidate physical computing resource object corresponding to a shallow sleep habit based on the sleep habit information corresponding to each of the multiple physical computing resource objects; and select a candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.
[0202] In some optional embodiments, when the processor 802 selects a candidate physical computing resource object whose sleep probability meets the requirements as a target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits, it is specifically used to: select a target physical computing resource object from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits 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 operating status of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.
[0203] In some optional embodiments, when the processor 802 selects a target physical computing resource object from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and other auxiliary information, it is specifically used to: select the candidate physical computing resource object whose utilization meets the requirements and has the highest sleep probability as the target physical computing resource object based on the sleep probability of at least one candidate physical computing resource object under shallow sleep habits and the current utilization rate.
[0204] Furthermore, as shown in Figure 8, the electronic device also includes other components such as a communication component 803, a display 804 and a power supply component 805. Figure 8 only schematically shows some components, which does not mean that the electronic device only includes the components shown in Figure 8. In addition, the components in the dotted box in Figure 8 are optional components, not mandatory components, and the specific components may depend on the product form of the electronic device. The electronic device of this embodiment can be implemented as a terminal device such as a desktop computer, a laptop computer, a tablet computer, a smart phone or an IOT device, or it can be a server-side device such as a conventional server, a cloud server or a server array. If the electronic device of this embodiment is implemented as a terminal device such as a desktop computer, a laptop computer, a tablet computer, a smart phone, etc., it may include the components in the dotted box in Figure 8; if the electronic device of this embodiment is implemented as a server-side device such as a conventional server, a cloud server or a server array, it may not include the components in the dotted box in Figure 8.
[0205] Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be executed by the electronic device in the method embodiment shown in FIG. 5 .
[0206] Accordingly, an embodiment of the present disclosure also provides a multi-core processor system, comprising multiple processor cores and a memory, wherein 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 embodiment shown in Figure 5 above.
[0207] In this embodiment, resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects. By maintaining sleep state transfer prediction information corresponding to multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This allows tasks to be scheduled to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible. This is beneficial for allowing some physical computing resource objects to be in a deep sleep state for as long as possible, allowing some physical computing resource objects to be in a busy state as much as possible, and 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 memory 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-mentioned communication component is configured to facilitate wired or wireless communication 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 a communication standard, 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 also 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-mentioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor can not only sense the boundary of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0211] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0212] The above-mentioned 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 operating mode, such as call mode, recording mode, and voice recognition mode, the microphone is configured to receive external audio signals. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0213] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
[0214] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0215] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0217] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.
[0218] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. 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 using 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic 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 transitory computer-readable media such as modulated data signals and carrier waves.
[0220] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0221] The above are merely examples of the present disclosure and are not intended to limit the present disclosure. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure are intended to be included within the scope of the claims of the present disclosure.
Claims
1. A method for processing computing resources, wherein, Including: Maintaining the sleep state transition prediction information corresponding to each of 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 during the next sleep when awakened from any one of the multiple sleep states; Selecting a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; Scheduling a target task to be scheduled to the target physical computing resource object.
2. The method according to claim 1, wherein, Maintaining the sleep state transition prediction information corresponding to each of multiple physical computing resource objects, including: When it is monitored that any physical computing resource object is awakened from the first sleep state, obtaining the actual sleep time of the any physical computing resource object in the first sleep state, where the first sleep state is any one of the sleep states; Updating the sleep state transition prediction information corresponding to the any physical computing resource object 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 sleep state transition prediction information corresponding to the any physical computing resource object 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 of the any physical computing resource object entering 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 increasing the probability information of the any physical computing resource object entering the second sleep state during the next sleep when 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 any one of claims 1 to 3, wherein, Also including: 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 the initial values of the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects.
5. The method according to claim 4, wherein, Creating the data structures corresponding to each of the multiple physical computing resource objects, 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 that the corresponding physical computing resource object may be in when awakened, and one column represents a sleep state that the corresponding physical computing resource object may enter during 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 during the next sleep when 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 each of the multiple physical computing resource objects, 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 any one of claims 1-6, wherein, Further included: 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 when going to sleep next time after being awakened from the fourth sleep state; According to the probability information of entering each sleep state when going to sleep next time after being awakened from the fourth sleep state, select the sleep state with the largest probability information as the candidate sleep state; In the case that 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, wherein, Selecting the target physical computing resource object according to the sleep state transition prediction information corresponding to the multiple physical computing resource objects includes: 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; Select the 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, wherein, 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 when going to sleep next time; 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 when going to sleep next time.
11. A physical machine, wherein, 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 when going to sleep next time after being awakened from any sleep state for the corresponding physical computing resource object; 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 onto 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, where 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, wherein, It includes multiple processor cores and a memory, where 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, wherein, 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.
16. A computer program product, wherein, The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in the method according to any one of claims 1-10.
Citation Information
Patent Citations
Computing resource processing method and device and storage medium
CN120216153A
Cluster energy-saving method and device
CN114710563A
Task scheduling method and device, electronic equipment and storage medium
CN117149440A
Adaptive Doze to Hibernate
US20170308148A1
System sleep method and apparatus and system wake-up method and apparatus
WO2023206693A1