CN107295175B - Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal - Google Patents

Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal Download PDF

Info

Publication number
CN107295175B
CN107295175B CN201710486133.8A CN201710486133A CN107295175B CN 107295175 B CN107295175 B CN 107295175B CN 201710486133 A CN201710486133 A CN 201710486133A CN 107295175 B CN107295175 B CN 107295175B
Authority
CN
China
Prior art keywords
electric quantity
mobile terminal
power
battery voltage
battery temperature
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
CN201710486133.8A
Other languages
Chinese (zh)
Other versions
CN107295175A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710486133.8A priority Critical patent/CN107295175B/en
Publication of CN107295175A publication Critical patent/CN107295175A/en
Application granted granted Critical
Publication of CN107295175B publication Critical patent/CN107295175B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • 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 embodiment of the invention discloses a display control method, a display control device, a storage medium and a mobile terminal of electric quantity of the mobile terminal, wherein the method comprises the following steps: starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time; after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface; and if the set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when the power-on event is triggered, so as to display the electric quantity according to the electric quantity information. According to the technical scheme provided by the embodiment of the invention, the accuracy of electric quantity display of the mobile terminal can be improved.

Description

Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal
Technical Field
The embodiment of the invention relates to the technical field of electric quantity management, in particular to a display control method and device of electric quantity of a mobile terminal, a storage medium and the mobile terminal.
Background
At present, displaying the Power on the screen of the mobile terminal becomes a basic function in the mobile terminal, generally, a battery information monitoring thread monitors a change condition of the battery Power at a bottom layer of the mobile terminal, and when the battery Power changes, the current Power is written into a Real-time clock (RTC) of a Power Management chip (PMIC) and displayed on the screen of the mobile terminal.
Disclosure of Invention
The embodiment of the invention provides a display control method and device for electric quantity of a mobile terminal, a storage medium and the mobile terminal, which can improve the accuracy of electric quantity display of the mobile terminal.
In a first aspect, an embodiment of the present invention provides a method for controlling display of an electric quantity of a mobile terminal, including:
starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time;
after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface;
and if the set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when the power-on event is triggered, so as to display the electric quantity according to the electric quantity information.
In a second aspect, an embodiment of the present invention provides a device for controlling display of power of a mobile terminal, including:
the electric quantity information updating process starting module is used for starting an electric quantity information updating detection process and detecting electric quantity updating information of the mobile terminal in real time;
the electric quantity information storage module is used for storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface after the electric quantity updating information is detected;
and the electric quantity information acquisition module is used for acquiring the electric quantity information in the nonvolatile storage medium when a power-on event is triggered if a forced power-off event of the set hardware is triggered, so as to display the electric quantity according to the electric quantity information.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for controlling display of power of a mobile terminal as provided in the first aspect.
In a fourth aspect, an embodiment of the present invention provides a mobile terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for controlling display of power of the mobile terminal according to the first aspect.
According to the display control scheme of the electric quantity of the mobile terminal provided by the embodiment of the invention, the electric quantity updating information of the mobile terminal is detected in real time by starting an electric quantity information updating detection process; after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface; if the set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when the power-on event is triggered, so as to display the electric quantity according to the electric quantity information, thereby improving the accuracy of electric quantity display of the mobile terminal.
Drawings
Fig. 1 is a schematic flow chart illustrating a method for controlling power display of a mobile terminal according to the prior art;
fig. 2 is a schematic flow chart illustrating a method for controlling display of power of a mobile terminal according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another method for controlling power consumption display of a mobile terminal according to an embodiment of the present invention;
fig. 4 is a flowchart illustrating another method for controlling power consumption display of a mobile terminal according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating another method for controlling power consumption display of a mobile terminal according to an embodiment of the present invention;
fig. 6 is a block diagram of a display control device for power of a mobile terminal according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
Detailed Description
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a schematic flow chart of a method for controlling display of power of a mobile terminal in the prior art, where as shown in fig. 1, the method for controlling display of power of a mobile terminal in the prior art includes: step 10: starting; step 11: monitoring the change condition of the battery electric quantity by a battery information monitoring thread; step 12: judging whether the electric quantity of the battery changes, if so, executing a step 13: writing the current electric quantity into a real-time clock (RTC) register of the power management chip; step 14: and (6) ending. However, resources in the RTC register are limited, and complete power information cannot be stored, and generally, only the power of the battery is stored in the RTC, and other power information affecting the power of the battery cannot be stored, so that the precision of the power information is low. On the other hand, after the mobile terminal triggers a long-press power button restart event or a battery unplugging event, the electric quantity information stored in the RTC will be lost, and the electric quantity information needs to be displayed according to the recalculated battery electric quantity after the mobile terminal is restarted, and the recalculated electric quantity may not be consistent with the electric quantity before the mobile terminal is turned off, so that the problems of inaccurate electric quantity initialization, large electric quantity jump and large difference between the real electric quantity and the electric quantity are caused, and the user experience is seriously influenced.
Fig. 2 is a flowchart illustrating a method for controlling display of power of a mobile terminal according to an embodiment of the present invention, where the method can be executed by a device for controlling display of power of a mobile terminal, where the device can be implemented by software and/or hardware, and can be generally integrated in a mobile terminal. As shown in fig. 2, the method includes:
step 101, starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time.
The mobile terminal described in this embodiment includes, but is not limited to, a mobile phone, a notebook, a smart watch, a tablet computer, a personal digital assistant, and the like.
And 102, after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface.
The Non-Volatile storage medium includes an Embedded Multi Media Card (eMMC) and a Non-Volatile Random Access Memory (NVRAM), and the information stored in the Non-Volatile storage medium is not lost after the mobile terminal triggers a hardware-forced power-down event.
After the Android application framework layer of the mobile terminal detects a signal for updating the electric quantity acquired from the kernel layer, the Android application framework layer can acquire the updated electric quantity information through the kernel layer, and the updated electric quantity information is stored in a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface in the application framework layer.
Wherein, the electric quantity information is battery electric quantity, and the step may include: and after the electric quantity updating information is detected, storing the updated electric quantity and the battery temperature and/or the battery voltage corresponding to the updated electric quantity into a nonvolatile storage medium through a set electric quantity updating interface.
And 103, if it is detected that a set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when it is detected that a power-on event is triggered, so as to display the electric quantity according to the electric quantity information.
The displaying of the electric quantity according to the electric quantity information may be displaying the electric quantity according to the electric quantity information, or displaying the electric quantity according to the electric quantity information when a second candidate display electric quantity is obtained after other target parameters are obtained subsequently, for example, after power-on and power-on restart, may be displaying the electric quantity according to the electric quantity information and the target parameters.
If the long-time pressing event of the set restart key is triggered or the battery power-down event of the mobile terminal is triggered, determining that the forced power-down event of the set hardware is triggered. The reset restart key is a key for performing restart operation when a long-press instruction of the key is detected, and can be a power key. Generally, when a mobile terminal is stuck and the like, a user may press a power key for a long time to restart or pull out a battery, and in this case, the power information of the RTC in the prior art is cleared and lost. According to the method and the device, the electric quantity information is stored in the nonvolatile storage medium of the mobile terminal, the electric quantity information before the situation occurs can be stored when the situation occurs, and the electric quantity information in the nonvolatile storage medium can be acquired after the mobile terminal is powered on again.
According to the method provided by the embodiment of the invention, the electric quantity updating information of the mobile terminal is detected in real time by starting the electric quantity information updating detection process; after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface; if the set hardware forced power-down event is triggered, when the power-up event is triggered, the electric quantity information in the nonvolatile storage medium is acquired to display the electric quantity according to the electric quantity information, so that the problems that the electric quantity information stored in the RTC is lost and the difference between the displayed electric quantity and the real electric quantity is large when the mobile terminal triggers the set hardware forced power-down event in the prior art are solved, the display electric quantity closer to the real point electric quantity can be determined according to the stored electric quantity information to be displayed, and the electric quantity display accuracy of the mobile terminal is improved.
Fig. 3 is a schematic flow chart of another method for controlling display of power of a mobile terminal according to an embodiment of the present invention, where the method includes the following steps:
step 201, starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time.
Step 202, after the power updating information is detected, storing the updated power information into a nonvolatile storage medium of the mobile terminal through a setting power updating interface.
Step 203, determining that a set hardware forced power down event is triggered, when a power up event is triggered, acquiring a first electric quantity stored in the nonvolatile storage medium, and taking the first electric quantity as a first candidate display electric quantity.
The mobile terminal stores the updated electric quantity information into the nonvolatile storage medium every time the electric quantity information changes and updates, so that after the mobile terminal triggers the set hardware forced power-down event, the nonvolatile storage medium stores the memory electric quantity before the set hardware forced power-down event is triggered, and the memory electric quantity is used as a first candidate display electric quantity.
And step 204, determining the current second candidate display electric quantity of the mobile terminal according to the set electric quantity determination rule.
After the mobile terminal is powered on again, the current second candidate display electric quantity of the mobile terminal can be determined according to the current environment of the mobile terminal, such as the temperature of a battery, the voltage of the battery or the time length between a hardware forced power-down event and the power-on again, for example, the corresponding second candidate display electric quantity under the current temperature and voltage can be determined according to the pre-stored battery voltage-capacity relation curve of the battery voltage and the electric quantity under each temperature.
Step 205, determining a target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity.
In the prior art, since the power information in the RTC is lost, the power calculated after the reboot is directly used as the display power to display, and the power before the reboot is not considered. According to the method and the device, the target display electric quantity is determined according to the first candidate display electric quantity and the second candidate display electric quantity, and the target display electric quantity is determined by considering the electric quantity information before and after restarting, so that the target display electric quantity is more fit with the real electric quantity.
This step may include: and if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity.
The first set value is a preset parameter value for indicating whether the electric quantity jumps or not, if the electric quantity change value is smaller than the first set value, the jump is not considered to occur, otherwise, the jump is considered to occur. Illustratively, if the first candidate display power stored in the non-volatile storage medium is 30%, and the second candidate display power determined after power-on and power-on is 39%, and if the first setting value is 10%, in the prior art, 39% is displayed, the user is given an experience that the power is 39% in the illusion, but only 30% actually, the power is not durable. In this embodiment, since the difference between the first candidate display electric quantity and the second candidate display electric quantity is less than 10%, it is determined that no significant jump occurs in the change between the first candidate display electric quantity and the second candidate display electric quantity, the first candidate display electric quantity is closer to the true electric quantity, and the first candidate display electric quantity is used as the target display electric quantity to be displayed. The first setting value may be set according to parameters such as performance and model of the mobile terminal, for example, the first setting value may also be set to 20%.
And step 206, displaying the target display electric quantity on a screen of the mobile terminal.
The display method of the target display electric quantity on the mobile terminal can be displayed in a numerical percentage mode or a box percentage mode.
According to the method provided by the embodiment of the invention, if the fact that the set hardware forced power-down event is triggered is detected, when the fact that the power-up event is triggered is detected, the first electric quantity stored in the nonvolatile storage medium is obtained, the first electric quantity is used as the first candidate display electric quantity, the current second candidate display electric quantity of the mobile terminal is determined according to the set electric quantity determination rule, the target display electric quantity is determined according to the first candidate display electric quantity and the second candidate display electric quantity, the target display electric quantity is determined by considering the first candidate display electric quantity and the second candidate display electric quantity, the target display electric quantity is closer to the real electric quantity, and the electric quantity display accuracy of the mobile terminal is improved.
Fig. 4 is a schematic flow chart of another method for controlling display of power of a mobile terminal according to an embodiment of the present invention, where the method includes the following steps:
step 301, starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time.
Step 302, after the electric quantity updating information is detected, storing the updated electric quantity and the battery temperature and/or the battery voltage corresponding to the updated electric quantity into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface.
When the fact that the electric quantity of the mobile terminal is updated is detected, the updated electric quantity and the currently stored latest battery temperature and/or battery voltage corresponding to the updated electric quantity are obtained, and the updated electric quantity and the battery temperature and/or battery voltage corresponding to the updated electric quantity are stored in a nonvolatile storage medium.
Step 303, determining that a set hardware forced power down event is triggered, when a power up event is triggered, acquiring a first electric quantity stored in the nonvolatile storage medium, and a first battery temperature and/or a first battery voltage corresponding to the first electric quantity, and using the first electric quantity as a first candidate display electric quantity.
When the fact that the power-on event is triggered is detected, first memory electricity first electricity stored in a nonvolatile storage medium of the mobile terminal, and first battery temperature and/or first battery voltage corresponding to the first electricity are/is obtained.
And step 304, determining the current second candidate display electric quantity of the mobile terminal according to the set electric quantity determination rule, and acquiring the current second battery temperature and/or second battery voltage of the mobile terminal.
And the second battery temperature or the second battery voltage is the battery temperature or the battery voltage measured after the mobile terminal is powered on and started.
Step 305, determining a target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity, and the change situation between the first battery temperature and the second battery temperature, and/or the change situation between the first battery voltage and the second battery voltage.
When the battery temperature and/or the battery voltage are greatly changed, for example, a set hardware forced power-down event is triggered outdoors in winter, and the mobile terminal is powered on again after entering indoors, the battery temperature can be greatly changed, or the battery voltage can be greatly changed when the mobile terminal triggers a set hardware forced power-down event and the time interval between the set hardware forced power-down event and the power-on again is long. When the battery temperature or the battery voltage changes greatly, the battery capacity may change greatly to generate capacity jump.
The step may specifically include: if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity; if the change values of the first candidate display electric quantity and the second candidate display electric quantity are larger than or equal to a first set value, detecting the change condition between the first battery temperature and the second battery temperature and/or the change condition between the first battery voltage and the second battery voltage; if the change value between the first battery temperature and the second battery temperature is smaller than a second set value and/or the change value between the first battery voltage and the second battery voltage is smaller than a third set value, determining the first candidate display electric quantity as a target display electric quantity; and if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, determining the second candidate display electric quantity as a target display electric quantity.
Illustratively, if the first candidate display power obtained from the nonvolatile storage medium after the power is re-turned on is 30%, the corresponding first battery temperature is 0 °, the first battery voltage is 3.7V, the second candidate display power is 45%, the second battery temperature is 25 °, the second battery voltage is 3.7V, the first set value is 10%, the second set value is 20 °, and the third set value is 0.5V, it is known that 45% of the variation between the first candidate display power and the second candidate display power is greater than the first set value, and 25 ° of the variation between the second battery temperature and the first battery temperature is greater than the second set value, it is considered that a normal power jump is generated by the variation of the battery temperature, and the second candidate display power 45% is taken as the target display power; if only the second battery temperature is 5 degrees based on the same parameter values, and the change value of the battery temperature is 5 degrees smaller than the second set value, it is determined that the change of the battery temperature does not cause the electric quantity jump value to be larger than the first set value, the electric quantity jump is abnormal jump, and the first candidate display electric quantity is determined as the target display electric quantity.
Illustratively, if the first candidate display power obtained from the non-volatile storage medium after the power is re-turned on is 30%, the corresponding first battery temperature is 0 °, the first battery voltage is 3.7V, the second candidate display power is 45%, the second battery temperature is 0 °, the second battery voltage is 3.4V, the first set value is 10%, the second set value is 20 °, and the third set value is 0.5V, it is known that 45% of the variation between the first candidate display power and the second candidate display power is greater than the first set value, and the variation between the first battery voltage and the second battery voltage is 0.3V less than the third set value, the jump of the battery power is considered as an abnormal jump, and the first candidate display power is taken as the target display power.
In addition, the determination of the target display electric quantity may be performed in combination with the change of the battery temperature and the battery voltage, for example, when the change of the battery temperature is greater than the second set value and the change of the battery voltage is greater than the third set value, the second candidate display electric quantity is determined as the target display electric quantity. Furthermore, the weight of the battery temperature and the battery voltage change value to the determined target display electric quantity can be set, and the weight of the battery temperature can be set to be larger.
The electric quantity jump caused by the large change of the electric quantity and/or the voltage of the battery can be normal electric quantity jump, whether the electric quantity jump is normal electric quantity jump or not can be further determined when the electric quantity jump occurs, if the electric quantity jump is normal electric quantity jump, the second candidate display electric quantity after the jump is taken as target display electric quantity, and if the electric quantity jump is not normal electric quantity jump, the first candidate display electric quantity before the jump is taken as target display electric quantity.
Determining the second candidate display electric quantity as the target display electric quantity may include, if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value, and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value: if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, acquiring intermediate electric quantity corresponding to the second battery temperature and/or the second battery voltage from a set relation corresponding table; and if the difference value between the second candidate display electric quantity and the intermediate electric quantity is within a preset error range, determining the second candidate display electric quantity as a target display electric quantity.
Illustratively, according to the above example parameters, the first battery temperature is 0 °, the second battery temperature is 25 °, and the variation value of the battery temperature is 25 ° and is greater than the second set value 20 °, then the intermediate electric quantity corresponding to the second battery temperature at the current battery voltage of 3.7V is obtained from the corresponding relation table of the battery temperature and the electric quantity, and if the intermediate electric quantity is 40%, and the difference between the intermediate electric quantity and the second candidate display electric quantity 42% is within 5% of the preset error range, the second candidate display electric quantity is taken as the target display electric quantity.
And step 306, displaying the target display electric quantity on a screen of the mobile terminal.
The method provided by this embodiment, when it is detected that a set hardware forced power down event is triggered, and when it is detected that a power up event is triggered, acquires a first power amount and a first battery temperature and/or a first battery voltage stored in the non-volatile storage medium, uses the first power amount as a first candidate display power amount, determines a current second candidate display power amount of the mobile terminal according to a set power amount determination rule, and acquires a current second battery temperature and/or a second battery voltage of the mobile terminal, determines a target display power amount according to the first candidate display power amount and the second candidate display power amount, and a change situation between the first battery temperature and the second battery temperature, and/or a change situation between the first battery voltage and the second battery voltage, in combination with consideration of the first candidate display power amount and the second candidate display power amount, and the target display electric quantity is determined according to the change condition of the battery temperature and/or the battery voltage, so that the target display electric quantity is closer to the real electric quantity, and the electric quantity display accuracy of the mobile terminal is improved.
Fig. 5 is a schematic flow chart of another method for controlling display of power of a mobile terminal according to an embodiment of the present invention, where the method includes the following steps:
step 401, monitoring the electric quantity information by an electric quantity information monitoring thread of a kernel layer of the mobile terminal.
The power information includes a battery power, and may further include a battery temperature and/or a battery voltage.
Step 402, judging whether the electric quantity is changed, if so, executing step 403, setting a setting flag to be 1, otherwise, executing step 401.
In step 403, set flag to 1.
The setting mark is a parameter for marking whether the electric quantity changes, and if the setting mark is 1, the electric quantity is updated. The initial value of the setting flag is 0, and the setting flag can be stored in a setting file, for example, in/sys/class/power _ supply/bms/soc _ notify _ ready.
And step 404, regularly storing the detected electric quantity information to a set storage path.
For example, the detected power amount information is stored into/sys/class/power _ supply/bms/battery _ info every 5 seconds.
Step 405, acquiring power information.
And an Android layer of the mobile terminal starts an electric quantity information updating detection process to obtain the electric quantity information.
And step 406, acquiring an update signal of the electric quantity information.
Step 407, determining whether an electric quantity updating signal is acquired, if so, executing step 408, otherwise, executing step 405.
And if the updating signal is acquired, acquiring the electric quantity information and storing the electric quantity information into the nonvolatile storage medium.
Step 408, storing the power information in a non-volatile storage medium.
Step 409, determining that a set hardware forced power-down event is triggered, and when a power-on event is triggered, acquiring the electric quantity information in the nonvolatile storage medium to display the electric quantity according to the electric quantity information.
For example, the power information is stored in the oppo _ custom partition of the embedded memory.
The technical solution provided by this embodiment detects the power update information of the mobile terminal in real time by starting the power information update detection process, after the power updating information is detected, the updated power information is stored in a nonvolatile storage medium of the mobile terminal, if the forced power-down event of the set hardware is detected to be triggered, acquiring power information in the non-volatile storage medium when a power-on event is detected to be triggered, the electric quantity is displayed according to the electric quantity information, thereby avoiding the problems that when the mobile terminal triggers and sets a hardware forced power-down event in the prior art, the power information stored in the RTC is lost, the difference between the displayed power and the real power is large, the display electric quantity closer to the electric quantity of the real point can be determined according to the stored electric quantity information to be displayed, and the electric quantity display accuracy of the mobile terminal is improved.
Fig. 6 is a block diagram of a display control device for power of a mobile terminal according to an embodiment of the present invention, where the display control device can be implemented by software and/or hardware, and is generally integrated in a mobile terminal, and can perform display control on power display of the mobile terminal by executing a display control method for power of the mobile terminal. As shown in fig. 6, the apparatus includes:
the electric quantity information updating process starting module 51 is used for starting an electric quantity information updating detection process and detecting the electric quantity updating information of the mobile terminal in real time;
the electric quantity information storage module 52 is used for storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface after the electric quantity updating information is detected;
and the electric quantity information acquiring module 53 is configured to, if it is detected that a set hardware forced power down event is triggered, acquire the electric quantity information in the nonvolatile storage medium when it is detected that a power up event is triggered, so as to display the electric quantity according to the electric quantity information.
On the basis of the above embodiment, the setting of the forced power-down event of the hardware includes setting a long-press event of a restart key to be triggered or a battery power-down event of the mobile terminal to be triggered.
On the basis of the above embodiment, when detecting that a power-on event is triggered, the electric quantity information acquiring module acquires the electric quantity information in the nonvolatile storage medium, and displaying the electric quantity according to the electric quantity information includes:
when a power-on event is detected to be triggered, acquiring first electric quantity stored in the nonvolatile storage medium, and taking the first electric quantity as a first candidate display electric quantity;
determining the current second candidate display electric quantity of the mobile terminal according to a set electric quantity determination rule;
determining a target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity;
and displaying the target display electric quantity on a screen of the mobile terminal.
On the basis of the above embodiment, the determining, by the electric quantity information obtaining module, the target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity includes:
and if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity.
On the basis of the above embodiment, the electric quantity information further includes a battery temperature and/or a battery voltage, and after the electric quantity information acquisition module detects the electric quantity update information, the electric quantity information after update is stored in the nonvolatile storage medium by setting the electric quantity update interface, including:
and after the electric quantity updating information is detected, storing the updated electric quantity and the battery temperature and/or the battery voltage corresponding to the updated electric quantity into a nonvolatile storage medium through a set electric quantity updating interface.
On the basis of the foregoing embodiment, when detecting that the power-on event is triggered, the electric quantity information acquiring module acquires a first electric quantity stored in the nonvolatile storage medium, and taking the first electric quantity as a first candidate display electric quantity includes:
when the power-on event is detected to be triggered, acquiring first electric quantity stored in the nonvolatile storage medium, first battery temperature and/or first battery voltage, and taking the first electric quantity as a first candidate display electric quantity;
the determining the current second candidate display electric quantity of the mobile terminal according to the set electric quantity determination rule comprises:
determining the current second candidate display electric quantity of the mobile terminal according to a set electric quantity determination rule, and acquiring the current second battery temperature and/or second battery voltage of the mobile terminal;
the determining a target display power amount according to the first candidate display power amount and the second candidate display power amount comprises:
and determining the target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity, the change situation between the first battery temperature and the second battery temperature, and/or the change situation between the first battery voltage and the second battery voltage.
On the basis of the foregoing embodiment, the determining, by the electric quantity information obtaining module, the target display electric quantity according to the first candidate display electric quantity and the second candidate display electric quantity, and the change between the first battery temperature and the second battery temperature, and/or the change between the first battery voltage and the second battery voltage includes:
if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity;
if the change values of the first candidate display electric quantity and the second candidate display electric quantity are larger than or equal to a first set value, detecting the change condition between the first battery temperature and the second battery temperature and/or the change condition between the first battery voltage and the second battery voltage;
if the change value between the first battery temperature and the second battery temperature is smaller than a second set value and/or the change value between the first battery voltage and the second battery voltage is smaller than a third set value, determining the first candidate display electric quantity as a target display electric quantity;
and if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, determining the second candidate display electric quantity as a target display electric quantity.
On the basis of the foregoing embodiment, if the variation value between the first battery temperature and the second battery temperature is greater than or equal to a second set value, and/or the variation value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, the determining, by the electric quantity information obtaining module, the second candidate display electric quantity as the target display electric quantity includes:
if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, acquiring intermediate electric quantity corresponding to the second battery temperature and/or the second battery voltage from a set relation corresponding table;
and if the difference value between the second candidate display electric quantity and the intermediate electric quantity is within a preset error range, determining the second candidate display electric quantity as a target display electric quantity.
On the basis of the above embodiment, the nonvolatile storage medium includes an embedded memory and a nonvolatile random access memory.
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a method for controlling display of power of a mobile terminal, the method including:
starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time;
after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface;
and if the set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when the power-on event is triggered, so as to display the electric quantity according to the electric quantity information.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium containing the computer-executable instructions provided in the embodiments of the present invention is not limited to the above-mentioned display control operation of the power of the mobile terminal, and may also perform related operations in the display control method of the power of the mobile terminal provided in any embodiments of the present invention.
The embodiment of the invention provides a mobile terminal, wherein the mobile terminal can be integrated with a display control device of the electric quantity of the mobile terminal provided by the embodiment of the invention. Fig. 7 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention. As shown in fig. 7, the mobile terminal may include: a housing (not shown), a memory 601, a Central Processing Unit (CPU) 602 (also called a processor, hereinafter referred to as CPU), a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU602 and the memory 601 are disposed on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the mobile terminal; the memory 601 is used for storing executable program codes; the CPU602 executes a computer program corresponding to the executable program code by reading the executable program code stored in the memory 601 to implement the steps of:
starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time;
after the electric quantity updating information is detected, storing the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface;
and if the set hardware forced power-down event is triggered, acquiring the electric quantity information in the nonvolatile storage medium when the power-on event is triggered, so as to display the electric quantity according to the electric quantity information.
The mobile terminal further includes: peripheral interfaces 603, RF (Radio Frequency) circuitry 605, audio circuitry 606, speakers 611, power management chip 608, input/output (I/O) subsystem 609, touch screen 612, other input/control devices 610, and external ports 604, which communicate via one or more communication buses or signal lines 607.
It should be understood that the illustrated mobile terminal 600 is merely one example of a mobile terminal and that the mobile terminal 600 may have more or fewer components than shown, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes the mobile terminal for controlling power display provided in this embodiment in detail, where the mobile terminal is a mobile phone as an example.
A memory 601, the memory 601 being accessible by the CPU602, the peripheral interface 603, and the like, the memory 601 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 603, said peripheral interface 603 may connect input and output peripherals of the device to the CPU602 and the memory 601.
An I/O subsystem 609, the I/O subsystem 609 may connect input and output peripherals on the device, such as a touch screen 612 and other input/control devices 610, to the peripheral interface 603. The I/O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610. Where one or more input controllers 6092 receive electrical signals from or transmit electrical signals to other input/control devices 610, the other input/control devices 610 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 6092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 612, which touch screen 612 is an input interface and an output interface between the user's mobile terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 6091 in the I/O subsystem 609 receives electrical signals from the touch screen 612 or transmits electrical signals to the touch screen 612. The touch screen 612 detects a contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 612, that is, to implement a human-computer interaction, where the user interface object displayed on the touch screen 612 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 605 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, RF circuitry 605 receives and transmits RF signals, also referred to as electromagnetic signals, through which RF circuitry 605 converts electrical signals to or from electromagnetic signals and communicates with a communication network and other devices. RF circuitry 605 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electric signal, and transmit the electric signal to the speaker 611.
The speaker 611 is used to convert the voice signal received by the handset from the wireless network through the RF circuit 605 into sound and play the sound to the user.
And a power management chip 608 for supplying power and managing power to the hardware connected to the CPU602, the I/O subsystem, and the peripheral interface.
The mobile terminal provided by the embodiment of the invention avoids the problems that the difference between the displayed electric quantity and the real electric quantity is large because the electric quantity information stored in the RTC is lost when the mobile terminal triggers the hardware forced power-down event in the prior art, can determine the displayed electric quantity closer to the electric quantity of the real point according to the stored electric quantity information to display, and improves the accuracy of electric quantity display of the mobile terminal.
The display control device for the electric quantity of the mobile terminal, the computer readable storage medium and the mobile terminal provided in the above embodiments can execute the display control method for the electric quantity of the mobile terminal provided in any embodiment of the present invention, and have corresponding functional modules and beneficial effects for executing the method. For details of the mobile terminal power display control method provided in any embodiment of the present invention, reference may be made to the technical details not described in detail in the above embodiments.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (7)

1. A display control method for electric quantity of a mobile terminal is characterized by comprising the following steps:
starting an electric quantity information updating detection process, and detecting electric quantity updating information of the mobile terminal in real time;
after the electric quantity updating information is detected, storing the updated electric quantity information and the battery temperature and/or the battery voltage corresponding to the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface;
if the fact that a set hardware forced power-down event is triggered is detected, when the fact that a power-on event is triggered is detected, acquiring first electric quantity stored in a nonvolatile storage medium, and first battery temperature and/or first battery voltage corresponding to the first electric quantity, and taking the first electric quantity as first candidate display electric quantity;
determining the current second candidate display electric quantity of the mobile terminal according to a set electric quantity determination rule, and acquiring the current second battery temperature and/or second battery voltage of the mobile terminal;
if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity;
if the change values of the first candidate display electric quantity and the second candidate display electric quantity are larger than or equal to a first set value, detecting the change condition between the first battery temperature and the second battery temperature and/or the change condition between the first battery voltage and the second battery voltage:
if the change value between the first battery temperature and the second battery temperature is smaller than a second set value and/or the change value between the first battery voltage and the second battery voltage is smaller than a third set value, determining the first candidate display electric quantity as a target display electric quantity;
if the change value between the first battery temperature and the second battery temperature is larger than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is larger than or equal to a third set value, determining the second candidate display electric quantity as a target display electric quantity;
and displaying the target display electric quantity on a screen of the mobile terminal.
2. The method of claim 1, wherein if it is detected that a long-press event of a reset button is triggered or a battery power-down event of the mobile terminal is triggered, it is determined that a set hardware forced power-down event is triggered.
3. The method according to claim 1, wherein the determining the second candidate display power amount as the target display power amount if the variation value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the variation value between the first battery voltage and the second battery voltage is greater than or equal to a third set value comprises:
if the change value between the first battery temperature and the second battery temperature is greater than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is greater than or equal to a third set value, acquiring intermediate electric quantity corresponding to the second battery temperature and/or the second battery voltage from a set relation corresponding table;
and if the difference value between the second candidate display electric quantity and the intermediate electric quantity is within a preset error range, determining the second candidate display electric quantity as a target display electric quantity.
4. The method of any of claims 1-3, wherein the non-volatile storage medium comprises embedded memory and non-volatile random access memory.
5. A display control device for electric quantity of a mobile terminal is characterized by comprising:
the electric quantity information updating process starting module is used for starting an electric quantity information updating detection process and detecting electric quantity updating information of the mobile terminal in real time;
the electric quantity information storage module is used for storing the updated electric quantity information and the battery temperature and/or the battery voltage corresponding to the updated electric quantity information into a nonvolatile storage medium of the mobile terminal through a set electric quantity updating interface after the electric quantity updating information is detected;
the electric quantity information acquisition module is used for acquiring first electric quantity in the nonvolatile storage medium and first battery temperature and/or first battery voltage corresponding to the first electric quantity when detecting that a set hardware forced power-down event is triggered and when detecting that a power-on event is triggered, and taking the first electric quantity as a first candidate display electric quantity; determining the current second candidate display electric quantity of the mobile terminal according to a set electric quantity determination rule, and acquiring the current second battery temperature and/or second battery voltage of the mobile terminal; if the change value between the first candidate display electric quantity and the second candidate display electric quantity is smaller than a first set value, determining the first candidate display electric quantity as a target display electric quantity; if the change values of the first candidate display electric quantity and the second candidate display electric quantity are larger than or equal to a first set value, detecting the change condition between the first battery temperature and the second battery temperature and/or the change condition between the first battery voltage and the second battery voltage: if the change value between the first battery temperature and the second battery temperature is smaller than a second set value and/or the change value between the first battery voltage and the second battery voltage is smaller than a third set value, determining the first candidate display electric quantity as a target display electric quantity; if the change value between the first battery temperature and the second battery temperature is larger than or equal to a second set value and/or the change value between the first battery voltage and the second battery voltage is larger than or equal to a third set value, determining the second candidate display electric quantity as a target display electric quantity; and displaying the target display electric quantity on a screen of the mobile terminal.
6. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing a method for controlling display of power of a mobile terminal according to any one of claims 1 to 4.
7. A mobile terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for controlling the display of power of the mobile terminal according to any one of claims 1 to 4 when executing the computer program.
CN201710486133.8A 2017-06-23 2017-06-23 Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal Active CN107295175B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710486133.8A CN107295175B (en) 2017-06-23 2017-06-23 Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710486133.8A CN107295175B (en) 2017-06-23 2017-06-23 Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN107295175A CN107295175A (en) 2017-10-24
CN107295175B true CN107295175B (en) 2020-02-07

Family

ID=60098149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710486133.8A Active CN107295175B (en) 2017-06-23 2017-06-23 Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN107295175B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109116290B (en) * 2018-06-14 2020-08-11 出门问问信息科技有限公司 Optimization method and device for metering of equipment electricity meter and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7386403B2 (en) * 2005-03-30 2008-06-10 Inventec Corporation Method and system for charging management
CN105259508A (en) * 2015-10-14 2016-01-20 惠州Tcl移动通信有限公司 Terminal and method for calculating initial electric energy thereof
CN105472135B (en) * 2015-11-18 2019-03-08 Oppo广东移动通信有限公司 A kind of display methods and device of mobile terminal electricity
CN106572259A (en) * 2016-11-09 2017-04-19 惠州Tcl移动通信有限公司 Mobile terminal battery power displaying method and system
CN106603861A (en) * 2016-12-30 2017-04-26 广东欧珀移动通信有限公司 Electric quantity display method and device, and terminal

Also Published As

Publication number Publication date
CN107295175A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
CN109074158B (en) Electronic equipment and method for starting application thereof
US11086663B2 (en) Preloading application using active window stack
CN105929925B (en) Electronic device and method for managing power in electronic device
US20190069244A1 (en) Electronic device for providing mode switching and a method thereof
US10366029B2 (en) Data transceiving method and device
US10739994B2 (en) Method and electronic device for recognizing touch
US20190370657A1 (en) Method and apparatus for updating application prediction model, storage medium, and terminal
CN108304151B (en) Method for displaying content and electronic device thereof
EP3435209B1 (en) Method for recognizing a screen-off gesture, and storage medium and terminal thereof
EP3098687B1 (en) Electronic device and power managing method thereof
WO2019223511A1 (en) Application program preloading method and apparatus, storage medium, and terminal
CN107800865B (en) Electronic device and method for displaying time information in low power state
US10268308B2 (en) Input processing method and device
WO2019019835A1 (en) Method and device for responding to blank screen gesture, and storage medium and mobile terminal
CN109040467A (en) Interface electricity determines method, apparatus, storage medium and mobile terminal
WO2019214476A1 (en) Screen direction setting method and device, storage medium and terminal
CN106776259B (en) Mobile terminal frame rate detection method and device and mobile terminal
US20150066424A1 (en) Electronic device and method for measuring position change
CN113703799A (en) Computing device and BIOS updating method and medium thereof
CN110058980B (en) Terminal start time early warning method, electronic device and computer readable storage medium
US11297025B2 (en) Method for controlling notification and electronic device therefor
CN107295175B (en) Display control method and device for electric quantity of mobile terminal, storage medium and mobile terminal
CN109186657B (en) Proximity sensor parameter calibration method and device, terminal equipment and storage medium
CN107766218B (en) System optimization method and device, storage medium and terminal equipment
CN106843440B (en) A kind of mobile terminal restarts control method, device and mobile terminal

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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant