Power Consumption Control Mode Selection Method, Device, Equipment and Readable Storage Medium
The method addresses power management inefficiencies by dynamically allocating power control strategies based on task type and execution status, ensuring efficient and stable power consumption in terminal devices.
Patent Information
- Application Number
- CN202111435563.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-11-29
AI Technical Summary
When multitasking is performed simultaneously, existing power consumption control methods may lead to reduced task execution efficiency or system stability problems, especially when different tasks have inconsistent power consumption requirements.
The task is assigned a power consumption control policy based on the task type and power consumption level request, and the policy is set to the on or disabled state according to the task execution situation to determine the actual power consumption control mode.
It ensures the execution efficiency and execution integrity of tasks, and maintains the stability of the system's multi-task operation.
Smart Images

Figure CN114116221B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terminal control, and in particular, to a method, device, equipment and readable storage medium for selecting a power consumption control mode. Background Art
[0002] With the development of the Internet of Things and edge computing, terminal devices, as data operation nodes, need to carry more tasks. In order to improve the utilization rate of individual terminal devices and meet the requirements of energy conservation, environmental protection and green efficiency, it is generally realized based on a real-time operating system and power consumption control at present.
[0003] However, the power consumption requirements corresponding to different tasks are different. When multiple tasks are executed simultaneously, enabling power consumption control may cause the execution efficiency of some tasks to decrease or be aborted; moreover, when performing power consumption control, directly operating the underlying hardware by tasks can easily lead to problems with the stability of system multi-task operations. Summary of the Invention
[0004] To solve the above technical problems, the present invention provides a method, device, equipment and readable storage medium for selecting a power consumption control mode.
[0005] In a first aspect, the present invention provides a method for selecting a power consumption control mode, and the method for selecting a power consumption control mode includes:
[0006] Allocating power consumption control strategies for each task based on the task type and power consumption level request of each task;
[0007] Setting each power consumption control strategy to an on state or an off state based on the execution situation of each task;
[0008] Determining the actual power consumption control mode according to the status of each power consumption control strategy.
[0009] Optionally, the task type includes a single-task type and a multi-task type, and the power consumption control strategy includes control based on a total switch method and control based on a reference count method. Correspondingly, allocating power consumption control strategies for each task based on the task type and power consumption level request of each task includes:
[0010] Allocating a power consumption control strategy based on the total switch method for a single-task type task;
[0011] And / or, allocating a power consumption control strategy based on the reference count method for a multi-task type task;
[0012] Wherein, the level of the power consumption control mode included in the power consumption control strategy is not greater than the target level corresponding to the power consumption level request of the corresponding task, and the higher the level of the power consumption control mode, the greater the power consumption control intensity.
[0013] Optionally, setting each power consumption control policy to an enabled state or a disabled state based on the execution status of each task includes:
[0014] When the task is a single-task type, the power consumption control policy assigned to the task is set to the disabled state before the task is completed, and the power consumption control policy assigned to the task is set to the enabled state after the task is completed;
[0015] When the task is a multi-task type, the power consumption control policy assigned to the task is set to the disabled state when the reference count is not zero, and the power consumption control policy assigned to the task is set to the enabled state when the reference count is zero. Among them, the task includes multiple subtasks. The reference count is incremented by one before each subtask is executed, and the reference count is decremented by one after each subtask is completed. The reference count is zero after all subtasks are completed.
[0016] Optionally, determining the actual power consumption control mode according to the status of each power consumption control policy includes:
[0017] When there is only a power consumption control policy in the enabled state, determine the highest-level power consumption control mode that each enabled power consumption control policy can enable. Among them, the highest-level power consumption control mode that an enabled power consumption control policy can enable is the power consumption control mode of the corresponding target level;
[0018] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest level that each enabled power consumption control policy can enable as the actual power consumption control mode.
[0019] Optionally, determining the actual power consumption control mode according to the status of each power consumption control policy includes:
[0020] When there is only a power consumption control policy in the disabled state, determine the highest-level power consumption control mode that each disabled power consumption control policy can enable. Among them, the highest-level power consumption control mode that a disabled power consumption control policy can enable is a power consumption control mode that is one level lower than the power consumption control mode of the corresponding target level;
[0021] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest level that each disabled power consumption control policy can enable as the actual power consumption control mode.
[0022] Optionally, determining the actual power consumption control mode according to the status of each power consumption control policy includes:
[0023] When there are power consumption control policies in the enabled state and power consumption control policies in the disabled state, determine the highest-level power consumption control mode that can be enabled for each power consumption control policy in the enabled state, and determine the highest-level power consumption control mode that can be enabled for each power consumption control policy in the disabled state;
[0024] Select the power consumption control mode with the lowest level from the highest-level power consumption control modes that can be enabled for each power consumption control policy in the enabled state and the highest-level power consumption control modes that can be enabled for each power consumption control policy in the disabled state as the actual power consumption control mode.
[0025] In a second aspect, the present invention further provides a power consumption control mode selection device, where the power consumption control mode selection device includes:
[0026] An allocation module for allocating power consumption control policies for each task based on the task type and power consumption level request of each task;
[0027] A setting module for setting each power consumption control policy to the enabled state or the disabled state based on the execution situation of each task;
[0028] A determination module for determining the actual power consumption control mode according to the state of each power consumption control policy.
[0029] In a third aspect, the present invention further provides a power consumption control mode selection device, where the power consumption control mode selection device includes a processor, a memory, and a power consumption control mode selection program stored on the memory and executable by the processor. When the power consumption control mode selection program is executed by the processor, the power consumption control mode selection method described above is implemented.
[0030] In a fourth aspect, the present invention further provides a readable storage medium, where a power consumption control mode selection program is stored on the readable storage medium. When the power consumption control mode selection program is executed by a processor, the power consumption control mode selection method described above is implemented.
[0031] In the present invention, power consumption control policies are allocated for each task based on the task type and power consumption level request of each task; each power consumption control policy is set to the enabled state or the disabled state based on the execution situation of each task; and the actual power consumption control mode is determined according to the state of each power consumption control policy. Through the present invention, the actual power consumption control mode is determined according to the state of the power consumption control policies allocated for each task, so that the actually selected power consumption control mode meets the power consumption requirements of each task, thereby ensuring the execution efficiency and execution integrity of each task, and without the need for tasks to participate in the power consumption control process, ensuring the stability of the system's multi-task operation. Description of the Drawings
[0032] Figure 1Schematic diagram of the hardware structure of the power consumption control mode selection device involved in the embodiment of the present invention;
[0033] Figure 2 Schematic flowchart of an embodiment of the power consumption control mode selection method of the present invention;
[0034] Figure 3 Schematic diagram of the functional modules of an embodiment of the power consumption control mode selection device of the present invention.
[0035] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners
[0036] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0037] In a first aspect, an embodiment of the present invention provides a power consumption control mode selection device, and the power consumption control mode selection device may be an embedded electronic device, a personal computer (PC), a laptop computer, a server, or other devices with data processing functions.
[0038] Referring to Figure 1 , Figure 1 is a schematic diagram of the hardware structure of the power consumption control mode selection device involved in the embodiment of the present invention. In the embodiment of the present invention, the power consumption control mode selection device may include a processor 1001 (such as a Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wireless-FIdelity, WI-FI interface); the memory 1005 may be a high-speed random access memory (random access memory, RAM), or a stable memory (non-volatile memory), such as a disk memory, and the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001. Those skilled in the art can understand that Figure 1 the hardware structure shown in
[0039] does not constitute a limitation to the present invention, and may include more or fewer components than shown in the figure, or combine some components, or different component arrangements. Figure 1 , Figure 1In the memory 1005 serving as a computer storage medium, an operating system, a network communication module, a user interface module, and a power consumption control mode selection program may be included. Among them, the processor 1001 may call the power consumption control mode selection program stored in the memory 1005 and execute the power consumption control mode selection method provided by the embodiments of the present invention.
[0040] In a second aspect, an embodiment of the present invention provides a method for selecting a power consumption control mode.
[0041] In one embodiment, with reference to Figure 2 , Figure 2 is a schematic flowchart of an embodiment of the power consumption control mode selection method of the present invention. As Figure 2 shown, the power consumption control mode selection method includes:
[0042] Step S10: Allocate a power consumption control strategy for each task based on the task type and power consumption level request of each task;
[0043] In this embodiment, there are two types of task types. One is the single-task type, that is, the task only contains a single task; the other is the multi-task type, that is, the task is composed of multiple subtasks. Each task also sends a power consumption level request, and the power consumption level requested by the power consumption level request is the highest level of the power consumption control mode that the task can accept for normal execution. The execution entity of this embodiment can allocate a power consumption control strategy for each task based on the task type and power consumption level request of each task.
[0044] Further, in one embodiment, the task type includes a single-task type and a multi-task type, the power consumption control strategy includes control based on the total switch method and control based on the reference count method. Correspondingly, step S10 includes:
[0045] Allocate a power consumption control strategy based on the total switch method for tasks of the single-task type;
[0046] and / or allocate a power consumption control strategy based on the reference count method for tasks of the multi-task type;
[0047] Among them, the level of the power consumption control mode included in the power consumption control strategy is not greater than the target level corresponding to the power consumption level request of the corresponding task, and the higher the level of the power consumption control mode, the greater the power consumption control intensity.
[0048] In this embodiment, for example, the levels of the power consumption control mode are: the first level < the second level < the third level < the fourth level < the fifth level, and the higher the level of the power consumption control mode, the greater the power consumption control intensity.
[0049] Taking the tasks to be currently executed including task A and task B as an example.
[0050] Task A is a single-task type. If the requested power consumption level for Task A corresponds to the target level of the fifth level, then a power consumption control strategy 1 based on the total switch method is allocated for Task A, and the level of the power consumption control mode included in the power consumption control strategy 1 is not greater than the fifth level.
[0051] Task B is a multi-task type. If the requested power consumption level for Task B corresponds to the target level of the third level, then a power consumption control strategy 2 based on the reference counting method is allocated for Task B, and the level of the power consumption control mode included in the power consumption control strategy 2 is not greater than the third level.
[0052] Step S20: Set each power consumption control strategy to the enabled state or the disabled state based on the execution situation of each task;
[0053] In this embodiment, each corresponding power consumption control strategy is set to the enabled state or the disabled state based on the execution situation of each task. For example, for a single-task type task, during the task execution phase, its corresponding power consumption control strategy is set to the disabled state, and when the task is not in the execution phase (such as when the task execution is completed), its corresponding power consumption control strategy is set to the enabled state. For a multi-task type task, during the execution phase of each subtask, its corresponding power consumption control strategy is set to the disabled state, and during the execution completion of all task subtasks or the execution interval between subtasks, its corresponding power consumption control strategy is set to the enabled state.
[0054] Further, in one embodiment, step S20 includes:
[0055] When the task is a single-task type, the power consumption control strategy allocated for the task is set to the disabled state before the task is completed, and the power consumption control strategy allocated for the task is set to the enabled state after the task is completed;
[0056] When the task is a multi-task type, the power consumption control strategy allocated for the task is set to the disabled state when the reference count is not zero, and the power consumption control strategy allocated for the task is set to the enabled state when the reference count is zero, where the task includes multiple subtasks, the reference count is incremented by one before each subtask is executed, the reference count is decremented by one after each subtask is completed, and the reference count is reset to zero after all subtasks are completed.
[0057] In this embodiment, taking Task A as an example of a single-task type, the power consumption control strategy 1 allocated for Task A is set to the disabled state before Task A is completed, and the power consumption control strategy 1 allocated for Task A is set to the enabled state after Task A is completed.
[0058] Taking task B as an example of the multi - task type, task B contains multiple subtasks. Before executing each subtask, the reference count is incremented by one. After each subtask is completed, the reference count is decremented by one. And after all subtasks are completed, the reference count returns to zero. In this way, the state of the power consumption control policy 2 allocated for task B can be set according to the reference count. Specifically, when the reference count is not zero, the power consumption control policy 2 allocated for task B is set to the disabled state, and when the reference count is zero, the power consumption control policy 2 allocated for task B is set to the enabled state.
[0059] Step S30: Determine the actual power consumption control mode according to the states of the respective power consumption control policies.
[0060] In this embodiment, according to the state of each power consumption control policy, an enabled power consumption control mode can be determined, and then the actual power consumption control mode is determined from multiple enabled power consumption control modes, so that the finally determined actual power consumption control mode meets the power consumption requirements of each task.
[0061] Further, in one embodiment, step S30 includes:
[0062] When there is only a power consumption control policy in the enabled state, determine the highest - level power consumption control mode that can be enabled by each power consumption control policy in the enabled state. Among them, the highest - level power consumption control mode that can be enabled by a power consumption control policy in the enabled state is the power consumption control mode of the corresponding target level;
[0063] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest level that can be enabled by each power consumption control policy in the enabled state as the actual power consumption control mode.
[0064] In this embodiment, for example, a power consumption control policy 1 based on the total - switch - mode control is allocated for task A, and the level of the power consumption control mode included in the power consumption control policy 1 is not greater than the fifth level (i.e., the target level corresponding to the power consumption level request of task A); a power consumption control policy 2 based on the reference - count - mode control is allocated for task B, and the level of the power consumption control mode included in the power consumption control policy 2 is not greater than the third level (i.e., the target level corresponding to the power consumption level request of task B).
[0065] If both the power consumption control policy 1 and the power consumption control policy 2 are in the enabled state, then it can be determined that the highest - level power consumption control mode that can be enabled by the power consumption control policy 1 is the power consumption control mode of the fifth level. Similarly, it can be determined that the highest - level power consumption control mode that can be enabled by the power consumption control policy 2 is the power consumption control mode of the third level. Obviously, the level of the power consumption control mode that can be enabled by the power consumption control policy 1 is greater than the level of the power consumption control mode that can be enabled by the power consumption control policy 2, so the power consumption control mode of the third level is selected as the actual power consumption control mode.
[0066] Further, in one embodiment, step S30 includes:
[0067] When there is only a power consumption control policy in the disabled state, determine the highest-level power consumption control mode that can be enabled for each power consumption control policy in the disabled state. Among them, the highest-level power consumption control mode that can be enabled for a power consumption control policy in the disabled state is a power consumption control mode that is one level lower than the corresponding target-level power consumption control mode;
[0068] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest levels that can be enabled for each power consumption control policy in the disabled state as the actual power consumption control mode.
[0069] In this embodiment, if both power consumption control policy 1 and power consumption control policy 2 are in the disabled state, it can be determined that the highest-level power consumption control mode that can be enabled for power consumption control policy 1 is the power consumption control mode of the fourth level. Similarly, it can be determined that the highest-level power consumption control mode that can be enabled for power consumption control policy 2 is the power consumption control mode of the second level. Obviously, the level of the power consumption control mode that can be enabled for power consumption control policy 1 is higher than the level of the power consumption control mode that can be enabled for power consumption control policy 2. Then, select the power consumption control mode of the second level as the actual power consumption control mode.
[0070] Further, in one embodiment, step S30 includes:
[0071] When there are power consumption control policies in the enabled state and power consumption control policies in the disabled state, determine the highest-level power consumption control mode that can be enabled for each power consumption control policy in the enabled state, and determine the highest-level power consumption control mode that can be enabled for each power consumption control policy in the disabled state;
[0072] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest levels that can be enabled for each power consumption control policy in the enabled state and the highest-level power consumption control modes that can be enabled for each power consumption control policy in the disabled state as the actual power consumption control mode.
[0073] In this embodiment, if power consumption control policy 1 is in the disabled state and power consumption control policy 2 is in the enabled state, it can be determined that the highest-level power consumption control mode that can be enabled for power consumption control policy 1 is the power consumption control mode of the fourth level, and it can be determined that the highest-level power consumption control mode that can be enabled for power consumption control policy 2 is the power consumption control mode of the third level. Then, finally select the power consumption control mode of the third level as the actual power consumption control mode.
[0074] In this embodiment, power consumption control policies are allocated for each task based on the task type and power consumption level request of each task; each power consumption control policy is set to an enabled state or a disabled state based on the execution situation of each task; and the actual power consumption control mode is determined according to the state of each power consumption control policy. Through this embodiment, the actual power consumption control mode is determined according to the state of the power consumption control policy allocated for each task, so that the actually selected power consumption control mode meets the power consumption requirements of each task, thereby ensuring the execution efficiency and execution integrity of each task, and without the need for the task to participate in the power consumption control process, ensuring the stability of the system's multi-task operation.
[0075] In a third aspect, an embodiment of the present invention further provides a power consumption control mode selection device.
[0076] In one embodiment, with reference to Figure 3 , Figure 3 is a schematic diagram of the function modules of an embodiment of the power consumption control mode selection device of the present invention. As Figure 3 shown, the power consumption control mode selection device includes:
[0077] An allocation module 10, configured to allocate a power consumption control policy for each task based on the task type and power consumption level request of each task;
[0078] A setting module 20, configured to set each power consumption control policy to an enabled state or a disabled state based on the execution situation of each task;
[0079] A determination module 30, configured to determine the actual power consumption control mode according to the state of each power consumption control policy.
[0080] Further, in one embodiment, the task type includes a single-task type and a multi-task type, and the power consumption control policy includes control based on a total switch method and control based on a reference count method. Correspondingly, the allocation module 10 is configured to:
[0081] Allocate a power consumption control policy based on the total switch method for a single-task type task;
[0082] And / or, allocate a power consumption control policy based on the reference count method for a multi-task type task;
[0083] Wherein, the level of the power consumption control mode included in the power consumption control policy is not greater than the target level corresponding to the power consumption level request of the corresponding task, and the higher the level of the power consumption control mode, the greater the power consumption control intensity.
[0084] Further, in one embodiment, the setting module 20 is configured to:
[0085] When the task is of the single-task type, the power consumption control policy assigned to the task is set to the disabled state before the task is completed, and the power consumption control policy assigned to the task is set to the enabled state after the task is completed;
[0086] When the task is of the multi-task type, the power consumption control policy assigned to the task is set to the disabled state when the reference count is not zero, and the power consumption control policy assigned to the task is set to the enabled state when the reference count is zero. Among them, the task includes multiple subtasks, the reference count is incremented by one before each subtask is executed, the reference count is decremented by one after each subtask is completed, and the reference count is zero after all subtasks are completed.
[0087] Further, in one embodiment, the determining module 30 is configured to:
[0088] When there is only a power consumption control policy in the enabled state, determine the highest-level power consumption control mode that each power consumption control policy in the enabled state can enable. Among them, the highest-level power consumption control mode that a power consumption control policy in the enabled state can enable is the power consumption control mode of the corresponding target level;
[0089] Select the lowest-level power consumption control mode from the highest-level power consumption control modes that each power consumption control policy in the enabled state can enable as the actual power consumption control mode.
[0090] Further, in one embodiment, the determining module 30 is configured to:
[0091] When there is only a power consumption control policy in the disabled state, determine the highest-level power consumption control mode that each power consumption control policy in the disabled state can enable. Among them, the highest-level power consumption control mode that a power consumption control policy in the disabled state can enable is a power consumption control mode that is one level lower than the power consumption control mode of the corresponding target level;
[0092] Select the lowest-level power consumption control mode from the highest-level power consumption control modes that each power consumption control policy in the disabled state can enable as the actual power consumption control mode.
[0093] Further, in one embodiment, the determining module 30 is configured to:
[0094] When there are power consumption control policies in the enabled state and power consumption control policies in the disabled state, determine the highest-level power consumption control mode that each power consumption control policy in the enabled state can enable, and determine the highest-level power consumption control mode that each power consumption control policy in the disabled state can enable;
[0095] Select the power consumption control mode with the lowest level from the power consumption control modes with the highest levels enabled by each enabled power consumption control strategy and the highest levels of power consumption control modes enabled by each disabled power consumption control strategy as the actual power consumption control mode.
[0096] Among them, the functional implementation of each module in the above power consumption control mode selection device corresponds to each step in the embodiment of the above power consumption control mode selection method, and its functions and implementation processes will not be elaborated here one by one.
[0097] Fourthly, an embodiment of the present invention also provides a readable storage medium.
[0098] A power consumption control mode selection program is stored on the readable storage medium of the present invention. When the power consumption control mode selection program is executed by a processor, the steps of the power consumption control mode selection method as described above are implemented.
[0099] Among them, the method implemented when the power consumption control mode selection program is executed can refer to each embodiment of the power consumption control mode selection method of the present invention, which will not be elaborated here.
[0100] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or system including that element.
[0101] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0102] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device to execute the methods described in each embodiment of the present invention.
[0103] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A method for selecting a power consumption control mode, characterized in that The power consumption control mode selection method includes: Allocating power consumption control policies for each task based on the task type and power consumption level request of each task; Setting each power consumption control policy to an enabled state or a disabled state based on the execution status of each task; Determining the actual power consumption control mode according to the status of each power consumption control policy; The task type includes a single-task type and a multi-task type, and the power consumption control policy includes control based on a total switch method and control based on a reference count method. Correspondingly, allocating power consumption control policies for each task based on the task type and power consumption level request of each task includes: Allocating a power consumption control policy based on the total switch method for tasks of the single-task type; And / or allocating a power consumption control policy based on the reference count method for tasks of the multi-task type; Among them, the level of the power consumption control mode included in the power consumption control policy is not greater than the target level corresponding to the power consumption level request of the corresponding task, and the higher the level of the power consumption control mode, the greater the power consumption control intensity; Setting each power consumption control policy to an enabled state or a disabled state based on the execution status of each task includes: When the task is of the single-task type, setting the power consumption control policy allocated to the task to the disabled state before the task is completed, and setting the power consumption control policy allocated to the task to the enabled state after the task is completed; When the task is of the multi-task type, setting the power consumption control policy allocated to the task to the disabled state when the reference count is not zero, and setting the power consumption control policy allocated to the task to the enabled state when the reference count is zero. Among them, the task includes multiple subtasks, the reference count is incremented by one before each subtask is executed, the reference count is decremented by one after each subtask is completed, and the reference count is zero after all subtasks are completed; Determining the actual power consumption control mode according to the status of each power consumption control policy includes: When there is only a power consumption control policy in the enabled state, determining the highest-level power consumption control mode that can be enabled by each power consumption control policy in the enabled state. Among them, the highest-level power consumption control mode that can be enabled by a power consumption control policy in the enabled state is the power consumption control mode of the corresponding target level; Selecting the lowest-level power consumption control mode from the highest-level power consumption control modes that can be enabled by each power consumption control policy in the enabled state as the actual power consumption control mode.
2. The power consumption control mode selection method according to claim 1, wherein Determining the actual power consumption control mode according to the status of each power consumption control policy includes: When there is only a power consumption control policy in the disabled state, determining the highest-level power consumption control mode that can be enabled by each power consumption control policy in the disabled state. Among them, the highest-level power consumption control mode that can be enabled by a power consumption control policy in the disabled state is a power consumption control mode that is one level lower than the power consumption control mode of the corresponding target level; Selecting the lowest-level power consumption control mode from the highest-level power consumption control modes that can be enabled by each power consumption control policy in the disabled state as the actual power consumption control mode.
3. The power consumption control mode selection method according to claim 1, characterized in that Determining the actual power consumption control mode according to the status of each power consumption control policy includes: When there are power consumption control policies in the enabled state and power consumption control policies in the disabled state, determine the highest-level power consumption control mode that each enabled power consumption control policy can enable, and determine the highest-level power consumption control mode that each disabled power consumption control policy can enable; Select the power consumption control mode with the lowest level from the highest-level power consumption control modes that each enabled power consumption control policy can enable and the highest-level power consumption control modes that each disabled power consumption control policy can enable as the actual power consumption control mode.
4. A power consumption control mode selection device, characterized in that, The power consumption control mode selection device includes: An allocation module for allocating power consumption control policies for each task based on the task type of each task and the power consumption level request; A setting module for setting each power consumption control policy to the enabled state or the disabled state based on the execution status of each task; A determination module for determining the actual power consumption control mode according to the status of each power consumption control policy; The task type includes a single-task type and a multi-task type, and the power consumption control policy includes control based on the total switch method and control based on the reference count method. Correspondingly, the allocation module is specifically used for: Allocating a power consumption control policy based on the total switch method for a single-task type task; And / or, allocating a power consumption control policy based on the reference count method for a multi-task type task; Wherein, the level of the power consumption control mode included in the power consumption control policy is not greater than the target level corresponding to the power consumption level request of the corresponding task, and the higher the level of the power consumption control mode, the greater the power consumption control intensity; The setting module is specifically used for: When the task is of the single-task type, set the power consumption control policy allocated to the task to the disabled state before the task is completed, and set the power consumption control policy allocated to the task to the enabled state after the task is completed; When the task is of the multi-task type, set the power consumption control policy allocated to the task to the disabled state when the reference count is not zero, and set the power consumption control policy allocated to the task to the enabled state when the reference count is zero. Among them, the task includes multiple subtasks, the reference count is incremented by one before each subtask is executed, the reference count is decremented by one after each subtask is completed, and the reference count is zero after all subtasks are completed; The determination module is specifically used for: When there are only power consumption control policies in the enabled state, determine the highest-level power consumption control mode that each enabled power consumption control policy can enable, where the highest-level power consumption control mode that an enabled power consumption control policy can enable is the power consumption control mode of the corresponding target level; Select the power consumption control mode with the lowest level from the highest-level power consumption control modes that each enabled power consumption control policy can enable as the actual power consumption control mode.
5. A power consumption control mode selection device, characterized in that The power consumption control mode selection device includes a processor, a memory, and a power consumption control mode selection program stored on the memory and executable by the processor. When the power consumption control mode selection program is executed by the processor, the steps of the power consumption control mode selection method described in any one of claims 1 to 3 are implemented.
6. A readable storage medium, characterized in that, A power consumption control mode selection program is stored on the readable storage medium. When the power consumption control mode selection program is executed by a processor, the steps of the power consumption control mode selection method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Task scheduling method and device and server cluster
CN103902379A