CN115343641A - Method, apparatus, device, medium and program product for determining battery level - Google Patents

Method, apparatus, device, medium and program product for determining battery level Download PDF

Info

Publication number
CN115343641A
CN115343641A CN202211273016.0A CN202211273016A CN115343641A CN 115343641 A CN115343641 A CN 115343641A CN 202211273016 A CN202211273016 A CN 202211273016A CN 115343641 A CN115343641 A CN 115343641A
Authority
CN
China
Prior art keywords
voltage value
battery
value
current
determining
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.)
Granted
Application number
CN202211273016.0A
Other languages
Chinese (zh)
Other versions
CN115343641B (en
Inventor
周亮
王妙玉
欧宝星
吴宁泉
李昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Hotata Smart Home Co Ltd
Original Assignee
Guangdong Hotata Smart Home 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 Guangdong Hotata Smart Home Co Ltd filed Critical Guangdong Hotata Smart Home Co Ltd
Priority to CN202211273016.0A priority Critical patent/CN115343641B/en
Publication of CN115343641A publication Critical patent/CN115343641A/en
Application granted granted Critical
Publication of CN115343641B publication Critical patent/CN115343641B/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/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
    • 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
    • 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
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/60Other road transportation technologies with climate change mitigation effect
    • Y02T10/70Energy storage systems for electromobility, e.g. batteries

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Secondary Cells (AREA)

Abstract

The embodiment of the application provides a method, a device, equipment, a medium and a program product for determining battery power, and relates to the field of smart home. The method comprises the following steps: acquiring a current voltage value of the battery at the current moment, and calculating a historical voltage average value of the battery at a plurality of historical moments; the current time and a plurality of historical times have a continuous relation; determining respective corresponding weight values of the current voltage value and the historical voltage mean value according to the current voltage value; and determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage mean value and respective corresponding weight values, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment. The scheme provided by the embodiment of the application can realize the effect of providing accurate electric quantity information for the user.

Description

Method, apparatus, device, medium and program product for determining battery level
Technical Field
The present application relates to the field of smart home technologies, and in particular, to a method and an apparatus for determining battery power, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The smart lock usually uses a dry battery or a lithium battery as a power source, and the battery as the power source means that the battery is completely consumed. To enhance the user experience, the manufacturer may typically inform the user of the remaining power of the smart lock in various ways.
At present, the more conventional scheme for acquiring the remaining capacity is as follows: the voltage data of a battery installed in the intelligent lock is acquired through a main control MCU (Micro Controller Unit), and the voltage data is directly converted into electric quantity data, so that the residual electric quantity is acquired. On one hand, considering the characteristic that the power consumption of the battery is limited, the master control MCU needs to be set in a sleep state or an awake state according to a scene, specifically: the main control MCU can not acquire the voltage data of the battery in real time when in the dormant state, and can acquire the voltage data of the battery only when in the awakening state, namely the voltage data of the battery can not be acquired in real time. On the other hand, it is difficult to calculate the voltage data of the battery using a current integration method or a more advanced SOC estimation method (such as a kalman filter method) in consideration of the limited processing capability of the MCU. And finally, converting the obtained voltage data into electric quantity data so as to obtain the residual electric quantity of the battery.
In addition, if the voltage data is directly converted into the electric quantity data, instantaneous larger current is caused by actions such as unlocking, so that the measured voltage data drops more, correspondingly the obtained electric quantity data drops more, and the fact is obviously not met; if the simple filtering processing is directly performed on the plurality of voltage data, the change of the voltage data cannot be immediately reflected when the battery is replaced by the user, that is, the correspondingly obtained voltage data cannot be immediately reflected.
Therefore, the solutions for acquiring the power provided by the related art all lead the user to recognize the wrong battery power. Thus, the user experience still needs to be improved.
Disclosure of Invention
An object of the embodiments of the present application is to provide a solution for determining battery power, so as to solve the above technical problem. To achieve the purpose, the scheme provided by the embodiment of the application is as follows.
In one aspect, an embodiment of the present application provides a method for determining battery power, where the method includes:
acquiring a current voltage value of the battery at the current moment, and calculating a historical voltage mean value of the battery at a plurality of historical moments; the current time and a plurality of historical times have a continuous relation; determining respective corresponding weight values of the current voltage value and the historical voltage mean value according to the current voltage value; and determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage mean value and respective corresponding weight values, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment.
Optionally, determining a weight value corresponding to the current voltage value according to the current voltage value includes:
determining a first parameter based on the current voltage value and a target voltage value of the battery at a previous moment; the target voltage value of the battery at the previous moment corresponds to the residual capacity at the previous moment; acquiring a second parameter from a preset first range; and performing power operation by taking the first parameter as an exponent and the second parameter as a base number, and determining an operation result as a weight value corresponding to the current voltage value.
Optionally, determining the first parameter based on the current voltage value and the target voltage value of the battery at the previous time includes:
calculating the absolute value of the difference between the current voltage value and the target voltage value at the last moment; acquiring a third parameter from a preset second range; a ratio of the absolute value to the third parameter is determined, and the first parameter is determined based on the ratio and a preset value.
And if the ratio is greater than the preset value, setting the ratio as the preset value.
Optionally, determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value, and respective corresponding weight values, includes:
and carrying out weighted calculation on the current voltage value and the historical voltage average value based on the respective corresponding weight values to obtain the target voltage value of the battery at the current moment.
Optionally, determining the remaining capacity of the battery at the current time according to the target voltage value at the current time includes:
acquiring a preset corresponding relation table; the corresponding relation table comprises a plurality of preset voltage values and electric quantity information corresponding to each voltage value; each electric quantity information describes the percentage of the residual capacity of the battery to the total capacity of the battery; and determining the electric quantity information corresponding to the target voltage value in the preset corresponding relation table as the current residual electric quantity of the battery.
Optionally, the current voltage value is one; the sum of the number of the current voltage values and the number of the historical voltage values is a preset number; the numerical value corresponding to the preset number is within a preset third range.
On the other hand, the embodiment of the application further provides a detection method for the battery capacity of the intelligent lock, and the method for determining the battery capacity is applied to implementation.
In another aspect, an embodiment of the present application provides an apparatus for determining a battery power, where the apparatus includes:
the acquisition module is used for acquiring the current voltage value of the battery at the current moment and calculating the historical voltage mean value of the battery at a plurality of historical moments; the current time has a continuous relationship with several historical times.
And the first determining module is used for determining the weighted values corresponding to the current voltage value and the historical voltage mean value according to the current voltage value.
And the second determining module is used for determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value and respective corresponding weight values, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment.
An embodiment of the present application further provides an electronic device, including:
the device comprises a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to realize the steps of the method for determining the battery capacity provided by the embodiment of the application.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of a method for determining battery power provided by embodiments of the present application.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the method for determining battery power provided in an embodiment of the present application are implemented.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
the embodiment of the application provides a method for determining the electric quantity of a battery, and aims to acquire more accurate electric quantity information. The method comprises the following steps: acquiring a current voltage value of the battery, and calculating historical voltage mean values of a plurality of historical moments; when the actual voltage value at the current moment is calculated, acquiring a weight value (namely an occupation ratio) of the current voltage value based on the current voltage value, indirectly acquiring a weight value of a historical voltage mean value according to the weight value, and finally calculating a target voltage value (namely the actual voltage value of the battery) of the battery at the current moment according to the current voltage value and the weight value thereof, and the historical voltage mean value and the weight value thereof; further, the remaining capacity of the battery at the current moment is determined according to the corresponding relation between the voltage value and the capacity information. That is to say, when the actual voltage value at the current time is obtained, in order to avoid that the obtained current voltage value is not accurate enough due to various interferences, the obtained current voltage value is not only used as the actual voltage value, but the actual voltage value is calculated together by combining the current voltage value and the historical voltage value, and finally the actual voltage value at the current time is calculated according to the weight occupied by each type of voltage value. Even under some scenes, under the condition that the acquired current voltage value is inaccurate due to the influence of other operations on equipment where the battery is located, the accurate actual voltage value can be normally acquired, so that the residual capacity of the battery at the current moment is acquired. Therefore, the embodiment of the application can obtain more accurate electric quantity information.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic structural diagram of an intelligent lock according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for determining battery power according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an apparatus for determining battery power according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the embodiments set forth below in connection with the drawings are exemplary descriptions for explaining technical solutions of the embodiments of the present application, and do not limit the technical solutions of the embodiments of the present application.
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 should be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, information, data, steps, operations, elements, and/or components, but do not preclude the presence or addition of other features, information, data, 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 be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. The term "and/or" as used herein indicates at least one of the items defined by the term, e.g., "a and/or B" may be implemented as "a", or as "B", or as "a and B".
To make the objects, technical solutions and advantages of the present application more clear, the following detailed description of the embodiments of the present application will be made with reference to the accompanying drawings.
With the development of the home industry, more and more homes are intelligent and simplified, for example, a door with an intelligent lock is configured. Based on this door that disposes intelligent lock, the user need not to carry the key, only needs through any kind of identification methods in fingerprint identification, digital code discernment and the voiceprint discernment, just can easily realize opening the door and enter the family. While smart locks typically use dry cells or lithium batteries as a power source. The battery is used as a power supply, the residual electric quantity of the battery is required to be provided for a user, so that when the electric quantity of the battery is exhausted, the user can replace the battery in time according to the displayed electric quantity information, and the normal work of the intelligent lock is guaranteed.
The embodiment of the application provides a method for determining battery power, which is applied to various electronic devices (in the embodiment of the application, the electronic devices can also be called as devices). The method can comprise the following steps: acquiring a current voltage value of the battery at the current moment, and calculating a historical voltage average value of the battery at a plurality of historical moments; the current time and a plurality of historical times have a continuous relation; determining respective corresponding weight values of the current voltage value and the historical voltage mean value according to the current voltage value; and determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage mean value and the corresponding weight value, and further acquiring the residual electric quantity of the battery. Optionally, after the remaining power is acquired, the power information is displayed through a display screen configured for the electronic device, so as to provide better user experience.
Optionally, the electronic device may be an intelligent lock, such as an intelligent lock installed on a large door, and the intelligent lock is configured with a power supply, such as a lithium battery; after the intelligent lock is started, the state of the intelligent lock comprises a wake-up state and a sleep state; the operation of detecting the voltage value of the battery is not carried out for the intelligent lock in the dormant state, and the operation of detecting the voltage value of the battery can be carried out for the intelligent lock in the awakening state; the battery has limited electric quantity, and can enter a dormant state when not used so as to save the electric quantity; when the intelligent lock is in the awakening state, the method for determining the battery power provided by the embodiment of the application can be implemented to obtain the remaining power of the battery of the intelligent lock. Optionally, the electronic device may also be a portable intelligent terminal device, such as a mobile phone, a tablet, and the like, where the intelligent terminal device is connected to an intelligent electric bicycle, and the intelligent electric bicycle is configured with a battery; the intelligent terminal device can send a voltage obtaining request to the intelligent electric bicycle to obtain the voltage value of the intelligent electric bicycle, so that a method for determining the electric quantity of the battery is implemented, and the residual electric quantity of the intelligent electric bicycle is obtained, so that whether the intelligent electric bicycle can be ridden or not is confirmed.
Optionally, the battery is divided according to the electrolyte type of the battery, and the battery as a power supply can be an alkaline battery, such as an alkaline zinc-manganese battery; the battery as a power source may be an acid battery such as a zinc-manganese dry battery; the battery as the power source may be an organic electrolyte battery such as a lithium battery or the like. It should be noted that the type of the battery may also refer to the related art division manner.
Optionally, the method provided in the embodiment of the present application may be implemented as a stand-alone application program or a functional module/plug-in of an application program, or may also be implemented as an application program or a functional module/plug-in of an application program respectively configured on a device. For example, the application program may be a special door lock control program or another application program having a door lock control function, and the application program may be used to obtain more accurate power information.
The technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application are explained below by describing several exemplary embodiments. It should be noted that the following embodiments may be referred to, referred to or combined with each other, and the description of the same terms, similar features, similar implementation steps, etc. in different embodiments is not repeated.
Fig. 1 shows a smart lock 10, the smart lock 10 being equipped with a battery 140 and comprising the following modules:
the detecting module 110 is configured to detect a voltage value of the battery 140.
The main control module 120 is configured to execute a method for determining a battery power provided in this embodiment of the application based on the detected voltage value, so as to obtain a remaining power of the battery 140 at the current time.
Optionally, the detection module 110 may be an electromagnetic voltage transformer, a hall voltage sensor, a voltage division voltage sensor, or the like; the main control module 120 may be an MCU (Micro Controller Unit).
Optionally, the smart lock 10 further includes a display module 130, and the main control module 120 further calls the display module 130 to display the remaining power of the battery 140 at the current time after obtaining the remaining power of the battery at the current time.
If the remaining capacity of the battery is detected to be 60%, the information may be displayed through the display module 130.
Fig. 2 shows a flow diagram of a method of determining battery charge. As shown in FIG. 2, the method includes the following steps S210 to S230.
S210, acquiring a current voltage value of the battery at the current moment, and calculating a historical voltage mean value of the battery at a plurality of historical moments; the current time has a continuous relationship with several historical times.
Alternatively, the method may be applied to various devices equipped with a battery. For example, the device may be the intelligent lock provided in the above embodiment of the present application, where the intelligent lock uses a battery as a power supply, and includes a main control module and a detection module, and the main control module is connected to the detection module of the intelligent lock, so as to receive and store a voltage value of the battery detected by the detection module. In storing the voltage values, the voltage values received by the device in each wake-up state may be stored as a group.
Optionally, the obtaining of the current voltage value of the battery at the current time may specifically include: and responding to the awakening operation aiming at the intelligent lock, and acquiring the current voltage value of the battery at the current moment.
Optionally, when the device is an intelligent lock, the device includes at least two states, a sleep state and an awake state. When the intelligent lock is in an unlocking scene, the intelligent lock is in an awakening state; or when the intelligent lock is in a scene of replacing the battery, the intelligent lock is in an awakening state. During a unit period (e.g., 1 day), the smart lock may be awake many times, and after a plurality of unit periods, the smart lock enters a situation in which the battery needs to be replaced.
Optionally, when the device is in the wake-up state, a current voltage value of the battery at the current moment is obtained. When the current voltage value of the battery at the current moment is obtained, the average value of the obtained multiple voltage values can be used as the current voltage value; the last voltage value of the acquired voltage values may be used as the current voltage value, or the first voltage value may be used as the current voltage value. It should be noted that it is possible to determine which voltage value to use as the current voltage value according to the requirements.
Optionally, the several historical moments may be understood as: and the corresponding time when the equipment is in the awakening state for a plurality of times before the current time. The plurality of times of awakening states are a plurality of times of continuous awakening states, and the current time and the latest historical time have a continuous relation.
Optionally, the sum of the number of the plurality of historical moments and the number of the current moments is a preset number. And acquiring a current voltage value at the current moment, and acquiring a corresponding historical voltage value at each historical moment. Therefore, the sum of the number of the current voltage values and the number of the historical voltage values is a preset number; the value corresponding to the predetermined number is within a predetermined third range.
Optionally, the historical voltage average value of the plurality of historical moments may be obtained by obtaining a historical voltage value corresponding to each historical moment of the plurality of historical moments and calculating an average value of all the historical voltage values, that is, the average value corresponds to the historical voltage average value.
Alternatively, the last voltage value in a group of voltage values stored when each is in the wake-up state may be used as the historical voltage value at the corresponding historical time.
In one example scenario, from 8: and entering an unlocking scene at the time 00, namely from 8: beginning to be in an awakening state at the time 00; after the operation is completed, from 8: entering a dormant state at the moment 03; until from 9: and entering an unlocking scene at the time 00, namely from 9: and the time 00 is in the wake-up state again. Then "8: time 00 "and" 9: time 00 "is two consecutive wake-up times.
In yet another exemplary scenario, historical voltage values for (M-1) historical time instants, P respectively, are obtained 1 、P 2 ……P M-1 (ii) a Obtaining a current voltage value P at the current moment M I.e. the sum of the number of present voltage values and the number of historical voltage values is M. Wherein M is greater than or equal to 5 and less than or equal to 20. And the historical voltage average Ave can be obtained by the following equation 1.
Figure 529060DEST_PATH_IMAGE001
Formula 1;
and S220, determining respective corresponding weight values of the current voltage value and the historical voltage mean value according to the current voltage value.
Optionally, the weight value corresponding to the current voltage value is a first weight value, and the weight value corresponding to the historical voltage average value is a second weight value. Wherein the sum of the first weight value and the second weight value is 1. After determining the first weight value according to the current voltage value, since the sum of the first weight value and the second weight value is 1, the second weight value may be obtained by a difference between 1 and the first weight value.
And S230, determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value and respective corresponding weight values, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment.
Specifically, a first parameter is determined based on a current voltage value and a target voltage value of the battery at the last moment; the target voltage value of the battery at the previous moment corresponds to the residual capacity at the previous moment; acquiring a second parameter from a preset first range; and performing power operation by taking the first parameter as an exponent and the second parameter as a base number, and determining an operation result as a weight value corresponding to the current voltage value.
Optionally, the process of the weight calculation is as follows:
calculating a first product of the first weight value and the current voltage value; calculating a second product of the second weighted value and the historical voltage mean value; taking the sum of the first product and the second product as a target voltage value of the battery at the current moment; and acquiring the residual electric quantity of the battery at the current moment according to the target voltage value at the current moment.
In one example scenario, the first weight value may be represented as W and the second weight value may be represented as (1-W). Target voltage value P now Can be obtained by the following equation 2:
Figure 164572DEST_PATH_IMAGE002
formula 2;
in an optional implementation manner, determining the remaining capacity of the battery at the current time according to the target voltage value at the current time may specifically include:
acquiring a preset corresponding relation table; the corresponding relation table comprises a plurality of preset voltage values and electric quantity information corresponding to each voltage value; each electric quantity information describes the percentage of the residual capacity of the battery in the total capacity of the battery; and determining the electric quantity information corresponding to the target voltage value in the preset corresponding relation table as the current residual electric quantity of the battery.
The corresponding relation table comprises a plurality of preset voltage values and residual electric quantity corresponding to each voltage value.
In an application scenario, taking a lithium battery as an example, the state of charge of the lithium battery is 6V when the lithium battery is at full load. The state of charge of the lithium battery is also called the SOC (state of charge) of the battery, and may also be called the remaining capacity, which represents the ratio of the remaining capacity of the lithium battery after being used for a period of time or left unused for a long time to the capacity of the lithium battery in a fully charged state, and is usually identified by percentage. When SOC =0, the lithium battery is completely discharged; when SOC =1, it indicates that the lithium battery is fully charged.
The conversion relationship between the voltage value and the SOC of the lithium battery can be determined by the following table 1.
TABLE 1
Value of voltage 6.0V 5.8V 5.6V 5.4V 5.2V 5.0V 4.9V 4.8V 4.6V 4.2V
Residual capacity 100% 90% 80% 70% 60% 50% 40% 30% 20% 10%
Such as P now When = 5.2V, the corresponding SOC is 60%, that is, the remaining capacity is 60%.
The embodiment of the application provides a method for determining battery electric quantity, which comprises the following steps: acquiring the current voltage value of the battery, and calculating the historical voltage mean value of the voltage values at a plurality of historical moments; when the actual voltage value at the current moment is calculated, acquiring a weight value (namely an occupation ratio) corresponding to the current voltage value based on the current voltage value, indirectly acquiring a weight value corresponding to a historical voltage average value according to the weight value, and finally calculating a target voltage value (namely the actual voltage value of the battery) of the battery at the current moment according to the current voltage value and the weight value thereof, and the historical voltage average value and the weight value thereof; further, the remaining capacity of the battery at the current moment is determined according to the corresponding relation between the voltage value and the capacity information. That is to say, when the actual voltage value at the current time is obtained, in order to avoid that the obtained current voltage value is not accurate enough due to various interferences, the obtained current voltage value is not only used as the actual voltage value, but the actual voltage value is calculated by combining the current voltage value and the historical voltage value, and finally the actual voltage value at the current time is calculated according to the weight occupied by each type of voltage value. Even under some scenes, for example, under the condition that other operations on the battery influence the acquired current voltage value to be inaccurate, the accurate actual voltage value can be normally acquired, so that the residual capacity of the battery at the current moment is acquired. Therefore, the embodiment of the application can obtain more accurate electric quantity information.
Next, the contents of step S220 and step S230 will be explained in detail.
In an optional embodiment, determining a weight value corresponding to the current voltage value according to the current voltage value may specifically include the following steps Sa1 to Sa3.
Sa1, determining a first parameter based on the current voltage value and a target voltage value of the battery at the last moment; the target voltage value of the battery at the previous moment corresponds to the remaining capacity at the previous moment.
Optionally, calculating an absolute value of a difference between the current voltage value and the target voltage value at the previous moment; acquiring a third parameter from a preset second range; a first parameter is determined based on the ratio and a preset value. Specifically, a ratio of the absolute value to the third parameter is determined, and a difference between the ratio and a preset value is used as the first parameter.
The third parameter is a voltage value, and may specifically represent a magnitude of a voltage change.
In one example scenario, the present voltage value is taken as P M The target voltage value corresponding to the residual capacity at the previous moment is P pre (ii) a The third parameter is delta P, and the value range of the delta P is between 0.2v and 0.4 v; the calculation process of the ratio E can refer to the following equation 3. If Δ P =0.2, the change in the corresponding electrical quantity is 10%, and if Δ P =0.4, the change in the corresponding electrical quantity is 20%.
Figure 290659DEST_PATH_IMAGE003
Formula 3;
and Sa2, acquiring a second parameter from a preset first range.
In one example scenario, a second parameter a is selected. Wherein, the value range of A is between 10 and 1000.
And Sa3, performing exponentiation by using the first parameter as an exponent and the second parameter as a base number, and determining an operation result as a weight value corresponding to the current voltage value.
In yet another example scenario, where the preset value may be 1, the first parameter is E-1. The calculation process of the first weight value W may refer to the following equation 4.
Figure 37030DEST_PATH_IMAGE004
Formula 4;
optionally, when E is greater than the preset value, E is set as the preset value. Specifically, if P M Relative to P pre The variation is large, then the probability of E being greater than the preset value is large, and the maximum value of W is 1. Therefore, it is necessary to set E = a preset numerical value in the case where E is larger than the preset numerical value, so that the maximum value of W can be made 1. That is, if E is calculated when the predetermined value is 1>1, E =1 is set.
Optionally, when E is calculated for the first time, P pre Do not exist and cannot be according to the publicEquation 3 calculates E, so that the embodiment of the present application also determines E by providing another preset value (e.g., value 0), that is, setting E =0.
For the smart lock, if the battery is replaced, the voltage value of the battery may change suddenly and greatly, and then the calculated E may be greater than the preset value. Therefore, P should be increased at this time M Weight in calculating the target voltage value. If E is equal to a preset value, the calculated first weighted value W is 1, that is, when the target voltage value is calculated, the obtained P is used M Mainly comprises the following steps. And, when acquiring the current voltage value, the voltage value acquired at the last moment of the awake state may be used as the current voltage value.
For the intelligent lock, if the intelligent lock is in an unlocking scene, the current is increased instantly due to unlocking action, the voltage falls to a certain extent relative to a normal value, and the normal unlocking process does not consume too much power consumption, so that the voltage change is normal. In this case, the calculated target voltage value can be made to approach the actual voltage value of the battery in conjunction with the history voltage value.
After the remaining capacity at the current moment is calculated, the remaining capacity can be displayed to the user.
In an alternative embodiment, the device is further configured with a display screen by which at least the remaining amount of the battery at the current moment is displayed.
Fig. 3 illustrates that the present application provides an apparatus for determining battery charge. The apparatus 300 includes an obtaining module 310, a first determining module 320, and a second determining module 330.
The obtaining module 310 is configured to obtain a current voltage value of the battery at a current time, and calculate a historical voltage average value of the battery at a plurality of historical times; the current time has a continuous relationship with several historical times.
The first determining module 320 is configured to determine, according to the current voltage value, respective weighted values of the current voltage value and the historical voltage average value.
The second determining module 330 is configured to determine a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value, and the respective corresponding weight values, and determine the remaining capacity of the battery at the current moment according to the target voltage value at the current moment.
Optionally, the first determining module 320 is specifically configured to, in determining the weight value corresponding to the current voltage value according to the current voltage value:
determining a first parameter based on a current voltage value and a target voltage value of the battery at a previous moment; the target voltage value of the battery at the previous moment corresponds to the residual capacity at the previous moment; acquiring a second parameter from a preset first range; and performing power operation by taking the first parameter as an exponent and the second parameter as a base number, and determining an operation result as a weight value corresponding to the current voltage value.
Optionally, the first determining module 320, in determining the first parameter based on the current voltage value and the target voltage value of the battery at the previous time, is specifically configured to:
calculating the absolute value of the difference between the current voltage value and the target voltage value at the last moment; acquiring a third parameter from a preset second range; a ratio of the absolute value to the third parameter is determined, and the first parameter is determined based on the ratio and a preset value.
And if the ratio is greater than the preset value, setting the ratio as the preset value.
Optionally, the second determining module 330 is specifically configured to, in determining the target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value, and the respective corresponding weight value:
and carrying out weighted calculation on the current voltage value and the historical voltage average value based on the respective corresponding weight values to obtain the target voltage value of the battery at the current moment.
Optionally, the second determining module 330 is specifically configured to, in determining the remaining capacity of the battery at the current time according to the target voltage value at the current time:
acquiring a preset corresponding relation table; the corresponding relation table comprises a plurality of preset voltage values and electric quantity information corresponding to each voltage value; each electric quantity information describes the percentage of the residual capacity of the battery in the total capacity of the battery; and determining the electric quantity information corresponding to the target voltage value in the preset corresponding relation table as the current residual electric quantity of the battery.
Optionally, the current voltage value is one; the sum of the number of the current voltage values and the number of the historical voltage values is a preset number; the numerical value corresponding to the preset number is in a preset third range.
The apparatus of the embodiment of the present application may execute the method provided by the embodiment of the present application, and the implementation principle is similar, the actions executed by the modules in the apparatus of the embodiments of the present application correspond to the steps in the method of the embodiments of the present application, and for the detailed functional description of the modules of the apparatus, reference may be specifically made to the description in the corresponding method shown in the foregoing, and details are not repeated here.
In an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, where the processor executes the computer program to implement the steps of a method for determining a battery power, and compared with the related art, the steps of: and more accurate electric quantity information is obtained.
In an alternative embodiment, an electronic device is provided, as shown in fig. 4, the electronic device 4000 shown in fig. 4 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, and the transceiver 4004 may be used for data interaction between the electronic device and other electronic devices, such as data transmission and/or data reception. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 4, but that does not indicate only one bus or one type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium, other magnetic storage devices, or any other medium that can be used to carry or store a computer program and that can be Read by a computer, without limitation.
The memory 4003 is used for storing computer programs for executing the embodiments of the present application, and execution is controlled by the processor 4001. The processor 4001 is used to execute computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: smart locks, cell phones, tablet computers, and the like.
Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when being executed by a processor, the computer program may implement the steps and corresponding contents of the foregoing method embodiments.
Embodiments of the present application further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps and corresponding contents of the foregoing method embodiments can be implemented.
The terms "first," "second," "third," "fourth," "1," "2," and the like in the description and in the claims of the present application and in the above-described drawings (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in other sequences than described or illustrated herein.
It should be understood that, although each operation step is indicated by an arrow in the flowchart of the embodiment of the present application, the implementation order of the steps is not limited to the order indicated by the arrow. In some implementation scenarios of the embodiments of the present application, the implementation steps in the flowcharts may be performed in other sequences as desired, unless explicitly stated otherwise herein. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on an actual implementation scenario. Some or all of these sub-steps or stages may be performed at the same time, or each of these sub-steps or stages may be performed at different times, respectively. Under the scenario that the execution time is different, the execution sequence of the sub-steps or phases may be flexibly configured according to the requirement, which is not limited in the embodiment of the present application.
The foregoing is only an optional implementation manner of a part of implementation scenarios in the present application, and it should be noted that, for those skilled in the art, other similar implementation means based on the technical idea of the present application are also within the protection scope of the embodiments of the present application without departing from the technical idea of the present application.

Claims (10)

1. A method of determining battery charge, the method comprising:
acquiring a current voltage value of a battery at the current moment, and calculating a historical voltage average value of the battery at a plurality of historical moments; the current time and the plurality of historical times have a continuous relation;
determining respective corresponding weight values of the current voltage value and the historical voltage mean value according to the current voltage value;
and determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage mean value and respective corresponding weight values, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment.
2. The method according to claim 1, wherein the determining a weight value corresponding to the current voltage value according to the current voltage value comprises:
determining a first parameter based on the current voltage value and a target voltage value of the battery at a previous time; the target voltage value of the battery at the previous moment corresponds to the residual capacity at the previous moment;
acquiring a second parameter from a preset first range;
and performing power operation by using the first parameter as an exponent and the second parameter as a base number, and determining an operation result as a weight value corresponding to the current voltage value.
3. The method of claim 2, wherein determining a first parameter based on the current voltage value and a target voltage value of the battery at a previous time comprises:
calculating an absolute value of a difference between the current voltage value and a target voltage value at the previous time;
acquiring a third parameter from a preset second range;
determining a ratio of the absolute value to the third parameter, and determining the first parameter based on the ratio and a preset value;
and if the ratio is larger than a preset value, setting the ratio as the preset value.
4. The method of claim 1, wherein determining the target voltage value of the battery at the current time according to the current voltage value, the historical voltage average value, and the respective weight value comprises:
and carrying out weighted calculation on the current voltage value and the historical voltage average value based on respective corresponding weight values to obtain a target voltage value of the battery at the current moment.
5. The method of claim 1, wherein determining the remaining capacity of the battery at the current time based on the target voltage value at the current time comprises:
acquiring a preset corresponding relation table; the corresponding relation table comprises a plurality of preset voltage values and electric quantity information corresponding to each voltage value; each electric quantity information is used for describing the percentage of the residual capacity of the battery to the total capacity of the battery;
and determining the electric quantity information corresponding to the target voltage value in the preset corresponding relation table as the current residual electric quantity of the battery.
6. The method of claim 1, wherein the current voltage value is one; the sum of the number of the current voltage values and the number of the historical voltage values is a preset number; the numerical value corresponding to the preset number is in a preset third range; each historical voltage value corresponds to one historical time.
7. A method for detecting the electric quantity of an intelligent lock battery is characterized by being realized by applying the method of any one of claims 1 to 6.
8. An apparatus for determining battery charge, the apparatus comprising:
the acquisition module is used for acquiring the current voltage value of the battery at the current moment and calculating the historical voltage mean value of the battery at a plurality of historical moments; the current time and the plurality of historical times have a continuous relation;
the first determining module is used for determining the weight values corresponding to the current voltage value and the historical voltage mean value according to the current voltage value;
and the second determining module is used for determining a target voltage value of the battery at the current moment according to the current voltage value, the historical voltage average value and the corresponding weight value, and determining the residual capacity of the battery at the current moment according to the target voltage value at the current moment.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory, wherein the processor executes the computer program to perform the steps of the method of any of claims 1-6.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN202211273016.0A 2022-10-18 2022-10-18 Method, apparatus, device, medium and program product for determining battery charge Active CN115343641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211273016.0A CN115343641B (en) 2022-10-18 2022-10-18 Method, apparatus, device, medium and program product for determining battery charge

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211273016.0A CN115343641B (en) 2022-10-18 2022-10-18 Method, apparatus, device, medium and program product for determining battery charge

Publications (2)

Publication Number Publication Date
CN115343641A true CN115343641A (en) 2022-11-15
CN115343641B CN115343641B (en) 2023-05-26

Family

ID=83957153

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211273016.0A Active CN115343641B (en) 2022-10-18 2022-10-18 Method, apparatus, device, medium and program product for determining battery charge

Country Status (1)

Country Link
CN (1) CN115343641B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006217688A (en) * 2005-02-01 2006-08-17 Chugoku Electric Power Co Inc:The Instantaneous voltage drop compensation device
US20060259293A1 (en) * 2005-05-11 2006-11-16 France Telecom Computerized method and apparatus for automatically generating a natural language description of a person's activities
CN101126796A (en) * 2007-10-12 2008-02-20 深圳华为通信技术有限公司 Battery electric quantity detecting method and device
CN102739845A (en) * 2011-04-11 2012-10-17 国基电子(上海)有限公司 Electronic device capable of detecting battery power and battery power detection method
CN106093780A (en) * 2016-05-31 2016-11-09 青岛海信移动通信技术股份有限公司 A kind of terminal residual electricity determines method and terminal
CN107554330A (en) * 2017-08-25 2018-01-09 四川现代汽车有限公司 A kind of batteries of electric automobile energy management method
CN108549029A (en) * 2018-01-19 2018-09-18 昆山国显光电有限公司 Detection method, device and the terminal of battery capacity
CN109375107A (en) * 2018-11-19 2019-02-22 北京现代汽车有限公司 Battery dump energy detection method and device
CN110579712A (en) * 2019-10-14 2019-12-17 北京云迹科技有限公司 Electric quantity display method and device and electronic equipment
CN110716142A (en) * 2019-10-16 2020-01-21 蔚复来(浙江)科技股份有限公司 Low-power-consumption battery electric quantity detection method
CN110850313A (en) * 2019-11-14 2020-02-28 宁波德晶元科技有限公司 Lithium battery charging and discharging electric quantity display method and system
CN111142031A (en) * 2019-12-30 2020-05-12 深圳移航通信技术有限公司 Battery capacity updating method and equipment
CN112748347A (en) * 2020-12-30 2021-05-04 北京二郎神科技有限公司 Battery electric quantity obtaining method and device, storage medium and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006217688A (en) * 2005-02-01 2006-08-17 Chugoku Electric Power Co Inc:The Instantaneous voltage drop compensation device
US20060259293A1 (en) * 2005-05-11 2006-11-16 France Telecom Computerized method and apparatus for automatically generating a natural language description of a person's activities
CN101126796A (en) * 2007-10-12 2008-02-20 深圳华为通信技术有限公司 Battery electric quantity detecting method and device
CN102739845A (en) * 2011-04-11 2012-10-17 国基电子(上海)有限公司 Electronic device capable of detecting battery power and battery power detection method
CN106093780A (en) * 2016-05-31 2016-11-09 青岛海信移动通信技术股份有限公司 A kind of terminal residual electricity determines method and terminal
CN107554330A (en) * 2017-08-25 2018-01-09 四川现代汽车有限公司 A kind of batteries of electric automobile energy management method
CN108549029A (en) * 2018-01-19 2018-09-18 昆山国显光电有限公司 Detection method, device and the terminal of battery capacity
CN109375107A (en) * 2018-11-19 2019-02-22 北京现代汽车有限公司 Battery dump energy detection method and device
CN110579712A (en) * 2019-10-14 2019-12-17 北京云迹科技有限公司 Electric quantity display method and device and electronic equipment
CN110716142A (en) * 2019-10-16 2020-01-21 蔚复来(浙江)科技股份有限公司 Low-power-consumption battery electric quantity detection method
CN110850313A (en) * 2019-11-14 2020-02-28 宁波德晶元科技有限公司 Lithium battery charging and discharging electric quantity display method and system
CN111142031A (en) * 2019-12-30 2020-05-12 深圳移航通信技术有限公司 Battery capacity updating method and equipment
CN112748347A (en) * 2020-12-30 2021-05-04 北京二郎神科技有限公司 Battery electric quantity obtaining method and device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN115343641B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN108957337A (en) Determination method, apparatus, storage medium and the electronic equipment of cell health state
CN111490304B (en) Battery equalization enabling method and device, storage medium and battery pack
CN101206246A (en) Method for preestimating battery residual capacity
CN111983495A (en) Battery pack health degree determination method and related device
CN113466716A (en) Battery health state measuring and calculating method and related equipment
CN101900793B (en) Battery discharge residual time estimating method
CN105607006A (en) Battery capacity determination method, system and terminal thereof
CN112098712B (en) Method for preventing fraudulent use of electricity
WO2012038579A1 (en) Providing power to a component
CN112858938A (en) Electric quantity calculation method and device, storage medium and electronic equipment
CN115754779A (en) Power management method, device, chip and storage medium
US20210215763A1 (en) Method for improving accuracy of capacity measurement
CN115343641A (en) Method, apparatus, device, medium and program product for determining battery level
CN115219930B (en) Vehicle storage battery aging early warning method and device, electronic equipment and storage medium
CN114089197A (en) Door lock monitoring method and device, electronic equipment and storage medium
CN110646738A (en) Power battery SOC obtaining method and system and related components
CN114994558A (en) Battery life detection method, terminal device and computer-readable storage medium
CN115714437A (en) Method and device for displaying charging capacity of battery, electric terminal and storage medium
CN110133365B (en) Method and device for detecting switching event of load
CN111970164A (en) System, method, device, terminal and storage medium for detecting state of communication module
CN114563615B (en) Whole vehicle dark current measurement method, system, vehicle and storage medium
US20210247453A1 (en) Methods, systems, and devices for charging advanced sealed lead acid batteries
CN116990695A (en) State of charge correction method, device, equipment and storage medium
CN118073688A (en) State of charge determination method, apparatus, electronic device, medium, and program product
CN114295993B (en) Battery SOC determination method and device, vehicle 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