CN112904216A - Battery electric quantity prompting method, system, storage medium and terminal equipment - Google Patents

Battery electric quantity prompting method, system, storage medium and terminal equipment Download PDF

Info

Publication number
CN112904216A
CN112904216A CN202110077032.1A CN202110077032A CN112904216A CN 112904216 A CN112904216 A CN 112904216A CN 202110077032 A CN202110077032 A CN 202110077032A CN 112904216 A CN112904216 A CN 112904216A
Authority
CN
China
Prior art keywords
battery power
output
current battery
electric quantity
square wave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110077032.1A
Other languages
Chinese (zh)
Inventor
俞斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huizhou TCL Mobile Communication Co Ltd
Original Assignee
Huizhou TCL Mobile Communication 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 Huizhou TCL Mobile Communication Co Ltd filed Critical Huizhou TCL Mobile Communication Co Ltd
Priority to CN202110077032.1A priority Critical patent/CN112904216A/en
Publication of CN112904216A publication Critical patent/CN112904216A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/385Arrangements for measuring battery or accumulator variables
    • G01R31/387Determining ampere-hour charge capacity or SoC
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/3644Constructional arrangements
    • G01R31/3646Constructional arrangements for indicating electrical conditions or variables, e.g. visual or audible indicators
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/371Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC] with remote indication, e.g. on external chargers

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention discloses a method, a system, a storage medium and a terminal device for prompting battery electric quantity, wherein the method comprises the following steps: reading the current battery capacity of the terminal equipment at intervals of preset time, and comparing the current battery capacity with a preset threshold; and if the current battery electric quantity is lower than or equal to the preset threshold value, calculating the duty ratio of the square wave output by the GPIO port according to the current battery electric quantity, and outputting a vibration signal. The invention realizes that the battery power of the terminal equipment can remind the user in a mode of outputting the vibration signal, so that the user can timely master the battery power condition even if the battery power is not displayed, thereby facilitating the use of the user and improving the user experience.

Description

Battery electric quantity prompting method, system, storage medium and terminal equipment
Technical Field
The invention relates to the technical field of electric quantity display, in particular to a method and a system for prompting battery electric quantity, a storage medium and a terminal device.
Background
The rechargeable battery has the characteristic of being used circularly through charging and discharging, and can realize the environment-friendly effect. At present, a rechargeable battery is generally adopted in terminal equipment, and is used as a most key energy storage component on the terminal equipment, and the percentage of the current remaining battery power needs to be displayed on a display screen of the terminal equipment in real time, so that a user can know the remaining amount of the current battery power.
However, in some cases, in order to pursue a display effect, the terminal device needs to display some content on the full screen, thereby causing the battery power not to be displayed on the screen. For example, when a user plays a game and when the user turns off the screen, the user cannot see the power display in these scenes, and if the user is immersed in the game all the time, the power of the battery may be too low to affect normal use, which brings great inconvenience to the user.
Accordingly, the prior art is yet to be improved and developed.
Disclosure of Invention
In view of the foregoing deficiencies of the prior art, an object of the present invention is to provide a method, a system, a storage medium and a terminal device for prompting battery power, which are used to solve the problem that the battery power of the existing terminal device is easy to be displayed on a screen in a specific scene, and inconvenience is brought to a user.
The technical scheme of the invention is as follows:
a battery power prompting method comprises the following steps:
reading the current battery capacity of the terminal equipment at intervals of preset time, and comparing the current battery capacity with a preset threshold;
and if the current battery electric quantity is lower than or equal to the preset threshold value, calculating the duty ratio of the square wave output by the GPIO port according to the current battery electric quantity, and outputting a vibration signal.
The battery electric quantity prompting method is characterized in that the frequency of the square wave output by the GPIO port is fixed, the duty ratio is variable, and the output vibration signal becomes lower along with the increase of the battery electric quantity.
The battery power prompting method further comprises the following steps:
and if the current battery power is higher than the preset threshold value, controlling the GPIO port to output a low level and not outputting a vibration signal.
The battery power prompting method comprises the following steps of reading the current battery power of the terminal equipment at preset time intervals:
starting a first timer with the timing time being preset time;
and the first timer triggers the central processing unit to read the current battery capacity of the terminal equipment at preset time intervals.
The battery power indication method is characterized in that the preset time is less than or equal to 2 s.
The battery power prompting method, wherein before the step of reading the current battery power of the terminal device every predetermined time, further comprises:
and starting indication control of the terminal equipment.
The battery power prompting method comprises the following steps of calculating the duty ratio of square waves output by the GPIO port according to the current battery power:
the duty ratio of the square wave output by the GPIO port is calculated by a central processing unit, and the calculation formula is as follows: and r is rmax-s rmax/sth, wherein s is the battery power, r is the duty ratio of the square wave output by the GPIO port of the central processing unit calculated according to the battery power s, rmax is the maximum value of the duty ratio of the square wave output by the preset GPIO, and sth is the preset threshold value of the battery power.
A battery power level notification system, comprising:
the battery electric quantity obtaining and judging module is used for reading the current battery electric quantity of the terminal equipment at preset time intervals and comparing the current battery electric quantity with a preset threshold value;
and the calculation and output module is used for calculating the duty ratio of the square wave output by the GPIO port of the central processing unit according to the current battery electric quantity and outputting a vibration signal.
A storage medium, wherein the storage medium stores one or more programs, which are executable by one or more processors to implement the steps in the battery power prompting method of the present invention.
A terminal device, comprising a processor adapted to implement instructions; and a storage medium adapted to store a plurality of instructions, the instructions adapted to be loaded by a processor and to perform the steps of the battery power indication method of the present invention.
Has the advantages that: compared with the prior art, the invention provides a battery electric quantity prompting method, which comprises the steps of reading the electric quantity of a battery at preset time intervals and judging whether the electric quantity of the battery is lower than a preset threshold value, if so, calculating the duty ratio of a square wave output by a GPIO port of the battery according to the electric quantity of the battery, and outputting a vibration signal, and if not, controlling the GPIO port to output a low level and stopping outputting the signal. The invention realizes that the battery power of the terminal equipment can be presented to the user in the second condition, so that the user can timely master the battery power condition even if the battery power cannot be displayed, thereby facilitating the use of the user and improving the user experience.
Drawings
Fig. 1 is a flowchart illustrating a method for prompting battery power according to a preferred embodiment of the present invention.
Fig. 2 is a schematic block diagram of the terminal device of the present invention.
Detailed Description
The present invention provides a method, a system, a storage medium and a terminal device for prompting battery power, and the present invention is further described in detail below in order to make the purpose, technical scheme and effect of the present invention clearer and clearer. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for prompting battery power according to a preferred embodiment of the present invention, as shown in the figure, the method includes the following steps:
s10, reading the current battery capacity of the terminal equipment at preset time intervals, and comparing the current battery capacity with a preset threshold;
and S20, if the current battery capacity is lower than or equal to the preset threshold, calculating the duty ratio of the square wave output by the GPIO port according to the current battery capacity, and outputting a vibration signal.
This embodiment is through the current battery power that will acquire and predetermine the threshold value and compare, if current battery power is less than or equal to predetermine the threshold value, then explain that current battery power is in lower stage, it is low and bring inconvenience for the user to use terminal equipment for preventing battery power from crossing excessively, this moment can be based on current battery power calculates the duty cycle of GPIO mouth output square wave to output vibration signal, thereby make terminal equipment's battery power present for the user with the second kind of condition, make the user also can immediately master the surplus condition of battery power when battery power shows not coming out, thereby make things convenient for the user to use terminal equipment, promote user experience.
In some embodiments, the frequency of the square wave output by the GPIO port is fixed, the duty ratio is variable, and the output vibration signal becomes lower as the battery level increases.
In the present embodiment, the english of the GPIO is called General-purpose input/output, the chinese is called General-purpose input and output, the PIN can be freely used by the user through program control, and the PIN can be used as General-purpose input (GPI), General-purpose output (GPO), General-purpose input and output (GPIO), such as clk generator, chip select, etc., according to practical considerations. Since one pin can be used for input, output or other special functions, there must be a register to select these functions. For input, the high and low of the pin potential can be determined by reading a certain register; for output, a certain register can be written to make the pin output a high potential or a low potential; for other special functions, there are additional registers to control them. The registers include a GPxCON register, a GPxDAT register, a GPxUP register, and the like, and the GPxCON register is used for configuring pin functions. PORT A is different from PORT B-PORT H/J in function selection, and each bit in GPACON corresponds to one pin, and the number of the pins is 23. When a bit is set to 0, the corresponding pin is an output pin. At this time, we can write 1 or 0 in GPADAT correspondingly to let this pin output high level or low level; when a bit is set to 1, the corresponding pin is an address line or is used for address control, and GPADATA is not useful. In general GPACON is usually set to 1 in order to access an external device. PORT B-PORT H/J are completely the same in register operation, each two bits in GPxCON control a pin, 00 input, 01 output, 10 special functions, 11 reserved. The GPxDAT register GPxDAT is used for reading and writing pins, when the pins are set as input, the level state of the corresponding pins can be known to be high or low by reading the register, and when the pins are set as output, the bits of the register are written, so that the pins can output high level or low level. When a certain bit of the GPxUP register is 1, the corresponding pin has no internal pull-up resistor; at 0, the corresponding pin has an internal pull-up resistor. The pull-up resistor is used for outputting high level and low level when the GPIO pin is in the third state. But rather, exhibits a high resistance state, which is equivalent to no chip connection. Its level state is determined by the pull-up and pull-down resistors.
In this embodiment, the frequency of the square wave output by the GPIO port is fixed, the duty ratio is variable, and the output vibration signal becomes lower as the battery power increases. That is to say, when the current battery power is lower than or equal to the preset threshold, the lower the current battery power is, the stronger the vibration signal output by the GPIO port is, and the higher the current battery power is, the weaker the vibration signal output by the GPIO port is.
In the present embodiment, the Duty Cycle (Duty Cycle) is defined as: in a series of ideal pulse trains (e.g., square waves), the ratio of the duration of the positive pulse to the total period of the pulse. For example: pulse width 1 mus, signal period 4 mus pulse train, duty cycle 0.25. I.e. the ratio of the time occupied by the pulse to the total time during a period of continuous operation. The concept can be used To measure the conduction or cut-off condition of the switching tube, and if the conduction time of the switching tube is To and the pulse period is T, the duty ratio is To: t, if the duty ratio is 1: 1, the switch tube is in a normally open state, that is, the pulse signal applied to the control electrode (generally, the base electrode) of the switch tube always turns on the switch tube (actually, the pulse signal is not already).
In this embodiment, the duty ratio of the square wave output by the GPIO port is variable, that is, the strength of the output vibration signal is variable.
In some specific embodiments, the preset threshold may be 30% -1%. For example, when the preset threshold is 20%, calculating the duty ratio of the square wave output by the GPIO port according to the current battery power when the current battery power is less than or equal to 20%, and outputting a vibration signal.
In some embodiments, the duty ratio of the square wave output by the GPIO port is calculated by the formula r-rmax-s rmax/sth, where s is the battery power, r is the duty ratio of the square wave output by the GPIO port of the central processing unit calculated according to the battery power s, rmax is the maximum value of the preset duty ratio of the square wave output by the GPIO port, and sth is the preset threshold value of the battery power.
In this embodiment, it can be known from the calculation formula that the duty ratio r of the square wave output by the GPIO port is inversely proportional to the battery power s, that is, the larger the battery power is, the smaller the duty ratio of the square wave output by the GPIO port is, and the smaller the battery power is, the larger the duty ratio of the square wave output by the GPIO port is.
In some embodiments, the method for prompting battery power further includes the steps of: and if the current battery power is higher than the preset threshold value, controlling the GPIO port to output a low level and not outputting a vibration signal.
In this embodiment, the preset threshold may be 30% to 1%. For example, taking the preset threshold as 20%, that is, when the current battery power is read to be higher than 20%, indicating that more available power is left in the device terminal, the GPIO port is controlled to output a low level, and no vibration signal is output, that is, a prompt that the remaining power is low is not required to be made to the user.
In some specific embodiments, when the preset threshold is 10%, if the current battery power is less than or equal to 10%, it indicates that the terminal device has less available power, then the duty ratio of the GPIO port output square wave is calculated according to the current battery power, and a vibration signal is output to prompt a user, and along with the gradual decrease of the current power, the duty ratio of the GPIO port output square wave is larger, that is, the vibration signal is stronger; when the current battery power is read to be higher than 10%, indicating that more available power is left in the device terminal, controlling the GPIO port to output a low level, and not outputting a vibration signal, namely, not prompting that the remaining power is low for a user.
In some specific embodiments, when the preset threshold is 5%, if the current battery power is less than or equal to 5%, it indicates that the terminal device has less available power, then the duty ratio of the square wave output by the GPIO port is calculated according to the current battery power, and a vibration signal is output to prompt a user, and along with the gradual decrease of the current power, the larger the duty ratio of the square wave output by the GPIO port is, that is, the stronger the vibration signal is; when the current battery power is read to be higher than 5%, the residual available power of the device terminal is more, the GPIO port is controlled to output low level, no vibration signal is output, and a prompt that the residual power is low does not need to be made for a user.
In some specific embodiments, when the preset threshold is 3%, if the current battery power is less than or equal to 3%, it indicates that the terminal device has less available power, then the duty ratio of the GPIO port output square wave is calculated according to the current battery power, and a vibration signal is output to prompt a user, and along with the gradual decrease of the current power, the duty ratio of the GPIO port output square wave is larger, that is, the vibration signal is stronger; when the current battery power is read to be higher than 3%, the residual available power of the device terminal is more, the GPIO port is controlled to output low level, no vibration signal is output, and a prompt that the residual power is lower does not need to be made for a user.
In some embodiments, before the step of reading the current battery power of the terminal device at predetermined time intervals, the method further includes: and starting indication control of the terminal equipment.
In this embodiment, the terminal device is provided with an indication control option for prompting the battery power, and when a user needs to activate the battery power prompt, the indication control of the terminal device can be started, so that when the current battery power of the terminal device is read to be lower than or equal to a preset threshold value, a vibration signal is sent to prompt the user; and if the user does not start the indication control of the terminal equipment, the battery power of the terminal equipment is exhausted immediately, and a vibration signal cannot be sent to prompt the user.
In some embodiments, the step of reading the current battery power of the terminal device at predetermined time intervals comprises: starting a first timer with the timing time being preset time; and the first timer triggers the central processing unit to read the current battery capacity of the terminal equipment at preset time intervals.
In this embodiment, the predetermined time is less than or equal to 2s, and if the predetermined time is set to be longer, the real-time performance of acquiring the current battery power is poor, so that the technical effect of the present invention cannot be achieved. By way of example, the predetermined time is 1 s. That is to say, the first timer triggers the central processing unit to read the current battery capacity of the terminal device every 1s, and compares the read current battery capacity with the preset threshold value in real time.
In some embodiments, there is also provided a battery charge level indicator system, comprising:
the battery electric quantity obtaining and judging module 10 is used for reading the current battery electric quantity of the terminal equipment at preset time intervals and comparing the current battery electric quantity with a preset threshold value;
and the calculation and output module 11 is used for calculating the duty ratio of the square wave output by the GPIO port of the central processing unit according to the current battery electric quantity and outputting a vibration signal.
In the system provided in this embodiment, the battery power acquiring and determining module 10 is configured to acquire a current battery power, and compare the acquired current battery power with a preset threshold; if current battery power is less than or equal to preset threshold value, then explain that current battery power is in lower stage, for preventing that battery power is too low and bring inconvenience for the user to use terminal equipment, calculation and output module are used for according to current battery power calculates the duty cycle of GPIO mouth output square wave to output vibration signal, thereby make terminal equipment's battery power present the user with the second kind of condition, make the user also can immediately master the surplus condition of battery power when battery power does not show, thereby convenience of customers uses terminal equipment, promotes user experience.
In some embodiments, the battery charge indicator system further comprises: and the starting module 12 is used for starting indication control of the terminal equipment.
In some embodiments, the battery charge indicator system further comprises: and the GPIO control module 13 is used for controlling a GPIO port of the central processing unit to output high level or low level.
In some embodiments, the battery power acquiring and determining module 10 further includes a first timer, and the first timer is configured to trigger reading of the battery power every predetermined time and determine whether the battery power is lower than a preset threshold.
In some embodiments, the battery charge indicator system further comprises: and the vibration stopping module 14 is used for controlling the GPIO port to output low level and stopping outputting vibration signals.
In some embodiments, the calculation and output module 11 includes a calculation unit, and the calculation unit is configured to calculate a duty ratio of the GPIO port output square wave by using a following calculation formula r-rmax-s-rmax/sth, where s is a battery power, r is a duty ratio of the GPIO port output square wave calculated by the central processing unit according to the battery power s, rmax is a maximum value of the duty ratio of the preset GPIO output square wave, and sth is a preset threshold of the battery power.
In some embodiments, a storage medium is further provided, wherein the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the steps of the battery power prompting method of the present invention.
In some embodiments, there is also provided a terminal device, as shown in fig. 2, comprising at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logic instructions in the memory 22 to perform the methods in the embodiments described above.
Furthermore, the logic instructions in the memory 22 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes the functional application and data processing, i.e. implements the method in the above-described embodiments, by executing the software program, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be transient storage media.
In addition, the specific processes loaded and executed by the storage medium and the instruction processors in the terminal device are described in detail in the method, and are not stated herein.
By way of example, the terminal device includes a processor 20, and the processor 20 may call logic instructions in a memory 22 to execute the following instructions:
reading the current battery capacity of the terminal equipment at intervals of preset time, and comparing the current battery capacity with a preset threshold;
and if the current battery electric quantity is lower than or equal to the preset threshold value, calculating the duty ratio of the square wave output by the GPIO port according to the current battery electric quantity, and outputting a vibration signal.
And if the current battery power is higher than the preset threshold value, controlling the GPIO port to output a low level and not outputting a vibration signal.
The terminal device provided by this embodiment compares the current battery power obtained with a preset threshold, if the current battery power is lower than or equal to the preset threshold, it indicates that the current battery power is in a lower stage, it is inconvenient for the user to use the terminal device for preventing the battery power from being too low, at this moment, the duty ratio of the GPIO port output square wave can be calculated according to the current battery power, and a vibration signal is output, so that the battery power of the terminal device can be presented to the user in a second condition, even if the user can immediately grasp the remaining condition of the battery power when the battery power is not displayed, the user can use the terminal device conveniently, and the user experience is improved.
In this embodiment, the frequency of the square wave output by the GPIO port is fixed, the duty ratio is variable, and the output vibration signal becomes lower as the battery power increases.
In the present embodiment, the english of the GPIO is called General-purpose input/output, the chinese is called General-purpose input and output, the PIN can be freely used by the user through program control, and the PIN can be used as General-purpose input (GPI), General-purpose output (GPO), General-purpose input and output (GPIO), such as clk generator, chip select, etc., according to practical considerations. Since one pin can be used for input, output or other special functions, there must be a register to select these functions. For input, the high and low of the pin potential can be determined by reading a certain register; for output, a certain register can be written to make the pin output a high potential or a low potential; for other special functions, there are additional registers to control them. The registers include a GPxCON register, a GPxDAT register, a GPxUP register, and the like, and the GPxCON register is used for configuring pin functions. PORT A is different from PORT B-PORT H/J in function selection, and each bit in GPACON corresponds to one pin, and the number of the pins is 23. When a bit is set to 0, the corresponding pin is an output pin. At this time, we can write 1 or 0 in GPADAT correspondingly to let this pin output high level or low level; when a bit is set to 1, the corresponding pin is an address line or is used for address control, and GPADATA is not useful. In general GPACON is usually set to 1 in order to access an external device. PORT B-PORT H/J are completely the same in register operation, each two bits in GPxCON control a pin, 00 input, 01 output, 10 special functions, 11 reserved. The GPxDAT register GPxDAT is used for reading and writing pins, when the pins are set as input, the level state of the corresponding pins can be known to be high or low by reading the register, and when the pins are set as output, the bits of the register are written, so that the pins can output high level or low level. When a certain bit of the GPxUP register is 1, the corresponding pin has no internal pull-up resistor; at 0, the corresponding pin has an internal pull-up resistor. The pull-up resistor is used for outputting high level and low level when the GPIO pin is in the third state. But rather, exhibits a high resistance state, which is equivalent to no chip connection. Its level state is determined by the pull-up and pull-down resistors.
In this embodiment, the frequency of the square wave output by the GPIO port is fixed, the duty ratio is variable, and the output vibration signal becomes lower as the battery power increases. That is to say, when the current battery power is lower than or equal to the preset threshold, the lower the current battery power is, the stronger the vibration signal output by the GPIO port is, and the higher the current battery power is, the weaker the vibration signal output by the GPIO port is.
In this embodiment, the terminal device may be any device including a touch screen, such as a mobile phone and a tablet.
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 system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
In summary, the present invention provides a method for prompting battery power, which reads the battery power every predetermined time and determines whether the battery power is lower than a preset threshold, if so, calculates the duty ratio of the GPIO port to output the square wave according to the battery power and outputs the vibration signal, otherwise, controls the GPIO port to output the low level and stops outputting the signal. The invention realizes that the battery power of the terminal equipment can be presented to the user in the second condition, so that the user can timely master the battery power condition even if the battery power cannot be displayed, thereby facilitating the use of the user and improving the user experience.
It is to be understood that the invention is not limited to the examples described above, but that modifications and variations may be effected thereto by those of ordinary skill in the art in light of the foregoing description, and that all such modifications and variations are intended to be within the scope of the invention as defined by the appended claims.

Claims (10)

1. A battery electric quantity prompting method is characterized by comprising the following steps:
reading the current battery capacity of the terminal equipment at intervals of preset time, and comparing the current battery capacity with a preset threshold;
and if the current battery electric quantity is lower than or equal to the preset threshold value, calculating the duty ratio of the square wave output by the GPIO port according to the current battery electric quantity, and outputting a vibration signal.
2. The method for prompting battery power according to claim 1, wherein the frequency of the GPIO port output square wave is fixed and the duty cycle is variable, and the output vibration signal becomes lower as the battery power increases.
3. The battery power prompting method according to claim 1, further comprising the steps of:
and if the current battery power is higher than the preset threshold value, controlling the GPIO port to output a low level and not outputting a vibration signal.
4. The method according to claim 1, wherein the step of reading the current battery power of the terminal device every predetermined time includes:
starting a first timer with the timing time being preset time;
and the first timer triggers the central processing unit to read the current battery capacity of the terminal equipment at preset time intervals.
5. The battery power level indication method of claim 4, wherein the predetermined time is less than or equal to 2 s.
6. The method for prompting battery power according to claim 1, wherein the step of reading the current battery power of the terminal device every predetermined time is preceded by:
and starting indication control of the terminal equipment.
7. The method for prompting battery power according to claim 1, wherein the step of calculating the duty ratio of the square wave output by the GPIO port according to the current battery power comprises:
the duty ratio of the square wave output by the GPIO port is calculated by a central processing unit, and the calculation formula is as follows: and r is rmax-s rmax/sth, wherein s is the battery power, r is the duty ratio of the square wave output by the GPIO port of the central processing unit calculated according to the battery power s, rmax is the maximum value of the duty ratio of the square wave output by the preset GPIO, and sth is the preset threshold value of the battery power.
8. A battery power prompting system, comprising:
the battery electric quantity obtaining and judging module is used for reading the current battery electric quantity of the terminal equipment at preset time intervals and comparing the current battery electric quantity with a preset threshold value;
and the calculation and output module is used for calculating the duty ratio of the square wave output by the GPIO port of the central processing unit according to the current battery electric quantity and outputting a vibration signal.
9. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to perform the steps of the battery level notification method of any one of claims 1-7.
10. A terminal device comprising a processor adapted to implement instructions; and a storage medium adapted to store a plurality of instructions adapted to be loaded by a processor and to perform the steps of the battery power indication method of any of claims 1-7.
CN202110077032.1A 2021-01-20 2021-01-20 Battery electric quantity prompting method, system, storage medium and terminal equipment Pending CN112904216A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110077032.1A CN112904216A (en) 2021-01-20 2021-01-20 Battery electric quantity prompting method, system, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110077032.1A CN112904216A (en) 2021-01-20 2021-01-20 Battery electric quantity prompting method, system, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN112904216A true CN112904216A (en) 2021-06-04

Family

ID=76117758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110077032.1A Pending CN112904216A (en) 2021-01-20 2021-01-20 Battery electric quantity prompting method, system, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN112904216A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113766288A (en) * 2021-08-04 2021-12-07 深圳Tcl新技术有限公司 Electric quantity prompting method and device and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605174A (en) * 2009-07-15 2009-12-16 中兴通讯股份有限公司 The method of a kind of portable terminal and realization vibration mode thereof
CN103024204A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Method and device for saving electricity for mobile terminal
CN103576933A (en) * 2013-10-30 2014-02-12 昆山市大久电子有限公司 Mouse
CN104035049A (en) * 2014-06-25 2014-09-10 小米科技有限责任公司 Method, device and system for detecting battery power
CN105141780A (en) * 2015-09-21 2015-12-09 Tcl移动通信科技(宁波)有限公司 Vibration indication control method and system at conversation
CN105954684A (en) * 2016-05-27 2016-09-21 北京小鸟看看科技有限公司 Cell electricity quantity detection method and device
CN210982686U (en) * 2019-10-22 2020-07-10 上海庆科信息技术有限公司 Battery electric quantity detection circuit and intelligent lock

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605174A (en) * 2009-07-15 2009-12-16 中兴通讯股份有限公司 The method of a kind of portable terminal and realization vibration mode thereof
CN103024204A (en) * 2012-12-13 2013-04-03 广东欧珀移动通信有限公司 Method and device for saving electricity for mobile terminal
CN103576933A (en) * 2013-10-30 2014-02-12 昆山市大久电子有限公司 Mouse
CN104035049A (en) * 2014-06-25 2014-09-10 小米科技有限责任公司 Method, device and system for detecting battery power
CN105141780A (en) * 2015-09-21 2015-12-09 Tcl移动通信科技(宁波)有限公司 Vibration indication control method and system at conversation
CN105954684A (en) * 2016-05-27 2016-09-21 北京小鸟看看科技有限公司 Cell electricity quantity detection method and device
CN210982686U (en) * 2019-10-22 2020-07-10 上海庆科信息技术有限公司 Battery electric quantity detection circuit and intelligent lock

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113766288A (en) * 2021-08-04 2021-12-07 深圳Tcl新技术有限公司 Electric quantity prompting method and device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN101398459B (en) Method and device for identifying charger type
CN108132401A (en) Charge abnormal detection method, device, storage medium and mobile terminal
TW201742348A (en) Method and device for controlling charging and electronic equipment having the same
CN104156748B (en) Method for reading and writing label and device thereof
CN111314986B (en) Network type switching method and device, mobile terminal and storage medium
CN112904216A (en) Battery electric quantity prompting method, system, storage medium and terminal equipment
CN112858938A (en) Electric quantity calculation method and device, storage medium and electronic equipment
CN109596989A (en) Display methods, device and the electronic equipment of electric quantity for electronic equipment
CN112698229B (en) Short-circuit current detection method and device, readable storage medium and electronic equipment
CN110826112B (en) Method and system for identifying hardware version number
CN110971219A (en) Pressure sensor, switch circuit thereof, clock control method and clock control device
CN115168921B (en) Lossless deletion management device suitable for multi-solid-state hard disk system
CN116973757A (en) Battery capacity calibration method based on battery calibrator and related equipment
CN113259389B (en) Protocol switching method and system for guide rail meter
CN113672176B (en) Data reading method, system, equipment and computer readable storage medium
CN113991764A (en) Charger charging control method and device and charger
CN106972568A (en) Charging detecting circuit, method and electronic equipment
CN109299018B (en) Method and device for reading historical data in Flash memory
CN113127078B (en) CPLD configuration selection method and device
CN111367496B (en) Method and system for rapidly storing and reading self-generating switch flash memory
CN116093885B (en) Low-voltage protection method and device applied to model airplane electronic speed regulator
CN111124285B (en) Solid state disk data holding method, device, equipment and medium
CN114253198B (en) Control circuit of EVCC control system of electric automobile
CN115248378A (en) Battery module capacity determination method and device, terminal equipment and storage medium
CN208873135U (en) Board information checking device in place

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210604

RJ01 Rejection of invention patent application after publication