Nothing Special   »   [go: up one dir, main page]

CN111459258A - Power consumption management method and device, electronic equipment and medium - Google Patents

Power consumption management method and device, electronic equipment and medium Download PDF

Info

Publication number
CN111459258A
CN111459258A CN202010235917.5A CN202010235917A CN111459258A CN 111459258 A CN111459258 A CN 111459258A CN 202010235917 A CN202010235917 A CN 202010235917A CN 111459258 A CN111459258 A CN 111459258A
Authority
CN
China
Prior art keywords
application program
function interface
interface
specified
preset
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
CN202010235917.5A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010235917.5A priority Critical patent/CN111459258A/en
Publication of CN111459258A publication Critical patent/CN111459258A/en
Pending legal-status Critical Current

Links

Images

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/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application provides a power consumption management method and device, electronic equipment and a medium, and relates to the technical field of terminals. Embodiments of the present application include: when the designated application program runs, calling a preset dynamic library, monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the designated application program, and calling a designated function interface in the preset dynamic library when the residual electric quantity is less than a preset electric quantity threshold value so that the designated function interface replaces an original function interface corresponding to the designated function interface in the designated application program, and limiting the running power consumption of the designated application program through the designated function interface. By adopting the method, the service life of the electronic equipment in the low-power state can be prolonged.

Description

Power consumption management method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to a power consumption management method and apparatus, an electronic device, and a medium.
Background
At present, electronic devices are widely used, and when the power of the electronic device is in a low power state, a user generally turns off an application program with high power consumption in order to prolong the use time of the remaining power. However, if a user uses an application with high power consumption, the power consumption is accelerated, and the electronic device is shut down in a short time.
Disclosure of Invention
An object of the embodiments of the present application is to provide a power consumption management method, apparatus, electronic device and medium, so as to prolong a service time of the electronic device when the electronic device is in a low power state. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a power consumption management method, where the method is applied to an electronic device, and the method includes:
when a designated application program runs, calling a preset dynamic library, and monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the designated application program;
when the residual electric quantity is smaller than a preset electric quantity threshold value, calling a designated function interface in the preset dynamic library so that the designated function interface replaces an original function interface corresponding to the designated function interface in the designated application program;
and limiting the running power consumption of the specified application program through the specified function interface.
In a possible implementation manner, when the remaining power is less than a preset power threshold, invoking a designated function interface in the preset dynamic library to enable the designated function interface to replace an original function interface corresponding to the designated function interface in the designated application program, includes:
when the residual electric quantity is smaller than a preset electric quantity threshold value and a battery of the electronic equipment is not in a charging state, calling a specified function interface in the preset dynamic library to enable the specified function interface to replace an original function interface corresponding to the specified function interface in the specified application program;
after the calling of the designated function interface in the preset dynamic library to enable the designated function interface to replace the original function interface corresponding to the designated function interface in the application program, the method further includes:
and when the battery of the electronic equipment is monitored to be in a charging state, stopping using the specified function interface, and recovering using the original function interface corresponding to the specified function interface in the specified application program.
In one possible implementation, the specified function interface includes any one or more of a traffic interface, a resolution interface, and a sampling rate interface; the limiting the running power consumption of the specified application program through the specified function interface comprises the following steps:
limiting the network communication throughput of the specified application program through a network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold; and/or;
limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold; and/or;
and limiting the audio sampling rate of the specified application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the specified application program does not exceed a preset sampling rate threshold value.
In a possible implementation manner, the limiting, by the network communication module corresponding to the traffic interface, the network communication throughput of the specified application program so that the network communication throughput of the specified application program does not exceed a preset throughput threshold includes:
and detecting whether a background downloading task exists in the designated application program through a network communication module corresponding to the flow interface, and if so, suspending the background downloading task.
In a possible implementation manner, when a specific application program runs, a preset dynamic library is called, and the monitoring of the remaining power of the electronic device includes:
and acquiring the electric quantity displayed in the status bar of the electronic equipment, and taking the acquired electric quantity as the residual electric quantity.
In a second aspect, an embodiment of the present application provides a power consumption management apparatus, where the apparatus is applied to an electronic device, and the apparatus includes:
the monitoring module is used for calling a preset dynamic library when a specified application program runs and monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the specified application program;
the calling module is used for calling a specified function interface in the preset dynamic library when the residual electric quantity is smaller than a preset electric quantity threshold value so as to enable the specified function interface to replace an original function interface corresponding to the specified function interface in the specified application program;
and the limiting module is used for limiting the running power consumption of the specified application program through the specified functional interface.
In a possible implementation manner, the calling module is specifically configured to call a specified function interface in the preset dynamic library when the remaining power is less than a preset power threshold and a battery of the electronic device is not in a charging state, so that the specified function interface replaces an original function interface corresponding to the specified function interface in the specified application program;
and the calling module is further configured to stop using the designated function interface and resume using an original function interface corresponding to the designated function interface in the designated application program when it is monitored that the battery of the electronic device is in a charging state.
In one possible implementation, the specified function interface includes any one or more of a traffic interface, a resolution interface, and a sampling rate interface; the restriction module is specifically configured to:
limiting the network communication throughput of the specified application program through a network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold; and/or;
limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold; and/or;
and limiting the audio sampling rate of the specified application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the specified application program does not exceed a preset sampling rate threshold value.
In a possible implementation manner, the limiting module is specifically configured to detect whether a background downloading task exists in the specified application program through a network communication module corresponding to the traffic interface, and if so, suspend the background downloading task.
In a possible implementation manner, the monitoring module is specifically configured to acquire an electric quantity displayed in a status bar of the electronic device, and use the acquired electric quantity as the remaining electric quantity.
In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the method steps of the first aspect when executing the program stored in the memory.
In a fourth aspect, this application further provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the method steps described in the first aspect.
In a fifth aspect, embodiments of the present application further provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform the method steps of the first aspect.
By adopting the technical scheme, when the low power of the electronic equipment is monitored, the original function interface in the appointed application program can be replaced by the appointed function interface through the preset dynamic library, the running power consumption of the appointed function of the application program is limited through the appointed function interface, and the purpose of limiting the running power consumption of the appointed application program can be achieved.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a power consumption management method according to an embodiment of the present application;
fig. 2 is an exemplary schematic diagram of a mobile phone interface provided in an embodiment of the present application;
fig. 3 is a flowchart of another power consumption management method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating setting of a preset dynamic library in an installation package of a specific application according to an embodiment of the present application;
fig. 5 is a schematic diagram of an apparatus for power consumption management according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a power consumption management method, which is applied to electronic devices such as a mobile phone and a tablet computer, and as shown in fig. 1, the method includes:
s101, when the designated application program runs, calling a preset dynamic library, and monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the designated application program.
And S102, when the residual electric quantity is smaller than a preset electric quantity threshold value, calling a specified function interface in a preset dynamic library so that the specified function interface replaces an original function interface corresponding to the specified function interface in a specified application program.
And S103, limiting the running power consumption of the specified application program through the specified function interface.
By adopting the method, when the low power of the electronic equipment is monitored, the original function interface in the appointed application program can be replaced by the appointed function interface through the preset dynamic library, the running power consumption of the appointed function of the application program is limited through the appointed function interface, and the purpose of limiting the running power consumption of the appointed application program can be achieved.
In S101, the designated application may be any application in the electronic device, and the control of the running power consumption of the application may be realized by setting a dynamic library in the installation package of the application in advance.
For example, in the embodiment of the present application, a preset Dynamic library is provided in an installation package of a specific application program, and although the preset Dynamic library does not belong to the code of the specific application program, the specific application program can call the preset Dynamic library and execute the code in the preset Dynamic library.
In the embodiment of the application, the preset dynamic library has a function code for monitoring the remaining power of the electronic device, and the electronic device can acquire the remaining power of the electronic device by calling the function code in the preset dynamic library.
In order to ensure the accuracy of the obtained remaining power, S101 may specifically execute: and acquiring the electric quantity displayed in the status bar of the electronic equipment, and taking the acquired electric quantity as the residual electric quantity.
Because the electric quantity displayed by the status bar of the electronic equipment is the electric quantity determined by the system of the electronic equipment, the electric quantity can accurately represent the actual electric quantity of the electronic equipment, and therefore, the electric quantity displayed in the status bar at the top end of the screen can be acquired by calling a preset dynamic library only through a hook (hook) function. Optionally, the accuracy of the power amount depends on the accuracy of the power amount displayed by the status bar of the electronic device, and may be 1% for example.
For example, as shown in fig. 2, fig. 2 is an exemplary schematic diagram of a mobile phone interface, where the mobile phone interface includes a status bar of a mobile phone, and if it is determined that the power displayed in the status bar is 31% through a hook function, it may be determined that the remaining power of the electronic device is 31%.
In the above S102, the designated function interface may be an interface of a function with higher power consumption in the designated application program, and in the embodiment of the present application, part of the function interfaces in the designated application program may be replaced on the premise of not affecting normal operation of other functions of the designated application program.
In the above S103, the specific function can be realized through the specific function interface in the preset dynamic library by a code corresponding to the specific function in the preset dynamic library, so as to limit the operation power consumption.
In an embodiment of the present application, since the electronic device does not substantially run out of power during charging, when performing power consumption management in the embodiment of the present application, reference needs to be made to whether the electronic device is in a charging state, as shown in fig. 3, where the method specifically includes the following steps:
and S301, calling a preset dynamic library to monitor the residual electric quantity of the electronic equipment when the specified application program runs.
S301 is the same as S101, and reference may be made to the related description in S101, which is not repeated herein.
S102 may be specifically executed as S302.
And S302, when the residual electric quantity is less than a preset electric quantity threshold value and the battery of the electronic equipment is not in a charging state, calling a specified function interface in a preset dynamic library so that the specified function interface replaces an original function interface corresponding to the specified function interface in the application program.
And S303, limiting the running power consumption of the specified application program through the specified function interface.
The step is the same as S103, and reference may be made to the related description in S103, which is not described herein again.
S304, when the battery of the electronic equipment is monitored to be in a charging state, stopping using the designated function interface, and recovering using the original function interface corresponding to the designated function interface in the designated application program.
After S302, the electronic device may monitor whether the battery is in a charging state in real time, and when the battery is in the charging state, S304 may be executed.
It can be understood that, if the battery of the electronic device is in a charging state, the power of the battery will be continuously increased, and the power exhaustion condition will not occur, so that the operation power consumption of the specified application program does not need to be limited, and the original function interface of the specified function interface can be continuously used, i.e. the low power consumption mode is recovered to the standard mode, thereby stopping limiting the operation power consumption of the specified application program.
Optionally, in yet another embodiment, when it is monitored that the battery of the electronic device is in the charging state and the remaining power of the electronic device reaches the preset power threshold, the use of the designated function interface is stopped, and the use of the original function interface is resumed.
In the embodiment of the application, whether the battery is in a charging state or not can be determined by monitoring the battery state of the electronic device, and if the battery is in an Unp charged (discharged) state, the battery is determined to be in an uncharged state; otherwise, if the battery is in the charging state, the battery is determined to be in the charging state.
By adopting the method, when the electric quantity of the electronic equipment is too low and the electronic equipment is not in a charging state, the appointed function interface in the preset dynamic library can be called, so that the original function interface corresponding to the appointed function interface in the appointed application program is replaced by the appointed function interface, the power consumption limitation of the appointed application program is realized, and the electric quantity of the electronic terminal is prevented from being consumed too fast. And when the charging wire of the electronic equipment is inserted, the original function interface of the specified application program can be recovered and used, and the flexibility of limiting the power consumption is higher.
In one embodiment of the application, the specified function interface comprises any one or more of a traffic interface, a resolution interface, and a sample rate interface. S103, limiting the operating power consumption of the designated application program through the designated function interface, which specifically includes any one or more of the following implementation manners.
In the first mode, the network communication throughput of the specified application program is limited through the network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold.
Specifically, the electronic device may invoke a traffic interface of a network communication underlying library implementation classification (category), and execute a network communication throughput management code in the network communication module in the preset dynamic library to limit the network communication throughput of the specified application program to be not greater than a preset communication throughput threshold.
For example, if the preset communication throughput threshold is 200k/s, when the network communication throughput of the specified application program is more than 200k/s, the network communication throughput is reduced to be less than 200k/s or less than 200k/s, and when the network communication throughput of the specified application program is less than 200k/s, the network communication throughput is kept unchanged.
In an embodiment, whether a background downloading task exists in a designated application program may be detected through a network communication module corresponding to a traffic interface, and if the background downloading task exists, the background downloading task is suspended. By suspending the background download task, the network communication throughput of the designated application program can be reduced.
For example, if the designated application is video playing software, when the power of the electronic device is too low, a flow interface in a preset dynamic library may be called to suspend a cache task in the video playing software. And when the original flow interface in the audio and video playing software is recovered, continuing to perform the caching task.
And secondly, limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold.
Specifically, the electronic device may call a resolution interface of a video underlying library implementation classification (category), and execute resolution management code included in a graphics rendering module in a preset dynamic library to limit a picture resolution of a specified application program not to exceed a preset resolution threshold.
For example, if the designated application is video playing software, and if the designated resolution threshold is resolution corresponding to standard definition, when the image resolution of the video playing software is high definition or higher, the image resolution of the video playing software may be switched to resolution corresponding to standard definition through the image rendering module corresponding to the resolution interface.
And thirdly, limiting the audio sampling rate of the appointed application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the appointed application program does not exceed a preset sampling rate threshold value.
In particular, the electronic device may invoke a sample rate interface (samplerate) of the audio underlying library implementation classification (category) to execute sample rate management code included by the audio module in the preset dynamic library to limit the sample rate of the audio of the specified application from exceeding a preset sample rate threshold.
For example, if the sampling rate threshold is the standard tone quality, when the tone quality of the audio and video application program is the high-quality tone quality and the lossless tone quality, the tone quality of the audio and video application program may be switched to the standard tone quality through the audio module corresponding to the sampling rate interface. And when the tone quality of the audio and video application program is the standard tone quality, keeping the tone quality of the audio and video application program unchanged.
By adopting the method, the power consumption of the function with high power consumption in the appointed application program is limited, so that the use duration of the electronic equipment in a low-power state can be prolonged on the basis of not closing the appointed application program, and the use duration of the appointed application program by a user is prolonged.
In order to implement the power consumption management method provided in the embodiment of the present application, a preset dynamic library needs to be set in an installation package of a specified application in advance, taking an example that an electronic device uses an IOS system, and a specific process is shown in fig. 4.
First, a preset dynamic library is created and implemented, and a project of an IOS framework type may be created, where the project includes a Mach-O file, and the Mach-O file includes the function modules in the preset dynamic library described in the above embodiments. And then setting the Mach-O file type as a dynamic library to obtain a dynamic library file.
Then, an apple Application (ipa) file of the specified Application program is decompressed, and the dynamic library file is copied to a Framework (Framework) folder under the engineering directory of the specified Application program, which is equivalent to adding the dynamic library file into an installation package of the specified Application program.
And then modifying the Mach-O file in the Framework folder, and importing the loading path of the dynamic library file in an L oadCommands list.
And then, the ipa file is compressed again, the ipa file is installed into the electronic equipment, and the preset dynamic library is loaded after a specified application program in the electronic equipment is started. In an embodiment, after the preset dynamic library is loaded, a low power consumption option may be generated on the display interface, and if the user selects the low power consumption option, the power consumption management method described in the above method embodiment may also be implemented by using the preset dynamic library.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a power consumption management apparatus, where the apparatus is applied to an electronic device, and as shown in fig. 5, the apparatus includes:
the monitoring module 501 is configured to, when a specified application program runs, call a preset dynamic library to monitor the remaining power of the electronic device, where the preset dynamic library is a dynamic library preset in an installation package of the specified application program;
a calling module 502, configured to call, when the remaining power is smaller than a preset power threshold, a specified function interface in the preset dynamic library, so that the specified function interface replaces an original function interface corresponding to the specified function interface in the specified application program;
a limiting module 503, configured to limit the running power consumption of the specified application program through the specified function interface.
Optionally, the invoking module 502 is specifically configured to invoke a specified function interface in the preset dynamic library when the remaining power is less than a preset power threshold and a battery of the electronic device is not in a charging state, so that the specified function interface replaces an original function interface corresponding to the specified function interface in the specified application program;
the calling module 502 is further configured to stop using the specified function interface when it is monitored that the battery of the electronic device is in a charging state, and resume using an original function interface corresponding to the specified function interface in the specified application program.
Optionally, the designated function interface includes any one or more of a traffic interface, a resolution interface, and a sampling rate interface; the restriction module 503 is specifically configured to:
limiting the network communication throughput of the specified application program through a network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold; and/or;
limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold; and/or;
and limiting the audio sampling rate of the specified application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the specified application program does not exceed a preset sampling rate threshold value.
Optionally, the limiting module 503 is specifically configured to detect whether a background downloading task exists in the specified application program through the network communication module corresponding to the traffic interface, and if so, suspend the background downloading task.
Optionally, the monitoring module 501 is specifically configured to acquire the electric quantity displayed in the status bar of the electronic device, and use the acquired electric quantity as the remaining electric quantity.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604;
a memory 603 for storing a computer program;
the processor 601 is configured to implement the method steps in the above method embodiments when executing the program stored in the memory 603.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the above power consumption management method steps.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer, causes the computer to perform any of the above-described power consumption management methods.
The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g., from one website site, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DS L)) or wireless (e.g., infrared, wireless, microwave, etc.) manner to another website site, computer, server, or data center.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A power consumption management method, applied to an electronic device, the method comprising:
when a designated application program runs, calling a preset dynamic library, and monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the designated application program;
when the residual electric quantity is smaller than a preset electric quantity threshold value, calling a designated function interface in the preset dynamic library so that the designated function interface replaces an original function interface corresponding to the designated function interface in the designated application program;
and limiting the running power consumption of the specified application program through the specified function interface.
2. The method according to claim 1, wherein when the remaining power is less than a preset power threshold, calling a designated function interface in the preset dynamic library to enable the designated function interface to replace an original function interface corresponding to the designated function interface in the designated application program, includes:
when the residual electric quantity is smaller than a preset electric quantity threshold value and a battery of the electronic equipment is not in a charging state, calling a specified function interface in the preset dynamic library to enable the specified function interface to replace an original function interface corresponding to the specified function interface in the specified application program;
after the calling of the designated function interface in the preset dynamic library to enable the designated function interface to replace the original function interface corresponding to the designated function interface in the application program, the method further includes:
and when the battery of the electronic equipment is monitored to be in a charging state, stopping using the specified function interface, and recovering using the original function interface corresponding to the specified function interface in the specified application program.
3. The method of claim 1 or 2, wherein the specified function interface comprises any one or more of a traffic interface, a resolution interface, and a sampling rate interface; the limiting the running power consumption of the specified application program through the specified function interface comprises the following steps:
limiting the network communication throughput of the specified application program through a network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold; and/or;
limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold; and/or;
and limiting the audio sampling rate of the specified application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the specified application program does not exceed a preset sampling rate threshold value.
4. The method of claim 3, wherein limiting the network communication throughput of the specified application through the network communication module corresponding to the traffic interface so that the network communication throughput of the specified application does not exceed a preset throughput threshold comprises:
and detecting whether a background downloading task exists in the designated application program through a network communication module corresponding to the flow interface, and if so, suspending the background downloading task.
5. The method of claim 1, wherein invoking a preset dynamic library to monitor the remaining power of the electronic device when a specific application program is running comprises:
and acquiring the electric quantity displayed in the status bar of the electronic equipment, and taking the acquired electric quantity as the residual electric quantity.
6. A power consumption management apparatus, applied to an electronic device, the apparatus comprising:
the monitoring module is used for calling a preset dynamic library when a specified application program runs and monitoring the residual electric quantity of the electronic equipment, wherein the preset dynamic library is a dynamic library preset in an installation package of the specified application program;
the calling module is used for calling a specified function interface in the preset dynamic library when the residual electric quantity is smaller than a preset electric quantity threshold value so as to enable the specified function interface to replace an original function interface corresponding to the specified function interface in the specified application program;
and the limiting module is used for limiting the running power consumption of the specified application program through the specified functional interface.
7. The apparatus of claim 6,
the calling module is specifically configured to call a specified function interface in the preset dynamic library when the remaining power is less than a preset power threshold and a battery of the electronic device is not in a charging state, so that the specified function interface replaces an original function interface corresponding to the specified function interface in the specified application program;
and the calling module is further configured to stop using the designated function interface and resume using an original function interface corresponding to the designated function interface in the designated application program when it is monitored that the battery of the electronic device is in a charging state.
8. The apparatus of claim 6 or 7, wherein the specified function interface comprises any one or more of a traffic interface, a resolution interface, and a sampling rate interface; the restriction module is specifically configured to:
limiting the network communication throughput of the specified application program through a network communication module corresponding to the flow interface, so that the network communication throughput of the specified application program does not exceed a preset throughput threshold; and/or;
limiting the image resolution of the specified application program through a graphic rendering module corresponding to the resolution interface, so that the image resolution of the specified application program does not exceed a preset resolution threshold; and/or;
and limiting the audio sampling rate of the specified application program through an audio module corresponding to the sampling rate interface, so that the audio sampling rate of the specified application program does not exceed a preset sampling rate threshold value.
9. The apparatus according to claim 8, wherein the limiting module is specifically configured to detect whether a background downloading task exists in the designated application through a network communication module corresponding to the traffic interface, and if so, suspend the background downloading task.
10. The apparatus according to claim 6, wherein the monitoring module is specifically configured to acquire the electric quantity displayed in a status bar of the electronic device, and use the acquired electric quantity as the remaining electric quantity.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
CN202010235917.5A 2020-03-30 2020-03-30 Power consumption management method and device, electronic equipment and medium Pending CN111459258A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010235917.5A CN111459258A (en) 2020-03-30 2020-03-30 Power consumption management method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010235917.5A CN111459258A (en) 2020-03-30 2020-03-30 Power consumption management method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN111459258A true CN111459258A (en) 2020-07-28

Family

ID=71685023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010235917.5A Pending CN111459258A (en) 2020-03-30 2020-03-30 Power consumption management method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111459258A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596601A (en) * 2020-12-30 2021-04-02 海光信息技术股份有限公司 Method and device for enabling computing equipment to generate quantitative power consumption

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104166453A (en) * 2014-08-15 2014-11-26 百度在线网络技术(北京)有限公司 Method and device for reducing power consumption of mobile terminal
CN104540198A (en) * 2015-01-16 2015-04-22 深圳市中兴移动通信有限公司 Mobile terminal as well as power regulation method and power regulation device of WLAN of mobile terminal
CN105009024A (en) * 2012-12-28 2015-10-28 脸谱公司 Conserving battery and data usage
CN105278811A (en) * 2015-10-23 2016-01-27 三星电子(中国)研发中心 Screen display device and method of intelligent terminal
CN105930190A (en) * 2016-04-27 2016-09-07 百度在线网络技术(北京)有限公司 Program self-starting method and device based on operating system
CN107810462A (en) * 2015-08-31 2018-03-16 谷歌有限责任公司 Energy saver mode for electronic installation
CN108279765A (en) * 2017-01-06 2018-07-13 北京嘀嘀无限科技发展有限公司 The method for managing power supply and mobile device of mobile device
CN108733334A (en) * 2018-03-13 2018-11-02 广东欧珀移动通信有限公司 Image quality parameter adjusting method, device, terminal and storage medium
CN110837288A (en) * 2018-08-15 2020-02-25 北京搜狗科技发展有限公司 Application program management method and device, mobile terminal and readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105009024A (en) * 2012-12-28 2015-10-28 脸谱公司 Conserving battery and data usage
CN104166453A (en) * 2014-08-15 2014-11-26 百度在线网络技术(北京)有限公司 Method and device for reducing power consumption of mobile terminal
CN104540198A (en) * 2015-01-16 2015-04-22 深圳市中兴移动通信有限公司 Mobile terminal as well as power regulation method and power regulation device of WLAN of mobile terminal
CN107810462A (en) * 2015-08-31 2018-03-16 谷歌有限责任公司 Energy saver mode for electronic installation
CN105278811A (en) * 2015-10-23 2016-01-27 三星电子(中国)研发中心 Screen display device and method of intelligent terminal
CN105930190A (en) * 2016-04-27 2016-09-07 百度在线网络技术(北京)有限公司 Program self-starting method and device based on operating system
CN108279765A (en) * 2017-01-06 2018-07-13 北京嘀嘀无限科技发展有限公司 The method for managing power supply and mobile device of mobile device
CN108733334A (en) * 2018-03-13 2018-11-02 广东欧珀移动通信有限公司 Image quality parameter adjusting method, device, terminal and storage medium
CN110837288A (en) * 2018-08-15 2020-02-25 北京搜狗科技发展有限公司 Application program management method and device, mobile terminal and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112596601A (en) * 2020-12-30 2021-04-02 海光信息技术股份有限公司 Method and device for enabling computing equipment to generate quantitative power consumption
CN112596601B (en) * 2020-12-30 2023-03-14 海光信息技术股份有限公司 Method and device for enabling computing equipment to generate quantitative power consumption

Similar Documents

Publication Publication Date Title
US10819455B2 (en) Broadcast processing method, non-transitory storage medium, and electronic device
CN111163345A (en) Image rendering method and device
CN108063818B (en) Data downloading method, device, terminal and computer readable storage medium
CN110012217B (en) Method and device for determining acquisition resolution and electronic equipment
CN110377341B (en) Method, device, medium and electronic equipment for monitoring no-response exception
CN111367698B (en) Application program flash back detection and processing method and device and electronic equipment
CN111158619A (en) Picture processing method and device
CN110727566B (en) Method, device, medium and electronic equipment for acquiring process crash information
CN114385563A (en) Hook control method and device based on preloads
CN107070670A (en) Broadcast transmission person is controlled to send method, device and the terminal device of broadcast message
CN111459258A (en) Power consumption management method and device, electronic equipment and medium
CN109901849B (en) Application program installation method and device, electronic equipment and storage medium
CN110851208A (en) Interface parameter and response data modification method and device
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN112822322B (en) Mobile terminal muting method and device, mobile terminal and storage medium
CN106445353A (en) Display method and device of super-large pictures and electronic equipment
CN111966508A (en) Message batch sending method and device, computer equipment and storage medium
CN114721740B (en) Message triggering method, device, equipment and storage medium
CN106708605B (en) Method and device for detecting resource leakage
CN115396990A (en) Power consumption control method and device
CN111836075B (en) Virtual desktop frame supplementing method and device, electronic equipment and readable storage medium
CN109343961B (en) Memory information processing method and device, storage medium and terminal
CN109376323B (en) Application running method, device, computer device and storage medium
CN113569169A (en) Page display method and device
CN110633566A (en) Intrusion detection method, device, terminal equipment and medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200728

RJ01 Rejection of invention patent application after publication