WO2025139217A1 - Computing resource processing method, device, and storage medium - Google Patents
Computing resource processing method, device, and storage medium Download PDFInfo
- Publication number
- WO2025139217A1 WO2025139217A1 PCT/CN2024/125026 CN2024125026W WO2025139217A1 WO 2025139217 A1 WO2025139217 A1 WO 2025139217A1 CN 2024125026 W CN2024125026 W CN 2024125026W WO 2025139217 A1 WO2025139217 A1 WO 2025139217A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- sleep state
- sleep
- computing resource
- physical computing
- resource object
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
Definitions
- the present disclosure relates to the field of cloud computing technology, and in particular to a computing resource processing method, device and storage medium.
- Cloud servers usually use multi-core processors (Central Processing Unit, CPU), such as 4-core processors or 8-core processors, to provide users with higher computing performance.
- CPU Central Processing Unit
- ACPI Advanced Configuration and Power Management Interface
- the prior art faces the problem that the CPU frequently enters and exits the sleep state. Since entering and exiting the sleep state itself consumes additional power consumption, frequent entry and exit of the sleep state not only fails to save power consumption, but may even cause other CPUs to be unable to obtain a higher frequency.
- 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 sleep state.
- the embodiment of the present disclosure provides a physical machine, wherein an operating system is running on hardware resources of the physical machine, wherein the hardware resources include multiple physical computing resource objects, and the multiple physical computing resource objects support multiple sleep states with different sleep depths, and the operating system includes: a target resource scheduler and a target sleep controller; the target sleep controller is used to maintain sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, and the sleep state transfer prediction information includes the sleep state transfer prediction information of the corresponding physical computing resource object when it is awakened from any sleep state in the next sleep state.
- the target resource scheduler is used to select a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and schedule the target task to be scheduled to the target physical computing resource object.
- the disclosed embodiment also provides a computing resource processing method, including: 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 when awakened from any of the plurality of sleep states; selecting 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; and scheduling a target task to be scheduled to the target physical computing resource object.
- the embodiment of the present disclosure also provides a multi-core processor system, including multiple processor cores and a memory, wherein the memory is used to store 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.
- the embodiment of the present disclosure also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is enabled to implement the steps in the computing resource processing method.
- the embodiment of the present disclosure further provides a computer program product, which includes a computer program.
- a computer program product which includes a computer program.
- the steps in the computing resource processing method are implemented.
- resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects.
- the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information.
- This can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for 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, and thereby reducing the frequency of predicting sleep states, thereby reducing problems caused by prediction errors.
- FIG. 1a is a schematic diagram of a sleep state transition provided by an exemplary embodiment of the present disclosure
- FIG1b is a schematic diagram of sleep power consumption provided by an exemplary embodiment of the present disclosure.
- FIG2 is a software-hardware architecture diagram of a physical machine provided by another exemplary embodiment of the present disclosure.
- FIG3 is a schematic diagram of a flow chart of controlling a physical computing resource object to enter a third dormant state provided by another exemplary embodiment of the present disclosure
- FIG4 is a schematic diagram of the control logic of a menu sleep controller provided by yet another exemplary embodiment of the present disclosure.
- FIG5 is a schematic diagram of a flow chart of a computing resource processing method provided by another exemplary embodiment of the present disclosure.
- FIG6a 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;
- FIG6b is a schematic diagram of a process of updating a data structure provided by another exemplary embodiment of the present disclosure.
- FIG6c is a schematic diagram of a process of selecting a sleep state provided by another exemplary embodiment of the present disclosure.
- FIG6d is a schematic diagram of a process of scheduling by a target resource scheduler provided by another exemplary embodiment of the present disclosure.
- FIG7 is a schematic diagram of a computing resource processing device provided by another exemplary embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of an electronic device provided by yet another exemplary embodiment of the present disclosure.
- the target sleep controller 11 can 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 based on the following implementation methods:
- 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 (first sleep state), the probability of entering sleep state C0 in the next sleep state is 70%, the probability of entering sleep state C1 is 15% (second sleep state), and the probability of entering sleep state C2 is 15%, then 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 (first sleep state) from 15% to 70%.
- Implementation method 2 increase the probability information of any physical computing resource object entering the second sleep state at the next sleep state when it is awakened from the first sleep state, and reduce the probability information of any physical computing resource object entering other sleep states at the next sleep state when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the second sleep state (including the first sleep state).
- other sleep states refer to sleep states other than the second sleep state (including the first sleep state).
- the probability of entering the sleep state C0 and C2 is increased from 15% to 70%, and the probability of entering the sleep state C0 and C2 is reduced accordingly.
- the probability of entering the sleep state C0 in the next sleep state when awakened from the sleep state C0 (the first sleep state) can be reduced from 70% to 20%
- the probability of entering the sleep state C2 in the next sleep state when awakened from the sleep state C0 (the first sleep state) can be reduced from 15% to 10%.
- Implementation method 3 separately reducing the probability information of any physical computing resource object entering the first sleep state in the next sleep state when it is awakened from the first sleep state.
- the target sleep controller 11 can reduce the probability of any physical computing resource object entering sleep state C0 in the next sleep state when it is awakened from sleep state C0 from 70% to 15%.
- Implementation method 4 reduce the probability information of any physical computing resource object entering the first sleep state in the next 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 in the next sleep state when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state (including the second sleep state).
- other sleep states refer to sleep states other than the first sleep state (including the second sleep state).
- the probability of entering sleep state C1 in the next sleep state when it is awakened from sleep state C0 can be increased from 15% to 60%
- the probability of entering sleep state C2 in the next sleep state when it is awakened from sleep state C0 is increased from 15% to 20%.
- Implementation method 5 separately reducing the probability information of any physical computing resource object entering other sleep states in the next sleep state when it is 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.
- the target sleep controller 11 can reduce the probability of any physical computing resource object entering sleep state C2 in the next sleep state when it is awakened from sleep state C0 from 15% to 5%.
- the target sleep controller can dynamically update the sleep state transfer prediction information according to the running status of the physical computing resource object, so as to maintain more accurate sleep state transfer prediction information.
- it is convenient to more accurately select the sleep state that the physical computing resource object needs to enter when sleep is needed next time.
- it can also provide a more accurate data basis for resource scheduling based on sleep state transfer prediction information.
- the target sleep controller can create multiple A data structure corresponding to each of the multiple physical computing resource objects is initialized 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 capable of storing information, including but not limited to: arrays, lists, linked lists, queues, etc. The disclosed embodiment will take an array as an example for illustrative explanation, and the array will be called a sleep state weight array, but the form of the data structure is not limited.
- the target sleep controller can create sleep state weight arrays corresponding to multiple physical computing resource objects during the initialization process.
- the sleep state weight array is a multidimensional array including multiple rows and multiple 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 it is awakened
- 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 next time it sleeps. The larger the weight, the higher the probability.
- the element value of the sleep state weight array should be null.
- 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 transfer prediction information corresponding to each of the multiple physical computing resource objects.
- the target sleep controller 11 may initialize the array elements with the same number of rows and columns to the first value, and initialize the array elements with different number 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.
- the third value may be 100, and the sum of the first value and the second value in the same row is 100.
- the third value may also be any value, such as 90, 120 or 150, etc., which is not limited in this embodiment.
- the first value and the second value may also be any value under the condition that "the first value is greater than the second value" and "the sum of the first value and the second value in the same row is the third value", which is not limited in this embodiment.
- the first value is 70 and the second value is 15 as an example for illustration.
- the following table shows a multidimensional array after initialization, which is only used for illustrative purposes to better describe the meanings of the rows and columns.
- the weight is 15%, the weight of entering the sleep state C1 at the next sleep when awakened from the sleep state C1 is 70%, and the weight of entering the sleep state C2 at the next sleep 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 at the next sleep when awakened from the sleep state C2 is 15%, the weight of entering the sleep state C1 at the next sleep when awakened from the sleep state C2 is 15%, and the weight of entering the sleep state C2 at the next sleep when awakened from the sleep state C2 is 70%.
- the "relatively increasing the probability information of any physical computing resource object entering the first sleep state again in the next sleep state when it is awakened from the first sleep state” and "the target sleep controller relatively increasing 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” mentioned in the above embodiments are exemplified for the adjustment method of 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 is still the preset third value. This will be further explained below.
- the target sleep controller 11 may relatively increase the probability information of any physical computing resource object re-entering the first sleep state when it is awakened from the first sleep state when the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state.
- the target sleep controller 11 may relatively increase the probability information of any physical computing resource object re-entering the first sleep state when it is awakened from the first sleep state to a fourth value, and relatively reduce the probability information of any physical computing resource object entering other sleep states 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 is still the third value in the aforementioned embodiment.
- 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 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 is awakened from the first sleep state to the sixth value, and relatively reduce the probability information of any physical computing resource object entering other sleep states when it is awakened from the first sleep state to the seventh value, the sixth value may be greater than the seventh value, and the sum of the values in the same row is still the third value in the aforementioned embodiment.
- the target sleep controller 11 can use the data structure to According to the structure, the sleep state transfer prediction information corresponding to any physical computing resource object is updated more quickly.
- 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 according to 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. Among them, 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.
- the ACPI specification can be used to configure the sleep state.
- the physical machine can obtain a fixed ACPI description table, which defines ACPI information of various fixed hardware. From the description table, various sleep states supported by any physical computing resource object and the exit delay time corresponding to various sleep states are obtained.
- the target resource scheduler 12 can perform resource scheduling for each physical computing resource object; in the third step (shown in 3 of 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 and lasts for a preset time, the target sleep controller 11 can determine the third sleep state that the physical computing resource object needs to enter according to the sleep state transfer prediction information of the physical computing resource object maintained, and provide the third sleep state to the sleep control module 13, and 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 4 of 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.
- 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:
- Step Y1 obtaining the sleep state most recently exited by any physical computing resource object as the fourth sleep state.
- the sleep states most recently exited by the physical computing resource object are sleep state C1 and sleep state C2, respectively, and 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.
- 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.
- Step Y3 According to the probability information of entering each sleep state in the next sleep state when awakened from the fourth sleep state, the sleep state with the largest probability information is selected as the candidate sleep state.
- the target sleep controller 11 obtains the probability information of entering each sleep state in 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.
- Step Y4 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.
- the maximum tolerable exit delay time of the system can be a preset fixed value, a value dynamically configured by the system according to the system operation status, or a value customized by the user, which is not limited in this embodiment.
- 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.
- 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.
- Step U1 responding to a resource scheduling trigger event, generating sleep habit information corresponding to a plurality of physical computing resource objects according to sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects.
- the resource scheduling trigger event includes: time interruption, peripheral interruption, current application actively giving up running or higher priority application needing to run, etc.
- the target resource scheduler 12 may generate the sleep habit information corresponding to each of the plurality of physical computing resource objects based on the following steps U11-U12:
- the sleep controller menu can correct the next sleep time according to the number of threads in the I/O wait state and the correction factor.
- the sleep controller menu may use the second delay tolerance to correct the first delay tolerance, that is, select the minimum value from the second delay tolerance and the first delay tolerance as the corrected target tolerance.
- Step 53 Schedule the target task to be scheduled to the target physical computing resource object.
- 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.
- relatively increasing the probability information of any physical computing resource object entering the first sleep state again at the next sleep state when being awakened from the first sleep state includes: increasing the probability information of any physical computing resource object entering the first sleep state again at the next sleep state when being awakened from the first sleep state; and/or reducing the probability information of any physical computing resource object entering other sleep states at the next sleep state when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.
- relatively increasing the probability information of any physical computing resource object entering the second sleep state at the next 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 at the next 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 at the next sleep state 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 at the next sleep state when it is awakened from the first sleep state, and the other sleep states refer to sleep states other than the first sleep state and the second sleep state.
- the method also 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 an initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects.
- 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 a plurality of rows and a plurality of 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 when it sleeps next time, and the greater the weight, the higher the probability.
- data structures corresponding to multiple physical computing resource objects are initialized, including: 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.
- the method further includes: when it is monitored that any physical computing resource object needs to sleep, determining a third sleep state according to 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.
- the third sleep state is determined according to 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 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; according to 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, taking the candidate sleep state as the third sleep state.
- the method further includes: when the exit delay time of the candidate sleep state is greater than or equal to the system In the case where the maximum tolerable exit delay time of the system is greater than the maximum tolerable exit delay time of the system, another sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system is selected as the third sleep state.
- 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.
- 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.
- sleep habit information corresponding to each of the multiple physical computing resource objects is generated based on 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 that any physical computing resource object exits from any sleep state and re-enters 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 probability information that any physical computing resource object exits from any sleep state and re-enters the sleep state at the next sleep state.
- a target physical computing resource object is selected from a plurality of physical computing resource objects according to 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 according to 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 a target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.
- the at least one candidate physical computing resource object is selected according to the sleep state of the at least one candidate physical computing resource object in the shallow sleep state.
- the method comprises: selecting a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object in a shallow sleep state and in combination with other auxiliary information; wherein the other auxiliary information comprises at least one of the type of resource scheduling triggering event, the current operating state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.
- a target physical computing resource object is selected from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object in a shallow sleep habit in combination with other auxiliary information, including: based on the sleep probability of at least one candidate physical computing resource object in a shallow sleep habit and the current utilization rate, selecting a candidate physical computing resource object whose utilization rate meets the requirements and whose sleep probability is the highest as the target physical computing resource object.
- the following takes a multi-core CPU and the CPU cores it contains as an example, and describes in detail the implementation methods of the embodiments of the method shown in FIG. 5 in combination with FIG. 6a, FIG. 6b, FIG. 6c and FIG. 6d.
- Figure 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.
- the target sleep controller can be initialized and create a data structure for each CPU core (i.e., the physical computing resource object in the previous text) during initialization, such as an array 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 during the next sleep.
- 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 the next sleep when it is awakened from the sleep state represented by the row. The larger the weight, the higher the probability.
- 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.
- the target sleep controller can also monitor the status of each CPU core and update the data structure according to the status monitoring result.
- the update process will be described below in conjunction with FIG. 6 b.
- the target resource scheduler may start sleeping when the task queue in the physical computing resource object is empty.
- the target sleep controller can determine the actual sleep time according to the time of the last sleep state entry and the time of being awakened by the wake-up event.
- the wake-up event can be a timer arrival event or an interrupt event. After that, the target sleep controller can determine the sleep state that best matches the actual duration of the sleep state.
- the weight of the sleep state can be increased by 20 and the other weights can be reduced by 10; when the target sleep controller determines that the actual sleep time does not match the last predicted sleep state, the weight of the sleep state that best matches the actual duration of the sleep can be increased by 15 and the weight of the last predicted sleep state can be reduced by 15.
- the target sleep controller can more accurately select a sleep state from multiple sleep states based on the data structure. This will be further described below in conjunction with FIG. 6c.
- 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 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.
- the selection module 702 determines the third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object, it is specifically 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 transition prediction information corresponding to any physical computing resource object; select the probability information according to the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state
- the maximum sleep state is used as a 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.
- the selection module 702 is further used 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.
- the selection module 702 when the selection module 702 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.
- the selection module 702 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.
- the selection module 702 when the selection module 702 generates sleep habit information corresponding to multiple physical computing resource objects based on 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 from the sleep state transfer prediction information corresponding to any physical computing resource object; 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.
- the selection module 702 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 entering the sleep state again 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.
- the selection module 702 when the selection module 702 selects a target physical computing resource object from a plurality of physical computing resource objects according to the sleep habit information corresponding to each of the plurality of physical computing resource objects, the selection module 702 is specifically configured to: determine at least one candidate corresponding to a shallow sleep habit according to the sleep habit information corresponding to each of the plurality of physical computing resource objects; According to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit, select the candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object.
- resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects.
- the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for keeping some physical computing resource objects in a deep sleep state for as long as possible, keeping some physical computing resource objects in a busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.
- the processor 802 is coupled to the memory 801 and is used to execute the computer program in the memory 801, so as to: maintain sleep state transfer prediction information corresponding to each of the multiple 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 multiple sleep states when it is awakened from any of the multiple sleep states at the next sleep; select a target physical computing resource object according to the sleep state transfer 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.
- 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.
- the components in the dotted box in Figure 8 are optional components, not mandatory components, and 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.
- 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.
- an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, each step that can be executed by an electronic device in the method embodiment shown in FIG. 5 above can be implemented.
- an embodiment of the present disclosure also provides a multi-core processor system, including 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.
- resource scheduling of physical computing resource objects is combined with sleep control of physical computing resource objects.
- the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for keeping some physical computing resource objects in a deep sleep state for as long as possible, keeping some physical computing resource objects in a busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.
- the above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination of them, 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 storage, flash memory, disk or optical disk.
- SRAM static random-access memory
- EEPROM electrically erasable programmable read-only memory
- EPROM erasable programmable read-only memory
- PROM programmable read-only memory
- ROM read-only memory
- magnetic storage flash memory
- flash memory disk or optical disk.
- 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.
- the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel.
- the communication component also includes a near field communication (NFC) module to facilitate short-range communication.
- NFC near field communication
- the 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.
- RFID Radio Frequency Identification
- IrDA Infrared Data Association
- UWB Ultra Wide Band
- Bluetooth Bluetooth
- the above-mentioned display includes a screen, and the screen 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 a user.
- the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
- the power supply assembly provides power to various components of the device where 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 where the power supply assembly is located.
- the above-mentioned audio component can be configured to output and/or input audio signals.
- the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal.
- the received audio signal can be further stored in a memory or sent via a communication component.
- the audio component also includes a speaker for outputting an audio signal.
- 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 aspects. Moreover, 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 disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
- CD-ROM compact disc read-only memory
- optical storage etc.
- 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 work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, and the instruction device is implemented in one or more processes of the flowchart and/or one or more blocks of the block diagram. The function specified in the box.
- These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby 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.
- a computing device includes one or more processors (Central Processing Unit, CPU), input/output interfaces, network interfaces, and memory.
- processors Central Processing Unit, CPU
- input/output interfaces input/output interfaces
- network interfaces network interfaces
- memory volatile and non-volatile memory
- Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
- RAM random access memory
- ROM read-only memory
- flash RAM flash random access memory
- Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information.
- Information can be computer readable instructions, data structures, program modules or other data.
- Examples of computer storage media include, but are not limited to, Phase-change Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, 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.
- computer readable media does not include transitory media such as modulated data signals and carrier waves.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Power Sources (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
本公开要求于2023年12月26日提交中国专利局、申请号为202311817214.3、申请名称为“计算资源处理方法、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。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”, all contents of which are incorporated by reference in this disclosure.
本公开涉及云计算技术领域,尤其涉及一种计算资源处理方法、设备及存储介质。The present disclosure relates to the field of cloud computing technology, and in particular to a computing resource processing method, device and storage medium.
随着云计算技术的发展,越来越多的用户选择使用云服务器作为其基础设施。云服务器通常采用多核处理器(Central Processing Unit,CPU),例如4核处理器或8核处理器,为用户提供较高的计算性能。With the development of cloud computing technology, more and more users choose to use cloud servers as their infrastructure. Cloud servers usually use multi-core processors (Central Processing Unit, CPU), such as 4-core processors or 8-core processors, to provide users with higher computing performance.
为了在实现更高计算性能的同时降低设备功耗,高级配置和电源管理接口(Advanced Configuration and Power Management Interface,ACPI)规范定义了CPU休眠状态,CPU在空闲时进入休眠状态可节约功耗,并且有利于其它CPU以较高的频率工作。In order to achieve higher computing performance while reducing device power consumption, the Advanced Configuration and Power Management Interface (ACPI) specification defines CPU sleep states. When the CPU is idle, entering sleep state can save power consumption and help other CPUs work at a higher frequency.
但是,现有技术面临着CPU会频繁进出休眠状态的问题,由于进出休眠状态本身会消耗额外的功耗,如果频繁进出休眠状态不仅无法节约功耗,甚至导致其它CPU无法获得更高的频率。However, the prior art faces the problem that the CPU frequently enters and exits the sleep state. Since entering and exiting the sleep state itself consumes additional power consumption, frequent entry and exit of the sleep state not only fails to save power consumption, but may even cause other CPUs to be unable to obtain a higher frequency.
发明内容Summary of the invention
本公开的多个方面提供一种计算资源处理方法、设备及存储介质,用以降低物理计算资源对象进出休眠状态的频率。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 sleep state.
本公开实施例提供一种物理机,所述物理机的硬件资源上运行有操作系统,所述硬件资源包括多个物理计算资源对象,所述多个物理计算资源对象支持休眠深度不同的多个休眠状态,所述操作系统包括:目标资源调度器和目标休眠控制器;所述目标休眠控制器,用于维护所述多个物理计算资源对象各自对应的休眠状态转移预测信息,所述休眠状态转移预测信息中包括对应物理计算资源对象在从任一休眠状态被唤醒情况下在下一次休眠 时进入各个休眠状态的概率信息;所述目标资源调度器,用于根据所述多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象;将待调度的目标任务调度到所述目标物理计算资源对象上。The embodiment of the present disclosure provides a physical machine, wherein an operating system is running on hardware resources of the physical machine, wherein the hardware resources include multiple physical computing resource objects, and the multiple physical computing resource objects support multiple sleep states with different sleep depths, and the operating system includes: a target resource scheduler and a target sleep controller; the target sleep controller is used to maintain sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, and the sleep state transfer prediction information includes the sleep state transfer prediction information of the corresponding physical computing resource object when it is awakened from any sleep state in the next sleep state. The target resource scheduler is used to select a target physical computing resource object according to the sleep state transition prediction information corresponding to each of the multiple physical computing resource objects; and schedule the target task to be scheduled to the target physical computing resource object.
本公开实施例还提供一种计算资源处理方法,包括:维护多个物理计算资源对象各自对应的休眠状态转移预测信息,所述休眠状态转移预测信息中包括对应物理计算资源对象在从多个休眠状态中任一休眠状态被唤醒情况下在下一次休眠时进入所述多个休眠状态中各个休眠状态的概率信息;根据所述多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象;将待调度的目标任务调度到所述目标物理计算资源对象上。The disclosed embodiment also provides a computing resource processing method, including: 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 when awakened from any of the plurality of sleep states; selecting 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; and scheduling a target task to be scheduled to the target physical computing resource object.
本公开实施例还提供一种多核处理器系统,包括多个处理器核心和存储器,所述存储器用于存储操作系统的程序代码,所述多个处理器核心用于运行所述操作系统的程序代码,以用于实现所述计算资源处理方法中的步骤。The embodiment of the present disclosure also provides a multi-core processor system, including multiple processor cores and a memory, wherein the memory is used to store 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.
本公开实施例还提供一种存储有计算机程序的计算机可读存储介质,当所述计算机程序被处理器执行时,致使所述处理器能够实现所述计算资源处理方法中的步骤。The embodiment of the present disclosure also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is enabled to implement the steps in the computing resource processing method.
本公开实施例还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被处理器执行时实现所述计算资源处理方法中的步骤。The 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.
在本实施例中,将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,通过维护多个物理计算资源对象各自对应的休眠状态转移预测信息,根据所维护的休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率,进而降低对休眠状态进行预测的频率,减少预测出错引起的问题。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 can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for 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, and thereby reducing the frequency of predicting sleep states, thereby reducing problems caused by prediction errors.
此处所说明的附图用来提供对本公开的进一步理解,构成本公开的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation on the present disclosure. In the drawings:
图1a为本公开一示例性实施例提供的休眠状态转换的示意图;FIG. 1a is a schematic diagram of a sleep state transition provided by an exemplary embodiment of the present disclosure;
图1b为本公开一示例性实施例提供的休眠功耗的示意图;FIG1b is a schematic diagram of sleep power consumption provided by an exemplary embodiment of the present disclosure;
图2为本公开另一示例性实施例提供的物理机的软件-硬件架构图; FIG2 is a software-hardware architecture diagram of a physical machine provided by another exemplary embodiment of the present disclosure;
图3为本公开又一示例性实施例提供的控制物理计算资源对象进入第三休眠状态的流程示意图;FIG3 is a schematic diagram of a flow chart of controlling a physical computing resource object to enter a third dormant state provided by another exemplary embodiment of the present disclosure;
图4为本公开又一示例性实施例提供的menu休眠控制器的控制逻辑的示意图;FIG4 is a schematic diagram of the control logic of a menu sleep controller provided by yet another exemplary embodiment of the present disclosure;
图5为本公开又一示例性实施例提供的计算资源处理方法的流程示意图;FIG5 is a schematic diagram of a flow chart of a computing resource processing method provided by another exemplary embodiment of the present disclosure;
图6a为本公开又一示例性实施例提供的计算资源处理方法在实际应用场景中的部署实施的示意图;FIG6a 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;
图6b为本公开又一示例性实施例提供的对数据结构体进行更新的流程示意图;FIG6b is a schematic diagram of a process of updating a data structure provided by another exemplary embodiment of the present disclosure;
图6c为本公开又一示例性实施例提供的休眠状态选择的流程示意图;FIG6c is a schematic diagram of a process of selecting a sleep state provided by another exemplary embodiment of the present disclosure;
图6d为本公开又一示例性实施例提供的目标资源调度器进行调度的流程示意图;FIG6d is a schematic diagram of a process of scheduling by a target resource scheduler provided by another exemplary embodiment of the present disclosure;
图7为本公开又一示例性实施例提供的计算资源处理装置的示意图;FIG7 is a schematic diagram of a computing resource processing device provided by another exemplary embodiment of the present disclosure;
图8为本公开又一示例性实施例提供的电子设备的示意图。FIG. 8 is a schematic diagram of an electronic device provided by yet another exemplary embodiment of the present disclosure.
为使本公开的目的、技术方案和优点更加清楚,下面将结合本公开具体实施例及相应的附图对本公开技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the technical solutions of the present disclosure will be clearly and completely described below in combination 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 in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.
需要说明的是,本公开所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。另外,本公开涉及的各种模型(包括但不限于语言模型或大模型)是符合相关法律和标准规定的。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.
以多核处理器场景为例,ACPI规范中可定义多核处理器中的每个CPU核心可处于的电源状态,比如电源状态C0、电源状态C1、电源状态C2……电源状态Cn。其中,电源状态C0是CPU核心执行指令的有效功率状态,电源状态C1-电源状态Cn是CPU核心的休眠状态,休眠状态是一种低负荷的电源状态。在多核处理器场景中,在不需要CPU核心执行任务时,可通过CPU固件提供的API(Application Programming Interface,应用程序编程接口)控制CPU核心进行任何一种休眠状态,与CPU核心处于C0状态相比,这样可降低多核处理器整体的功耗,即可消耗更少的电源和散发更少的热量。其中,从休眠状态 C1-休眠状态Cn,在保持相同休眠时间的情况下,每个休眠状态节省的功耗依次增长。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, power state C1-power state Cn are the sleep states of the CPU core, and 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 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 the sleep state C1-sleep state Cn, under the condition of maintaining the same sleep time, the power consumption saved in each sleep state increases successively.
如图1a的休眠状态转换示意图所示,当CPU核心处于电源状态C0时,ACPI可通过定义的节流逻辑以及ACPI定义的休眠状态转换逻辑来改变多核处理器的整体性能,比如,多核处理器可启动节流逻辑,从而利用休眠状态转换逻辑来发出进入C1命令,从而使得CPU核心从电源状态C0进入休眠状态C1,当该CPU核心接收到休眠中断指令时可退出该休眠状态C1回到电源状态C0。另外,进入/退出休眠状态C2和C3的方式和上述进入/退出休眠状态C1的方式相同,此处不再赘述。As shown in the sleep state transition diagram of FIG1a, when the CPU core is in power state C0, ACPI can change the overall performance of the multi-core processor through the defined throttling logic and the sleep state transition logic defined by ACPI. For example, the multi-core processor can start the throttling logic, thereby using the sleep state transition logic to issue an entry C1 command, so that the CPU core enters the sleep state C1 from the power state C0, and when the CPU core receives the sleep interrupt instruction, it can exit the sleep state C1 and return to the power state C0. In addition, the method of entering/exiting the sleep state C2 and C3 is the same as the method of entering/exiting the sleep state C1 described above, and will not be repeated here.
需要说明的是,从休眠状态C1-休眠状态Cn,每个休眠状态节省的功耗依次增长,也可理解为从休眠状态C1-休眠状态Cn是休眠状态由“浅”入“深”的过程,当部分CPU核心进入更深的休眠状态时,其他CPU核心可获得更高的运行频率。如表1所示,此处以某款多核处理器为例,该处理器共有48个CPU核心,假设休眠状态C6是该款多核处理器支持的最深休眠状态,下面表1给出了未处于休眠状态C6的CPU核心的数量与其他CPU核心可以获得的运行频率之间的对应关系,由表1可知未处于休眠状态C6的CPU核心的数量越少,意味着处于休眠状态C6的CPU核心的数量越多,其他核心可获得的运行频率也就越高。It should be noted that, from sleep state C1 to sleep state Cn, the power consumption saved in each sleep state increases in sequence, which can also be understood as the process from sleep state C1 to sleep state Cn is the process of sleep state from "shallow" to "deep". When some CPU cores enter a deeper sleep state, other CPU cores can obtain a higher operating frequency. As shown in Table 1, here a multi-core processor is taken as an example. The processor has a total of 48 CPU cores. Assuming that sleep state C6 is the deepest sleep state supported by the multi-core processor, the following Table 1 shows the corresponding relationship between the number of CPU cores that are not in sleep state C6 and the operating frequency that other CPU cores can obtain. It can be seen from Table 1 that the fewer the number of CPU cores that are not in sleep state C6, the more the number of CPU cores in sleep state C6, and the higher the operating frequency that other cores can obtain.
表1
Table 1
由上述可知,CPU核心在空闲状态下进入休眠状态可以节约功耗,当再次被调度时,可以被唤醒并退出休眠状态。如图1b所示,CPU核心进入或退出某个休眠状态时是会消 耗功耗和需要时间的。其中,退出休眠状态需要的时间可称为退出延迟时间。另外,随着休眠状态深度的增加,进入或退出休眠状态消耗的功耗和时间会逐渐增大。由此可见,如果不能为CPU核心选择合适的休眠状态,会导致CPU核心频繁进出休眠状态,进入和退出休眠状态本身会消耗额外的功耗,导致其他CPU核心不能获得更高的频率,不仅不会带来功耗的节约,反而会造成功耗资源的浪费和响应延迟。例如,在一些情况下,如果CPU核心的实际休眠时间比预期休眠时间短,在根据预期休眠时间为CPU核心错误地选择了更深的休眠状态,由于CPU核心在该休眠状态下实际休眠时间较短,休眠所节约的功耗要小于进入和退出该休眠状态消耗的功耗,这不仅浪费CPU功耗且会存在更长的响应延时。又例如,在另一些情况下,CPU核心的实际休眠时间比预期休眠时间长,在根据预期休眠时间为CPU核心错误地选择了较浅的休眠状态,这会导致CPU核心过早地从休眠状态醒来,浪费CPU功耗,另外由于CPU核心未能进入更深的休眠状态还会导致其他核心不能获得更高的频率。From the above, it can be seen that the CPU core can save power by entering the sleep state when it is idle. When it is scheduled again, it can be awakened and exit the sleep state. As shown in Figure 1b, when the CPU core enters or exits a sleep state, it will consume power. The power consumption and time required. Among them, the time required to exit the sleep state can be called the exit delay time. In addition, as the depth of the sleep state increases, the power consumption and time consumed to enter or exit the sleep state will gradually increase. It can be seen that if the appropriate sleep state cannot be selected for the CPU core, the CPU core will frequently enter and exit the sleep state. Entering and exiting the sleep state itself will consume additional power consumption, resulting in other CPU cores being unable to obtain a higher frequency. Not only will it not bring power consumption savings, but it will also cause a waste of power consumption resources and response delays. For example, in some cases, if the actual sleep time of the CPU core is shorter than the expected sleep time, a deeper sleep state is mistakenly selected for the CPU core based on the expected sleep time. Since the actual sleep time of the CPU core in this sleep state is shorter, the power consumption saved by sleep is less than the power consumption consumed by entering and exiting the sleep state, which not only wastes CPU power consumption but also causes a longer response delay. For example, in other cases, the actual sleep time of the CPU core is longer than the expected sleep time, and 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.
在本公开实施例中,以上述多核处理器的相关内容为基础,将休眠状态这一概念引入到各种物理计算资源对象中。物理计算资源对象可包括CPU、DPU(Data Processing Unit,数据处理器)或TPU(Tensor Processing Unit,张量处理器)等各种其它类似CPU的物理计算资源对象。在将休眠状态引入各种物理计算资源对象的情况下,在多个物理计算资源对象协同作用的场景中,同样会面临频繁进出休眠状态导致功耗浪费、响应延迟以及其它CPU无法获得更高的运行频率等技术问题。In the disclosed embodiment, based on the relevant contents 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 sleep state into various physical computing resource objects, in the scenario where multiple physical computing resource objects work together, technical problems such as frequent entry and exit of sleep state leading to power consumption waste, response delay and other CPUs being unable to obtain higher operating frequencies will also be faced.
针对上述问题,在本公开实施例中,提出将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,通过维护多个物理计算资源对象各自对应的休眠状态转移预测信息,根据所维护的休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率,充分发挥休眠状态的优势,节约功耗,让其它未处于深度休眠状态的物理计算资源对象尽量获得更高的运行频率;另外,由于物理计算资源对象进出休眠状态的频率降低了,意味着对休眠状态进行预测的频率也就降低了,有利于减少预测出错引起的问题,解决上述技术问题。In view of the above problems, in the embodiments 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 each of a plurality of 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, which is beneficial for 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 predicting sleep states is also reduced, which is beneficial for reducing problems caused by prediction errors and solving the above technical problems.
以下将结合附图,详细说明本公开各实施例提供的技术方案。The technical solutions provided by various embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
图2为本公开一示例性实施例提供的物理机的软件-硬件架构图,如图2所示,物理机包含应用层21、内核层(即操作系统)22以及硬件资源层23。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 .
其中,硬件资源层23包括物理机的各种硬件资源。物理机的硬件资源包括多个物理计 算资源对象,多个物理计算资源对象之间协同作业,多个物理计算资源对象可集成在一个芯片上但并不限于此。以物理计算资源对象是CPU为例,多个物理计算资源对象可以实现为多核CPU。除此之外,物理机的硬件资源还包括存储器、通信组件、显示器、电源组件、音频组件以及各种外部设备等,在图2中未作图示。另外,图2中仅对物理计算资源对象进行示意,并未对物理计算资源对象的数量进行限定。The hardware resource layer 23 includes various hardware resources of the physical machine. The hardware resources of the physical machine include multiple physical computers. A physical computing resource object, multiple physical computing resource objects work together, and multiple physical computing resource objects can be integrated on one chip but are not limited to this. Taking the physical computing resource object as a CPU as an example, multiple physical computing resource objects can be implemented as a multi-core CPU. In addition, the hardware resources of the physical machine also include memory, communication components, display, power components, audio components, and various external devices, which are not shown in Figure 2. In addition, Figure 2 only illustrates the physical computing resource objects, and does not limit the number of physical computing resource objects.
在本实施例中,对多个物理计算资源对象来说,支持休眠深度不同的多个休眠状态。根据物理计算资源对象的类型和厂商的不同,物理计算资源对象所支持的休眠状态的数量会有所不同,另外,进出各个休眠状态消耗的功耗和时间也会有所不同。比如,对一些厂商提供的物理计算资源对象可支持休眠状态C1、休眠状态C2和休眠状态C3,对另一些厂商提供的物理计算资源对象可支持休眠状态C1、休眠状态C2、休眠状态C3、休眠状态C4、休眠状态C5和休眠状态C6,对此不做限定。无论是哪种类型的物理计算资源对象,无论是哪个厂商提供的物理计算资源对象,对于物理计算资源对象所支持的多个休眠状态,不同休眠状态的休眠深度会有所不同。可选地,为了便于描述,可以利用C后面数字的来表示休眠状态的休眠深度,随着C后面的数字的增大,休眠状态的休眠深度依次递增,相应地,进出这些休眠状态消耗的功耗和时间也会依次增大。In this embodiment, for multiple physical computing resource objects, multiple sleep states with different sleep depths are supported. Depending on the type of physical computing resource object and the manufacturer, the number of sleep states supported by the physical computing resource object will be different. In addition, the power consumption and time consumed in entering and exiting each sleep state will also be different. For example, the physical computing resource objects provided by some manufacturers can support sleep state C1, sleep state C2 and sleep state C3, and the physical computing resource objects provided by other manufacturers can support sleep state C1, sleep state C2, sleep state C3, sleep state C4, sleep state C5 and sleep state C6, which are not limited to this. Regardless of the type of physical computing resource object, regardless of which manufacturer provides the physical computing resource object, for the multiple sleep states supported by the physical computing resource object, the sleep depth of different sleep states will be different. Optionally, for the convenience of description, the number after C can be used to represent the sleep depth of the sleep state. As the number after C increases, the sleep depth of the sleep state increases successively, and accordingly, the power consumption and time consumed in entering and exiting these sleep states will also increase successively.
在本实施例中,在物理机的硬件资源上运行有操作系统,即内核层22,操作系统之上是应用层21,应用层21包括运行在物理机上的各种应用程序。根据物理机的应用场景和实现形态的不同,应用程序在实现上也会略有区别。以物理机实现为手机、电脑等终端设备为例,运行于物理机上的应用程序可以是电商购物类应用、各种视频类应用、邮箱类应用、即时通讯类应用、各种办公类应用等。以物理机实现为常规服务器、云服务器、服务器集群等服务器设备为例,运行于物理机上的应用程序可以是各种数据库或数据仓库、流式计算类应用、日志处理类应用、分布式计算、各种虚拟机或容器等。In this embodiment, an operating system, i.e., a kernel layer 22, runs on the hardware resources of the physical machine, and above the operating system is an 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 application program may also be slightly different in implementation. Taking the physical machine as a mobile phone, computer and other terminal devices as an example, the application program running on the physical machine may be an e-commerce shopping application, various video applications, mailbox applications, instant messaging applications, various office applications, etc. Taking the physical machine as a conventional server, cloud server, server cluster and other server devices as an example, the application program running on the physical machine may be various databases or data warehouses, streaming computing applications, log processing applications, distributed computing, various virtual machines or containers, etc.
相对应用程序而言,操作系统是一组主管并控制物理机的各种操作、运用和运行硬件、软件资源和提供公共服务来组织用户交互的相互关联的系统软件程序。在本公开实施例中,操作系统作为应用程序与硬件资源之间的桥梁,操作系统中包括各种硬件资源的驱动程序,用于驱动各种硬件资源。除此之外,本实施例的操作系统还包括:用于对物理计算资源对象进行休眠控制的休眠控制器,以及用于对物理计算资源对象进行调度的资源调度器。在本实施例中,为了让物理计算资源对象能够合理地进出休眠状态,提供了一种新的休眠控制器和新的资源调度器,为了便于描述和区分,将本公开实施例提供的新的休眠控制器和新的资源调度器分别称为目标休眠控制器11和目标资源调度器12。在此说明,操作系统中可以仅包含目标休眠控制器11和目标资源调度器12,也可以包含其它休眠控制器和其 他资源调度器,具体可视应用需求和应用场景而定,对此不做限定。接下来,将重点介绍目标休眠控制器11和目标资源调度器12相互配合对物理计算资源对象进行休眠控制和资源调度的过程。Relative to the application program, the operating system is a group of interrelated system software programs that are responsible for and control various operations of the physical machine, use and run hardware and software resources, and provide public services to organize user interactions. In the embodiment of the present disclosure, the operating system acts as a bridge between the application program and the hardware resources. The operating system includes various hardware resource drivers for driving various hardware resources. In addition, the operating system of the present embodiment also includes: a sleep controller for controlling the sleep state of physical computing resource objects, and a resource scheduler for scheduling physical computing resource objects. In the present embodiment, in order to allow the physical computing resource objects to reasonably enter and exit the sleep state, a new sleep controller and a new resource scheduler are provided. For the sake of ease of description and distinction, the new sleep controller and the new resource scheduler provided in the embodiment of the present disclosure are respectively referred to as the target sleep controller 11 and the target resource scheduler 12. It is explained here that the operating system may only include the target sleep controller 11 and the target resource scheduler 12, or may include other sleep controllers and their respective resource schedulers. The specific resource scheduler may be determined according to application requirements and application scenarios, and is not limited thereto. Next, the process of the target sleep controller 11 and the target resource scheduler 12 cooperating with each other to perform sleep control and resource scheduling on the physical computing resource objects will be described in detail.
在本实施例中,目标休眠控制器11可维护多个物理计算资源对象各自对应的休眠状态转移预测信息,其中,任一个物理计算资源对象对应的休眠状态转移预测信息用于预测该物理计算资源对象在不同休眠状态中的状态转移情况。休眠状态转移预测信息中可包括对应物理计算资源对象在从任一休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息。其中,概率信息可以实现为概率值,也可以实现为权重,对此不做限定。举例说明,假设物理计算资源对象可支持休眠状态C0、休眠状态C1和休眠状态C2,该物理计算资源对象对应的休眠状态转移预测信息可包括:该物理计算资源对象在从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C0的概率如70%、进入休眠状态C1的概率如15%和进入休眠状态C2的概率如15%,该物理计算资源对象在从休眠状态C1被唤醒情况下在下一次休眠时进入休眠状态C0的概率如30%、进入休眠状态C1的概率如40%和进入休眠状态C2的概率如20%,该物理计算资源对象在从休眠状态C2被唤醒情况下在下一次休眠时进入休眠状态C0的概率如50%、进入休眠状态C1的概率如15%和进入休眠状态C2的概率如30%。In this embodiment, the target sleep controller 11 can maintain sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, wherein the sleep state transition prediction information corresponding to any physical computing resource object is used to predict the state transition of the physical computing resource object in different sleep states. The sleep state transition prediction information may include probability information of the corresponding physical computing resource object entering each sleep state when it is awakened from any sleep state at the next sleep. The probability information can be implemented as a probability value or as a weight, which is not limited. For example, assuming that a physical computing resource object can support sleep state C0, sleep state C1 and sleep state C2, the sleep state transfer 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 at the next sleep is 70%, the probability of entering sleep state C1 is 15%, and the probability of entering sleep state C2 is 15%; when the physical computing resource object is awakened from sleep state C1, the probability of entering sleep state C0 at the next sleep is 30%, the probability of entering sleep state C1 is 40%, and the probability of entering sleep state C2 is 20%; when the physical computing resource object is awakened from sleep state C2, the probability of entering sleep state C0 at the next sleep is 50%, the probability of entering sleep state C1 is 15%, and the probability of entering sleep state C2 is 30%.
在本实施例中,目标休眠控制器11可以将其所维护的多个物理计算资源对象各自对应的休眠状态转移预测信息透露给目标资源调度器12。可选地,目标休眠控制器11可以主动将其所维护的多个物理计算资源对象各自对应的休眠状态转移预测信息提供给目标资源调度器12,或者,目标资源调度器12也可以主动向目标休眠控制器11请求,目标休眠控制器11根据该请求将其所维护的多个物理计算资源对象各自对应的休眠状态转移预测信息提供给目标资源调度器12。对目标资源调度器12来说,在进行任务调度时,可根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象,并将待调度的目标任务调度到目标物理计算资源对象上。比如,目标资源调度器12可根据多个物理计算资源对象各自对应的休眠状态转移预测信息,从物理计算资源对象D1、物理计算资源对象D2、物理计算资源对象D3和物理计算资源对象D4中选择物理计算资源对象D1作为目标物理计算资源对象,并将目标任务调度到该目标物理计算资源对象上。In this embodiment, the target sleep controller 11 can disclose the sleep state transfer 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 actively provide the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects it maintains to the target resource scheduler 12, or the target resource scheduler 12 can also actively request the target sleep controller 11, and the target sleep controller 11 provides the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects it maintains to the target resource scheduler 12 according to the request. For the target resource scheduler 12, when performing task scheduling, it can select the target physical computing resource object according to the sleep state transfer 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 may 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 according to 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.
在本公开实施例中,目标资源调度器12根据多个物理计算资源对象各自对应的休眠状态转移预测信息进行资源调度的过程,以优先调度未处于休眠状态、处于较浅休眠状态或者进入较浅休眠状态概率较高的物理计算资源对象为调度原则,通过这种方式,可将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,根据所维护的 休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间或有较多机会处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,从而降低物理计算资源对象进出休眠状态的频率,达到节约功耗,并让其它物理计算资源对象尽量获得较高运行频率。In the embodiment of the present disclosure, the target resource scheduler 12 performs resource scheduling according to the sleep state transition 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, in a shallow sleep state, or have a high 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 sleep state transition prediction information is used to schedule physical computing resource objects, 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 beneficial for some physical computing resource objects to be in deep sleep states for as long as possible or have more opportunities 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, thereby saving power consumption and allowing other physical computing resource objects to obtain a higher operating frequency as much as possible.
在一些可选的实施例中,随着物理计算资源对象的运行状态的变化,例如从休眠状态进入工作状态,或者从工作状态进入某个休眠状态,各个物理计算资源对象的休眠状态转移预测信息会发生变化,因此还可以对物理计算资源对象的休眠状态转移预测信息进行更新,从而得到更为准确的休眠状态转移预测信息,以便后续基于该休眠状态转移预测信息进行更为准确地资源调度。其中,对休眠状态转移预测信息的更新操作可由目标休眠控制器11在维护过程中执行。In some optional embodiments, as the running state of the physical computing resource object changes, such as from a sleep state to a working state, or from a working state to a sleep state, the sleep state transition prediction information of each physical computing resource object will change, so the sleep state transition prediction information of the physical computing resource object can also be updated to obtain more accurate sleep state transition prediction information, so as to perform more accurate resource scheduling based on the sleep state transition prediction information in the future. The update operation of the sleep state transition prediction information can be performed by the target sleep controller 11 during the maintenance process.
具体地,目标休眠控制器11在维护多个物理计算资源对象各自对应的休眠状态转移预测信息时,可监测多个物理计算资源对象的运行状态,这里的运行状态可包括:工作状态和休眠状态,休眠状态可包括不同休眠深度的多个休眠状态;在监测到任一物理计算资源对象从第一休眠状态被唤醒时,可获取该物理计算资源对象在第一休眠状态下的实际休眠时间,其中,第一休眠状态可为任一休眠状态,也就是说,目标休眠控制器11在监测到任一物理计算资源对象从任一休眠状态被唤醒时可获取该物理计算资源对象在该任一休眠状态下的实际休眠时间;进而,根据物理计算资源对象在第一休眠状态下的实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息。Specifically, when maintaining sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, the target sleep controller 11 can monitor the operating state of the multiple physical computing resource objects, where the operating state may include: working state and sleep state, and the sleep state may include multiple sleep states with different sleep depths; when monitoring that any physical computing resource object is 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 that any physical computing resource object is 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; further, according to the actual sleep time of the physical computing resource object in the first sleep state and the exit delay time of the first sleep state, the sleep state transfer prediction information corresponding to any physical computing resource object is updated.
其中,获取物理计算资源对象在第一休眠状态下的实际休眠时间可通过以下步骤R1-步骤R2:The actual sleep time of the physical computing resource object in the first sleep state may be obtained by following steps R1-R2:
步骤R1、目标休眠控制器11可获取该物理计算资源对象进入该第一休眠状态的第一时间,以及被唤醒事件从第一休眠状态唤醒的第二时间。其中,唤醒事件可为定时器到达事件或中断事件等。中断事件是指当物理计算资源对象执行正常程序时,系统中出现某些急需处理的异常情况或特殊请求,物理计算资源对象暂时中止正在运行的任务而转去对随机发生的更为紧迫的任务进行处理。In step R1, the target sleep controller 11 can obtain the first time when the physical computing resource object enters the first sleep state, and the second time when the physical computing resource object is awakened from the first sleep state by the awakening event. The awakening event can be a timer arrival event or an interrupt event, etc. An interrupt event means that when the physical computing resource object executes a normal program, some abnormal conditions or special requests that need to be processed urgently appear in the system, and the physical computing resource object temporarily suspends the running task and turns to process the more urgent tasks that occur randomly.
步骤R2、根据第二时间和第一时间,计算任一物理计算资源对象在第一休眠状态下的实际休眠时间。本公开实施例并不限定根据第二时间和第一时间计算任一物理计算资源对象在第一休眠状态下的实际休眠时间的实施方式。可选地,目标休眠控制器11可计算第二时间和第一时间的差值作为任一物理计算资源对象在第一休眠状态下的实际休眠时间;或 者,目标休眠控制器11还可利用预设的差值修正规则对第二时间和第一时间的差值进行修正,并将修正后的差值作为任一物理计算资源对象在第一休眠状态下的实际休眠时间;或者,目标休眠控制器11也可根据第二时间和第一时间各自的预设权重对第二时间和第一时间进行加权求和,得到任一物理计算资源对象在第一休眠状态下的实际休眠时间。Step R2: Calculate the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time. The disclosed embodiment does not limit the implementation method of calculating the actual sleep time of any physical computing resource object in the first sleep state according to the second time and the first time. Optionally, the target sleep controller 11 may calculate the difference between the second time and the first time as the actual sleep time of any physical computing resource object in the first sleep state; or Alternatively, the target sleep controller 11 may also utilize 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; alternatively, the target sleep controller 11 may 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.
在获取任一物理计算资源对象在第一休眠状态下的实际休眠时间后,目标休眠控制器11可根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息。具体地,根据任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间之间的匹配情况的不同,更新任一物理计算资源对象对应的休眠状态转移预测信息的方式也会有所不同。在本公开实施例中,并不限定定义任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间之间是否相匹配的方式,具体可以根据应用需求灵活定义。其中,目标休眠控制器11可通过以下任一种方式判断任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间是否匹配。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 according to 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.
方式1、目标休眠控制器11可判断任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间是否相同,若相同,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配,若不相同,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配。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.
方式2、目标休眠控制器11还可计算任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间之间的误差,若该误差在预设的误差范围内,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配,若该误差不在预设的误差范围内,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配。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.
方式3、目标休眠控制器11可判断任一物理计算资源对象在第一休眠状态下的实际休眠时间是否在第一休眠状态的退出延迟时间的一定倍数范围内,若为是,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配,若为否,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配。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.
方式4、目标休眠控制器11还可判断任一物理计算资源对象在第一休眠状态下的实际休眠时间是否大于第一休眠状态的退出延迟时间;若是,进一步判断任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间的差值是否大于设 定差值阈值;若是,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配,若上述任一判断操作为否,则任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配。Method 4: The target sleep controller 11 may 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 the set A difference threshold is determined; 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.
无论如何定义任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间之间是否相匹配,均可以分为两种情况:一种是任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况,另一种是任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况,以下将分情况进行介绍。No matter how to define whether the actual sleep time of any physical computing resource object in the first sleep state matches the exit delay time of the first sleep state, it can be divided into two situations: one is the situation 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, and the other is the situation 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.
情况1、在任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况下,说明对任一物理计算资源对象来说第一休眠状态是相对较佳的休眠状态,因此可以相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息,以便于在下一次需要休眠时能够以较高概率再次进入第一休眠状态。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.
进一步可选地,目标休眠控制器11相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息的实现方式包括:可单独增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;或者,可单独减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态之外的休眠状态;或者,也可以在增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息的同时,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息。Further optionally, the target sleep controller 11 relatively increases the probability information of any physical computing resource object re-entering the first sleep state at the next sleep when it is awakened from the first sleep state, including: the probability information of any physical computing resource object re-entering the first sleep state 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 state refers to the sleep state other than the first sleep state; or, while increasing the probability information of any physical computing resource object re-entering the first sleep state 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.
比如,假设任一物理计算资源对象从休眠状态C0(休眠状态C0为第一休眠状态的示例)被唤醒,则在更新任一物理计算资源对象对应的休眠状态转移预测信息之前,任一物理计算资源对象从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C0的概率70%、进入休眠状态C1概率15%以及进入休眠状态C2概率15%,则在任一物理计算资源对象在休眠状态C0下的实际休眠时间与休眠状态C0的退出延迟时间相匹配的情况下,目标休眠控制器11对休眠状态转移预测信息进行更新时,可以单独将从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C0的概率从70%增大至80%,或者也可以单独将休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C1和休眠状态C2的概率从15%减小至10%,或者,将从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C0的概率从70%增大至80%,并将进入休眠状态C1和休眠状态C2的概率从15%减小至10%。在此 说明,在前文示例中,对进入休眠状态C1和休眠状态C2的两个概率减小的幅度相同为例,也可以不相同,例如将进入休眠状态C1的概率减小10%,将进入休眠状态C2的概率减小5%。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 C2 is 15%. When the controller 11 updates the sleep state transition prediction information, the probability of entering the sleep state C0 in the next sleep state when awakened from the sleep state C0 can be increased from 70% to 80%, or the probability of entering the sleep state C1 and the sleep state C2 in the next sleep state when awakened from the sleep state C0 can be reduced from 15% to 10%, or the probability of entering the sleep state C0 in the next sleep state when awakened from the sleep state C0 can be increased from 70% to 80%, and the probability of entering the sleep state C1 and the sleep state C2 can be reduced from 15% to 10%. In this Note that in the above example, the reduction ranges of the two probabilities of entering the sleep state C1 and the sleep state C2 are the same, but they can also be different, for example, the probability of entering the sleep state C1 is reduced by 10%, and the probability of entering the sleep state C2 is reduced by 5%.
情况2、在任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,说明对任一物理计算资源对象来说第一休眠状态并不是相对较佳的休眠状态,因此可以确定退出延迟时间与实际休眠时间相匹配的休眠状态并将其记为第二休眠状态,对任一物理计算资源对象来说第二休眠状态是相对较佳的休眠状态,因此相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,以便于在下一次需要休眠时能够以较高概率进入第二休眠状态。其中,第二休眠状态是退出延迟时间与实际休眠时间相匹配的休眠状态,也就是说,目标休眠控制器11可在实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,将相对增加退出延迟时间与实际休眠时间相匹配的休眠状态所对应的概率信息,从而对休眠状态转移预测信息进行较为准确的更新。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 means 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 the second sleep state. The second sleep state is a relatively optimal sleep state for any physical computing resource object. Therefore, the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state is relatively increased, so that it can enter the second sleep state with a higher probability when it needs to sleep next time. Among them, the second sleep state is a sleep state whose exit delay time matches the actual sleep time. That is to say, when the actual sleep time does not match the exit delay time of the first sleep state, the target sleep controller 11 can relatively increase the probability information corresponding to the sleep state whose exit delay time matches the actual sleep time, thereby updating the sleep state transition prediction information more accurately.
具体地,目标休眠控制器11在情况2下可基于以下几种实施方式相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息:Specifically, in case 2, the target sleep controller 11 can relatively increase the probability information of any physical computing resource object entering the second sleep state when it is awakened from the first sleep state in the next sleep state based on the following implementation methods:
实施方式一、单独增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息。举例说明,假设任一物理计算资源对象从休眠状态C0(休眠状态C0为第一休眠状态的示例)被唤醒,则在更新任一物理计算资源对象对应的休眠状态转移预测信息之前,任一物理计算资源对象从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C0的概率70%、进入休眠状态C1概率15%(第二休眠状态)以及进入休眠状态C2概率15%,则在任一物理计算资源对象在休眠状态C0下的实际休眠时间与休眠状态C0的退出延迟时间不匹配的情况下,目标休眠控制器11可将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C1的概率从15%增大至70%。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 (first sleep state), the probability of entering sleep state C0 in the next sleep state is 70%, the probability of entering sleep state C1 is 15% (second sleep state), and the probability of entering sleep state C2 is 15%, then 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 (first sleep state) from 15% to 70%.
实施方式二、增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,并减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,这里的其它休眠状态是指除第二休眠状态之外的休眠状态(包括第一休眠状态在内)。沿用前述例子进行举例,在任一物理计算资源对象在休眠状态C0下的实际休眠时间与休眠状态C0的退出延迟时间不匹配的情况下,将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C1 的概率从15%增大至70%,并将进入休眠状态C0和C2的概率相应减小。例如,可以将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C0的概率从70%减小至20%,将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C2的概率从15%减小至10%。Implementation method 2: increase the probability information of any physical computing resource object entering the second sleep state at the next sleep state when it is awakened from the first sleep state, and reduce the probability information of any physical computing resource object entering other sleep states at the next sleep state when it is awakened from the first sleep state, where 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, it will enter sleep state C1 at the next sleep state when it is awakened from sleep state C0 (first sleep state). The probability of entering the sleep state C0 and C2 is increased from 15% to 70%, and the probability of entering the sleep state C0 and C2 is reduced accordingly. For example, the probability of entering the sleep state C0 in the next sleep state when awakened from the sleep state C0 (the first sleep state) can be reduced from 70% to 20%, and the probability of entering the sleep state C2 in the next sleep state when awakened from the sleep state C0 (the first sleep state) can be reduced from 15% to 10%.
实施方式三、单独减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第一休眠状态的概率信息。沿用前述例子进行举例,在任一物理计算资源对象在休眠状态C0下的实际休眠时间与休眠状态C0的退出延迟时间不匹配的情况下,目标休眠控制器11可将任一物理计算资源对象从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C0的概率从70%减小至15%。Implementation method 3: separately reducing the probability information of any physical computing resource object entering the first sleep state in the next sleep state when it is awakened from the first sleep state. Using the above example, when the actual sleep time of any physical computing resource object in sleep state C0 does not match the exit delay time of sleep state C0, the target sleep controller 11 can reduce the probability of any physical computing resource object entering sleep state C0 in the next sleep state when it is awakened from sleep state C0 from 70% to 15%.
实施方式四、减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第一休眠状态的概率信息,并增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,这里的其它休眠状态是指除第一休眠状态之外的休眠状态(包括第二休眠状态在内)。沿用前述例子进行举例,在任一物理计算资源对象在休眠状态C0下的实际休眠时间与休眠状态C0的退出延迟时间不匹配的情况下,将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C0的概率从70%减小至20%,并将进入休眠状态C1和C2的概率相应增大。例如,可以将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C1的概率从15%增大至60%,将从休眠状态C0(第一休眠状态)被唤醒情况下在下一次休眠时进入休眠状态C2的概率从15%增大至20%。Implementation method 4: reduce the probability information of any physical computing resource object entering the first sleep state in the next 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 in the next sleep state when it is awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state (including the second sleep state). Using the above example, when the actual sleep time of any physical computing resource object in sleep state C0 does not match the exit delay time of sleep state C0, the probability of entering sleep state C0 in the next sleep state when it is awakened from sleep state C0 (first sleep state) is reduced from 70% to 20%, and the probability of entering sleep states C1 and C2 is increased accordingly. For example, the probability of entering sleep state C1 in the next sleep state 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 in the next sleep state when it is awakened from sleep state C0 (first sleep state) is increased from 15% to 20%.
实施方式五、单独减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,这里的其它休眠状态是指除第一休眠状态和第二休眠状态之外的休眠状态。沿用前述例子进行举例,目标休眠控制器11可将任一物理计算资源对象从休眠状态C0被唤醒情况下在下一次休眠时进入休眠状态C2的概率从15%降低至5%。Implementation method 5: separately reducing the probability information of any physical computing resource object entering other sleep states in the next sleep state when it is 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. Using the above example, the target sleep controller 11 can reduce the probability of any physical computing resource object entering sleep state C2 in the next sleep state when it is awakened from sleep state C0 from 15% to 5%.
通过上述方式,目标休眠控制器可以根据物理计算资源对象的运行状态对休眠状态转移预测信息进行动态更新,从而维护更为准确的休眠状态转移预测信息,一方面便于在下一次需要休眠时能够更加准确地为物理计算资源对象选择需要进入的休眠状态,另一方面也可以为基于休眠状态转移预测信息的资源调度提供更为准确的数据基础。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, so as to maintain 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 sleep is needed 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.
在本公开上述实施例中,并未限定目标休眠控制器具体是采用何种方式来维护休眠状态转移预测信息的。在一些可选的实施例中,目标休眠控制器可以在初始化过程中创建多 个物理计算资源对象各自对应的数据结构体;初始化多个物理计算资源对象各自对应的数据结构体,以得到多个物理计算资源对象各自对应的休眠状态转移预测信息的初始值;进而随着物理计算资源对象的运行状态的变化,可根据上文描述的方式动态更新数据结构体中记录的休眠状态转移预测信息。其中,数据结构体用于存储对应物理计算资源对象对应的休眠状态转移预测信息。其中,数据结构体是指能够进行信息存储的数据结构,包括但不限于:数组、列表、链表和队列等。本公开实施例将以数组为例进行示例性说明,并将该数组称为休眠状态权重数组,但并不对数据结构体的形式进行限定。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 transition prediction information. In some optional embodiments, the target sleep controller can create multiple A data structure corresponding to each of the multiple physical computing resource objects is initialized 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. Among them, the data structure is used to store the sleep state transfer prediction information corresponding to the corresponding physical computing resource object. Among them, the data structure refers to a data structure capable of storing information, including but not limited to: arrays, lists, linked lists, queues, etc. The disclosed embodiment will take an array as an example for illustrative explanation, and the array will be called a sleep state weight array, but the form of the data structure is not limited.
具体地,目标休眠控制器在初始化过程中可创建多个物理计算资源对象各自对应的休眠状态权重数组,休眠状态权重数组是包括多行和多列的多维数组,如表2所示。其中,休眠状态权重数组中一行代表对应物理计算资源对象被唤醒时可能所处的一个休眠状态,一列代表对应物理计算资源对象在下一次休眠时可能进入的一个休眠状态,行列相交的数组元素表示对应物理计算资源对象在从该行代表的休眠状态被唤醒时在下一次休眠时进入该列所代表的休眠状态的权重,权重越大概率越高。需要说明的是,在初始化之前,休眠状态权重数组的元素值应为空值。Specifically, the target sleep controller can create sleep state weight arrays corresponding to multiple physical computing resource objects during the initialization process. The sleep state weight array is a multidimensional array including multiple rows and multiple columns, as shown in Table 2. Among them, a row in the sleep state weight array 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 next time it sleeps. The larger the weight, the higher the probability. It should be noted that before initialization, the element value of the sleep state weight array should be null.
接着,目标休眠控制器11可初始化多个物理计算资源对象各自对应的休眠状态权重数组,以得到多个物理计算资源对象各自对应的休眠状态转移预测信息的初始值。在一可选实施例中,目标休眠控制器11可将行数和列数相同的数组元素初始化为第一值,并将行数和列数不同的数组元素初始化为第二值,其中,第一值大于第二值,且同一行中的第一值与第二值之和为第三值。其中,如表2所示,第三值可为100,同一行中的第一值与第二值之和为100。除此之外,第三值还可为任意值,比如90、120或150等,本实施例不做限制,对应地,第一值和第二值在满足“第一值大于第二值”和“同一行中的第一值与第二值之和为第三值”这两个条件的情况下,也可为任意值,本实施例不做限制。在表2中,以第一值为70,第二值为15为例进行图示。下表为经过初始化的之后的多维数组,仅用于示例性说明以便对行和列各自的含义更好地描述。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 transfer prediction information corresponding to each of the multiple physical computing resource objects. In an optional embodiment, the target sleep controller 11 may initialize the array elements with the same number of rows and columns to the first value, and initialize the array elements with different number 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. Wherein, 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 also be any value, such as 90, 120 or 150, etc., which is not limited in this embodiment. Correspondingly, the first value and the second value may also be any value under the condition that "the first value is greater than the second value" and "the sum of the first value and the second value in the same row is the third value", which is not limited in this embodiment. In Table 2, the first value is 70 and the second value is 15 as an example for illustration. The following table shows a multidimensional array after initialization, which is only used for illustrative purposes to better describe the meanings of the rows and columns.
表2
Table 2
也就是说,在上表2中示出的休眠状态权重数组中,休眠状态C0所在一行可表示:对应物理计算资源对象从休眠状态C0被唤醒时在下一次休眠时进入休眠状态C0的权重为70%,从休眠状态C0被唤醒时在下一次休眠时进入休眠状态C1的权重为15%,从休眠状态C0被唤醒时在下一次休眠时进入休眠状态C2的权重为15%;休眠状态C1所在一行可表示:对应物理计算资源对象从休眠状态C1被唤醒时在下一次休眠时进入休眠状态C0的权重为15%,从休眠状态C1被唤醒时在下一次休眠时进入休眠状态C1的权重为70%,从休眠状态C1被唤醒时在下一次休眠时进入休眠状态C2的权重为15%;休眠状态C2所在一行可表示:对应物理计算资源对象从休眠状态C2被唤醒时在下一次休眠时进入休眠状态C0的权重为15%,从休眠状态C2被唤醒时在下一次休眠时进入休眠状态C1的权重为15%,从休眠状态C2被唤醒时在下一次休眠时进入休眠状态C2的权重为70%。That is to say, in the sleep state weight array shown in Table 2 above, the row where the sleep state C0 is located can 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 is 70%, when it is awakened from the sleep state C0, the weight of entering the sleep state C1 at the next sleep is 15%, and when it is awakened from the sleep state C0, the weight of entering the sleep state C2 at the next sleep 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 is 15%. The weight is 15%, the weight of entering the sleep state C1 at the next sleep when awakened from the sleep state C1 is 70%, and the weight of entering the sleep state C2 at the next sleep 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 at the next sleep when awakened from the sleep state C2 is 15%, the weight of entering the sleep state C1 at the next sleep when awakened from the sleep state C2 is 15%, and the weight of entering the sleep state C2 at the next sleep when awakened from the sleep state C2 is 70%.
在此基础上,结合休眠状态权重数组以及上述列举的初始化方式,对前述实施例中提到的“相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息”以及“目标休眠控制器在相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息”等对概率信息的调整方式进行示例性说明。需要说明的是,无论如何对多维数组进行更新,多维数组中同一行中的各个值增大或减小之后的和仍为预设的第三值。以下将进一步说明。On this basis, combined with the sleep state weight array and the above-listed initialization methods, the "relatively increasing the probability information of any physical computing resource object entering the first sleep state again in the next sleep state when it is awakened from the first sleep state" and "the target sleep controller relatively increasing 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" mentioned in the above embodiments are exemplified for the adjustment method of 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 is still the preset third value. This will be further explained below.
可选地,目标休眠控制器11可在任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息。其中,目标休眠控制器11可将任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息相对增大为第四值,并将任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其他休眠状态的概率信息相对减小为第五值,第四值可大于第五值,且同一行的各个值相加后仍为前述实施例中的第三值。Optionally, the target sleep controller 11 may relatively increase the probability information of any physical computing resource object re-entering the first sleep state when it is awakened from the first sleep state 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. Among them, the target sleep controller 11 may relatively increase the probability information of any physical computing resource object re-entering the first sleep state when it is awakened from the first sleep state to a fourth value, and relatively reduce the probability information of any physical computing resource object entering other sleep states 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 is still the third value in the aforementioned embodiment.
可选地,目标休眠控制器11可在任一物理计算资源对象在第一休眠状态下的实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息。其中,目标休眠控制器11可将任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息相对增大为第六值,并将任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其他休眠状态的概率信息相对减小为第七值,第六值可大于第七值,且同一行的各个值相加后仍为前述实施例中的第三值。Optionally, 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 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. Among them, 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 to the sixth value, and relatively reduce the probability information of any physical computing resource object entering other sleep states when it is awakened from the first sleep state to the seventh value, the sixth value may be greater than the seventh value, and the sum of the values in the same row is still the third value in the aforementioned embodiment.
通过这种方式,在前述初始化后的数据结构体的基础上,目标休眠控制器11可利用数 据结构体,更加快捷地对任一物理计算资源对象对应的休眠状态转移预测信息进行更新。In this way, based on the aforementioned initialized data structure, the target sleep controller 11 can use the data structure to According to the structure, the sleep state transfer prediction information corresponding to any physical computing resource object is updated more quickly.
在一些可选的实施例中,目标休眠控制器11除了维护各个物理计算资源对象对应的休眠状态转移预测信息之外,还可监测任一物理计算资源对象中的任务队列,当该物理计算资源对象中的任务队列为空时,或者,当该物理计算资源对象中的任务队列为空且持续预设时间后,目标休眠控制器11可确定该物理计算资源对象需要休眠。在监测到该物理计算资源对象需要休眠时,目标休眠控制器11可根据该物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态,并控制任一物理计算资源对象进入第三休眠状态。其中,第三休眠状态为多个休眠状态中的任一个休眠状态,是该任一物理计算资源对象此次需要进入的休眠状态。以下将结合图3所示的操作系统内部架构和工作原理对上述过程进一步说明。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 according to 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. Among them, 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.
如图3所示,第一步(图3中的①所示),可利用ACPI规范来配置休眠状态,具体地,物理机可获取固定ACPI描述表,该描述表中定义了各种固定硬件的ACPI信息。从该描述表中获取任一物理计算资源对象支持的各种休眠状态以及各种休眠状态对应的退出延迟时间。第二步(图3中的②所示),目标资源调度器12可以对各个物理计算资源对象进行资源调度;第三步(图3中的③所示),在资源调度过程中,若监测到任一个物理计算资源对象中的任务队列为空,或者该物理计算资源对象中的任务队列为空且持续预设时间时,目标休眠控制器11可根据所维护的该物理计算资源对象的休眠状态转移预测信息,确定该物理计算资源对象需要进入的第三休眠状态,将第三休眠状态提供给休眠管控模块13,由休眠管控模块13选择物理计算资源对象对应的驱动模块14,并利用驱动模块14通过物理计算资源对象对应的固件控制物理计算资源对象进入第三休眠状态,参见图3中的④所示。在此说明,在图3中,以操作系统内部包括目标休眠控制器11、目标资源调度器12、休眠管控模块13和驱动模块14为例进行图示,仅为对操作系统的内部架构的示意性说明,操作系统的内部实现架构并不限于此。As shown in FIG3 , in the first step (shown in ① of 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 of various fixed hardware. From the description table, various sleep states supported by any physical computing resource object and the exit delay time corresponding to various sleep states are obtained. In the second step (shown in ② of FIG3 ), the target resource scheduler 12 can perform resource scheduling for each physical computing resource object; in the third step (shown in ③ of 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 and lasts for a preset time, the target sleep controller 11 can determine the third sleep state that the physical computing resource object needs to enter according to the sleep state transfer prediction information of the physical computing resource object maintained, and provide the third sleep state to the sleep control module 13, and 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 ④ of 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.
具体地,目标休眠控制器11根据物理计算资源对象对应的休眠状态转移预测信息确定第三休眠状态时,可基于以下步骤Y1-步骤Y4实现: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:
步骤Y1、获取任一物理计算资源对象最近退出的休眠状态,作为第四休眠状态。比如,该物理计算资源对象历史时刻退出的休眠状态依次为休眠状态C1和休眠状态C2,目标休眠控制器11可将该物理计算资源对象最近退出的休眠状态C2作为第四休眠状态。Step Y1, obtaining the sleep state most recently exited by any physical computing resource object as the fourth sleep state. For example, the sleep states most recently exited by the physical computing resource object are sleep state C1 and sleep state C2, respectively, and 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.
步骤Y2、从任一物理计算资源对象对应的休眠状态转移预测信息中,获取从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息。 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.
步骤Y3、根据从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息,选择概率信息最大的休眠状态作为候选休眠状态。Step Y3: According to the probability information of entering each sleep state in the next sleep state when awakened from the fourth sleep state, the sleep state with the largest probability information is selected as the candidate sleep state.
比如,目标休眠控制器11获取的从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息分别为:休眠状态C0为15%、休眠状态C1为70%以及休眠状态C2为15%,因此,目标休眠控制器11可选择概率信息最大的休眠状态C1作为候选休眠状态。For example, the target sleep controller 11 obtains the probability information of entering each sleep state in 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.
步骤Y4、在候选休眠状态的退出延迟时间小于系统最大可容忍的退出延迟时间的情况下,将候选休眠状态作为第三休眠状态。其中,系统最大可容忍的退出延迟时间可为预设的固定值,也可为系统根据系统运行情况进行动态配置的值,还可为用户自定义设置的值,本实施例不做限制。Step Y4: 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. The maximum tolerable exit delay time of the system can be a preset fixed value, a value dynamically configured by the system according to the system operation status, or a value customized by the user, which is not limited in this embodiment.
除了上述步骤Y4“候选休眠状态的退出延迟时间小于系统最大可容忍的退出延迟时间”的情况,目标休眠控制器11还可在候选休眠状态的退出延时时间大于或等于系统最大可容忍的退出延迟时间的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态。其中,在退出延时时间小于系统最大可容忍的退出延迟时间的休眠状态为一个的情况下,目标休眠控制器11可将该休眠状态作为第三休眠状态。在退出延时时间小于系统最大可容忍的退出延迟时间的休眠状态为多个的情况下,目标休眠控制器11可选择退出延时时间小于系统最大可容忍的退出延迟时间且概率信息最大的休眠状态作为第三休眠状态。In addition to the above-mentioned step Y4 "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. Among them, when there is 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 this sleep state as the third sleep state. When 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.
通过上述方式,目标休眠控制器11可根据物理计算资源对象对应的休眠状态转移预测信息较为准确地确定第三休眠状态。Through 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.
在前述各个实施例中介绍的目标休眠控制器11相应的执行逻辑的基础上,目标资源调度器12还可与目标休眠控制器协同,从而完成对目标任务的联合调度,以下将进一步说明。On the basis of the corresponding execution logic of the target sleep controller 11 introduced in the above-mentioned embodiments, the target resource scheduler 12 may also cooperate with the target sleep controller to complete the joint scheduling of the target tasks, which will be further explained below.
目标资源调度器12根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象时,可基于以下步骤U1-步骤U2实现:The target resource scheduler 12 may 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, and may implement the selection based on the following steps U1-U2:
步骤U1、响应资源调度触发事件,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息。其中,资源调度触发事件包括:时间中断、外设中断、当前应用主动放弃运行或者更高优先级应用需要运行等。Step U1, responding to a resource scheduling trigger event, generating sleep habit information corresponding to a plurality of physical computing resource objects according to sleep state transition prediction information corresponding to each of the plurality of physical computing resource objects. The resource scheduling trigger event includes: time interruption, peripheral interruption, current application actively giving up running or higher priority application needing to run, etc.
步骤U2、根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象。 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.
通过上述方式,目标资源调度器12可基于多个物理计算资源对象各自对应的休眠习惯信息,更为准确对从多个物理计算资源对象中选择目标物理计算资源对象。Through 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.
在一些可选的实施例中,目标资源调度器12在执行上述步骤U1时,可基于以下步骤U11-步骤U12生成多个物理计算资源对象各自对应的休眠习惯信息:In some optional embodiments, when executing the above step U1, the target resource scheduler 12 may generate the sleep habit information corresponding to each of the plurality of physical computing resource objects based on the following steps U11-U12:
步骤U11、针对任一物理计算资源对象,从任一物理计算资源对象对应的休眠状态转移预测信息中,获取任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息。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 at the next sleep state from the sleep state transition prediction information corresponding to the physical computing resource object.
步骤U12、根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息。其中,目标资源调度器12可构建数据结构体并将任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息写入该数据结构体,得到该物理计算资源对象对应的休眠习惯信息。Step U12: Generate 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. The target resource scheduler 12 may construct a data structure and write 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 into the data structure to obtain the sleep habit information corresponding to the physical computing resource object.
其中,数据结构体包括但不限于:数组、列表、链表和队列等。目标资源调度器12还可直接将任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息作为该物理计算资源对象对应的休眠习惯信息。The data structure includes but is not limited to: arrays, lists, linked lists, queues, etc. The target resource scheduler 12 can also directly use the probability information of any physical computing resource object exiting from any sleep state and re-entering the sleep state at the next sleep state as the sleep habit information corresponding to the physical computing resource object.
举例说明,假设共有休眠状态C0、休眠状态C1和休眠状态C2三个休眠状态。目标资源调度器12可从任一物理计算资源对象对应的休眠状态转移预测信息中,获取该物理计算资源对象从休眠状态C0退出并在下一次休眠时再次进入该休眠状态C0的概率为40%、从休眠状态C1退出并在下一次休眠时再次进入该休眠状态C1的概率为35%以及从休眠状态C2退出并在下一次休眠时再次进入该休眠状态C2的概率为60%。基于此,目标资源调度器12可将上述概率信息作为任一物理计算资源对象对应的休眠习惯信息。For example, assume that there are three sleep states, namely, sleep state C0, sleep state C1, and sleep state C2. The target resource scheduler 12 can obtain from the sleep state transition prediction information corresponding to any physical computing resource object that the probability of the physical computing resource object exiting from sleep state C0 and re-entering sleep state C0 at the next sleep is 40%, the probability of exiting from sleep state C1 and re-entering sleep state C1 at the next sleep is 35%, and the probability of exiting from sleep state C2 and re-entering sleep state C2 at 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.
在另一些可选的实施例中,目标资源调度器12在执行上述步骤U1时,还可通过以下方式来将休眠习惯信息划分为浅度休眠习惯或深度休眠习惯两个休眠习惯类型,得到休眠习惯信息。其中,若某个物理计算资源对象对应的休眠习惯类型为浅度休眠习惯,说明该物理计算资源对象习惯处于浅度休眠状态;若某个物理计算资源对象对应的休眠习惯类型为深度休眠习惯,说明该物理计算资源对象习惯处于深度休眠状态。以下将进一步说明。In some other optional embodiments, when executing the above step U1, the target resource scheduler 12 can also divide the sleep habit information into two sleep habit types, namely, shallow sleep habit and deep sleep habit, in the following manner to obtain the sleep habit information. If the sleep habit type corresponding to a physical computing resource object is shallow sleep habit, it means that the physical computing resource object is used to being in a shallow sleep state; if the sleep habit type corresponding to a physical computing resource object is deep sleep habit, it means that the physical computing resource object is used to being in a deep sleep state. This will be further explained below.
若任一物理计算资源对象从最浅休眠状态退出并在下一次休眠时进入该最浅休眠状态的概率信息最大,目标资源调度器12可确定任一物理计算资源对应的休眠习惯类型为浅度休眠习惯,并根据最大的概率信息生成任一物理计算资源对象在浅度休眠习惯下的休眠概率。其中,目标资源调度器12可直接将最大的概率信息作为任一物理计算资源对象在浅度休眠习惯下的休眠概率;也可将最大的概率信息乘以预设的概率系数得到任一物理计 算资源对象在浅度休眠习惯下的休眠概率;还可将最大的概率信息叠加预设的修正值,得到任一物理计算资源对象在浅度休眠习惯下的休眠概率,本实施例不做限制。If the probability information of any physical computing resource object exiting the shallowest sleep state and entering the shallowest sleep state at the next sleep is the largest, the target resource scheduler 12 can determine that the sleep habit type corresponding to any physical computing resource is a shallow sleep habit, and generate the sleep probability of any physical computing resource object under the shallow sleep habit according to the maximum probability information. 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; or 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. The maximum probability information can also be superimposed with a preset correction value to obtain the sleep probability of any physical computing resource object under the shallow sleep habit, which is not limited in this embodiment.
若任一物理计算资源对象从最深休眠状态退出并在下一次休眠时进入该最深休眠状态的概率信息最大,确定任一物理计算资源对象对应的休眠习惯类型为深度休眠习惯,并根据最大的概率信息生成任一物理计算资源在深度休眠习惯下的休眠概率。根据最大的概率信息生成任一物理计算资源在深度休眠习惯下的休眠概率的方式,与上述任一物理计算资源对象在浅度休眠习惯下的休眠概率的生成方式同理,此处不再赘述。If the probability information that any physical computing resource object exits the deepest sleep state and enters the deepest sleep state at the next sleep is the largest, the sleep habit type corresponding to any physical computing resource object is determined to be a deep sleep habit, and the sleep probability of any physical computing resource under the deep sleep habit is generated according to the maximum probability information. The method of generating the sleep probability of any physical computing resource under the deep sleep habit according to the maximum probability information is the same as the method of generating the sleep probability of any physical computing resource object under the shallow sleep habit, which will not be repeated here.
通过这种方式,目标资源调度器12不仅可较为准确地得到休眠习惯信息,还可将休眠习惯信息较为准确地划分为浅度休眠习惯或深度休眠习惯两种类型。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: shallow sleep habit and deep sleep habit.
在一些可选的实施例中,目标资源调度器12在多个物理计算资源对象中选择目标物理计算资源对象时,可根据多个物理计算资源对象各自对应的休眠习惯信息,确定对应于浅度休眠习惯的至少一个候选物理计算资源对象。比如,共有5个物理计算资源对象,分别为物理计算资源对象D1-物理计算资源对象D5,其各自对应的休眠习惯信息分别对应于浅度休眠习惯、浅度休眠习惯、深度休眠习惯、深度休眠习惯和深度休眠习惯,目标资源调度器12可将物理计算资源对象D1和物理计算资源对象D2作为候选物理计算资源对象。In some optional embodiments, when the target resource scheduler 12 selects a target physical computing resource object from a plurality of physical computing resource objects, it may determine at least one candidate physical computing resource object corresponding to a shallow sleep habit according to the sleep habit information corresponding to each of the plurality of physical computing resource objects. For example, there are five physical computing resource objects, namely, physical computing resource object D1 to physical computing resource object D5, and their corresponding sleep habit information respectively corresponds to a shallow sleep habit, a shallow sleep habit, a deep sleep habit, a deep sleep habit, and a deep sleep habit. The target resource scheduler 12 may select physical computing resource object D1 and physical computing resource object D2 as candidate physical computing resource objects.
目标资源调度器12在确定对应于浅度休眠习惯的至少一个候选物理计算资源对象之后,可根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象。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 according to the sleep probability of the at least one candidate physical computing resource object under the shallow sleep habit.
具体地,目标资源调度器12可根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象。其中,其它辅助信息可包括:资源调度触发事件的类型、候选物理计算资源对象当前的运行状态以及候选物理计算资源对象当前的利用率中的至少一种。以下将分情况进行说明。Specifically, 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 sleep probability of at least one candidate physical computing resource object under the shallow sleep habit, combined with other auxiliary information. Among them, the other auxiliary information may include: at least one of the type of resource scheduling triggering event, the current operating state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object. The following will be explained in different cases.
可选地,以其它辅助信息为资源调度触发事件的类型为例,目标资源调度器12在从至少一个候选物理计算资源对象中选择目标物理计算资源对象时,可根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率和资源调度触发事件的类型选择目标物理计算资源对象。其中,目标资源调度器12可先根据资源调度触发事件的类型从至少一个候选物理计算资源对象选择至少一个目标候选物理计算资源对象,其中,资源调度触发事件的类型与其对应的物理计算资源对象之间的对应关系可由目标资源调度器12维护。之后,目标资源调度器12可从至少一个目标候选物理计算资源对象中,选择休眠概率最大的候选 物理计算资源对象作为目标物理计算资源对象。Optionally, taking other auxiliary information as the type of resource scheduling trigger event as an example, when the target resource scheduler 12 selects a target physical computing resource object from at least one candidate physical computing resource object, it 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. 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 a candidate with the highest sleep probability from at least one target candidate physical computing resource object. The physical computing resource object is used as the target physical computing resource object.
可选地,以其它辅助信息为候选物理计算资源对象当前的运行状态为例,目标资源调度器12在从至少一个候选物理计算资源对象中选择目标物理计算资源对象时,可根据至少一个候选物理计算资源对象当前的运行状态和在浅度休眠习惯下的休眠概率选择目标物理计算资源对象。其中,目标资源调度器12可先根据至少一个候选物理计算资源对象当前的运行状态,从至少一个候选物理计算资源对象中选取运行状态符合预设的状态条件的至少一个目标候选物理计算资源对象,并从至少一个目标候选物理计算资源对象中,选择休眠概率最大的候选物理计算资源对象作为目标物理计算资源对象。Optionally, taking the current operating state of the candidate physical computing resource object as an example of other auxiliary information, the target resource scheduler 12 may select the target physical computing resource object according to the current operating state of the at least one candidate physical computing resource object and the sleep probability under the shallow sleep habit when selecting the target physical computing resource object from the at least one candidate physical computing resource object. Among them, the target resource scheduler 12 may first select at least one target candidate physical computing resource object whose operating state meets the preset state condition from the at least one candidate physical computing resource object according to the current operating state of the at least one candidate physical computing resource object, and 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.
可选地,以其它辅助信息为候选物理计算资源对象当前的利用率为例,目标资源调度器12在从至少一个候选物理计算资源对象中选择目标物理计算资源对象时,可根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率和当前的利用率,选择利用率符合要求且休眠概率最大的候选物理计算资源对象作为目标物理计算资源对象。其中,利用率对应的要求可根据实际需求进行设定为任意条件,比如不大于80%、不大于70%或不大于60%等等,本实施例不做限制。Optionally, taking the current utilization rate of the candidate physical computing resource object as an example of other auxiliary information, when the target resource scheduler 12 selects the target physical computing resource object from at least one candidate physical computing resource object, it can select the candidate physical computing resource object with the utilization rate that meets the requirements and the largest sleep probability as the target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit and the current utilization rate. Among them, the requirement corresponding to the utilization rate can be set as any condition according to actual needs, such as not more than 80%, not more than 70% or not more than 60%, etc., which is not limited in this embodiment.
通过上述方式,由于结合了其它辅助信息,因此,目标资源调度器12可根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,更为准确地从至少一个候选物理计算资源对象中选择目标物理计算资源对象。In the above manner, since other auxiliary information is combined, the target resource scheduler 12 can more accurately select a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.
在以上各个实施例的基础上,前述实施例中提到的多个物理计算资源对象可为多核处理器。另外,前述实施例提到的物理机可适用于垂直/专用的应用场景,在应用于垂直/专用场景的情况下,物理机的操作系统可以仅包含目标资源调度器和目标休眠控制器即可实现以上各个实施例。On the basis of the above embodiments, the multiple physical computing resource objects mentioned in the above embodiments may be multi-core processors. In addition, the physical machine mentioned in the above embodiments may be applicable to vertical/dedicated application scenarios. When applied to 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.
除此之外,物理机还可以被配置应用于各种通用场景,在通用场景中,前述实施例中提到的操作系统还可包括其它资源调度器和其它休眠控制器,不同休眠控制器的休眠控制逻辑不同,不同资源调度器的资源调度逻辑不同,而且允许用户根据应用需求,灵活选择使用哪种休眠控制器和哪种资源调度器。In addition, the physical machine can also be configured for application in 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.
比如,操作系统上可包括若干个其它资源调度器、若干个其它休眠控制器以及前述实施例中的目标休眠控制器和目标资源调度器。不同其它资源调度器与不同其它休眠控制器之间是相互独立的。相互独立的概念是指每个其它资源调度器可按照自身的调度逻辑执行资源调度,每个其它休眠控制器可按照自身的休眠控制逻辑进行休眠控制,也就是说,其它资源调度器的资源调度过程并不依赖于其它任何休眠控制器的休眠控制过程,其它资源 调度器和其它休眠控制器之间是解耦的。其中,用户可在若干个其它资源调度器和若干个其它休眠控制器之间任意组合使用,具体地,物理机可响应于用户的选取操作,从若干个其它资源调度器和若干个其它休眠控制器中确定一个资源调度器和一个休眠控制器,被选择的资源调度器和休眠控制器被配置生效,从而基于该资源调度器和该休眠控制器进行目标任务的调度,本公开实施例并不限定任何其它休眠控制器的休眠控制逻辑,也不限定任何其它资源调度器的资源调度逻辑。物理机还可响应于用户的选取操作,选取目标资源调度器和目标休眠控制器来配合进行目标任务的调度,即目标资源调度器和目标休眠控制器被配置为生效,相对于其它资源调度器和其它休眠控制器,目标资源调度器和目标休眠控制器需要组合使用,两者之间是关联的,会相互影响。需要说明的是,在其它资源调度器中的任一资源调度器和其它休眠控制器中的任一休眠控制器被配置生效时,目标资源调度器和目标休眠控制器被配置为失效。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. The scheduler 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 as to schedule the target task 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 the target resource scheduler and the target sleep controller to cooperate in the scheduling of the target task in response to the user's selection operation, that is, the target resource scheduler and the target sleep controller are configured to take effect. Relative to 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 in other resource schedulers and any sleep controller in other sleep controllers are configured to take effect, the target resource scheduler and the target sleep controller are configured to be invalid.
以下将以操作系统为Linux为例,对其他休眠控制器的休眠控制逻辑进行示例性说明。The following will take the Linux operating system as an example to exemplify the sleep control logic of other sleep controllers.
在Linux系统通常可配置有menu(直译为菜单)、面向事件的计时器(timer events oriented,teo)、ladder(直译为梯子)等多个休眠控制器。其中,menu休眠控制器是一种尝试预测空闲持续时间并使用预测值为物理计算资源对象选择休眠状态的休眠控制器,关于menu休眠控制器的详细休眠控制逻辑可参见下述实施例中的描述。teo休眠控制器是一种试图找到适合给定条件的最深休眠状态的休眠控制器。具体地,teo休眠控制器会监测各物理计算资源对象的空闲持续时间,并尝试将观察到的空闲持续时间值与可用的休眠状态进行比较,并使用该信息来选择最有可能“匹配”物理计算资源对象即将到来的空闲间隔的休眠状态。其中,ladder休眠控制器是一种按照由浅到深逐渐进入各种休眠状态的休眠控制器,即它会优先进入最浅的休眠状态,并根据休眠时长确定是否进入下一级较深的休眠状态。In Linux systems, multiple sleep controllers such as menu, timer events oriented (TEO), and 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 a physical computing resource object. For the 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 according to the sleep duration.
在本公开实施例中,假设用户选择使用其它休眠控制器和其他资源调度器,以menu休眠控制器、CFS(Completely Fair Scheduler,完全公平调度器)资源调度器为例,如图4所示,这两者之间的工作逻辑是解耦的,CFS会根据自己的资源调度策略对物理计算资源对象进行资源调度,在该过程中,menu会根据自己的休眠控制逻辑进行休眠控制,该休眠控制逻辑具体如下:In the disclosed embodiment, 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 FIG4 , the working logic between the two is decoupled. The CFS will perform resource scheduling for the physical computing resource objects according to its own resource scheduling strategy. In this process, the menu will perform sleep control according to its own sleep control logic. The sleep control logic is as follows:
(1)该休眠控制器menu可记录各次历史实际休眠时间,以用于预测下次的休眠时间。(1) The sleep controller menu can record each historical actual sleep time to predict the next sleep time.
(2)该休眠控制器menu可根据上述各次历史实际休眠时间,计算修正系数。该修正系数可用于预测I/O(Input/Output,输入/输出)等因素对实际休眠时间的影响以便在后续步骤中对这些影响进行修正。具体地,该休眠控制器可根据以下公式计算修正系数: (2) The sleep controller menu can calculate the correction coefficient based on the above historical actual sleep time. The correction coefficient can be used to predict the impact of factors such as I/O (Input/Output) on the actual sleep time so as to correct these impacts in subsequent steps. Specifically, the sleep controller can calculate the correction coefficient according to the following formula:
修正系数=1024×实际休眠时间÷预计休眠时间Correction coefficient = 1024 × actual sleep time ÷ estimated sleep time
(3)若各次历史实际休眠时间满足以下条件:标准差<20且方差<=400,则该休眠控制器menu可取各次历史实际休眠时间的平均值作为下次休眠时间。(3) If each historical actual sleep time meets the following conditions: standard deviation <20 and variance <=400, then the sleep controller menu can take the average value of each historical actual sleep time as the next sleep time.
(4)该休眠控制器menu可获取处于I/O wait状态的线程数,其中,I/O wait状态指的是在等待磁盘I/O请求完成的状态。(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.
(5)该休眠控制器menu可通过处于I/O wait状态的线程数以及修正系数,来修正下次休眠时间。(5) The sleep controller menu can correct the next sleep time according to the number of threads in the I/O wait state and the correction factor.
(6)该休眠控制器menu可获取设备及系统范围内的由pm qos(power management quality of service,电源管理服务质量)设置的退出延迟时间,并从中选择最小值作为第一延迟容忍度latency_req。之后,该休眠控制器可基于以下公式来预测第二延迟容忍度:(6) The sleep controller menu can obtain the exit delay time set by pm qos (power management quality of service) within the device and system range, and select the minimum value as the first delay tolerance latency_req. After that, the sleep controller can predict the second delay tolerance based on the following formula:
第二延迟容忍度=预测的下次休眠时间÷(10×处于I/O wait状态的线程数+1)(公式2)Second delay tolerance = predicted next sleep time ÷ (10 × number of threads in I/O wait state + 1) (Formula 2)
(7)该休眠控制器menu可利用第二延迟容忍度对第一延迟容忍度进行修正,即从第二延迟容忍度和第一延迟容忍度中选取最小值作为修正后的目标容忍度。(7) The sleep controller menu may use the second delay tolerance to correct the first delay tolerance, that is, select the minimum value from the second delay tolerance and the first delay tolerance as the corrected target tolerance.
(8)该休眠控制器menu可从预设的多个休眠状态中选取最深的且退出延迟时间小于或等于目标容忍度的休眠状态,之后,休眠控制器可控制物理计算资源对象进入该休眠状态。(8) The sleep controller menu can select the deepest sleep state with an exit delay time less than or equal to the target tolerance from multiple preset sleep states, and then the sleep controller can control the physical computing resource object to enter the sleep state.
需要说明的是,以上介绍的menu休眠控制器的控制逻辑存在诸多缺陷,比如,无法与资源调度器联动以减少物理计算资源对象进出休眠状态的次数,还存在物理计算资源对象进出休眠状态的次数频繁从而导致消耗功耗较高的缺陷,另外,预测休眠状态失败率较高也会导致功耗浪费。这也从另一角度验证了本公开的前述各个实施例中的目标资源调度器和目标休眠控制器相联动所产生的技术效果。It should be noted that the control logic of the menu sleep controller introduced above has many defects, such as the inability to link with the resource scheduler to reduce the number of times the physical computing resource object enters and exits the sleep state, and the frequent number of physical computing resource objects entering and exiting the sleep state leads to high power consumption. In addition, the high failure rate of predicting the sleep state also leads to waste of power. This also verifies from another perspective the technical effect produced by the linkage between the target resource scheduler and the target sleep controller in the aforementioned embodiments of the present disclosure.
除上述各实施例提供的物理机之外,本公开实施例还提供一种计算资源处理方法,以下将结合附图进行说明。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 in conjunction with the accompanying drawings.
图5是本公开一示例性实施例提供的计算资源处理方法的流程示意图,可包括如图5所示的步骤: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 :
步骤51、维护多个物理计算资源对象各自对应的休眠状态转移预测信息,休眠状态转移预测信息中包括对应物理计算资源对象在从多个休眠状态中任一休眠状态被唤醒情况下在下一次休眠时进入多个休眠状态中各个休眠状态的概率信息。Step 51: Maintain sleep state transition prediction information corresponding to each of the multiple physical computing resource objects, wherein the sleep state transition prediction information includes probability information of the corresponding physical computing resource object entering each of the multiple sleep states at the next sleep when awakened from any of the multiple sleep states.
步骤52、根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象。 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.
步骤53、将待调度的目标任务调度到目标物理计算资源对象上。Step 53: Schedule the target task to be scheduled to the target physical computing resource object.
需要说明的是,本方法实施例的执行主体可为操作系统,具体可为操作系统中的目标资源调度器和目标休眠控制器。不同步骤的执行主体可以不同,比如,有的步骤可由目标资源调度器执行,有的步骤可由目标休眠控制器执行,本实施例不做限制。It should be noted that the execution subject of the embodiment of the method may be an operating system, specifically a target resource scheduler and a target sleep controller in the operating system. The execution subjects of different steps may be different, for example, some steps may be executed by the target resource scheduler, and some steps may be executed by the target sleep controller, which is not limited in this embodiment.
在本实施例中,可将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,通过维护多个物理计算资源对象各自对应的休眠状态转移预测信息,根据所维护的休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率。In this embodiment, the resource scheduling of physical computing resource objects can be combined with the sleep control of physical computing resource objects. By maintaining the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects, the physical computing resource objects are scheduled according to the maintained sleep state transfer prediction information. This can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for some physical computing resource objects to be in a deep sleep state for as long as possible, and for 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.
在一些可选的实施例中,维护多个物理计算资源对象各自对应的休眠状态转移预测信息,包括:在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间,第一休眠状态为任一休眠状态;根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息。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.
在一些可选的实施例中,在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间,包括:获取任一物理计算资源对象进入第一休眠状态的第一时间,以及被唤醒事件从第一休眠状态唤醒的第二时间;根据第二时间和第一时间,计算任一物理计算资源对象在第一休眠状态下的实际休眠时间。In some optional embodiments, when monitoring any physical computing resource object 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.
在一些可选的实施例中,根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息,包括:在实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;在实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,第二休眠状态是退出延迟时间与实际休眠时间相匹配的休眠状态。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.
在一些可选的实施例中,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息,包括:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态之外的休眠状态。 In some optional embodiments, relatively increasing the probability information of any physical computing resource object entering the first sleep state again at the next sleep state when being awakened from the first sleep state includes: increasing the probability information of any physical computing resource object entering the first sleep state again at the next sleep state when being awakened from the first sleep state; and/or reducing the probability information of any physical computing resource object entering other sleep states at the next sleep state when being awakened from the first sleep state, where other sleep states refer to sleep states other than the first sleep state.
在一些可选的实施例中,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,包括:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第一休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态和第二休眠状态之外的休眠状态。In some optional embodiments, relatively increasing the probability information of any physical computing resource object entering the second sleep state at the next 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 at the next 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 at the next sleep state 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 at the next sleep state when it is awakened from the first sleep state, and the other sleep states refer to sleep states other than the first sleep state and the second sleep state.
在一些可选的实施例中,方法还包括:在初始化过程中,创建多个物理计算资源对象各自对应的数据结构体,数据结构体用于存储对应物理计算资源对象对应的休眠状态转移预测信息;初始化多个物理计算资源对象各自对应的数据结构体,以得到多个物理计算资源对象各自对应的休眠状态转移预测信息的初始值。In some optional embodiments, the method also 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 an initial value of the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects.
在一些可选的实施例中,创建多个物理计算资源对象各自对应的数据结构体,包括:创建多个物理计算资源对象各自对应的休眠状态权重数组,休眠状态权重数组是包括多行和多列的多维数组;其中,一行代表对应物理计算资源对象被唤醒时可能所处的一个休眠状态,一列代表对应物理计算资源对象在下一次休眠时可能进入的一个休眠状态;行列相交的数组元素表示对应物理计算资源对象在从该行代表的休眠状态被唤醒时在下一次休眠时进入该列所代表的休眠状态的权重,权重越大概率越高。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 a plurality of rows and a plurality of 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 when it sleeps next time, and the greater the weight, the higher the probability.
在一些可选的实施例中,初始化多个物理计算资源对象各自对应的数据结构体,包括:将行数和列数相同的数组元素初始化为第一值,并将行数和列数不同的数组元素初始化为第二值;其中,第一值大于第二值,且同一行中的第一值与第二值之和为第三值。In some optional embodiments, data structures corresponding to multiple physical computing resource objects are initialized, including: 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.
在一些可选的实施例中,方法还包括:在监测到任一物理计算资源对象需要休眠时,根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态;控制任一物理计算资源对象进入第三休眠状态。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 according to 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.
在一些可选的实施例中,根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态,包括:获取任一物理计算资源对象最近退出的休眠状态,作为第四休眠状态;从任一物理计算资源对象对应的休眠状态转移预测信息中,获取从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息;根据从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息,选择概率信息最大的休眠状态作为候选休眠状态;在候选休眠状态的退出延迟时间小于系统最大可容忍的退出延迟时间的情况下,将候选休眠状态作为第三休眠状态。In some optional embodiments, the third sleep state is determined according to 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 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; according to 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, taking the candidate sleep state as the third sleep state.
在一些可选的实施例中,方法还包括:在候选休眠状态的退出延时时间大于或等于系 统最大可容忍的退出延迟时间的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态。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 system In the case where the maximum tolerable exit delay time of the system is greater than the maximum tolerable exit delay time of the system, another sleep state whose exit delay time is less than the maximum tolerable exit delay time of the system is selected as the third sleep state.
在一些可选的实施例中,选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态,包括:在退出延时时间小于系统最大可容忍的退出延迟时间的休眠状态为多个的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间且概率信息最大的休眠状态作为第三休眠状态。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.
在一些可选的实施例中,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象,包括:响应资源调度触发事件,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息;根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象。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.
在一些可选的实施例中,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息,包括:针对任一物理计算资源对象,从任一物理计算资源对象对应的休眠状态转移预测信息中,获取任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息;根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息。In some optional embodiments, sleep habit information corresponding to each of the multiple physical computing resource objects is generated based on 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 that any physical computing resource object exits from any sleep state and re-enters 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 probability information that any physical computing resource object exits from any sleep state and re-enters the sleep state at the next sleep state.
在一些可选的实施例中,根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息,包括:若任一物理计算资源对象从最浅休眠状态退出并在下一次休眠时进入该最浅休眠状态的概率信息最大,确定任一物理计算资源对应的休眠习惯类型为浅度休眠习惯,并根据最大的概率信息生成任一物理计算资源对象在浅度休眠习惯下的休眠概率;若任一物理计算资源对象从最深休眠状态退出并在下一次休眠时进入该最深休眠状态的概率信息最大,确定任一物理计算资源对象对应的休眠习惯类型为深度休眠习惯,并根据最大的概率信息生成任一物理计算资源在深度休眠习惯下的休眠概率。In some optional embodiments, sleep habit information corresponding to any physical computing resource object is generated based on probability information of any physical computing resource object exiting from any sleep state and entering the sleep state again 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.
在一些可选的实施例中,根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象,包括:根据多个物理计算资源对象各自对应的休眠习惯信息,确定对应于浅度休眠习惯的至少一个候选物理计算资源对象;根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象。In some optional embodiments, a target physical computing resource object is selected from a plurality of physical computing resource objects according to 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 according to 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 a target physical computing resource object according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit.
在一些可选的实施例中,根据至少一个候选物理计算资源对象在浅度休眠习惯下的休 眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象,包括:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象;其中,其它辅助信息包括资源调度触发事件的类型、候选物理计算资源对象当前的运行状态以及候选物理计算资源对象当前的利用率中的至少一种。In some optional embodiments, the at least one candidate physical computing resource object is selected according to the sleep state of the at least one candidate physical computing resource object in the shallow sleep state. The method comprises: selecting a target physical computing resource object from at least one candidate physical computing resource object according to the sleep probability of at least one candidate physical computing resource object in a shallow sleep state and in combination with other auxiliary information; wherein the other auxiliary information comprises at least one of the type of resource scheduling triggering event, the current operating state of the candidate physical computing resource object, and the current utilization rate of the candidate physical computing resource object.
在一些可选的实施例中,根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象,包括:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率和当前的利用率,选择利用率符合要求且休眠概率最大的候选物理计算资源对象作为目标物理计算资源对象。In some optional embodiments, a target physical computing resource object is selected from at least one candidate physical computing resource object based on the sleep probability of at least one candidate physical computing resource object in a shallow sleep habit in combination with other auxiliary information, including: based on the sleep probability of at least one candidate physical computing resource object in a shallow sleep habit and the current utilization rate, selecting a candidate physical computing resource object whose utilization rate meets the requirements and whose sleep probability is the highest as the target physical computing resource object.
关于本实施例方法中各步骤的详细实施方式以及有益效果已经在前述实施例中进行了详细描述,此处将不做详细阐述说明。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.
下面以多核CPU及其包含的CPU核心为例,结合图6a、图6b、图6c和图6d对上述图5所示方法中各实施例的实施方式进行详细说明。The following takes a multi-core CPU and the CPU cores it contains as an example, and describes in detail the implementation methods of the embodiments of the method shown in FIG. 5 in combination with FIG. 6a, FIG. 6b, FIG. 6c and FIG. 6d.
其中,图6a为本公开实施例提供的计算资源处理方法在实际应用场景中的部署实施的示意图。Among them, Figure 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.
其中,目标休眠控制器可进行初始化并在初始化时为每个CPU核心(即前文中的物理计算资源对象)创建数据结构体,比如格式为weight[][]的数组,其中,一行代表对应物理计算资源对象被唤醒时可能所处的一个休眠状态,一列代表对应物理计算资源对象在下一次休眠时可能进入的一个休眠状态,行列相交的数组元素表示对应物理计算资源对象在从该行代表的休眠状态被唤醒时在下一次休眠时进入该列所代表的休眠状态的权重,权重越大概率越高。Among them, the target sleep controller can be initialized and create a data structure for each CPU core (i.e., the physical computing resource object in the previous text) during initialization, such as an array 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 during the next sleep. 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 the next sleep when it is awakened from the sleep state represented by the row. The larger the weight, the higher the probability.
目标休眠控制器可对初始化该数据结构体,具体地,目标休眠控制器可在数组i、j下标相同时,将该行列相交的元素初始化为70。目标休眠控制器可在数组i、j下标不相同时,将这些元素初始化为(100-70)/2=15。需要说明的是,无论是经过初始化还是后续的元素更新过程,每行的各个元素应始终满足相加为100的条件。图6a中示例性的示出了初始化后的数据结构体,以三个休眠状态C0-C2为例进行图示,并以8个CPU核心为例进行图示,在图6a中示出的8个CPU核心为分别核0-核7。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 array i and j subscripts are the same. The target sleep controller can initialize these elements to (100-70)/2=15 when the array i and j subscripts are different. It should be noted that, regardless of the initialization or subsequent element update process, the elements of each row should always satisfy 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.
经过初始化后,目标休眠控制器还可对各个CPU核心进行状态监测,并根据状态监测结果对数据结构体进行更新。以下将结合图6b对该更新过程进行说明。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 result. The update process will be described below in conjunction with FIG. 6 b.
如图6b所示,目标资源调度器可在物理计算资源对象中的任务队列为空时启动休眠 流程,并查询上次进入的休眠状态以及该休眠状态对应的退出延迟时间。目标休眠控制器可根据上次进入休眠状态的时间,以及被唤醒事件唤醒的时间确定实际休眠时间,唤醒事件可为定时器到达事件或中断事件。之后,目标休眠控制器可确定与该休眠实际持续的时间最匹配的休眠状态。As shown in FIG6b , the target resource scheduler may start sleeping when the task queue in the physical computing resource object is empty. The target sleep controller can determine the actual sleep time according to the time of the last sleep state entry and the time of being awakened by the wake-up event. The wake-up event can be a timer arrival event or an interrupt event. After that, the target sleep controller can determine the sleep state that best matches the actual duration of the sleep state.
目标休眠控制器在判定实际休眠时间与上次预测的休眠状态相匹配时,可将该休眠状态的权值增加20,并将其他权重均减少10;在判定实际休眠时间与上次预测的休眠状态不匹配时,可将与该休眠实际持续的时间最匹配的休眠状态的权值增加15,并将该上次预测的休眠状态减15。When the target sleep controller determines that the actual sleep time matches the last predicted sleep state, the weight of the sleep state can be increased by 20 and the other weights can be reduced by 10; when the target sleep controller determines that the actual sleep time does not match the last predicted sleep state, the weight of the sleep state that best matches the actual duration of the sleep can be increased by 15 and the weight of the last predicted sleep state can be reduced by 15.
如图6b所示,通过这种方式目标休眠控制器可较为准确地对数据结构体进行较为准确地更新。As shown in FIG. 6 b , in this way, the target sleep controller can update the data structure more accurately.
基于上述内容,目标休眠控制器可基于数据结构体从多个休眠状态中较为准确地选择休眠状态。以下将结合图6c进一步说明。Based on the above content, the target sleep controller can more accurately select a sleep state from multiple sleep states based on the data structure. This will be further described below in conjunction with FIG. 6c.
如图6c所示,对于被唤醒后需要再次进入休眠状态的CPU核心,目标休眠控制器可获取其最近退出的休眠状态(即图6b中的“获取上次退出的上次休眠状态”),并以该休眠状态为行,在该行对应的多列元素中确定权值最高的休眠状态,作为下次休眠将进入的状态。之后,目标休眠控制器可判断该休眠状态的退出延迟时间是否小于系统最大可容忍的退出延迟事件。若为否,则目标休眠控制器继续选择更浅一层次的休眠状态并继续判断选择的休眠状态的退出延迟时间是否小于系统最大可容忍的退出延迟时间;若为是,则可完成休眠状态的选择。As shown in FIG6c, for a CPU core that needs to enter a sleep state again after being awakened, the target sleep controller can obtain the sleep state that it has exited most recently (i.e., "obtain the last sleep state of the last exit" in FIG6b), and use the sleep state as a row, and determine the sleep state with the highest weight in the multiple column elements corresponding to the row as the state to be entered in the next sleep state. Afterwards, the target sleep controller can determine whether the exit delay time of the sleep state is less than the maximum tolerable exit delay event of the system. If not, the target sleep controller continues to select a sleep state at a shallower level and continues to determine whether the exit delay time of the selected sleep state is less than the maximum tolerable exit delay time of the system; if yes, the sleep state selection can be completed.
在以上介绍的目标休眠控制器相应的执行逻辑的基础上,目标资源调度器还可与目标休眠控制器协同,从而完成对目标任务的联合调度。以下将结合图6d进一步说明。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 task, which will be further explained below in conjunction with FIG. 6d.
如图6d所示,目标资源调度器可响应时间中断、外设中断、当前应用主动放弃运行、或更高优先级应用需要运行等事件,读取各个CPU核心的数据结构体(weight[][]数组)。针对任一个CPU核心,目标资源调度器可判断该CPU核心的最深休眠状态是否权重最高,若为是,则目标资源调度器可继续查找处于最浅休眠状态且权重最高的CPU核心,并将上述处于最深休眠状态CPU核心上的目标任务调度至该处于最浅休眠状态且权重最高的CPU核心上,进而可运行最浅休眠状态且权重最高的CPU核心上的任务队列中处于队首的任务。通过这种方式,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率As shown in FIG6d , 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 with 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 with 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 with 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 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, and reducing the frequency of physical computing resource objects entering and exiting sleep states.
需要说明的是,在上述实施例及附图中的描述的一些流程中,包含了按照特定顺序出 现的多个操作,但是应该清楚了解,这些操作可以不按照其在本文中出现的顺序来执行或并行执行,操作的序号如51、52等,仅仅是用于区分开各个不同的操作,序号本身不代表任何的执行顺序。另外,这些流程可以包括更多或更少的操作,并且这些操作可以按顺序执行或并行执行。需要说明的是,本文中的“第一”、“第二”等描述,是用于区分不同的消息、设备、模块等,不代表先后顺序,也不限定“第一”和“第二”是不同的类型。It should be noted that some of the processes described in the above embodiments and the accompanying drawings include steps that are performed in a specific order. There are multiple operations in this article, 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 serial numbers of the operations, such as 51, 52, etc., are only used to distinguish different operations, and the serial 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 the order of precedence, nor do they limit the "first" and "second" to be different types.
本公开实施例还提供一种计算资源处理装置,如图7所示,该装置包括:维护模块701,用于:维护多个物理计算资源对象各自对应的休眠状态转移预测信息,所述休眠状态转移预测信息中包括对应物理计算资源对象在从多个休眠状态中任一休眠状态被唤醒情况下在下一次休眠时进入所述多个休眠状态中各个休眠状态的概率信息;选择模块702,用于:根据所述多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象;调度模块703,用于:将待调度的目标任务调度到所述目标物理计算资源对象上。The present disclosure embodiment also provides a computing resource processing device, as shown in Figure 7, the device includes: a maintenance module 701, which is used to maintain 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 at the next sleep when it is awakened from any of the plurality of sleep states; a selection module 702, which is used to 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; and a scheduling module 703, which is used to schedule the target task to be scheduled to the target physical computing resource object.
在一些可选的实施例中,维护模块701在维护多个物理计算资源对象各自对应的休眠状态转移预测信息时,具体用于:在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间,第一休眠状态为任一休眠状态;根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息。In some optional embodiments, when maintaining sleep state transfer prediction information corresponding to each of a plurality of physical computing resource objects, the maintenance module 701 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 according to the actual sleep time and the exit delay time of the first sleep state.
在一些可选的实施例中,维护模块701在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间时,具体用于:获取任一物理计算资源对象进入第一休眠状态的第一时间,以及被唤醒事件从第一休眠状态唤醒的第二时间;根据第二时间和第一时间,计算任一物理计算资源对象在第一休眠状态下的实际休眠时间。In some optional embodiments, when the maintenance module 701 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; 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.
在一些可选的实施例中,维护模块701根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息时,具体用于:在实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;在实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,第二休眠状态是退出延迟时间与实际休眠时间相匹配的休眠状态。In some optional embodiments, when the maintenance module 701 updates 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, 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 that any physical computing resource object will enter the first sleep state again when it is awakened from the first sleep state in the next sleep; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object will enter the second sleep state when it is awakened from the first sleep state in the next sleep, the second sleep state being a sleep state whose exit delay time matches the actual sleep time.
在一些可选的实施例中,维护模块701在相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息时,具体用于:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠 状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态之外的休眠状态。In some optional embodiments, the maintenance module 701 is specifically used to: 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 when it is awakened from the first sleep state; 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 at the next sleep state, where the other sleep states refer to sleep states other than the first sleep state.
在一些可选的实施例中,维护模块701在相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息时,具体用于:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第一休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态和第二休眠状态之外的休眠状态。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 at the next sleep state when it is 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 at the next sleep state when it is awakened from the first sleep state; and/or, reduce the probability information that any physical computing resource object enters the first sleep state at the next sleep state when it is awakened from the first sleep state; and/or, reduce the probability information that any physical computing resource object enters other sleep states at the next sleep state when it is awakened from the first sleep state, and other sleep states refer to sleep states other than the first sleep state and the second sleep state.
在一些可选的实施例中,维护模块701还用于:在初始化过程中,创建多个物理计算资源对象各自对应的数据结构体,数据结构体用于存储对应物理计算资源对象对应的休眠状态转移预测信息;初始化多个物理计算资源对象各自对应的数据结构体,以得到多个物理计算资源对象各自对应的休眠状态转移预测信息的初始值。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 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.
在一些可选的实施例中,维护模块701创建多个物理计算资源对象各自对应的数据结构体时,具体用于:创建多个物理计算资源对象各自对应的休眠状态权重数组,休眠状态权重数组是包括多行和多列的多维数组;其中,一行代表对应物理计算资源对象被唤醒时可能所处的一个休眠状态,一列代表对应物理计算资源对象在下一次休眠时可能进入的一个休眠状态;行列相交的数组元素表示对应物理计算资源对象在从该行代表的休眠状态被唤醒时在下一次休眠时进入该列所代表的休眠状态的权重,权重越大概率越高。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 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 when it sleeps next time, and the larger the weight, the higher the probability.
在一些可选的实施例中,维护模块701初始化多个物理计算资源对象各自对应的数据结构体时具体用于:将行数和列数相同的数组元素初始化为第一值,并将行数和列数不同的数组元素初始化为第二值;其中,第一值大于第二值,且同一行中的第一值与第二值之和为第三值。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.
在一些可选的实施例中,选择模块702还用于:在监测到任一物理计算资源对象需要休眠时,根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态;控制任一物理计算资源对象进入第三休眠状态。In some optional embodiments, the selection module 702 is also used to: when it is monitored that any physical computing resource object needs to sleep, determine the third sleep state according to 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.
在一些可选的实施例中,选择模块702根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态时,具体用于:获取任一物理计算资源对象最近退出的休眠状态,作为第四休眠状态;从任一物理计算资源对象对应的休眠状态转移预测信息中,获取从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息;根据从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息,选择概率信息 最大的休眠状态作为候选休眠状态;在候选休眠状态的退出延迟时间小于系统最大可容忍的退出延迟时间的情况下,将候选休眠状态作为第三休眠状态。In some optional embodiments, when the selection module 702 determines the third sleep state according to the sleep state transition prediction information corresponding to any physical computing resource object, it is specifically 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 transition prediction information corresponding to any physical computing resource object; select the probability information according to the probability information of entering each sleep state at the next sleep state when awakened from the fourth sleep state The maximum sleep state is used as a 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.
在一些可选的实施例中,选择模块702还用于:在候选休眠状态的退出延时时间大于或等于系统最大可容忍的退出延迟时间的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态。In some optional embodiments, the selection module 702 is further used 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.
在一些可选的实施例中,选择模块702选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态时,具体用于:在退出延时时间小于系统最大可容忍的退出延迟时间的休眠状态为多个的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间且概率信息最大的休眠状态作为第三休眠状态。In some optional embodiments, when the selection module 702 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.
在一些可选的实施例中,选择模块702根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象时,具体用于:响应资源调度触发事件,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息;根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象。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.
在一些可选的实施例中,选择模块702根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息时,具体用于:针对任一物理计算资源对象,从任一物理计算资源对象对应的休眠状态转移预测信息中,获取任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息;根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息。In some optional embodiments, when the selection module 702 generates sleep habit information corresponding to multiple physical computing resource objects based on 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 from the sleep state transfer prediction information corresponding to any physical computing resource object; 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.
在一些可选的实施例中,选择模块702根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息时,具体用于:若任一物理计算资源对象从最浅休眠状态退出并在下一次休眠时进入该最浅休眠状态的概率信息最大,确定任一物理计算资源对应的休眠习惯类型为浅度休眠习惯,并根据最大的概率信息生成任一物理计算资源对象在浅度休眠习惯下的休眠概率;若任一物理计算资源对象从最深休眠状态退出并在下一次休眠时进入该最深休眠状态的概率信息最大,确定任一物理计算资源对象对应的休眠习惯类型为深度休眠习惯,并根据最大的概率信息生成任一物理计算资源在深度休眠习惯下的休眠概率。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 entering the sleep state again 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.
在一些可选的实施例中,选择模块702根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象时,具体用于:根据多个物理计算资源对象各自对应的休眠习惯信息,确定对应于浅度休眠习惯的至少一个候选物 理计算资源对象;根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象。In some optional embodiments, when the selection module 702 selects a target physical computing resource object from a plurality of physical computing resource objects according to the sleep habit information corresponding to each of the plurality of physical computing resource objects, the selection module 702 is specifically configured to: determine at least one candidate corresponding to a shallow sleep habit according to the sleep habit information corresponding to each of the plurality of physical computing resource objects; According to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit, select the candidate physical computing resource object whose sleep probability meets the requirements as the target physical computing resource object.
在一些可选的实施例中,选择模块702根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象时,具体用于:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象;其中,其它辅助信息包括资源调度触发事件的类型、候选物理计算资源对象当前的运行状态以及候选物理计算资源对象当前的利用率中的至少一种。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.
在一些可选的实施例中,选择模块702根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象时,具体用于:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率和当前的利用率,选择利用率符合要求且休眠概率最大的候选物理计算资源对象作为目标物理计算资源对象。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 in a shallow sleep habit and other auxiliary information, it is specifically used to: select a 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 in a shallow sleep habit and the current utilization rate.
在本实施例中,将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,通过维护多个物理计算资源对象各自对应的休眠状态转移预测信息,根据所维护的休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率。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 can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for keeping some physical computing resource objects in a deep sleep state for as long as possible, keeping some physical computing resource objects in a busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.
图8为本公开示例性实施例提供的一种电子设备的结构示意图,如图8所示,该设备包括:存储器801和处理器802。其中,该电子设备包括但不限于前述实施例中的物理机,本实施例不做限制。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 make any limitation.
存储器801,用于存储计算机程序,并可被配置为存储其它各种数据以支持在电子设备上的操作。这些数据的示例包括用于在电子设备上操作的任何应用程序或方法的指令等。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.
在一些实施例中,处理器802,与存储器801耦合,用于执行存储器801中的计算机程序,以用于:维护多个物理计算资源对象各自对应的休眠状态转移预测信息,所述休眠状态转移预测信息中包括对应物理计算资源对象在从多个休眠状态中任一休眠状态被唤醒情况下在下一次休眠时进入所述多个休眠状态中各个休眠状态的概率信息;根据所述多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象;将待调度的目标任务调度到所述目标物理计算资源对象上。In some embodiments, the processor 802 is coupled to the memory 801 and is used to execute the computer program in the memory 801, so as to: maintain sleep state transfer prediction information corresponding to each of the multiple 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 multiple sleep states when it is awakened from any of the multiple sleep states at the next sleep; select a target physical computing resource object according to the sleep state transfer 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.
在一些可选的实施例中,处理器802在维护多个物理计算资源对象各自对应的休眠状 态转移预测信息时,具体用于:在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间,第一休眠状态为任一休眠状态;根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息。In some optional embodiments, the processor 802 maintains the sleep state corresponding to each of the plurality of physical computing resource objects. When the state transfer prediction information is obtained, it is specifically used to: when monitoring that any physical computing resource object is awakened from the first sleep state, obtain the actual sleep time of any physical computing resource object in the first sleep state, the first sleep state being any sleep state; according to the actual sleep time and the exit delay time of the first sleep state, update the sleep state transfer prediction information corresponding to any physical computing resource object.
在一些可选的实施例中,处理器802在监测到任一物理计算资源对象从第一休眠状态被唤醒时,获取任一物理计算资源对象在第一休眠状态下的实际休眠时间时,具体用于:获取任一物理计算资源对象进入第一休眠状态的第一时间,以及被唤醒事件从第一休眠状态唤醒的第二时间;根据第二时间和第一时间,计算任一物理计算资源对象在第一休眠状态下的实际休眠时间。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 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 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.
在一些可选的实施例中,处理器802根据实际休眠时间和第一休眠状态的退出延迟时间,更新任一物理计算资源对象对应的休眠状态转移预测信息时,具体用于:在实际休眠时间与第一休眠状态的退出延迟时间相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;在实际休眠时间与第一休眠状态的退出延迟时间不相匹配的情况下,相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息,第二休眠状态是退出延迟时间与实际休眠时间相匹配的休眠状态。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 that any physical computing resource object will enter the first sleep state again when it is awakened from the first sleep state in the next sleep; when the actual sleep time does not match the exit delay time of the first sleep state, relatively increase the probability information that any physical computing resource object will enter the second sleep state when it is awakened from the first sleep state in the next sleep, the second sleep state being a sleep state whose exit delay time matches the actual sleep time.
在一些可选的实施例中,处理器802在相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息时,具体用于:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时再次进入第一休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态之外的休眠状态。In some optional embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object will re-enter the first sleep state at the next sleep state 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 re-enter the first sleep state at the next sleep state 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 at the next sleep state when it is awakened from the first sleep state, and other sleep states refer to sleep states other than the first sleep state.
在一些可选的实施例中,处理器802在相对增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息时,具体用于:增大任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第二休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入第一休眠状态的概率信息;和/或,减小任一物理计算资源对象从第一休眠状态被唤醒情况下在下一次休眠时进入其它休眠状态的概率信息,其它休眠状态是指第一休眠状态和第二休眠状态之外的休眠状态。In some optional embodiments, when the processor 802 relatively increases the probability information that any physical computing resource object enters the second sleep state at the next sleep state when it is 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 at the next sleep state when it is awakened from the first sleep state; and/or, reduce the probability information that any physical computing resource object enters the first sleep state at the next sleep state when it is awakened from the first sleep state; and/or, reduce the probability information that any physical computing resource object enters other sleep states at the next sleep state when it is awakened from the first sleep state, and other sleep states refer to sleep states other than the first sleep state and the second sleep state.
在一些可选的实施例中,处理器802还用于:在初始化过程中,创建多个物理计算资源对象各自对应的数据结构体,数据结构体用于存储对应物理计算资源对象对应的休眠状态转移预测信息;初始化多个物理计算资源对象各自对应的数据结构体,以得到多个物理 计算资源对象各自对应的休眠状态转移预测信息的初始值。In some optional embodiments, the processor 802 is further used to: during the initialization process, create a data structure corresponding to each of the plurality of physical computing resource objects, the data structure being used to store sleep state transition prediction information corresponding to the corresponding physical computing resource object; initialize the data structure corresponding to each of the plurality of physical computing resource objects to obtain the plurality of physical The initial value of the sleep state transition prediction information corresponding to each resource object is calculated.
在一些可选的实施例中,处理器802创建多个物理计算资源对象各自对应的数据结构体时,具体用于:创建多个物理计算资源对象各自对应的休眠状态权重数组,休眠状态权重数组是包括多行和多列的多维数组;其中,一行代表对应物理计算资源对象被唤醒时可能所处的一个休眠状态,一列代表对应物理计算资源对象在下一次休眠时可能进入的一个休眠状态;行列相交的数组元素表示对应物理计算资源对象在从该行代表的休眠状态被唤醒时在下一次休眠时进入该列所代表的休眠状态的权重,权重越大概率越高。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 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 when it sleeps next time, and the larger the weight, the higher the probability.
在一些可选的实施例中,处理器802初始化多个物理计算资源对象各自对应的数据结构体时具体用于:将行数和列数相同的数组元素初始化为第一值,并将行数和列数不同的数组元素初始化为第二值;其中,第一值大于第二值,且同一行中的第一值与第二值之和为第三值。In some optional embodiments, when the processor 802 initializes the data structures corresponding to each of the 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.
在一些可选的实施例中,处理器802还用于:在监测到任一物理计算资源对象需要休眠时,根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态;控制任一物理计算资源对象进入第三休眠状态。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 according to 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.
在一些可选的实施例中,处理器802根据任一物理计算资源对象对应的休眠状态转移预测信息,确定第三休眠状态时,具体用于:获取任一物理计算资源对象最近退出的休眠状态,作为第四休眠状态;从任一物理计算资源对象对应的休眠状态转移预测信息中,获取从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息;根据从第四休眠状态被唤醒情况下在下一次休眠时进入各个休眠状态的概率信息,选择概率信息最大的休眠状态作为候选休眠状态;在候选休眠状态的退出延迟时间小于系统最大可容忍的退出延迟时间的情况下,将候选休眠状态作为第三休眠状态。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.
在一些可选的实施例中,处理器802还用于:在候选休眠状态的退出延时时间大于或等于系统最大可容忍的退出延迟时间的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态。In some optional embodiments, the processor 802 is further used 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.
在一些可选的实施例中,处理器802选择退出延时时间小于系统最大可容忍的退出延迟时间的另一休眠状态作为第三休眠状态时,具体用于:在退出延时时间小于系统最大可容忍的退出延迟时间的休眠状态为多个的情况下,选择退出延时时间小于系统最大可容忍的退出延迟时间且概率信息最大的休眠状态作为第三休眠状态。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.
在一些可选的实施例中,处理器802根据多个物理计算资源对象各自对应的休眠状态转移预测信息,选择目标物理计算资源对象时,具体用于:响应资源调度触发事件,根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各 自对应的休眠习惯信息;根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象。In some optional embodiments, when the processor 802 selects a target physical computing resource object according to 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 a plurality of physical computing resource objects according to the sleep state transfer prediction information corresponding to each of the multiple physical computing resource objects; The target physical computing resource object is selected from the multiple physical computing resource objects according to the sleep habit information corresponding to each of the multiple physical computing resource objects.
在一些可选的实施例中,处理器802根据多个物理计算资源对象各自对应的休眠状态转移预测信息,生成多个物理计算资源对象各自对应的休眠习惯信息时,具体用于:针对任一物理计算资源对象,从任一物理计算资源对象对应的休眠状态转移预测信息中,获取任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息;根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息。In some optional embodiments, when the processor 802 generates sleep habit information corresponding to multiple physical computing resource objects based on 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 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; generate 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.
在一些可选的实施例中,处理器802根据任一物理计算资源对象从任一休眠状态退出并在下一次休眠时再次进入该休眠状态的概率信息,生成任一物理计算资源对象对应的休眠习惯信息时,具体用于:若任一物理计算资源对象从最浅休眠状态退出并在下一次休眠时进入该最浅休眠状态的概率信息最大,确定任一物理计算资源对应的休眠习惯类型为浅度休眠习惯,并根据最大的概率信息生成任一物理计算资源对象在浅度休眠习惯下的休眠概率;若任一物理计算资源对象从最深休眠状态退出并在下一次休眠时进入该最深休眠状态的概率信息最大,确定任一物理计算资源对象对应的休眠习惯类型为深度休眠习惯,并根据最大的概率信息生成任一物理计算资源在深度休眠习惯下的休眠概率。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 entering the sleep state again 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.
在一些可选的实施例中,处理器802根据多个物理计算资源对象各自对应的休眠习惯信息,从多个物理计算资源对象中选择目标物理计算资源对象时,具体用于:根据多个物理计算资源对象各自对应的休眠习惯信息,确定对应于浅度休眠习惯的至少一个候选物理计算资源对象;根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象。In some optional embodiments, when the processor 802 selects 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, 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 plurality of 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.
在一些可选的实施例中,处理器802根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,选择休眠概率符合要求的候选物理计算资源对象作为目标物理计算资源对象时,具体用于:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象;其中,其它辅助信息包括资源调度触发事件的类型、候选物理计算资源对象当前的运行状态以及候选物理计算资源对象当前的利用率中的至少一种。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 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.
在一些可选的实施例中,处理器802根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率,结合其它辅助信息,从至少一个候选物理计算资源对象中选择目标物理计算资源对象时,具体用于:根据至少一个候选物理计算资源对象在浅度休眠习惯下的休眠概率和当前的利用率,选择利用率符合要求且休眠概率最大的候选物理计算资源对象 作为目标物理计算资源对象。In some optional embodiments, 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 the shallow sleep habit and in combination with other auxiliary information, specifically for: selecting a candidate physical computing resource object whose utilization rate meets the requirements and whose sleep probability is the largest according to the sleep probability of at least one candidate physical computing resource object under the shallow sleep habit and the current utilization rate; As the target physical compute resource object.
进一步,如图8所示,该电子设备还包括:通信组件803、显示器804和电源组件805等其它组件。图8中仅示意性给出部分组件,并不意味着电子设备只包括图8所示组件。另外,图8中虚线框内的组件为可选组件,而非必选组件,具体可视电子设备的产品形态而定。本实施例的电子设备可以实现为台式电脑、笔记本电脑、平板电脑、智能手机或IOT设备等终端设备,也可以是常规服务器、云服务器或服务器阵列等服务端设备。若本实施例的电子设备实现为台式电脑、笔记本电脑、平板电脑、智能手机等终端设备,可以包含图8中虚线框内的组件;若本实施例的电子设备实现为常规服务器、云服务器或服务器阵列等服务端设备,则可以不包含图8中虚线框内的组件。Further, 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 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.
相应地,本公开实施例还提供一种存储有计算机程序的计算机可读存储介质,计算机程序被执行时能够实现上述图5所示方法实施例中可由电子设备执行的各步骤。Accordingly, an embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program, and when the computer program is executed, each step that can be executed by an electronic device in the method embodiment shown in FIG. 5 above can be implemented.
相应地,本公开实施例还提供一种多核处理器系统,包括多个处理器核心和存储器,所述存储器用于存储操作系统的程序代码,所述多个处理器核心用于运行所述操作系统的程序代码,以用于实现上述图5所示方法实施例中的步骤。Correspondingly, an embodiment of the present disclosure also provides a multi-core processor system, including 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.
在本实施例中,将对物理计算资源对象的资源调度与对物理计算资源对象的休眠控制进行结合,通过维护多个物理计算资源对象各自对应的休眠状态转移预测信息,根据所维护的休眠状态转移预测信息对物理计算资源对象进行调度,能够尽量将任务调度到休眠状态相对较浅或者相对忙碌的物理计算资源对象上,有利于让部分物理计算资源对象尽量较长时间处于深度休眠状态,让部分物理计算资源对象尽量处于忙碌状态,降低物理计算资源对象进出休眠状态的频率。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 can schedule tasks to physical computing resource objects with relatively shallow sleep states or relatively busy states as much as possible, which is beneficial for keeping some physical computing resource objects in a deep sleep state for as long as possible, keeping some physical computing resource objects in a busy state as much as possible, and reducing the frequency of physical computing resource objects entering and exiting the sleep state.
上述存储器可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(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),磁存储器,快闪存储器,磁盘或光盘。The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination of them, 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 storage, flash memory, disk or optical disk.
上述通信组件被配置为便于通信组件所在设备和其他设备之间有线或无线方式的通信。通信组件所在设备可以接入基于通信标准的无线网络,如WiFi,2G、3G、4G/LTE、5G等移动通信网络,或它们的组合。在一个示例性实施例中,通信组件经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件还包括近场通信(Near Field Communication,NFC)模块,以促进短程通信。例如,在NFC 模块可基于射频识别(Radio Frequency Identification,RFID)技术,红外数据协会(Infrared Data Association,IrDA)技术,超宽带(Ultra Wide Band,UWB)技术,蓝牙(BlueTooth,BT)技术和其他技术来实现。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, in NFC The 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.
上述显示器包括屏幕,其屏幕可以包括液晶显示器(Liquid Crystal Display,LCD)和触摸面板(TouchPanel,TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与触摸或滑动操作相关的持续时间和压力。The above-mentioned display includes a screen, and the screen 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 a user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
上述电源组件,为电源组件所在设备的各种组件提供电力。电源组件可以包括电源管理系统,一个或多个电源,及其他与为电源组件所在设备生成、管理和分配电力相关联的组件。The power supply assembly provides power to various components of the device where 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 where the power supply assembly is located.
上述音频组件,可被配置为输出和/或输入音频信号。例如,音频组件包括一个麦克风(Microphone,MIC),当音频组件所在设备处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器或经由通信组件发送。在一些实施例中,音频组件还包括一个扬声器,用于输出音频信号。The above-mentioned audio component can be configured to output and/or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. 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 an audio signal.
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可读存储介质(包括但不限于磁盘存储器、只读光盘(Compact Disc Read-Only Memory,CD-ROM)、光学存储器等)上实施的计算机程序产品的形式。It should be understood by those skilled in the art 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 aspects. Moreover, 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 disk storage, compact disc read-only memory (CD-ROM), optical storage, etc.) containing computer-usable program code.
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present disclosure is described with reference to the flowchart and/or block diagram of the method, device (system), and computer program product according to the embodiment 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 process and/or box 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 process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个 方框中指定的功能。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 work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, and the instruction device is implemented in one or more processes of the flowchart and/or one or more blocks of the block diagram. The function specified in the box.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby 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.
在一个典型的配置中,计算设备包括一个或多个处理器(Central Processing Unit,CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(Random Access Memory,RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(Phase-change Random Access Memory,PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(Dynamic Random Access Memory,DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(Digital Video Disc,DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, Phase-change Random Access Memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read-Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, 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 in this article, computer readable media does not include transitory media such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
以上仅为本公开的实施例而已,并不用于限制本公开。对于本领域技术人员来说,本公开可以有各种更改和变化。凡在本公开的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本公开的权利要求范围之内。 The above are only embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.
Claims (16)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311817214.3A CN120216153A (en) | 2023-12-26 | 2023-12-26 | Computing resource processing method, device and storage medium |
| CN202311817214.3 | 2023-12-26 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025139217A1 true WO2025139217A1 (en) | 2025-07-03 |
Family
ID=96110586
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/125026 Pending WO2025139217A1 (en) | 2023-12-26 | 2024-10-15 | Computing resource processing method, device, and storage medium |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN120216153A (en) |
| WO (1) | WO2025139217A1 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170308148A1 (en) * | 2016-04-20 | 2017-10-26 | Microsoft Technology Licensing, Llc | Adaptive Doze to Hibernate |
| CN114710563A (en) * | 2020-12-17 | 2022-07-05 | 华为技术有限公司 | Cluster energy saving method and device |
| WO2023206693A1 (en) * | 2022-04-29 | 2023-11-02 | 华为技术有限公司 | System sleep method and apparatus and system wake-up method and apparatus |
| CN117149440A (en) * | 2023-10-26 | 2023-12-01 | 北京趋动智能科技有限公司 | Task scheduling method and device, electronic equipment and storage medium |
-
2023
- 2023-12-26 CN CN202311817214.3A patent/CN120216153A/en active Pending
-
2024
- 2024-10-15 WO PCT/CN2024/125026 patent/WO2025139217A1/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20170308148A1 (en) * | 2016-04-20 | 2017-10-26 | Microsoft Technology Licensing, Llc | Adaptive Doze to Hibernate |
| CN114710563A (en) * | 2020-12-17 | 2022-07-05 | 华为技术有限公司 | Cluster energy saving method and device |
| WO2023206693A1 (en) * | 2022-04-29 | 2023-11-02 | 华为技术有限公司 | System sleep method and apparatus and system wake-up method and apparatus |
| CN117149440A (en) * | 2023-10-26 | 2023-12-01 | 北京趋动智能科技有限公司 | Task scheduling method and device, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN120216153A (en) | 2025-06-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10437639B2 (en) | Scheduler and CPU performance controller cooperation | |
| US10509677B2 (en) | Granular quality of service for computing resources | |
| KR101029414B1 (en) | Apparatus and method provided for detecting processor state transition and machine accessible media and computing system | |
| US10049327B2 (en) | Application characterization for machine learning on heterogeneous core devices | |
| CN104303149B (en) | Method and system for scheduling requests in a portable computing device | |
| CN103930874B (en) | Changed using scheduled resource group and estimated by the workload to portable computing and save power | |
| JP6370498B2 (en) | Method and system for operating state coordination among multiple SOCs in a computing device | |
| US20100153765A1 (en) | Power state dependent wake-up alarm | |
| WO2018082570A1 (en) | I/o request scheduling method and device | |
| US9958933B2 (en) | Opportunistic waking of an application processor | |
| WO2024037068A1 (en) | Task scheduling method, electronic device and computer-readable storage medium | |
| WO2017206858A1 (en) | Method for managing central processing unit and related products | |
| CN119960944B (en) | Task scheduling methods and electronic devices | |
| KR20140067040A (en) | Managing processes within suspend states and execution states | |
| CN114816031B (en) | Power saving method for terminal equipment, terminal equipment and medium | |
| US11347544B1 (en) | Scheduling work items based on declarative constraints | |
| WO2025139217A1 (en) | Computing resource processing method, device, and storage medium | |
| WO2022039744A1 (en) | Temperature control of computing device | |
| HK40128203A (en) | Computing resource processing method and device and storage medium | |
| US12495089B2 (en) | Efficient datacenter energy management based on compute capacity and fleet management | |
| CN120821546B (en) | Multi-core real-time operating systems and their task scheduling methods, electronic devices | |
| CN120812711B (en) | Electronic device, control method thereof, and storage medium | |
| WO2021081813A1 (en) | Multi-core processor and scheduling method therefor, device, and storage medium | |
| WO2022206227A1 (en) | System startup method, device, and system, and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24910159 Country of ref document: EP Kind code of ref document: A1 |