CN113933715B - Method, device and equipment for displaying battery electric quantity and storage medium - Google Patents

Method, device and equipment for displaying battery electric quantity and storage medium Download PDF

Info

Publication number
CN113933715B
CN113933715B CN202010658111.7A CN202010658111A CN113933715B CN 113933715 B CN113933715 B CN 113933715B CN 202010658111 A CN202010658111 A CN 202010658111A CN 113933715 B CN113933715 B CN 113933715B
Authority
CN
China
Prior art keywords
electric quantity
battery
voltage
operation mode
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010658111.7A
Other languages
Chinese (zh)
Other versions
CN113933715A (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.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Zero Boundary Integrated Circuit Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Zero Boundary Integrated Circuit 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 Gree Electric Appliances Inc of Zhuhai, Zhuhai Zero Boundary Integrated Circuit Co Ltd filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010658111.7A priority Critical patent/CN113933715B/en
Publication of CN113933715A publication Critical patent/CN113933715A/en
Application granted granted Critical
Publication of CN113933715B publication Critical patent/CN113933715B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/165Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values
    • G01R19/16533Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values characterised by the application
    • G01R19/16538Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values characterised by the application in AC or DC supplies
    • G01R19/16542Indicating that current or voltage is either above or below a predetermined value or within or outside a predetermined range of values characterised by the application in AC or DC supplies for batteries
    • 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/3644Constructional arrangements
    • G01R31/3648Constructional arrangements comprising digital calculation means, e.g. for performing an algorithm
    • 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/367Software therefor, e.g. for battery testing using modelling or look-up tables
    • 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
    • G01R31/388Determining ampere-hour charge capacity or SoC involving voltage measurements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Secondary Cells (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Tests Of Electric Status Of Batteries (AREA)

Abstract

The application relates to a method, a device, equipment and a storage medium for displaying battery electric quantity, wherein the method comprises the following steps: in the real-time voltage detection process, after the battery voltage is obtained each time, comparing the battery voltage with a preset voltage corresponding to a current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage for distinguishing two adjacent electric quantity grades, and the operation mode comprises a normal operation mode and a low-power consumption operation mode; if the two continuous comparison results are different, determining the jump of the generated electric quantity, and counting the times of the jump of the generated electric quantity; when the times reach a preset value, selecting one of two adjacent electric quantity grades as a final electric quantity grade; and displaying the battery electric quantity corresponding to the final electric quantity grade. The problem that the battery power jumps when the battery voltage is between the critical values of two operation modes in the existing circuit is solved.

Description

Method, device and equipment for displaying battery electric quantity and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for displaying battery power.
Background
Two sets of operation modes are designed in the design of the existing hardware circuit, namely a normal operation mode and a low-power-consumption operation mode, and the critical value of the normal operation mode is different from that of the low-power-consumption operation mode. In actual operation, the normal operation mode and the low power consumption operation mode are operated simultaneously. When the battery voltage is between the critical value of the normal operation mode and the critical value of the low-power consumption operation mode, the electric quantity levels detected by the two modes are inconsistent, so that the chip is waken up back and forth, and the jump situation of the battery electric quantity display grid number is caused.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for displaying battery capacity, which are used for solving the problem that the battery capacity jumps when the battery voltage is between the critical values of two operation modes in the existing circuit.
In a first aspect, the present application provides a method for displaying battery power, including:
in the real-time voltage detection process, after a battery voltage is obtained each time, comparing the battery voltage with a preset voltage corresponding to a current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage for distinguishing two adjacent electric quantity grades, and the operation mode comprises a normal operation mode and a low-power consumption operation mode;
if the comparison results of two consecutive times are different, determining that the electric quantity jumps, and counting the times of the electric quantity jumps;
when the times reach a preset value, selecting one of the two adjacent electric quantity grades as a final electric quantity grade;
and displaying the battery electric quantity corresponding to the final electric quantity grade.
Optionally, when the number of times reaches a preset value, selecting one of the two adjacent electric quantity levels as a final electric quantity level includes:
when the times reach a preset value, determining that the current battery state is a charging state, and selecting the high electric quantity grade in the two adjacent electric quantity grades as the final electric quantity grade;
wherein, the electric quantity grade and the battery electric quantity are in a direct proportion relation.
Optionally, when the number of times reaches a preset value, selecting one of the two adjacent electric quantity levels as a final electric quantity level includes:
when the times reach a preset value, determining that the current battery state is a discharging state, and selecting the electric quantity level which is lower than the two adjacent electric quantity levels as the final electric quantity level;
wherein, the electric quantity grade and the battery electric quantity are in a direct proportion relation.
Optionally, when the number of times reaches a preset value, selecting one of the two adjacent electric quantity levels as a final electric quantity level includes:
and when the times reach a preset value, selecting the electric quantity grade corresponding to the preset voltage corresponding to the normal operation mode as the final electric quantity grade.
Optionally, comparing the battery voltage with a preset voltage corresponding to the current operation mode includes:
comparing the acquired first coded data corresponding to the battery voltage with second coded data corresponding to a preset voltage corresponding to the current operation mode;
the first coded data are obtained through calculation of the battery voltage and a reference voltage, and the second coded data are obtained through calculation of the preset voltage and the reference voltage.
Optionally, the preset voltage corresponding to the normal operation mode is not equal to the preset voltage corresponding to the low power consumption operation mode.
Optionally, the preset voltage corresponding to the normal operation mode is smaller than the preset voltage corresponding to the low power consumption operation mode.
In a second aspect, the present application provides a display device of battery power, comprising:
the comparison module is used for comparing the battery voltage with a preset voltage corresponding to a current operation mode after the battery voltage is obtained each time in the real-time voltage detection process to obtain a comparison result, wherein the preset voltage is a critical voltage used for distinguishing two adjacent electric quantity grades, and the operation modes comprise a normal operation mode and a low-power consumption operation mode;
the statistic module is used for determining the occurrence of electric quantity jump if the comparison results of two consecutive times are different and counting the times of the occurrence of the electric quantity jump;
the selecting module is used for selecting one of the two adjacent electric quantity grades as a final electric quantity grade when the times reach a preset value;
and the display module is used for displaying according to the battery electric quantity corresponding to the final electric quantity grade.
In a third aspect, the present application provides an electronic device, comprising: the system comprises a processor, a communication component, a memory and a communication bus, wherein the processor, the communication component and the memory are communicated with each other through the communication bus; the memory for storing a computer program; the processor is used for executing the program stored in the memory and realizing the display method of the battery power.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method for displaying battery power.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, in the process of real-time voltage detection, after the battery voltage is obtained every time, the obtained battery voltage is compared with the preset voltage corresponding to the current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage used for distinguishing two adjacent electric quantity grades, the operation modes comprise a normal operation mode and a low-power-consumption operation mode, and by comparing the battery voltage with the preset voltage corresponding to the current operation mode, the magnitude relation between the battery voltage and the preset voltage corresponding to the normal operation mode and the magnitude relation between the battery voltage and the preset voltage corresponding to the low-power-consumption operation mode can be effectively obtained.
Further, when the two continuous comparison results are different, namely, the two magnitude relations are not consistent, the occurrence of electric quantity jump is determined, the number of times of the occurrence of electric quantity jump is counted, and the accidental electric quantity jump caused by external factors or self factors or the electric quantity jump when the battery voltage reaches the critical voltage of two adjacent electric quantity grades can be determined through the number of times of the electric quantity jump; when the number of times of electric quantity jumping reaches a preset value, determining that the battery voltage jumps when reaching the critical voltage of two adjacent electric quantity grades, and selecting one of the two adjacent electric quantity grades as a final electric quantity grade; and displaying the battery electric quantity corresponding to the final electric quantity grade.
The method effectively solves the problem that under the condition that the normal operation mode and the low-power-consumption operation mode are executed together, the battery power is jumped due to inconsistent power levels detected by the two modes when the battery voltage is between the critical value of the normal operation mode and the critical value of the low-power-consumption operation mode because the critical values of the two operation modes are different.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a schematic flow chart illustrating a method for displaying battery power according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating a flow chart of power level calculation according to an embodiment of the present disclosure;
FIG. 3 is a schematic flow chart of a downshift process in an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a relationship between a preset voltage corresponding to a normal operation mode and a preset voltage corresponding to a low power consumption operation mode in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a device for displaying battery power according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a method for displaying battery power, which can be applied to hardware equipment, or a software application program, or a server. The specific implementation of the method is as shown in fig. 1:
step 101, in the process of real-time voltage detection, after the battery voltage is obtained each time, comparing the battery voltage with a preset voltage corresponding to the current operation mode to obtain a comparison result.
The preset voltage is a critical voltage used for distinguishing two adjacent electric quantity grades, and the operation modes comprise a normal operation mode and a low-power-consumption operation mode.
Specifically, the principle of collecting the battery power is introduced: after the battery voltage is obtained, a calculation result corresponding to the battery voltage is obtained by calculation using a formula DAC _ VAL/64 × VBAT, and a relationship between the calculation result and a reference voltage is compared by a voltage comparator, and the calculation result is defined as a calculation voltage for convenience of description. And when the calculation voltage is greater than the reference voltage, outputting a high level, and when the calculation voltage is less than the reference voltage, outputting a low level, and determining the electric quantity grade by using the output high level and the output low level, wherein different electric quantity grades correspond to different battery electric quantities. Of course, the user may also correspond different power levels to the same battery power, that is, the user may set the corresponding relationship between the power levels and the battery power according to actual needs. Wherein, the reference voltage is represented by VREF, the battery voltage is represented by VBAT, the calculation voltage is represented by VT, and DAC _ VAL is a 6-bit digital-analog coding value corresponding to the preset voltage.
The following description will be made by taking the battery voltage of an air conditioner remote controller as an example, wherein the remote controller uses two dry batteries connected in series, the battery voltage is 1.5V × 2 — 3V, and the battery capacity changes when the battery changes by 0.1V in the actual use process. In this embodiment, VREF is 0.8V, and 3V is divided into 4 parts, some of which are described below:
first, when the current circuit filter function is designed, the anti-jitter function near the critical point is limited, so that the battery voltage jitters at the critical point, which cannot be avoided. To address this problem, various critical points of the battery voltage are found, which are defined as a preset voltage in the present application. For example, the preset voltages include: 2.69V, 2.56V, 2.327V, 2.226V and 2.048V.
The following equations are used:
VT=DAC_VAL/64*VBAT
DAC _ VAL is calculated.
Because preset voltage belongs to battery voltage, for the critical voltage who is used for distinguishing two adjacent electric quantity grades, and, through the preset voltage who calculates being VREF, so with the battery voltage value for preset voltage, with VT value for VREF 0.8V, bring into in the formula:
0.8=DAC_VAL/64*2.69
0.8=DAC_VAL/64*2.56
0.8=DAC_VAL/64*2.327
0.8=DAC_VAL/64*2.226
0.8=DAC_VAL/64*2.048
respectively obtaining:
DAC_VAL=19
DAC_VAL=20
DAC_VAL=22
DAC_VAL=23
DAC_VAL=25
next, the detection process of the battery power is divided into 8 stages according to the value of DAC _ VAL, as shown in tables 1, 2, and 3:
BV 1 2 3 4 5 6 7 8 Display Level
>2.69V 1 1 1 1 1 1 1 1 3grids 0xff
>2.56V 0 1 1 1 1 1 1 1 3grids 0xfe
>2.327V 0 0 1 1 1 1 1 0 2grids 0x7c
>2.226V 0 0 0 1 1 1 0 0 1grids 0x38
>2.048V 0 0 0 0 1 0 0 0 0grids 0x10
<2.048V 0 0 0 0 0 0 0 0 0grids 0x00
TABLE 1 data schematic diagram of battery power up-down power level display
Wherein BV is an abbreviation of Battery Voltage and represents a preset voltage, Display represents the number of Display grids of battery electric quantity, Level represents electric quantity Level, and numbers 1-8 of a transverse header respectively represent that:
1 corresponds to the first Phase 1: DAC _ VAL1 ═ 19;
2 corresponds to the second Phase 2: DAC _ VAL2 ═ 20;
3 corresponds to the third Phase 3: DAC _ VAL3 ═ 22;
4 corresponds to the fourth Phase 4: DAC _ VAL4 ═ 23;
5 corresponds to the fifth Phase 5: DAC _ VAL5 ═ 25;
6 corresponds to the sixth Phase 6: DAC _ VAL6 ═ 23;
7 corresponds to the seventh Phase 7: DAC _ VAL7 ═ 22;
8 corresponds to the eighth Phase 8: DAC _ VAL8 is 20.
Specifically, the preset voltages are 2.69V and 2.56V for example:
taking the acquired battery voltage as 2.8V as an example, performing training comparison on the 8 stages, as shown in fig. 2, in order to save chip power consumption, a low power consumption operation mode is adopted when battery voltage detection is performed, when the low power consumption operation mode detects that the level of electric quantity changes, a normal operation mode is started, at this time, whether electric quantity jump occurs is judged, when the electric quantity jump is determined, the 8 stages are sequentially compared, and the position of the training value for performing training comparison is: the first detection is placed at the lower position and the second detection is placed at the upper position, namely, the value obtained in the first stage of the first detection is placed at the position of the eighth stage, and the value obtained in the eighth stage of the second detection is placed at the position of the first stage. And finally, determining the electric quantity grade according to the obtained round training value. And the placing position of the round training value is opposite to the numerical sequence of the binary representation of the level.
Next, the DAC _ VAL values corresponding to 2.8V and 8 stages are sequentially substituted into the above formula by calculating according to the above formula, and the obtained VTs are:
VT=DAC_VAL/64*2.69=19/64*2.8=0.831
VT=DAC_VAL/64*2.56=20/64*2.8=0.875
from the above formula, it can be seen that when the VT is greater than VREF at DAC _ VAL of 19 and 20, the VT corresponding to the calculation results of other phases must also be greater than VREF. Also, since a high level is output when VT is greater than VREF, the values corresponding to these eight phases are all 1. By adopting a 16-system mode, the 11111111 is converted into the 16-system of 0xff, that is, the electric quantity level corresponding to the preset voltage of 2.69V can be determined to be 0 xff.
Next, taking the acquired battery voltage as 2.6V as an example, performing round training comparison on the 8 stages, and sequentially substituting DAC _ VAL values corresponding to 2.6V and 8 stages into the above formula, where the obtained VTs are:
VT=DAC_VAL/64*2.69=19/64*2.6=0.772
VT=DAC_VAL/64*2.56=20/64*2.6=0.813
VT=DAC_VAL/64*2.56=22/64*2.6=0.894
VT=DAC_VAL/64*2.56=23/64*2.6=0.934
from the above formula, it can be seen that VT is less than VREF when DAC _ VAL is 19, low is output, VT is greater than VREF when DAC _ VAL is 20, 22, 23, high is output, and VT corresponding to other remaining stage calculation results can certainly be greater than VREF. Therefore, the eight stages correspond to a value of 01111111, and 11111110 is converted into a value of 0xfe in 16, that is, the preset voltage of 2.56V can be determined to correspond to a power level of 0 xfe.
According to the method, by analogy, the electric quantity grade corresponding to the preset voltage 2.327V is determined to be 0x7c, the electric quantity grade corresponding to the preset voltage 2.226V is determined to be 0x38, the electric quantity grade corresponding to the preset voltage 2.048V is determined to be 0x10, and when the battery voltage is lower than the preset voltage 2.048V, the electric quantity grade corresponding to the battery voltage is determined to be 0x 00.
BV 1 2 3 4 Display Level
>2.69V 1 1 1 1 3grids 0xf
>2.56V 0 1 1 1 3grids 0xe
>2.327V 0 0 1 1 2grids 0xc
>2.226V 0 0 0 1 1grids 0x8
>2.048V 0 0 0 0 0grids 0x0
<2.048V 0 0 0 0 0grids 0x0
TABLE 2 data schematic diagram of battery power level display for increasing battery power
Figure BDA0002577497290000081
Figure BDA0002577497290000091
TABLE 3 data diagram for battery power reduction power level display
In one embodiment, comparing the battery voltage with a preset voltage corresponding to the current operation mode includes: and comparing first coded data corresponding to the acquired battery voltage with second coded data corresponding to a preset voltage corresponding to the current operation mode, wherein the first coded data are obtained by calculating the battery voltage and a reference voltage, and the second coded data are obtained by calculating the preset voltage and the reference voltage.
Specifically, the battery state includes: the battery state of the battery discharging process is a discharging state, and the battery state of the battery charging process is a charging state. The stage operation corresponding to the discharging process is called an upshift process, for example, the preset voltage corresponding to <19, 20, 22, 23> is <2.69V, 2.56V, 2.327V, 2.226V >; the operation of the corresponding stage of the charging process is called a downshift process, for example, the preset voltage corresponding to <25, 23, 22, 20> is <2.048V, 2.226V, 2.327V, 2.56V >, wherein each stage of the upshift process or the downshift process is called a gear, in the downshift process, when four gears are all effective, the battery level display is full, when one gear is ineffective, the battery level display is reduced by one, and the like; in the upshifting process, when four gears are invalid, the battery electric quantity display zero grid is represented, when one gear is valid, the battery electric quantity display is increased by one grid, and the like. Due to the hysteresis effect of hardware, after the upshifting processing or the downshifting processing of the method is adopted, the bidirectional hysteresis effect can be realized, and the determination of the electric quantity grade is more accurate when the electric quantity jumps.
And 102, if the two continuous comparison results are different, determining the jump of the generated electric quantity, and counting the times of the jump of the generated electric quantity.
Specifically, in order to reduce chip power consumption and prolong the service life of a battery, two sets of operation modes are designed, one set of operation modes is a normal operation mode, the other set of operation modes is a low-power consumption operation mode, wherein reference voltages of the two sets of operation modes are inconsistent, and therefore preset voltages of the two sets of operation modes are inconsistent. In the practical application process, in order to save the power consumption of the chip, the battery voltage is detected in a low-power-consumption operation mode, the chip is awakened when the low-power-consumption operation mode detects that the electric quantity level changes, the normal operation mode detection is started, the normal operation mode and the low-power-consumption operation mode are alternately switched and detected, and the chip is awakened back and forth. The comparison results are different because the detection results of the two operation modes are different, and if the comparison results of two consecutive times are different, the occurrence of electric quantity jump is determined, and the times of the occurrence of the electric quantity jump are counted.
And 103, when the times reach a preset value, selecting one of two adjacent electric quantity grades as a final electric quantity grade.
Specifically, when the number of times of power jump reaches a preset value, one power level is selected from two adjacent power levels, and it can be effectively determined that the power jump is caused by the alternate detection of a normal operation mode and a low power consumption operation mode and the chip is waken up back and forth, rather than the accidental power jump caused by external factors or self factors.
In a specific embodiment, when the number of times of power hopping reaches a preset value, the current battery state is determined to be a charging state, and a power level higher than the current battery state in two adjacent power levels is selected as a final power level, wherein the power levels are in a direct proportion relation with the power of the battery.
In a specific embodiment, when the number of times of electric quantity jump reaches a preset value, the current battery state is determined to be a discharge state, and an electric quantity level which is lower than the electric quantity levels in two adjacent electric quantity levels is selected as a final electric quantity level, wherein the electric quantity level and the electric quantity of the battery are in a direct proportion relation.
Specifically, the battery state is a discharge state, and when the electric quantity jumps, the downshift process is performed, as shown in fig. 3, the downshift process is performed at <25, 23, 22, 20>, and the downshift process is described by taking 2.6V as an example:
and judging whether the current gear is equal to the previous gear, judging whether the jumping frequency reaches a preset value if the current gear is equal to the previous gear, judging whether the level is equal to 0x7 if the jumping frequency reaches the preset value, and displaying the level corresponding to the current gear if the level does not reach the preset value. The situation can hardly occur, and no unexpected fault occurs and no electric quantity jump occurs when the current gear is equal to the previous gear. And if the current gear is not equal to the previous gear, counting the jumping times, judging whether the jumping times reach a preset value, if so, judging whether the level is equal to 0x7, and if not, displaying the level corresponding to the current gear.
Judging whether the level is equal to 0x7, if so, setting <25, 23, 22, 20> to <25, 23, 22, 0>, namely setting the gear of 20 as invalid, and judging whether the level is equal to 0x 3; if the level is not equal to 0x7, determine whether the level is equal to 0x 3.
And comparing the obtained result with each gear according to the process in a analogized mode to obtain a comparison result, and obtaining the battery electric quantity to be displayed according to the obtained comparison result.
In a specific embodiment, a criterion may be set, and when the number of times of the electric quantity jump reaches a preset value, selecting an electric quantity level corresponding to a preset voltage corresponding to the normal operation mode as a final electric quantity level criterion is performed. Of course, the standard user may set according to an actual situation, and set that when the electric quantity jumps and reaches a preset value at this time, the electric quantity grade corresponding to the preset voltage corresponding to the low power consumption operation mode is selected as a standard of the final electric quantity grade.
And 104, displaying according to the battery electric quantity corresponding to the final electric quantity grade.
In one embodiment, the reference voltage corresponding to the normal operation mode is not equal to the reference voltage corresponding to the low power consumption operation mode, so that the preset voltage corresponding to the normal operation mode is not equal to the preset voltage corresponding to the low power consumption operation mode. The VBAT can be obtained by the above formula VT — DAC _ VAL/64 — VBAT, for example, substituting the reference voltage 0.8V corresponding to the normal operation mode and the value of DAC _ VAL of 19 into the formula to obtain VBAT equal to 2.69V; and substituting the reference voltage 0.7V corresponding to the low-power-consumption operation mode and the DAC _ VAL value 19 into a formula to obtain that VBAT is equal to 2.358V, so that the preset voltage corresponding to the normal operation mode can be obtained and is not equal to the preset voltage corresponding to the low-power-consumption operation mode. VBAT at this time is the threshold voltage of two adjacent power levels.
In addition, as can be seen from fig. 4, each preset voltage should have only one line, but actually corresponds to two lines, wherein a solid line LP _ VREF represents a preset voltage in the normal operation mode, a dashed line Nor _ VREF represents a preset voltage in the low power consumption operation mode, and a slash VBAT where the solid line LP _ VREF intersects with the dashed line Nor _ VREF represents a battery voltage, the battery voltage VBAT drops as the battery discharges, and when the battery voltage VBAT is between the solid line LP _ VREF and the dashed line Nor _ VREF, the power levels detected in the normal operation mode and the low power consumption operation mode are inconsistent, which causes chip wake-up and power jump. In addition, the preset voltage is not a fixed value, and the error exists in a certain range of about plus or minus 30mV, so that 2.544V marked by the preset voltage value corresponding to the solid line LP _ VREF in fig. 4 is shown, and it is known from practical application that the difference between the preset voltage corresponding to the normal operation mode and the preset voltage corresponding to the low power consumption mode is about 6 mV.
In one embodiment, the preset voltage corresponding to the normal operation mode is smaller than the preset voltage corresponding to the low power consumption operation mode.
According to the method provided by the embodiment of the application, in the process of real-time voltage detection, after the battery voltage is obtained every time, the obtained battery voltage is compared with the preset voltage corresponding to the current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage used for distinguishing two adjacent electric quantity grades, the operation modes comprise a normal operation mode and a low-power-consumption operation mode, and by comparing the battery voltage with the preset voltage corresponding to the current operation mode, the magnitude relation between the battery voltage and the preset voltage corresponding to the normal operation mode and the magnitude relation between the battery voltage and the preset voltage corresponding to the low-power-consumption operation mode can be effectively obtained.
Further, when the two continuous comparison results are different, namely, the two magnitude relations are not consistent, the occurrence of electric quantity jump is determined, the number of times of the occurrence of electric quantity jump is counted, and the accidental electric quantity jump caused by external factors or self factors or the electric quantity jump when the battery voltage reaches the critical voltage of two adjacent electric quantity grades can be determined through the number of times of the electric quantity jump; when the number of times of electric quantity jumping reaches a preset value, determining that the battery voltage jumps when reaching the critical voltage of two adjacent electric quantity grades, and selecting one of the two adjacent electric quantity grades as a final electric quantity grade; and displaying the battery electric quantity corresponding to the final electric quantity grade.
The method effectively solves the problem that under the condition that the normal operation mode and the low-power-consumption operation mode are executed together, the battery power is jumped due to inconsistent power levels detected by the two modes when the battery voltage is between the critical value of the normal operation mode and the critical value of the low-power-consumption operation mode because the critical values of the two operation modes are different.
The embodiment of the present application further provides a device for displaying battery power, and the specific implementation of the device may refer to the description in the method embodiment section, and repeated details are not repeated, as shown in fig. 5, the device mainly includes:
the comparing module 501 is configured to, in a real-time voltage detection process, compare the battery voltage with a preset voltage corresponding to a current operation mode each time after the battery voltage is obtained, and obtain a comparison result, where the preset voltage is a critical voltage used for distinguishing two adjacent electric quantity classes, and the operation mode includes a normal operation mode and a low power consumption operation mode.
The counting module 502 is configured to determine that the electric quantity jumps if the two consecutive comparison results are different, and count the number of times of the electric quantity jumps.
And a selecting module 503, configured to select one of the two adjacent electric quantity levels as a final electric quantity level when the number of times reaches a preset value.
The display module 504 is configured to display the battery power level according to the final power level.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 6, the electronic device mainly includes: a processor 601, a communication component 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication component 602 and the memory 603 communicate with each other via the communication bus 604. The memory 603 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 603 to implement the following steps: in the real-time voltage detection process, after the battery voltage is obtained each time, comparing the battery voltage with a preset voltage corresponding to a current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage for distinguishing two adjacent electric quantity grades, and the operation mode comprises a normal operation mode and a low-power consumption operation mode; if the two continuous comparison results are different, determining the jump of the generated electric quantity, and counting the times of the jump of the generated electric quantity; when the times reach a preset value, selecting one of two adjacent electric quantity grades as a final electric quantity grade; and displaying the battery electric quantity corresponding to the final electric quantity grade.
The communication bus 604 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 604 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
The communication component 602 is used for communication between the electronic device and other devices described above.
The Memory 603 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one storage device located remotely from the processor 601.
The Processor 601 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like, and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In still another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program which, when run on a computer, causes the computer to execute the display method of the battery power described in the above-described embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method for displaying battery power is characterized by comprising the following steps:
in the real-time voltage detection process, after a battery voltage is obtained each time, comparing the battery voltage with a preset voltage corresponding to a current operation mode to obtain a comparison result, wherein the preset voltage is a critical voltage for distinguishing two adjacent electric quantity grades, and the operation mode comprises a normal operation mode and a low-power consumption operation mode;
if the comparison results of two consecutive times are different, determining that the electric quantity jumps, and counting the times of the electric quantity jumps;
when the times reach a preset value, selecting one of the two adjacent electric quantity grades as a final electric quantity grade;
displaying the battery electric quantity corresponding to the final electric quantity grade;
wherein, compare the battery voltage with the preset voltage that current operation mode corresponds, include:
comparing the acquired first coded data corresponding to the battery voltage with second coded data corresponding to a preset voltage corresponding to the current operation mode;
the first coded data are obtained through calculation of the battery voltage and a reference voltage, and the second coded data are obtained through calculation of the preset voltage and the reference voltage.
2. The method for displaying battery power according to claim 1, wherein when the number of times reaches a preset value, selecting one of the two adjacent power levels as a final power level comprises:
when the times reach a preset value, determining that the current battery state is a charging state, and selecting the high electric quantity grade in the two adjacent electric quantity grades as the final electric quantity grade;
wherein, the electric quantity grade and the battery electric quantity are in a direct proportion relation.
3. The method for displaying battery power according to claim 1, wherein when the number of times reaches a preset value, selecting one of the two adjacent power levels as a final power level comprises:
when the times reach a preset value, determining that the current battery state is a discharging state, and selecting the electric quantity level which is lower than the two adjacent electric quantity levels as the final electric quantity level;
wherein, the electric quantity grade and the battery electric quantity are in a direct proportion relation.
4. The method for displaying battery power according to claim 1, wherein when the number of times reaches a preset value, selecting one of the two adjacent power levels as a final power level comprises:
and when the times reach a preset value, selecting the electric quantity grade corresponding to the preset voltage corresponding to the normal operation mode as the final electric quantity grade.
5. The method for displaying battery power according to claim 1, wherein the preset voltage corresponding to the normal operation mode is not equal to the preset voltage corresponding to the low power consumption operation mode.
6. The method for displaying battery power according to claim 5, wherein the preset voltage corresponding to the normal operation mode is smaller than the preset voltage corresponding to the low power consumption operation mode.
7. A battery charge level display device, comprising:
the comparison module is used for comparing the battery voltage with a preset voltage corresponding to a current operation mode after the battery voltage is obtained each time in the real-time voltage detection process to obtain a comparison result, wherein the preset voltage is a critical voltage used for distinguishing two adjacent electric quantity grades, and the operation modes comprise a normal operation mode and a low-power consumption operation mode; wherein, compare the battery voltage with the preset voltage that current operation mode corresponds, include: comparing the acquired first coded data corresponding to the battery voltage with second coded data corresponding to a preset voltage corresponding to the current operation mode; the first coded data are obtained by calculating the battery voltage and a reference voltage, and the second coded data are obtained by calculating the preset voltage and the reference voltage;
the statistic module is used for determining the occurrence of electric quantity jump if the comparison results of two consecutive times are different and counting the times of the occurrence of the electric quantity jump;
the selecting module is used for selecting one of the two adjacent electric quantity grades as a final electric quantity grade when the times reach a preset value;
and the display module is used for displaying according to the battery electric quantity corresponding to the final electric quantity grade.
8. An electronic device, comprising: the system comprises a processor, a communication component, a memory and a communication bus, wherein the processor, the communication component and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method for displaying battery power according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for displaying battery power according to any one of claims 1 to 6.
CN202010658111.7A 2020-07-09 2020-07-09 Method, device and equipment for displaying battery electric quantity and storage medium Active CN113933715B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010658111.7A CN113933715B (en) 2020-07-09 2020-07-09 Method, device and equipment for displaying battery electric quantity and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010658111.7A CN113933715B (en) 2020-07-09 2020-07-09 Method, device and equipment for displaying battery electric quantity and storage medium

Publications (2)

Publication Number Publication Date
CN113933715A CN113933715A (en) 2022-01-14
CN113933715B true CN113933715B (en) 2022-08-16

Family

ID=79273312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010658111.7A Active CN113933715B (en) 2020-07-09 2020-07-09 Method, device and equipment for displaying battery electric quantity and storage medium

Country Status (1)

Country Link
CN (1) CN113933715B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064025A (en) * 2011-10-19 2013-04-24 北京谊安医疗系统股份有限公司 Battery electric quantity detection method and device using the same
CN105403835A (en) * 2014-08-29 2016-03-16 展讯通信(深圳)有限公司 System and method for measuring battery level
CN107290674A (en) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 A kind of calibration method and terminal for showing charge value
CN107356881A (en) * 2017-07-19 2017-11-17 深圳天珑无线科技有限公司 A kind of control method of terminal, device and terminal
CN109633447A (en) * 2019-01-09 2019-04-16 福建联迪商用设备有限公司 Residual quantity display method and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102105170B1 (en) * 2013-10-24 2020-04-24 삼성전자주식회사 Electronic apparatus, input apparatus for display apparatus and method for determining remaining quantity of battery thereof

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064025A (en) * 2011-10-19 2013-04-24 北京谊安医疗系统股份有限公司 Battery electric quantity detection method and device using the same
CN105403835A (en) * 2014-08-29 2016-03-16 展讯通信(深圳)有限公司 System and method for measuring battery level
CN107290674A (en) * 2017-05-19 2017-10-24 深圳市金立通信设备有限公司 A kind of calibration method and terminal for showing charge value
CN107356881A (en) * 2017-07-19 2017-11-17 深圳天珑无线科技有限公司 A kind of control method of terminal, device and terminal
CN109633447A (en) * 2019-01-09 2019-04-16 福建联迪商用设备有限公司 Residual quantity display method and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"电动叉车的平滑显示SOC 估算";李光 等;《湖南工业大学学报》;20190930;第33卷(第5期);第36-42页 *

Also Published As

Publication number Publication date
CN113933715A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
US20150276885A1 (en) Method of Computing State of Charge and Battery State of Charge Monitor
CN104932966A (en) Method and device for detecting false downloading times of application software
CN109145825B (en) Coherent noise filtering method and system
CN113933715B (en) Method, device and equipment for displaying battery electric quantity and storage medium
CN110635781A (en) Digital filtering calculation method
Neyman et al. Repeated games with public uncertain duration process
CN110588430A (en) Charging method and charging equipment
US8711025B2 (en) Method for configuring analog-to-digital converter keys and non-transitory machine readable medium storing program code executed for performing such method
KR20200056716A (en) Battery SOH output system and method
CN105486940B (en) Key detection circuit and key detection method of electronic equipment
CN115166542A (en) SOC calculation method, control circuit, electronic device, and storage medium
US20220137143A1 (en) Battery model estimation based on battery terminal voltage and current transient due to load powered from the battery
CN112039064B (en) Control method based on power supply system and related device
CN106569890A (en) Application control method and terminal
CN116774084A (en) Method for estimating degradation of battery
CN112034371B (en) Battery health degree prediction method and terminal equipment
CN112034351A (en) Battery remaining capacity determining method and terminal equipment
CN112114264B (en) Battery electric quantity detection system
CN114236405A (en) Battery electric quantity detection method and device and portable electronic equipment
CN117169669B (en) Breakdown capacitance monitoring method and device, electronic equipment and readable storage medium
CN111896807B (en) Fundamental wave frequency measuring method, measuring terminal and storage medium
CN113125980B (en) Method and device for detecting direct current internal resistance of battery and terminal equipment
KR100597031B1 (en) Installation for management of error data in engine control unit
CN117590838B (en) Intelligent detection method and system for aging of microprocessor
CN113223505A (en) Model training method, data processing method, device, electronic equipment and storage medium

Legal Events

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