CN109309953B - Power consumption detection method, device, terminal and readable storage medium - Google Patents

Power consumption detection method, device, terminal and readable storage medium Download PDF

Info

Publication number
CN109309953B
CN109309953B CN201811455108.4A CN201811455108A CN109309953B CN 109309953 B CN109309953 B CN 109309953B CN 201811455108 A CN201811455108 A CN 201811455108A CN 109309953 B CN109309953 B CN 109309953B
Authority
CN
China
Prior art keywords
terminal
game
power consumption
electric quantity
residual electric
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.)
Active
Application number
CN201811455108.4A
Other languages
Chinese (zh)
Other versions
CN109309953A (en
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201811455108.4A priority Critical patent/CN109309953B/en
Publication of CN109309953A publication Critical patent/CN109309953A/en
Application granted granted Critical
Publication of CN109309953B publication Critical patent/CN109309953B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0261Power saving arrangements in terminal devices managing power supply demand, e.g. depending on battery level
    • 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
    • G06F1/3212Monitoring battery levels, e.g. power saving mode being initiated when battery voltage goes below a certain level
    • 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
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a power consumption detection method, which comprises the following steps: detecting that an application program currently started in a terminal has a plurality of running processes; acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal; acquiring a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal; and detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal. The invention also discloses a device, a terminal and a readable storage medium. The invention can detect and evaluate whether the residual electric quantity of the terminal is enough for the application program to run a process.

Description

Power consumption detection method, device, terminal and readable storage medium
Technical Field
The present invention relates to the field of power consumption detection methods, apparatuses, and terminals, and in particular, to a power consumption detection method, apparatus, terminal, and readable storage medium.
Background
With the continuous development of application programs in terminals, more and more users like to play application programs in terminals, the power consumption of the application programs in the running process is high, most of the power supply of the terminals is provided by batteries of the application programs, when the power is lower than a preset value, the application programs with a plurality of running processes can not continue to run out of one process, or the residual power can use the residual time of the application programs, for example: when the residual electric quantity is lower than a preset value, the user cannot know whether the residual electric quantity is enough to continue to run a game process, if the user chooses to continue the game, the terminal can be suddenly shut down due to insufficient electric quantity, so that the game is interrupted, and the game is lost, on the other hand, the user can influence the level of the game due to the fact that the game is shut down, 24528 is not safe to continue.
Disclosure of Invention
The invention mainly aims to provide a power consumption detection method, a terminal and a readable storage medium, which aim to detect and evaluate whether the residual electric quantity of the terminal is enough for an application program to run a process.
In order to achieve the above object, the present invention provides a power consumption detection method, the method comprising the steps of:
detecting whether an application program currently started in a terminal has a plurality of running processes or not;
if yes, acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
acquiring a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
and detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Optionally, before the step of obtaining the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal, the method further includes:
judging whether the residual electric quantity of the terminal is lower than a preset value, if yes, executing the steps of: and acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal.
Optionally, the application program is a game program with a multi-game running process;
the steps of the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal are as follows: the game program is used for presetting historical power consumption data and corresponding game office numbers in a period in the terminal;
the historical power consumption data of the game program in the preset period in the terminal comprises the following steps: the running time of the game program in the preset period in the terminal, the power consumption of the corresponding shortest single game, the power consumption of the corresponding longest single game and the corresponding total power consumption.
Optionally, the step of detecting whether the remaining power of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal includes:
when the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
When the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating a time length average value of the single game of the game program and an electric consumption average value of the single game process according to the running time length, the total electric consumption and the corresponding game number of the game program in a preset period in the terminal;
according to the formula: and calculating the residual game electric quantity value by the current residual electric quantity of the terminal, namely the total power consumption weight value of the current running environment, the average value of the time length of the single game and the residual game electric quantity value, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process when the residual game electric quantity value is larger than or equal to the average value of the power consumption of the single game, and detecting and judging that the current residual electric quantity of the terminal is insufficient for the game program to run a game process when the residual game electric quantity value is smaller than the average value of the power consumption of the single game.
Optionally, the step of detecting whether the remaining power of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal includes:
When the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient to run a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating the average value of the time length of the single game of the game program and the electric consumption of the unit time of the game program according to the historical running time length of the game program in the preset period of the terminal, the total electric consumption and the number of game games;
according to the formula: and detecting and judging that the current residual electric quantity of the terminal is insufficient to run a game process when the estimated electric quantity of the terminal is larger than the residual electric quantity of the terminal, and detecting and judging that the current residual electric quantity of the terminal is sufficient to run a game process when the estimated electric quantity of the terminal is smaller than or equal to the residual electric quantity of the terminal.
Optionally, the step of determining comprises: (total power consumption weight of terminal current running environment+power consumption of unit time) ×duration average value of single game=estimated game power consumption value of terminal, when estimated game power consumption value of terminal is greater than residual power value of terminal, detecting and judging that current residual power of terminal is insufficient to run a game process, when estimated game power consumption value of terminal is less than or equal to residual power value of terminal, detecting and judging that current residual power of terminal is sufficient to run a game process, after the steps of:
and if the residual electric quantity of the terminal is insufficient for the game program to run a game process, calculating the using time of the residual electric quantity of the terminal according to the power consumption per unit time, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Optionally, after the step of determining whether the remaining power of the terminal is sufficient for the application to run a process according to the historical power consumption data of the application, the running process number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal, the method further includes:
And displaying prompt information of whether the residual electric quantity of the terminal is enough for the application program to run a process or not in the running state of the application program through a prompt window.
In addition, to achieve the above object, the present invention also provides a power consumption detection apparatus, including:
and a detection module: the method comprises the steps of detecting whether an application program currently started in a terminal has an operation process or not;
the first acquisition module is used for acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
and a second acquisition module: the method comprises the steps of obtaining a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
and a judging module: and the terminal is used for judging whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number of the current application program, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
In addition, to achieve the above object, the present invention also provides a terminal including: the power consumption detection method comprises the steps of a memory, a processor and a power consumption detection program which is stored in the memory and can run on the processor, wherein the power consumption detection program is executed by the processor to realize the power consumption detection method.
In addition, in order to achieve the above object, the present invention also provides a readable storage medium having stored thereon a power consumption detection program which, when executed by a processor, implements the steps of the power consumption detection method as described above:
the method and the device detect that the application program currently started in the terminal has a plurality of running processes; acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal; acquiring a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal; and detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal. By the method, whether the residual electric quantity of the terminal is enough for the application program to run a process can be calculated, so that a user can know the residual electric quantity condition of the terminal, the application program using behavior can be adjusted in the first time, and data cannot be lost due to the fact that the running application program is interrupted when the terminal is turned off.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of a terminal implementing various embodiments of the present invention;
fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention;
FIG. 3 is a flowchart of a power consumption detection method according to a first embodiment of the present invention;
FIG. 4 is a flowchart of a second embodiment of a power consumption detection method according to the present invention;
FIG. 5 is a flowchart of a third embodiment of a power consumption detection method according to the present invention;
FIG. 6 is a flowchart of a fourth embodiment of a power consumption detection method according to the present invention;
FIG. 7 is a flowchart of a fifth embodiment of a power consumption detection method according to the present invention;
FIG. 8 is a flowchart of a sixth embodiment of a power consumption detection method according to the present invention;
FIG. 9 is a flowchart of a power consumption detection method according to a seventh embodiment of the present invention;
FIG. 10 is a schematic diagram of a power consumption detection apparatus according to the present invention;
fig. 11 is a schematic structural diagram of a power consumption detection apparatus according to another embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, terminals described in the present invention may include terminals such as cell phones, tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, wearable devices, smart bracelets, pedometers, and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like.
The following description will be given by taking a terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic hardware structure of a terminal implementing various embodiments of the present invention, the terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. It will be appreciated by those skilled in the art that the terminal structure shown in fig. 1 is not limiting of the terminal and that the terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving downlink information of the base station, processing the downlink information by the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code DivisionMultiple Access, CDMA 2000), WCDMA (Wi deband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the essential constitution of the terminal, and can be omitted entirely as required within the scope of not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The terminal 100 further comprises at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal 100 or may be used to transmit data between the terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the terminal, and connects various parts of the entire terminal using various interfaces and lines, and performs various functions of the terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the terminal 100 may further include a bluetooth module or the like, which is not described herein.
Based on the above-mentioned terminal hardware structure, various embodiments of the terminal of the present invention are presented.
Referring to fig. 1, in an embodiment of the terminal of the present invention, the terminal includes: a memory 109, a processor 110, and a power consumption detection program stored on the memory 109 and executable on the processor 110, which when executed by the processor 110, implements the steps of:
detecting whether an application program currently started in a terminal has a plurality of running processes or not;
if yes, acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
acquiring a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
and detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Further, before the step of obtaining the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal, the method further includes:
judging whether the residual electric quantity of the terminal is lower than a preset value, if yes, executing the steps of: and acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal.
Further, the application program is a game program with a multi-game running process;
the steps of the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal are as follows: the game program is used for presetting historical power consumption data and corresponding game office numbers in a period in the terminal;
the historical power consumption data of the game program in the preset period in the terminal comprises the following steps: the running time of the game program in the preset period in the terminal, the power consumption of the corresponding shortest single game, the power consumption of the corresponding longest single game and the corresponding total power consumption.
Further, the step of detecting whether the remaining power of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal comprises the following steps:
When the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating a time length average value of the single game of the game program and an electric consumption average value of the single game process according to the running time length, the total electric consumption and the corresponding game number of the game program in a preset period in the terminal;
according to the formula: and calculating the residual game electric quantity value by the current residual electric quantity of the terminal, namely the total power consumption weight value of the current running environment, the average value of the time length of the single game and the residual game electric quantity value, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process when the residual game electric quantity value is larger than or equal to the average value of the power consumption of the single game, and detecting and judging that the current residual electric quantity of the terminal is insufficient for the game program to run a game process when the residual game electric quantity value is smaller than the average value of the power consumption of the single game.
Further, the step of detecting whether the remaining power of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal comprises the following steps:
when the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient to run a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating the average value of the time length of the single game of the game program and the electric consumption of the unit time of the game program according to the historical running time length of the game program in the preset period of the terminal, the total electric consumption and the number of game games;
according to the formula: and detecting and judging that the current residual electric quantity of the terminal is insufficient to run a game process when the estimated electric quantity of the terminal is larger than the residual electric quantity of the terminal, and detecting and judging that the current residual electric quantity of the terminal is sufficient to run a game process when the estimated electric quantity of the terminal is smaller than or equal to the residual electric quantity of the terminal.
Further, the following formula: (total power consumption weight of terminal current running environment+power consumption of unit time) ×duration average value of single game=estimated game power consumption value of terminal, when estimated game power consumption value of terminal is greater than residual power value of terminal, detecting and judging that current residual power of terminal is insufficient to run a game process, when estimated game power consumption value of terminal is less than or equal to residual power value of terminal, detecting and judging that current residual power of terminal is sufficient to run a game process, after the steps of:
and if the residual electric quantity of the terminal is insufficient for the game program to run a game process, calculating the using time of the residual electric quantity of the terminal according to the power consumption per unit time, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Further, after the step of determining whether the remaining power of the terminal is sufficient for the application to run a process according to the historical power consumption data of the application, the running process number, the total power consumption weight of the current running environment of the terminal and the current remaining power of the terminal, the method further includes:
And displaying prompt information of whether the residual electric quantity of the terminal is enough for the application program to run a process or not in the running state of the application program through a prompt window.
The specific embodiments of the terminal of the present invention are substantially the same as the specific embodiments of the power consumption detection method described below, and will not be described herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the terminal of the present invention is based will be described below.
Referring to fig. 2, fig. 2 is a schematic diagram of a communication network system according to an embodiment of the present invention, where the communication network system is an LTE system of a general mobile communication technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network ) 202, an epc (Evolved Packet Core, evolved packet core) 203, and an IP service 204 of an operator that are sequentially connected in communication.
Specifically, the UE201 may be the terminal 100 described above, and will not be described herein.
The E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. The eNodeB2021 may be connected with other eNodeB2022 by a backhaul (e.g., an X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide access from the UE201 to the EPC 203.
EPC203 may include MME (Mobility Management Entity ) 2031, hss (Home Subscriber Server, home subscriber server) 2032, other MMEs 2033, SGW (Serving Gate Way) 2034, pgw (PDN Gate Way) 2035 and PCRF (Policy and Charging Rules Function, policy and tariff function entity) 2036, and so on. The MME2031 is a control node that handles signaling between the UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location registers (not shown) and to hold user specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034 and PGW2035 may provide IP address allocation and other functions for UE201, PCRF2036 is a policy and charging control policy decision point for traffic data flows and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem ), or other IP services, etc.
Although the LTE system is described above as an example, it should be understood by those skilled in the art that the present invention is not limited to LTE systems, but may be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above terminal hardware structure and the communication network system, various embodiments of the method of the present invention are provided.
The invention provides a power consumption detection method. Referring to fig. 3, fig. 3 is a flowchart illustrating a first embodiment of a power consumption detection method according to the present invention, based on the embodiment shown in fig. 3, the method includes:
step S10, detecting whether an application program currently started in a terminal has a plurality of running processes or not;
whether the currently started application program in the terminal has a plurality of running processes or not is detected, so that whether the residual electric quantity of the terminal is enough for a user to reuse one running process of the application program or not can be accurately predicted under the running state of the application program, and the running process is provided for the user, the user can reasonably select whether to resume using the application program or not, the situation that the current data is lost due to forced stopping of the application program due to insufficient electric quantity in the running process is avoided, and user experience is improved.
Step S20, historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal are obtained;
in an embodiment, the running process number and the historical power consumption data of the application program in the terminal are obtained, and the historical power consumption data of the application program is power consumption data such as running time in a preset period, corresponding total power consumption, power consumption of a corresponding longest running process, power consumption of a corresponding shortest running process and the like; the historical power consumption data in the preset period can be recorded and inquired by the system in the running process of the application program.
Dividing the total power consumption in the terminal by the running process number to obtain the average power consumption value of a single running process of the application program; dividing the running time of the application program by the running process number to obtain a time average value of a single running process of the application program; dividing the total power consumption by the running time to obtain the power consumption of the application program in unit time.
Step S30, obtaining a total power consumption weight of a current running environment of a terminal and a current residual electric quantity of the terminal;
the current operating environment of the terminal comprises one or more of a network environment, a hardware environment and a background operating program of the terminal. For example: network connection, screen brightness, CPU, other programs running in the background, etc.
The system can provide the total power consumption condition of the system and the power consumption ratio of various hardware devices (such as a CPU, a screen, a network and the like);
the method for determining the total power consumption weight of the current running environment of the terminal comprises the steps of respectively inquiring the power consumption weights corresponding to the network environment, the hardware environment and the background running program of the terminal according to the brand, the model and other identification information of the terminal and the operating system, and adding the power consumption weights corresponding to the network environment, the hardware environment and the background running program of the terminal to obtain the total power consumption weight of the current running environment.
Step S40, detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
According to the historical power consumption data of the application program and the corresponding running process number, the historical power consumption data of the application program is power consumption data such as historical running time length, corresponding total power consumption, power consumption of the corresponding longest running process, power consumption of the corresponding shortest running process and the like; dividing the total power consumption in the terminal by the running process number to obtain the average power consumption value of a single running process of the application program; dividing the running time of the application program by the running process number to obtain a time average value of a single running process of the application program; dividing the total power consumption by the historical operation duration to obtain the power consumption of the application program in unit time.
Therefore, whether the residual electric quantity of the terminal is enough for the application program to run one process can be calculated based on the electric consumption of the longest running process of the application program, the electric consumption of the shortest running process, the electric consumption average value of the single running process, the duration average value of the single running process, the electric consumption of unit time, the total electric consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating a power consumption detection method according to a second embodiment of the present invention. Based on the embodiment shown in fig. 4, before step S20, the method further includes:
step S50, determining whether the remaining power of the terminal is lower than a preset value, if yes, executing step S20,
when the residual electric quantity of the terminal is lower than a preset value, namely, when an indicator value with low electric quantity appears, historical power consumption data and running process number of the application program are obtained.
Further, referring to fig. 5, fig. 5 is a flowchart illustrating a third embodiment of the power consumption detection method according to the present invention. Based on the embodiment shown in fig. 5, the application program is a game program with a multi-game running process;
the step of S20 is: step S21, the game program presets historical power consumption data and corresponding game office numbers in a period in the terminal;
The historical power consumption data of the game program in the preset period in the terminal comprises the following steps: the running time of the game program in the preset period in the terminal, the power consumption of the corresponding shortest single game, the power consumption of the corresponding longest single game and the corresponding total power consumption.
The step of S40 is: step S41, detecting whether the residual electric quantity of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
The application program is a game program with a plurality of game running processes, the running process number of the application program is the game number of the game program, and the game history power consumption data are power consumption data such as the history running length and the corresponding total power consumption in a preset period, the power consumption of the corresponding longest single game, the power consumption of the corresponding shortest single game and the like; and calculating the historical power consumption condition of the game program based on the historical power consumption data and the game number, thereby further judging whether the residual power is enough for the game program to run a game process by combining the total power consumption weight of the current running environment of the terminal and the current residual power of the terminal.
Further, referring to fig. 6, fig. 6 is a flowchart of a fourth embodiment of the power consumption detection method of the present invention. Based on the embodiment shown in fig. 6, step S41 includes:
step S411, when the current residual electric quantity of the terminal is greater than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the shortest single game in the historical operation period in the preset period, detecting and judging that the residual electric quantity is insufficient to operate a game process, when the current residual electric quantity of the terminal is larger than the electric consumption of the longest single game in the historical operation period in the preset period, detecting and judging that the residual electric quantity is sufficient to operate the game process, and when the residual electric quantity is larger than or equal to the electric consumption of the shortest single game in the historical operation period in the preset period and smaller than or equal to the electric consumption of the longest single game in the historical operation period in the preset period, executing step S412 and step S413 to judge.
Step S412, when the current residual electric quantity of the terminal is smaller than the electric quantity of the longest single game and larger than the electric quantity of the shortest single game, calculating a time length average value of the single game of the game program and an electric quantity average value of the single game according to the running time length, the total electric quantity and the corresponding game number of the game program in a preset period in the terminal;
in the embodiment, assuming that the time of the preset period is the current 1-week time or 1 month of starting the game program, step S21 obtains the running time of the game program recorded in the preset period, the corresponding total power consumption and the corresponding number of game plays, specifically, the average value of the power consumption of the single game of the game program is obtained by dividing the total power consumption of the game program in the preset period by the corresponding number of game plays, and the running time of the game program in the preset period is divided by the corresponding number of game plays, so as to obtain the average value of the single game time of the game program;
step S413, according to the formula: and when the residual electric quantity value is smaller than the average value of the electric consumption of the single game, detecting and judging that the current residual electric quantity of the terminal is insufficient for running a game process.
Multiplying the total power consumption weight of the current running environment of the terminal by the average value of the game time length to obtain the electric quantity to be consumed by the current running environment of the terminal; and subtracting the current residual electric quantity of the terminal from the current running environment of the terminal to obtain a residual game electric quantity value, detecting and judging that the residual electric quantity is enough for the game program to run a game process when the residual game electric quantity value is larger than or equal to the average value of the electric consumption of the single game, and detecting and judging that the residual electric quantity is insufficient for the game program to run a game process when the residual game electric quantity value is smaller than the average value of the electric consumption of the single game. Therefore, whether the residual electric quantity of the terminal is enough or not is obtained, the result of the game program running one game process is more accurate, and the terminal can be used and guided for a user more correctly, so that the situation that the terminal is shut down to lose the game due to the fact that the user is not ready to play the game is avoided, and the user experience is improved.
Further, referring to fig. 7, fig. 7 is a flowchart of a fifth embodiment of the power consumption detection method according to the present invention. Based on the embodiment shown in fig. 7, step S41 includes:
s411, when the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
When the current residual electric quantity of the terminal is smaller than the electric consumption of the shortest single game in the historical operation period in the preset period, detecting and judging that the residual electric quantity is insufficient for the game program to operate a game process, when the current residual electric quantity of the terminal is larger than the electric consumption of the longest single game in the historical operation period in the preset period, detecting and judging that the residual electric quantity is sufficient for the game program to operate a game process, and when the residual electric quantity is larger than or equal to the electric consumption of the shortest single game in the historical operation period in the preset period and smaller than or equal to the electric consumption of the longest single game in the historical operation period in the preset period, executing step S414 and step S415 to judge.
S414, when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating the average value of the time length of the single game of the game program and the electric consumption of the unit time of the game program according to the historical running time length of the game program in the preset period of the terminal, the total electric consumption and the number of game games;
in the embodiment, assuming that the time of the preset period is 1 week or 1 month before starting the game program, step S21 obtains the running time of the game program recorded in the preset period, the corresponding total power consumption and the corresponding number of plays, specifically, the total power consumption of the game program in the preset period can be divided by the corresponding game time to obtain the power consumption of the unit time of the game program, and the running time of the game program in the preset period is divided by the corresponding number of plays to obtain the average value of the single play time of the game program;
S415, according to the formula: and when the estimated game consumption value of the terminal is smaller than or equal to the terminal residual electric quantity value, detecting and judging that the current residual electric quantity of the terminal is enough for the game program to run a game process.
The total power consumption weight of the current running environment of the terminal is added with the power consumption of the game program in unit time to obtain the power consumption of the terminal in unit time, the power consumption of the terminal in unit time is multiplied by the average value of the single game time to obtain the estimated game power consumption value of the terminal, when the residual power value of the terminal is larger than or equal to the estimated game power consumption value of the terminal, the residual power is detected and judged to be enough for the game program to run a game process, and when the residual power value of the terminal is smaller than the about-to-run power consumption value of the terminal, the residual power is detected and judged to be insufficient for the game program to run a game process. Therefore, whether the residual electric quantity is enough or not is obtained, the result of the game program running a game process is more accurate, and the user can be guided to use more correctly, so that the situation that the terminal is shut down to lose the game due to the fact that the user is not ready to play the game is avoided, and the user experience is improved.
Further, referring to fig. 8, fig. 8 is a flowchart of a sixth embodiment of the power consumption detection method according to the present invention. Based on the embodiment of fig. 8 described above, after step S415, the method further includes:
and if the residual electric quantity of the terminal is insufficient for the game program to run a game process, calculating the using time of the residual electric quantity of the terminal according to the power consumption per unit time, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
And if the residual electric quantity of the terminal is judged to be insufficient to finish a game, the total power consumption weight of the current running environment of the terminal is added with the power consumption of the game program in unit time to obtain the power consumption of the terminal in unit time, and the current residual electric quantity of the terminal is divided by the power consumption of the terminal in unit time to obtain the service time of the residual electric quantity of the terminal. Therefore, the user can further know the residual use time of the terminal, the situation that the terminal is shut down to lose games due to the fact that the user does not prepare to play the games is avoided, and user experience is improved.
Further, referring to fig. 9, fig. 9 is a flowchart of a seventh embodiment of the power consumption detection method according to the present invention. Based on the embodiment shown in fig. 9, after step S40, the method further includes:
And S60, displaying prompt information of whether the residual electric quantity of the terminal is enough for the application program to run a process or not in the running state of the application program through a prompt window.
When the residual electric quantity of the terminal is lower than a preset value, whether the residual electric quantity of the terminal is enough to run a process or not in the running state of the application program is displayed through a reminding window, or the service time of the application program is continuously used, so that when the electric quantity is insufficient, a user can be reminded in time, reasonable operation can be conveniently adopted by the user, service data is not lost due to the fact that the user exits before the application program does not complete a process, and if the game is not completed, the user is shut down before the game is not completed.
The invention also provides a power consumption detection device, and fig. 10 is a schematic structural diagram of the power consumption detection device. Based on the embodiment shown in fig. 10 described above, the apparatus includes: the device comprises a detection module 1, a first acquisition module 2, a second acquisition module and a judgment module 4.
Detection module 1: the method comprises the steps of detecting whether an application program currently started in a terminal has a plurality of running processes or not; the detection module 1 detects whether the currently started application program in the terminal has a plurality of running processes, so that whether the residual electric quantity of the terminal is enough for a user to reuse one running process of the application program in the running state of the application program can be accurately predicted, and the running process is provided for the user, so that the user can reasonably select whether to resume using the application program, the situation that the current data is lost due to forced stopping of the application program due to insufficient electric quantity in the running process is avoided, and the user experience is improved.
The first acquisition module 2 is used for acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
the first obtaining module 2 obtains the running process number and the historical power consumption data of the application program in the terminal, wherein the historical power consumption data of the application program is the running time in a preset period, the corresponding total power consumption, the power consumption of the corresponding longest running process, the power consumption of the corresponding shortest running process and other power consumption data; the historical power consumption data in a preset period can be recorded and inquired by the system in the running process of the application program;
dividing the total power consumption in the terminal by the running process number to obtain the average power consumption value of a single running process of the application program; dividing the running time of the application program by the running process number to obtain a time average value of a single running process of the application program; dividing the total power consumption by the running time to obtain the power consumption of the application program in unit time.
And a second acquisition module: the method comprises the steps of obtaining a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
the method comprises the steps that a second acquisition module acquires a total power consumption weight of a current running environment of a terminal and a current residual electric quantity of the terminal; the current operating environment of the terminal comprises one or more of a network environment, a hardware environment and a background operating program of the terminal. For example: network connectivity, screen brightness, CPU, other programs running in the background, etc., the system may provide a system overall power consumption and a power consumption duty cycle for various hardware devices (e.g., CPU, screen, network, etc.).
The method for determining the total power consumption weight of the current running environment of the terminal comprises the steps of respectively inquiring the power consumption weights corresponding to the network environment, the hardware environment and the background running program of the terminal according to the brand, the model and other identification information of the terminal and the operating system, and adding the power consumption weights corresponding to the network environment, the hardware environment and the background running program of the terminal to obtain the total power consumption weight of the current running environment.
Judgment module 4: and the terminal is used for judging whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number of the current application program, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
The judging module 4 judges the historical power consumption data of the application program according to the historical power consumption data of the application program and the corresponding running process number, wherein the historical power consumption data of the application program is power consumption data such as historical running time length, corresponding total power consumption, power consumption of the corresponding longest running process, power consumption of the corresponding shortest running process and the like; dividing the total power consumption in the terminal by the running process number to obtain the average power consumption value of a single running process of the application program; dividing the running time of the application program by the running process number to obtain a time average value of a single running process of the application program; dividing the total power consumption by the historical operation duration to obtain the power consumption of the application program in unit time.
Therefore, whether the residual electric quantity of the terminal is enough for the application program to run one process can be calculated based on the electric consumption of the longest running process of the application program, the electric consumption of the shortest running process, the electric consumption average value of the single running process, the duration average value of the single running process, the electric consumption of unit time, the total electric consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
Further, referring to fig. 11, fig. 11 is a schematic structural diagram of a power consumption detection apparatus according to another embodiment of the present invention: further comprises the following components on the basis of the illustration in fig. 11: a reminder module 5.
The reminding module 5 may display, through a reminding window, whether the remaining power of the terminal is sufficient to complete an operation process in the operation state of the application.
Therefore, the user can be reminded whether the residual electric quantity is enough for the running process of the application program or the use time of the application program is continuously used, and the user can be reminded in time when the electric quantity is insufficient, so that the user can take reasonable operation, and the loss of service data of a user can not be exited before the application program does not complete one running process.
The invention also provides a readable storage medium.
The readable storage medium of the present invention has stored thereon a power consumption detection program which, when executed by a processor, implements the steps of the power consumption detection method as described above.
The method implemented when the power consumption detection program running on the processor is executed may refer to the embodiment of the power consumption detection method of the present invention, and will not be described herein.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (8)

1. A method for detecting power consumption, the method comprising the steps of:
detecting whether an application program currently started in a terminal has a plurality of running processes or not;
if yes, acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
acquiring a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
detecting whether the residual electric quantity of the terminal is enough for the application program to run a process according to the historical power consumption data of the application program, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal;
the application program is a game program with a multi-game running process;
The steps of the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal are as follows: the game program is used for presetting historical power consumption data and corresponding game office numbers in a period in the terminal;
the historical power consumption data of the game program in the preset period in the terminal comprises the following steps: the running time of the game program in the preset period in the terminal, the power consumption of the corresponding shortest single game, the power consumption of the corresponding longest single game and the corresponding total power consumption;
detecting whether the residual power of the terminal is enough for the application to run a process according to the historical power consumption data of the application, the running process number, the total power consumption weight of the current running environment of the terminal and the current residual power of the terminal, wherein the step of detecting comprises the following steps of: detecting whether the residual electric quantity of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal;
detecting whether the residual electric quantity of the terminal is enough for the game program to run a game process according to the historical electric consumption data of the game program, the game office number, the total electric consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal, wherein the step comprises the following steps:
When the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating a time length average value of the single game of the game program and an electric consumption average value of the single game according to the running time length, the total electric consumption and the corresponding game number of the game program in a preset period in the terminal;
according to the formula: and when the residual electric quantity value is smaller than the average value of the electric consumption of the single game, detecting and judging that the current residual electric quantity of the terminal is insufficient for running a game process.
2. The power consumption detection method as claimed in claim 1, wherein before the step of obtaining the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal, the method further comprises:
judging whether the residual electric quantity of the terminal is lower than a preset value, if yes, executing the steps of: and acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal.
3. The power consumption detection method as claimed in claim 1, wherein the step of detecting whether the remaining power of the terminal is sufficient for the game program to run a game progress based on the historical power consumption data of the game program, the number of game plays, a total power consumption weight of a current running environment of the terminal, and a current remaining power of the terminal, comprises:
when the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient to run a game process by a game program;
When the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating the average value of the time length of the single game of the game program and the electric consumption of the unit time of the game program according to the historical running time length of the game program in the preset period of the terminal, the total electric consumption and the number of game games;
according to the formula: and when the estimated game consumption value of the terminal is smaller than or equal to the terminal residual electric quantity value, detecting and judging that the current residual electric quantity of the terminal is enough for the game program to run a game process.
4. The power consumption detection method of claim 3, wherein the following formula: (total power consumption weight of terminal current running environment+power consumption of unit time) ×duration average value of single game = terminal estimated game power consumption value, calculating terminal estimated game power consumption value, when terminal estimated game power consumption value is greater than terminal residual power value, detecting and judging that the terminal current residual power is insufficient to run a game process, when terminal estimated game power consumption value is less than or equal to terminal residual power value, detecting and judging that the terminal current residual power is sufficient to run a game process, then further comprising:
And if the residual electric quantity of the terminal is insufficient for the game program to run a game process, calculating the using time of the residual electric quantity of the terminal according to the power consumption per unit time, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal.
5. The power consumption detection method as claimed in claim 1, wherein after the step of determining whether the remaining power of the terminal is sufficient for the application to run a process according to the historical power consumption data of the application, the number of running processes, the total power consumption weight of the current running environment of the terminal, and the current remaining power of the terminal, the method further comprises:
and displaying prompt information of whether the residual electric quantity of the terminal is enough for the application program to run a process or not in the running state of the application program through a prompt window.
6. A power consumption detection apparatus, characterized by comprising:
and a detection module: the method comprises the steps of detecting whether an application program currently started in a terminal has a plurality of running processes or not;
the first acquisition module is used for acquiring historical power consumption data and corresponding running process numbers of the application program in a preset period in the terminal;
and a second acquisition module: the method comprises the steps of obtaining a total power consumption weight of a current running environment of a terminal and the current residual electric quantity of the terminal;
And a judging module: the method comprises the steps of judging whether the residual electric quantity of the terminal is enough for an application program to run a process according to historical power consumption data of the application program, the running process number of the current application program, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal;
the application program is a game program with a plurality of game running processes, and the steps of the historical power consumption data and the corresponding running process number of the application program in the preset period in the terminal are as follows: the game program is used for presetting historical power consumption data and corresponding game office numbers in a period in the terminal;
the historical power consumption data of the game program in the preset period in the terminal comprises the following steps: the running time of the game program in the preset period in the terminal, the power consumption of the corresponding shortest single game, the power consumption of the corresponding longest single game and the corresponding total power consumption;
the judging module is further configured to: detecting whether the residual electric quantity of the terminal is enough for the game program to run a game process according to the historical power consumption data of the game program, the game office number, the total power consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal;
Detecting whether the residual electric quantity of the terminal is enough for the game program to run a game process according to the historical electric consumption data of the game program, the game office number, the total electric consumption weight of the current running environment of the terminal and the current residual electric quantity of the terminal, wherein the step comprises the following steps:
when the current residual electric quantity of the terminal is larger than or equal to the power consumption of the longest single game, detecting and judging that the current residual electric quantity of the terminal is enough for a game program to run a game process; when the current residual electric quantity of the terminal is smaller than or equal to the power consumption of the shortest single game, detecting and judging that the residual electric quantity of the terminal is insufficient, and running a game process by a game program;
when the current residual electric quantity of the terminal is smaller than the electric consumption of the longest single game and larger than the electric consumption of the shortest single game, calculating a time length average value of the single game of the game program and an electric consumption average value of the single game according to the running time length, the total electric consumption and the corresponding game number of the game program in a preset period in the terminal;
according to the formula: and when the residual electric quantity value is smaller than the average value of the electric consumption of the single game, detecting and judging that the current residual electric quantity of the terminal is insufficient for running a game process.
7. A terminal, the terminal comprising: a memory, a processor and a power consumption detection program stored on the memory and executable on the processor, the power consumption alert calculation program implementing the steps of the power consumption detection method according to any one of claims 1 to 5 when executed by the processor.
8. A readable storage medium, characterized in that the readable storage medium has stored thereon a power consumption detection program which, when executed by a processor, implements the steps of the power consumption detection method according to any one of claims 1 to 5.
CN201811455108.4A 2018-11-30 2018-11-30 Power consumption detection method, device, terminal and readable storage medium Active CN109309953B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811455108.4A CN109309953B (en) 2018-11-30 2018-11-30 Power consumption detection method, device, terminal and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811455108.4A CN109309953B (en) 2018-11-30 2018-11-30 Power consumption detection method, device, terminal and readable storage medium

Publications (2)

Publication Number Publication Date
CN109309953A CN109309953A (en) 2019-02-05
CN109309953B true CN109309953B (en) 2023-12-12

Family

ID=65223623

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811455108.4A Active CN109309953B (en) 2018-11-30 2018-11-30 Power consumption detection method, device, terminal and readable storage medium

Country Status (1)

Country Link
CN (1) CN109309953B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486313B (en) * 2019-09-11 2024-03-26 华为技术有限公司 Power saving method and device for terminal
CN113268131B (en) * 2020-02-14 2024-01-09 北京小米移动软件有限公司 Method, device and medium for predicting endurance information
WO2023044781A1 (en) * 2021-09-24 2023-03-30 Oppo广东移动通信有限公司 Wireless communication method, and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005620A (en) * 2010-10-29 2011-04-06 华为终端有限公司 Terminal and method for managing electric quantity of terminal battery
CN105094282A (en) * 2015-07-22 2015-11-25 深圳市金立通信设备有限公司 Management method for application programs and terminal
CN105100429A (en) * 2015-06-08 2015-11-25 北京金山安全软件有限公司 Method and device for determining use time of residual electric quantity of mobile terminal
CN107333000A (en) * 2017-07-07 2017-11-07 奇酷互联网络科技(深圳)有限公司 The method and apparatus and mobile terminal of a kind of navigation
CN107517494A (en) * 2017-08-31 2017-12-26 努比亚技术有限公司 A kind of display methods of terminal battery electricity quantity, terminal and computer-readable recording medium
CN107979697A (en) * 2017-11-16 2018-05-01 维沃移动通信有限公司 A kind of based reminding method and mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101712906B1 (en) * 2009-12-23 2017-03-08 엘지전자 주식회사 Mobile terminal and method for controlling charging thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005620A (en) * 2010-10-29 2011-04-06 华为终端有限公司 Terminal and method for managing electric quantity of terminal battery
CN105100429A (en) * 2015-06-08 2015-11-25 北京金山安全软件有限公司 Method and device for determining use time of residual electric quantity of mobile terminal
CN105094282A (en) * 2015-07-22 2015-11-25 深圳市金立通信设备有限公司 Management method for application programs and terminal
CN107333000A (en) * 2017-07-07 2017-11-07 奇酷互联网络科技(深圳)有限公司 The method and apparatus and mobile terminal of a kind of navigation
CN107517494A (en) * 2017-08-31 2017-12-26 努比亚技术有限公司 A kind of display methods of terminal battery electricity quantity, terminal and computer-readable recording medium
CN107979697A (en) * 2017-11-16 2018-05-01 维沃移动通信有限公司 A kind of based reminding method and mobile terminal

Also Published As

Publication number Publication date
CN109309953A (en) 2019-02-05

Similar Documents

Publication Publication Date Title
CN110175062B (en) Screen refreshing frame rate method of mobile terminal, mobile terminal and storage medium
CN110087287B (en) Control method and device for terminal network searching, mobile terminal and storage medium
CN109525720A (en) Battery of mobile terminal control method, mobile terminal and readable storage medium storing program for executing
CN109195213B (en) Mobile terminal screen control method, mobile terminal and computer readable storage medium
CN107635070B (en) Message reminding method, terminal and storage medium
CN109884543B (en) Method and equipment for predicting remaining service life of battery
CN109309953B (en) Power consumption detection method, device, terminal and readable storage medium
CN112261535A (en) Major-minor switching method and device for wireless earphone and readable storage medium
CN112612598A (en) Anti-addiction method, mobile terminal and computer-readable storage medium
CN109890072B (en) Terminal power saving control method and device, mobile terminal and readable storage medium
CN110875979A (en) Contextual model control method, terminal and computer readable storage medium
CN110098651B (en) Charging method, charging device, electronic equipment and readable storage medium
CN109862278B (en) Light supplementing method and device for face recognition and computer readable storage medium
CN109545120B (en) Screen light sensor adjusting method, mobile terminal and computer readable storage medium
CN109445945B (en) Memory allocation method of application program, mobile terminal, server and storage medium
CN107634940B (en) Flow use control method, terminal, server and readable storage medium
CN107517487B (en) Call control method and mobile terminal
CN107066327B (en) Timing task processing method, mobile terminal and computer readable storage medium
CN109388947B (en) Background management method, device and computer readable storage medium
CN109151201B (en) Anti-addiction method, mobile terminal and computer storage medium
CN109711850B (en) Secure payment method, device and computer readable storage medium
CN107894958B (en) Junk information cleaning method, terminal, server and computer readable storage medium
CN107770373B (en) Screen saturation adjusting method and corresponding mobile terminal
CN112667339B (en) Screen refresh rate setting method, terminal and computer readable medium
CN111476231B (en) Image area identification method, device and computer readable storage 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
GR01 Patent grant
GR01 Patent grant