CN116520968A - Power management method, device, computing equipment and storage medium - Google Patents

Power management method, device, computing equipment and storage medium Download PDF

Info

Publication number
CN116520968A
CN116520968A CN202310507422.7A CN202310507422A CN116520968A CN 116520968 A CN116520968 A CN 116520968A CN 202310507422 A CN202310507422 A CN 202310507422A CN 116520968 A CN116520968 A CN 116520968A
Authority
CN
China
Prior art keywords
scene
power consumption
consumption optimization
resource
working
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
Application number
CN202310507422.7A
Other languages
Chinese (zh)
Inventor
张廉洁
何鲁港
苏家训
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202310507422.7A priority Critical patent/CN116520968A/en
Publication of CN116520968A publication Critical patent/CN116520968A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/329Power saving characterised by the action undertaken by task scheduling
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a power management method, a device, a computing device and a storage medium, belonging to the technical field of computers, wherein the method comprises the following steps: determining a current working scene and resources supporting power consumption optimization, matching resource power consumption optimization information corresponding to the current working scene from the corresponding relation between the working scene and the resource power consumption optimization information, taking the resource power consumption optimization information as target power consumption optimization information, and updating the working mode of each resource supporting power consumption optimization into an optimized working mode corresponding to each resource supporting power consumption optimization in the target power consumption optimization information. Therefore, the invention is equivalent to providing a method for automatically managing the power supply, and the user does not need to learn the setting mode, so that the user experience is improved. And by adjusting the resource working mode suitable for the working scene under different working scenes, the normal operation of the process under the current working scene is ensured, the occupation of resources is reduced as much as possible, the use of electric quantity is reduced, and the power supply endurance of the computing equipment is improved.

Description

Power management method, device, computing equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a power management method, apparatus, computing device, and readable storage medium.
Background
The power management of the computing device refers to how to effectively distribute power to different components of the system, so that the energy consumption of the components when idle is reduced, and the excellent power management system can save one half or two thirds of energy, thereby improving the cruising ability of the computing device.
As the demands of users for real work and life increase, tasks to be started in the computing device increase accordingly, which increases power consumption of the computing device, so that the duration of the computing device is shortened. To solve this problem, the power consumption of the power supply is managed by a power management tool in the prior art, such as a laptop-mode-tools, tlp, powertop. The existing power management tools all need users to analyze the actual working condition of the notebook, further, the power management configuration is manually carried out on working options which can be optimized, and after the power management configuration is manually set by the users, the power control of specific equipment is realized through the power management file nodes exposed by the kernel under specific catalogues (such as/sys/proc/catalogues). Therefore, the existing power management method needs to be set manually by a user, has a certain technical requirement on the user, and has a certain use threshold for non-professional users, so that the learning cost of the user is increased.
Accordingly, it is desirable to provide a power management method to solve the technical problem that the existing power management method increases the learning cost of the user.
Disclosure of Invention
To this end, embodiments of the present invention provide a power management method, apparatus, computing device, and readable storage medium in an effort to solve or at least mitigate the above-identified problems.
According to an aspect of the embodiment of the present invention, there is provided a power management method, adapted to be executed in a computing device, where a correspondence between a working scenario and resource power consumption optimization information is stored, where the resource power consumption optimization information includes an optimized working mode of each resource, the method includes: determining a current working scene; determining resources supporting power consumption optimization; matching the resource power consumption optimization information corresponding to the current working scene from the corresponding relation between the working scene and the resource power consumption optimization information, and taking the resource power consumption optimization information as target power consumption optimization information; and updating the working modes of the supporting power consumption optimizing resources into the optimizing working modes corresponding to the supporting power consumption optimizing resources in the target power consumption optimizing information.
Optionally, the computing device stores a correspondence between an application name and a working scenario, and the determining the current working scenario includes: scanning process information of all started processes, wherein the process information comprises process names and resource use information; determining the started application names according to the process names of the processes, and matching the working scenes corresponding to the application names from the corresponding relation between the application names and the working scenes to serve as target scenes; calculating the total utilization rate of resources according to the resource utilization information of each process; judging whether the target scene is a combined scene or not, if so, determining a current working scene according to the type of the combined scene and the total utilization rate of resources, and if not, setting the current working scene as the target scene.
Optionally, calculating the total utilization rate of the resources according to the utilization information of the resources of each process includes: and carrying out summation processing on the values of the resource use information of each process, and taking the summation processing result as the total resource use rate.
Optionally, the working scene includes a daily office scene, a game scene and an entertainment scene, the combined scene types include a first type, a second type, a third type and a fourth type, the first type corresponds to a combined scene of the daily office scene and the entertainment scene, the second type corresponds to a combined scene of the daily office scene and the game scene, the third type corresponds to a combined scene of the entertainment scene and the game scene, and the fourth type corresponds to a combined scene of the daily office scene, the game scene and the entertainment scene.
Optionally, determining the current working scene according to the combined scene type and the total utilization rate of the resources includes: when the combined scene type is the first type, judging whether the total utilization rate of the resources is smaller than a first preset value, if yes, setting the current working scene as a daily office scene, and if not, setting the current working scene as an entertainment scene.
Optionally, the power management method provided by the invention further includes: and when the combined scene type is the second type, judging whether the total utilization rate of the resources is smaller than a first preset value, if so, setting the current working scene as a daily office scene, and otherwise, setting the current working scene as a game scene.
Optionally, the power management method provided by the invention further includes: when the combined scene type is the third type, judging whether the total utilization rate of the resources is between a first preset value and a second preset value, if so, setting the current working scene as an entertainment scene, and otherwise, setting the current working scene as a game scene.
Optionally, the power management method provided by the invention further includes: when the combined scene type is the fourth type, judging whether the total utilization rate of the resources is lower than a first preset value, if yes, setting the current working scene as a daily office scene; if the total utilization rate of the resources is not lower than the first preset value, continuously judging whether the total utilization rate of the resources is between the first preset value and the second preset value, if so, setting the current working field as an entertainment scene, and otherwise, setting the current working scene as a game scene.
Optionally, the computing device further stores a correspondence between the combined scene and a black-and-white list, the black-and-white list includes a process processing rule, the process information further includes process state information, and when the target scene is the combined scene, the power management method provided by the invention further includes: traversing the corresponding relation between the combined scene and the black-and-white list, and determining the black-and-white list corresponding to the target working scene; determining an active process and an inactive process according to the process state information of each process; and according to the determined process processing rules in the black-and-white list, carrying out dormancy processing on inactive processes except the social application process and the preset application process, and reserving the active processes.
Optionally, determining resources supporting power consumption optimization includes: judging whether a power node exists in the resource, if so, determining that the resource supports power consumption optimization, otherwise, determining that the resource does not support power consumption optimization; and generating a power consumption optimization list according to the determined resources supporting power consumption optimization.
Optionally, updating the working mode of each supported power consumption optimizing resource to the optimized working mode corresponding to each supported power consumption optimizing resource in the target power consumption optimizing information includes: and updating the working modes of the resources in the power consumption optimization table into the optimized working modes corresponding to the supported power consumption optimization resources in the target power consumption optimization information.
Optionally, the resource usage information includes CPU utilization.
Optionally, the resources in the computing device include one or more of a CPU, memory, graphics card, hard disk, PCI-enabled bus device.
According to another aspect of the embodiment of the present invention, there is provided a power management apparatus adapted to be executed in a computing device, where a correspondence between a working scenario and resource power consumption optimization information is stored, where the resource power consumption optimization information includes an optimized working mode of each resource, the apparatus including: the working scene determining module is suitable for determining the current working scene; a power consumption optimization supporting resource determining module adapted to determine a power consumption optimization supporting resource; the power consumption optimization information determining module is suitable for matching the resource power consumption optimization information corresponding to the current working scene determined by the working scene determining module from the corresponding relation between the working scene and the resource power consumption optimization information as target power consumption optimization information; the power management module is suitable for updating the working modes of the supporting power consumption optimization resources determined by the supporting power consumption optimization resource determining module into the optimized working modes corresponding to the supporting power consumption optimization resources in the target power consumption optimization information determined by the power consumption optimization information determining module.
According to yet another aspect of the present invention, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method as described above.
According to another aspect of the invention, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method as described above.
According to the power management method provided by the embodiment of the invention, the current working scene is determined, the resources supporting power consumption optimization are determined, the resource power consumption optimization information corresponding to the current working scene is matched from the corresponding relation between the working scene and the resource power consumption optimization information, the resource power consumption optimization information is used as target power consumption optimization information, and the working modes of the resources supporting power consumption optimization are updated into the optimized working modes corresponding to the resources supporting power consumption optimization in the target power consumption optimization information. Therefore, the invention is equivalent to providing a method for automatically managing the power supply, and the user does not need to learn the setting mode, so that the user experience is improved.
In addition, the resource working mode suitable for the working scene is adjusted under different working scenes, so that the normal operation of the process under the current working scene is ensured, the occupation of resources is reduced as much as possible, the use of electric quantity is reduced, and the power supply endurance of the computing equipment is improved.
In addition, according to different working scenes, the non-active process is frozen, so that the electric quantity is saved, and the power supply endurance of the computing equipment is further improved.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and may be implemented according to the content of the specification, so that the technical means of the embodiments of the present invention can be more clearly understood, and the following specific implementation of the embodiments of the present invention will be more apparent.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 illustrates a block diagram of a computing device 100 according to one embodiment of the invention;
FIG. 2 illustrates a flow chart of a power management method 200 according to one embodiment of the invention;
fig. 3 shows a schematic diagram of a power management device 300 according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to solve the technical problem that the prior power management method increases the learning cost of users, the invention provides a power management method which can be packaged into an application program (namely software) to be installed in computing equipment or packaged into a plug-in to be integrated in an operating system running in the computing equipment. For example, the operating system may be a Linux operating system, a UOS operating system, or the like.
The starting mode of the source management method can be set according to the actual application scene, and the invention is not limited to the method. For example, when the computing device is started, that is, the computing device is started and successfully logs in the user, the power management method provided by the invention is automatically started when the computing device enters the user interface, or the user starts the power management method provided by the invention by triggering the interface.
The computing device 100 described above may be implemented as a server, such as an application server, web server, or the like; but not limited to, desktop computers, notebook computers, processor chips, tablet computers, and the like. Fig. 1 shows a block diagram of the physical components (i.e., hardware) of a computing device 100. In a basic configuration, computing device 100 includes at least one processing unit 102 and system memory 104. According to one aspect, depending on the configuration and type of computing device, system memory 104 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories.
According to one aspect, the system memory 104 includes an operating system 105. The system memory 104 also includes application programs 150. According to one aspect, operating system 105 is, for example, adapted to control the operation of computing device 100. Further, examples are practiced in connection with a graphics library, other operating systems, or any other application program and are not limited to any particular application or system. This basic configuration is illustrated in fig. 1 by those components within dashed line 108. According to one aspect, computing device 100 has additional features or functionality. For example, according to one aspect, computing device 100 includes additional data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Such additional storage is illustrated in fig. 1 by removable storage device 109 and non-removable storage device 110.
As set forth hereinabove, according to one aspect, a plurality of program modules are stored in the system memory 104. When the power management method provided by the present invention is implemented as application 150 and executed on processing unit 102, application 150 performs processes including, but not limited to, one or more of the stages of method 200. According to one aspect, the type of application is not limited, e.g., the application further includes: email and contacts applications, word processing applications, spreadsheet applications, database applications, slide show applications, drawing or computer-aided application, web browser applications, etc.
According to one aspect, the examples may be practiced in a circuit comprising discrete electronic components, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic components or a microprocessor. For example, examples may be practiced via a system on a chip (SOC) in which each or many of the components shown in fig. 1 may be integrated on a single integrated circuit. According to one aspect, such SOC devices may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all of which are integrated (or "burned") onto a chip substrate as a single integrated circuit. When operating via an SOC, the functionality described herein may be operated via dedicated logic integrated with other components of computing device 100 on a single integrated circuit (chip). Embodiments of the invention may also be practiced using other techniques capable of performing logical operations (e.g., AND, OR, AND NOT), including but NOT limited to mechanical, optical, fluidic, AND quantum techniques. In addition, embodiments of the invention may be practiced within a general purpose computer or in any other circuit or system.
According to one aspect, the computing device 100 may also have one or more input devices 112, such as a keyboard, mouse, pen, voice input device, touch input device, and the like. Output device(s) 114 such as a display, speakers, printer, etc. may also be included. The foregoing devices are examples and other devices may also be used. Computing device 100 may include one or more communication connections 116 that allow communication with other computing devices 118, examples of suitable communication connections 116 include, but are not limited to: RF transmitter, receiver and/or transceiver circuitry; universal Serial Bus (USB), parallel and/or serial ports. Computing device 100 may be communicatively connected to one or more other computing devices 118. The other computing devices 118 described above may be display devices, as the invention is not limited in this regard.
The term computer readable media as used herein includes computer storage media. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information (e.g., computer readable instructions, data structures, or program modules). System memory 104, removable storage 109, and non-removable storage 110 are all examples of computer storage media (i.e., memory storage). Computer storage media may include Random Access Memory (RAM), read Only Memory (ROM), electrically erasable read only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and that can be accessed by computer device 100. According to one aspect, any such computer storage media may be part of computing device 100. Computer storage media does not include a carrier wave or other propagated data signal.
According to one aspect, communication media is embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., carrier wave or other transport mechanism) and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio Frequency (RF), infrared, and other wireless media.
It should be noted that, the computing device stores a corresponding relation between a working scenario and resource power consumption optimization information, a corresponding relation between an application name and the working scenario, and a corresponding relation between a combined scenario and a black-white list, the resource power consumption optimization information includes an optimization working mode of each resource, and the resources in the computing device include one or more of a CPU, a memory, a graphics card, a hard disk, and an enabled PCI bus device. In some embodiments, the working scenario of the present invention comprises: daily office scenes, entertainment scenes, and gaming scenes.
Further, the application process corresponding to the daily office scene is an application process used for office, for example, including a wps document editor, a browser (including a UC browser, a 360 browser, etc.), mail, word, visio, etc. The application process corresponding to the entertainment scene is an application process for entertainment of a user, and comprises a browser (comprising a UC browser, a 360 browser and the like), a film and television APP (comprising a cool, loving, mango TV and the like), music (comprising QQ music, network cloud music and the like), games (comprising glory of an owner, absolute survival, happy extinction and the like) and the like. The application process corresponding to the game scene is a large-scale game process, for example, a large-scale game application process comprising 2D or 3D and the like.
The black-and-white list in the corresponding relation between the combined scene and the black-and-white list comprises a process processing rule, wherein the process processing rule is a rule for carrying out dormancy processing on inactive processes except for a social application process and a preset application process, and retaining the active process. The manner in which the inactive process and the active process are determined will be described below. Social applications, which may include all applications for social interaction, are not limited in this regard by the present invention, e.g., social applications include WeChat, QQ, etc.
The combined scene in the corresponding relation between the combined scene and the black-and-white list can comprise a first type, a second type, a third type and a fourth type. The first type of combined scene is a combined scene of a daily office scene and an entertainment scene, the second type of combined scene is a combined scene of a daily office scene and a game scene, the third type of combined scene is a combined scene of an entertainment scene and a game scene, and the fourth type of combined scene is a combined scene of a daily office scene, an entertainment scene and a game scene.
The preset application process can be set according to different combined scenes. For example, in a combination scenario of a daily office scenario and an entertainment scenario, in a combination scenario of a daily office scenario and a game scenario, i.e. in a combination scenario of a first type and a second type, the preset application process may be null, i.e. no preset application process is set, i.e. in a combination scenario of a first type and a second type, the process handling rules are: and carrying out dormancy processing on inactive processes except the social application process, and reserving the active processes.
In addition, in the daily office scenario, the combination scenario of the entertainment scenario and the game scenario, and in the combination scenario of the entertainment scenario and the game scenario, the preset application process may be a process related to the music player, that is, in the combination scenario of the third type and the fourth type, the process processing rule is: and carrying out dormancy processing on inactive processes except the social application process and the music player process, and reserving the active process.
The specific storage forms of the corresponding relation between the working scene and the resource power consumption optimization information, the corresponding relation between the application name and the working scene, and the corresponding relation between the scene combination and the black-white list can be set according to the actual application scene, and the invention is not limited to this, for example, the specific storage forms can be stored in a form of a table. The correspondence table between the combined scene and the black-and-white list is shown in table 1.
TABLE 1 scene composition and blacklist correspondence table
Taking the example that the resources in the computing device comprise a CPU, a memory, a display card, a hard disk and an enabled PCI bus device, the corresponding relation table of the working scene and the resource power consumption optimization information is shown in the table 2.
Table 2 working scenario and resource consumption optimization information correspondence table
Taking the application process included in the above working scenario as an example, the table of correspondence between the application names and the working scenario is shown in table 3.
TABLE 3 application name and working scenario correspondence table
Fig. 2 shows a flow chart of a power management method 200 according to one embodiment of the invention. Method 200 is suitable for execution in computing device 100, and method 200 may include steps 210 through 240.
By the method 200, a method for automatically managing power is provided, a user does not need to learn a setting mode, and user experience is improved. Specifically, the resource working mode suitable for the working scene is adjusted under different working scenes, so that the normal operation of the process under the current working scene is ensured, the occupation of resources is reduced as much as possible, the use of electric quantity is reduced, and the power supply endurance of the computing equipment is improved.
The implementation executes step 210 to determine the current working scenario, which is any one of a daily office scenario, an entertainment scenario, and a game scenario, that is, the current working scenario corresponds to only one working scenario. In some embodiments, the working process of determining the current working scenario is as follows:
first, process information of all started processes is scanned, where the process information includes process name, process state information and resource usage information, and the resource usage information may be set according to an actual application scenario, which is not limited by the present invention, and for example, the resource usage information includes CPU utilization. The process state information includes values of the process state and state, and can also be understood as state codes corresponding to the process state and the process state, where the corresponding relationships of the process state, the state meaning and the corresponding state codes are shown in table 4.
TABLE 4 correspondence table of process states, state meanings, and corresponding state codes
As can be seen from Table 4, the process states include run (indicating running or waiting in a run queue, indicated by state code R), interrupt (indicating dormant, blocked, waiting for the formation of a condition or receiving a signal, indicated by state code S), non-interruptible (indicating that the received signal is not awake and non-operational, the process must wait until an interrupt occurs, indicated by state code D), dead (indicating that the process has terminated, but the process descriptor exists, until the parent process invokes wait4 () system call, indicated by state code Z), and stopped (indicating that the process stops running after receiving SIGTOP, SIGSTP, SIGTOU signal, indicated by state code T).
After the process information of the started process is determined, the started application name is determined according to the process name of each process, and the working scene corresponding to each application name is matched from the corresponding relation between the application name and the working scene to serve as a target scene. And then according to the resource utilization information of each process, calculating the total utilization rate of resources, wherein the specific mode for calculating the total utilization rate of resources can be set according to the actual application scene, and the invention is not limited to the specific mode. For example, the sum processing is performed on the values of the resource usage information of each process, and the sum processing result is taken as the total usage rate of the resources, and taking the resource usage information as the CPU usage rate as an example, the specific way of calculating the total usage rate of the resources is as follows: and carrying out summation processing on the CPU utilization rate of each process, and taking the summation processing result of the CPU utilization rate as the total utilization rate of resources.
After determining the total utilization rate of resources, judging whether the target scene is a combined scene, if so, determining the type of the combined scene, and determining the current working scene according to the type of the combined scene and the total utilization rate of resources, otherwise, setting the current working scene as the target scene, and specifically:
if the combined scene type is the first type (the combined scene corresponding to the daily office scene and the entertainment scene), judging whether the total utilization rate of the resources is smaller than a first preset value, if so, setting the current working scene as the daily office scene, and if not, setting the current working scene as the entertainment scene.
If the combined scene type is the second type (the combined scene of the daily office scene and the game scene), judging whether the total utilization rate of the resources is smaller than a first preset value, if so, setting the current working scene as the daily office scene, otherwise, setting the current working scene as the game scene.
If the combined scene type is the third type (the combined scene corresponding to the entertainment scene and the game scene), judging whether the total utilization rate of the resources is between a first preset value and a second preset value, if so, setting the current working scene as the entertainment scene, otherwise, setting the current working scene as the game scene.
If the combined scene type is the fourth type (the combined scene corresponding to the daily office scene, the game scene and the entertainment scene), judging whether the total utilization rate of the resources is lower than a first preset value, if yes, setting the current working scene as the daily office scene, if not, continuously judging whether the total utilization rate of the resources is between the first preset value and a second preset value, if so, setting the current working scene as the entertainment scene, otherwise, setting the current working scene as the game scene.
The first preset value and the second preset value can be set according to the actual situation and the actual application scene of the equipment in the computing equipment, which is not limited by the invention. For example, the first preset value may be 30% and the second preset value may be 50%.
After determining the current operating scenario, step 220 is continued with determining resources that support power consumption optimization, i.e. resources that can adjust the operating mode. In some embodiments, step 220 comprises:
firstly judging whether a power node exists in the resource, if so, determining that the resource supports power consumption optimization, otherwise, determining that the resource does not support power consumption optimization. Under the condition that the resources support power consumption optimization, a power consumption optimization list is generated, and the power consumption optimization list comprises resource identifiers capable of performing power consumption optimization, so that which resources can be subjected to power consumption optimization can be determined according to the power consumption optimization list. If the resource does not support power consumption optimization, execution of the program is ended. For example, the power consumption optimization list includes the resource CPU, the independent graphics card and the hard disk, that is, in this case, in the computing device, only the CPU, the independent graphics card and the hard disk support power consumption optimization, and other devices do not support power consumption optimization.
In order to reduce consumption of electricity caused by occupation of resources by the inactive process, when determining that the target scene is a combined scene, in some embodiments, the present invention further freezes the inactive process, which specifically includes:
first, the correspondence between the combined scene and the black-and-white list is traversed, for example, the correspondence table between the combined scene and the black-and-white list shown in table 1 is traversed, and the black-and-white list corresponding to the target working scene is determined. And determining an active process and an inactive process according to the process state information of each process. After determining an active process and an inactive process according to the process state information, according to the determined process processing rules in the black-and-white list, performing dormancy processing on the inactive processes except the social application process and the preset application process, and reserving the active process.
For example, as can be seen from table 1, when the target working scenario is a combined scenario of the first type and the second type, inactive processes except for the social application process in all started processes of the computing device are subjected to dormancy processing, and active processes are reserved. And when the target working scene is a combined scene of the third type and the fourth type, performing dormancy processing on inactive processes except for the social application process and the music player process in all started processes of the computing device, and reserving the active processes.
In the present invention, as the process state shown in table 4, a process whose process state is running (i.e., state=r) is set as an active process, and the other processes are all set as inactive processes. Therefore, by freezing the inactive process, the electric quantity is saved, and the power supply endurance of the computing equipment is further improved.
After determining the resource supporting the power consumption optimization, step 230 is continuously executed, and the resource power consumption optimization information corresponding to the current working scenario is matched from the corresponding relation between the working scenario and the resource power consumption optimization information, so as to serve as the target power consumption optimization information, specifically:
and matching the resource power consumption optimization information corresponding to the current working scene from the corresponding relation table of the working scene and the resource power consumption optimization information, and taking the resource power consumption optimization information as target power consumption optimization information. Taking the current working scenario as a daily office scenario as an example, the resource power consumption optimization information which can be matched from table 2 and corresponds to the daily office scenario is: the independent display card is closed, the working mode of the CPU is an energy-saving mode, the hard disk is a low-power consumption mode, and the working mode of the PCI bus enabling equipment is an automatic mode.
After the resource power consumption optimization information corresponding to the current working scenario is matched, step 240 is executed finally, and the working mode of each supported power consumption optimization resource is updated to the optimized working mode corresponding to each supported power consumption optimization resource in the target power consumption optimization information. Specifically, the working modes of the resources in the power consumption optimization table are updated to the optimized working modes corresponding to the supported power consumption optimization resources in the target power consumption optimization information.
For example, the determined power consumption optimization list includes a resource CPU, an independent display card and a hard disk, and the resource power consumption optimization information matched from table 2 and corresponding to the daily office scenario is: the independent display card is closed, the working mode of the CPU is an energy-saving mode, the hard disk is a low-power consumption mode, and the working mode of the PCI bus enabling equipment is an automatic mode. Then, at this time, the working mode of the CPU of the computing device is set to be an energy-saving mode, the hard disk is set to be a low-power mode, and the independent graphics card is turned off, so that the working mode of each resource in the power consumption optimization table is updated to be an optimized working mode corresponding to each supported power consumption optimization resource in the target power consumption optimization information.
Therefore, the working mode of adjusting resources through the current working scene is realized, so that the power consumption is reduced. Steps 210 through 240 are performed each time it is desired to extend the power endurance of the computing device.
Fig. 3 shows a block diagram of a power management apparatus 300 according to an embodiment of the invention. The apparatus 300 includes a work scenario determination module 310, a support power consumption optimization resource determination module 320, a power consumption optimization information determination module 330, and a power management module 340, which are coupled in sequence.
The working scenario determination module 310 is adapted to determine a current working scenario.
The power consumption optimization supporting resource determining module 320 is adapted to determine resources supporting power consumption optimization.
The power consumption optimization information determining module 330 is adapted to match the resource power consumption optimization information corresponding to the current working scenario determined by the working scenario determining module 310 from the corresponding relation between the working scenario and the resource power consumption optimization information, as target power consumption optimization information.
The power management module 340 is adapted to update the operation mode of each supported power consumption optimization resource determined by the supported power consumption optimization resource determining module 320 to the optimized operation mode corresponding to each supported power consumption optimization resource in the target power consumption optimization information determined by the power consumption optimization information determining module 330.
It should be noted that, the working principle of the power management apparatus 300 is similar to that of the power management method 200, and the relevant points are referred to the description of the power management method 200 and are not repeated here.
From the above, it can be seen that the power management method provided by the present invention determines the current working scenario and determines the resources supporting power consumption optimization, and matches the resource power consumption optimization information corresponding to the current working scenario from the corresponding relation between the working scenario and the resource power consumption optimization information, and updates the working mode of each resource supporting power consumption optimization as the target power consumption optimization information into the optimized working mode corresponding to each resource supporting power consumption optimization in the target power consumption optimization information. Therefore, the invention is equivalent to providing a method for automatically managing the power supply, and the user does not need to learn the setting mode, so that the user experience is improved.
In addition, the resource working mode suitable for the working scene is adjusted under different working scenes, so that the normal operation of the process under the current working scene is ensured, the occupation of resources is reduced as much as possible, the use of electric quantity is reduced, and the power supply endurance of the computing equipment is improved.
In addition, according to different working scenes, the non-active process is frozen, so that the electric quantity is saved, and the power supply endurance of the computing equipment is further improved.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions of the methods and apparatus of the present invention, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the power management method of the present invention in accordance with instructions in said program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the invention. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed invention requires more features than are expressly recited in each claim.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the invention as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is intended to be illustrative, but not limiting, of the scope of the invention, which is defined by the appended claims.

Claims (11)

1. A power management method adapted to be executed in a computing device, where a correspondence between a working scenario and resource power consumption optimization information is stored, where the resource power consumption optimization information includes an optimized working mode of each resource, the method comprising:
determining a current working scene;
determining resources supporting power consumption optimization;
matching the resource power consumption optimization information corresponding to the current working scene from the corresponding relation between the working scene and the resource power consumption optimization information, and taking the resource power consumption optimization information as target power consumption optimization information;
and updating the working modes of the supporting power consumption optimizing resources into the optimizing working modes corresponding to the supporting power consumption optimizing resources in the target power consumption optimizing information.
2. The method of claim 1, wherein the computing device has stored therein an application name to work scenario correspondence, the determining the current work scenario comprising:
scanning process information of all started processes, wherein the process information comprises process names and resource use information;
determining the started application names according to the process names of the processes, and matching the working scenes corresponding to the application names from the corresponding relation between the application names and the working scenes to serve as target scenes;
Calculating the total utilization rate of resources according to the resource utilization information of each process;
judging whether the target scene is a combined scene or not, if so, determining the current working scene according to the type of the combined scene and the total utilization rate of the resources, and if not, setting the current working scene as the target scene.
3. The method of claim 2, wherein the work scenes include daily office scenes, game scenes, and entertainment scenes, the combined scene types include a first type, a second type, a third type, and a fourth type, the first type corresponding to a combined scene of daily office scenes and entertainment scenes, the second type corresponding to a combined scene of daily office scenes and game scenes, the third type corresponding to a combined scene of entertainment scenes and game scenes, and the fourth type corresponding to a combined scene of daily office scenes, game scenes, and entertainment scenes.
4. The method of claim 3, wherein determining the current work scenario according to a combined scenario type and the total usage of resources comprises:
when the combined scene type is the first type, judging whether the total utilization rate of the resources is smaller than a first preset value, if yes, setting the current working scene as a daily office scene, and if not, setting the current working scene as an entertainment scene.
5. The method of claim 4, further comprising:
and when the combined scene type is the second type, judging whether the total utilization rate of the resources is smaller than the first preset value, if so, setting the current working scene as a daily office scene, and otherwise, setting the current working scene as a game scene.
6. The method of claim 4, further comprising:
when the combined scene type is the third type, judging whether the total utilization rate of the resources is between the first preset value and the second preset value, if so, setting the current working scene as an entertainment scene, and otherwise, setting the current working scene as a game scene.
7. The method of claim 4, further comprising:
when the combined scene type is the fourth type, judging whether the total utilization rate of the resources is lower than the first preset value, if yes, setting the current working scene as a daily office scene;
if the total utilization rate of the resources is not lower than the first preset value, continuing to judge whether the total utilization rate of the resources is between the first preset value and the second preset value, if so, setting the current working field as an entertainment scene, otherwise, setting the current working scene as a game scene.
8. The method of any one of claims 4 to 7, wherein the computing device further stores therein a correspondence between a combined scene and a black-and-white list, the black-and-white list including process processing rules, the progress information further including process status information, and when the target scene is a combined scene, further including:
traversing the corresponding relation between the combined scene and the black-and-white list, and determining the black-and-white list corresponding to the target working scene;
determining an active process and an inactive process according to the process state information of each process;
and according to the determined process processing rules in the black-and-white list, carrying out dormancy processing on inactive processes except the social application process and the preset application process, and reserving the active processes.
9. A power management apparatus adapted to be executed in a computing device, the computing device having stored therein a correspondence between a work scenario and resource power consumption optimization information including an optimized work mode for each resource, the apparatus comprising:
the working scene determining module is suitable for determining the current working scene;
a power consumption optimization supporting resource determining module adapted to determine a power consumption optimization supporting resource;
The power consumption optimization information determining module is suitable for matching the resource power consumption optimization information corresponding to the current working scene determined by the working scene determining module from the corresponding relation between the working scene and the resource power consumption optimization information as target power consumption optimization information;
the power management module is suitable for updating the working modes of the supporting power consumption optimization resources determined by the supporting power consumption optimization resource determining module into the optimized working modes corresponding to the supporting power consumption optimization resources in the target power consumption optimization information determined by the power consumption optimization information determining module.
10. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any one of claims 1 to 8.
11. A readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform the method of any one of claims 1 to 8.
CN202310507422.7A 2023-05-06 2023-05-06 Power management method, device, computing equipment and storage medium Pending CN116520968A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310507422.7A CN116520968A (en) 2023-05-06 2023-05-06 Power management method, device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310507422.7A CN116520968A (en) 2023-05-06 2023-05-06 Power management method, device, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116520968A true CN116520968A (en) 2023-08-01

Family

ID=87389973

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310507422.7A Pending CN116520968A (en) 2023-05-06 2023-05-06 Power management method, device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116520968A (en)

Similar Documents

Publication Publication Date Title
AU2011323985B2 (en) Application lifetime management
US8776066B2 (en) Managing task execution on accelerators
CN102707966B (en) Method and device for acceleratively starting operating system, and method, device and terminal for generating prefetched information
KR20080098416A (en) System and method for multi-processor application support
CN104731614B (en) A kind of method and device that data are quickly loaded in start process
WO2022001128A1 (en) Fpga board memory data reading method and apparatus, and medium
CN110704334B (en) Method, system and equipment for important product data management
CN112988464A (en) Power-off protection method and computing device
US10114438B2 (en) Dynamic power budgeting in a chassis
EP4321991A1 (en) Native system-based derived software construction method and system, and device
CN116520968A (en) Power management method, device, computing equipment and storage medium
CN107656702B (en) Method and system for accelerating hard disk read-write and electronic equipment
US10447607B2 (en) System and method for dequeue optimization using conditional iteration
CN115756322A (en) Data storage method and device, electronic equipment and storage medium
CN115373860A (en) Scheduling method, device and equipment of GPU (graphics processing Unit) tasks and storage medium
CN112564924B (en) Computer expansion card and block chain terminal equipment
CN107209544B (en) System and method for SoC idle power state control based on I/O operating characteristics
CN111722888B (en) Operation execution method, device, equipment and readable storage medium
CN111930502A (en) Server management method, device, equipment and storage medium
CN111192063A (en) Online customer service queuing processing method and device and electronic equipment
EP4116825A1 (en) Device sleep method and computing device
US8799616B2 (en) Method and system for preferred CPU binding on virtual partitions
CN115658324B (en) Process scheduling method, computing device and storage medium
US20240012743A1 (en) Automation test accelerator
CN116339667A (en) Display server protocol switching method and device and computing equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination