A kind of electricity calibration method and device
Technical field
The present invention relates to battery technology fields, and in particular to a kind of electricity calibration method and device.
Background technique
Button cell is widely applied in many electronic toys, wrist-watch and some decoration commodity because its is small in size.But
Be button cell in the operating condition, due to the fluctuation up and down of voltage data, accurate electricity data can not be obtained.Even sometimes
Electricity data is waited because button cell is in certain state and can float up and down acutely, causes user to take for button cell and has damaged
It is bad, it directly throws away and causes the unnecessary wasting of resources.
Summary of the invention
The purpose of the present invention is to provide a kind of electricity calibration method and devices, existing since battery is working to solve
Voltage data fluctuation leads to the problem of button cell electricity display inaccuracy under state.
To achieve the above object, technical solution of the present invention provides a kind of electricity calibration method, the electricity calibration method
Include:
The battery capacity data of i-th group of preset group number are obtained, wherein the battery capacity data of preset group number are periodically
Acquisition;
When in the battery capacity data of i-th group of preset group number and the battery capacity data of (i-1)-th group of preset group number
When difference between maximum value and minimum value is less than the first preset threshold, the battery capacity data of i-th group of preset group number are determined
Subject to valid data group;
The battery capacity data of i-th group of preset group number are pre-processed, the first data are obtained;
When determining the absolute difference between the first data and the second data less than the second preset threshold, the first number is determined
According to for valid data;
Battery capacity percentage corresponding with the first data is obtained in the preset battery capacity percentage table of comparisons, is made
For the electricity data finally shown, wherein the second data are as follows: pre-processed to the battery capacity data of the preset group number of kth group
The data obtained afterwards, the battery capacity data of the preset group number of kth group are the battery capacity number in the preset group number for obtaining i-th group
The battery capacity data of preset group number acquired in period before, and the battery capacity data of the preset group number of kth group
For the period close to i-th group of preset group number battery capacity data quasi- valid data group, i is just whole more than or equal to 2
Number, k are the positive integer more than or equal to 1, and k is less than i.
The present invention has the advantage that multiple groups battery capacity data are periodically obtained, from each group of battery capacity data
Difference between middle determining maximum value and minimum value, if difference illustrates this group of battery capacity number less than the first preset threshold
The valid data group subject to.Data in alignment valid data group are pre-processed, and the first data are obtained, when determining the first data
And the second difference between data less than the second preset data when, it is determined that the first data are valid data.And this second number
It is obtained according to again by the mode for obtaining the first data, and the second data are to obtain in period before the first data.
Compared by the absolute difference between two data, when determining absolute difference less than the second preset threshold, it is determined that the first data
For valid data.Then battery capacity percentage corresponding with the first data is obtained in the preset battery capacity percentage table of comparisons
Than as final display result.Different battery capacity data are acquired by different cycles, then to battery capacity data into
Row screening, chooses quasi- valid data group, then choose valid data, and absolute difference between valid data and valid data before
It in a certain range just can be with.The process of so many screening, can filter out due to battery it is in running order under, voltage
The case where battery capacity error in data shown caused by the fluctuation up and down of data.The battery capacity data that finishing screen is selected can
Accurately to embody actual battery capacity data.It avoids user and takes for button electricity because the battery capacity of mistake is shown
Pond damage, directly throw away and caused by the unnecessary wasting of resources.
To achieve the above object, technical solution of the present invention provides a kind of electricity calibrating installation, the electricity calibrating installation
Include:
Acquiring unit, the battery capacity data of the preset group number for obtaining i-th group, wherein the battery of institute's preset group number is electric
Amount data periodically acquire;
Processing unit, for working as the battery capacity data of i-th group of preset group number and the battery of (i-1)-th group of preset group number
When the difference between maximum value and minimum value in electricity data is less than the first preset threshold, i-th group of preset group number is determined
Valid data group subject to battery capacity data;
The battery capacity data of i-th group of preset group number are pre-processed, the first data are obtained;
When determining the absolute difference between the first data and the second data less than the second preset threshold, the first number is determined
According to for valid data;
Acquiring unit is also used to, and battery corresponding with the first data is obtained in the preset battery capacity percentage table of comparisons
Electricity percentage, as the electricity data finally shown, wherein the second data are as follows: to the battery electricity of the preset group number of kth group
The data that obtain after amount data are pre-processed, the battery capacity data of the preset group number of kth group are to obtain i-th group default
The battery capacity data of preset group number acquired in period before the battery capacity data of group number, and the preset group of kth group
Several battery capacity data are the period close to the quasi- valid data group of the battery capacity data of i-th group of preset group number, i be greater than
Or the positive integer equal to 2, k are the positive integer more than or equal to 1, k is less than i.
The present invention has the advantage that multiple groups battery capacity data are periodically obtained, from each group of battery capacity data
Difference between middle determining maximum value and minimum value, if difference illustrates this group of battery capacity number less than the first preset threshold
The valid data group subject to.Data in alignment valid data group are pre-processed, and the first data are obtained, when determining the first data
And the second difference between data less than the second preset data when, it is determined that the first data are valid data.And this second number
It is obtained according to again by the mode for obtaining the first data, and the second data are to obtain in period before the first data.
Compared by the absolute difference between two data, when determining absolute difference less than the second preset threshold, it is determined that the first data
For valid data.Then battery capacity percentage corresponding with the first data is obtained in the preset battery capacity percentage table of comparisons
Than as final display result.Different battery capacity data are acquired by different cycles, then to battery capacity data into
Row screening, chooses quasi- valid data group, then choose valid data, and absolute difference between valid data and valid data before
It in a certain range just can be with.The process of so many screening, can filter out due to battery it is in running order under, voltage
The case where battery capacity error in data shown caused by the fluctuation up and down of data.The battery capacity data that finishing screen is selected can
Accurately to embody actual battery capacity data.It avoids user and takes for button electricity because the battery capacity of mistake is shown
Pond damage, directly throw away and caused by the unnecessary wasting of resources.
Detailed description of the invention
Fig. 1 is a kind of electricity calibration method flow diagram provided in an embodiment of the present invention;
Fig. 2 is a kind of electricity calibrating installation structural schematic diagram provided in an embodiment of the present invention.
Specific embodiment
The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention..
Embodiment 1
The embodiment of the present invention 1 provides a kind of electricity calibration method flow diagram.Specifically as shown in Figure 1, this method can
To include:
Step 110, the battery capacity data of i-th group of preset group number are obtained.
Specifically, electric quantity collector can periodically acquire each group of data.For example, 5 minutes all greatly as one
Phase acquired one group of data within 5 minutes, this group of data include 5 data, i.e., each minute acquisition one-shot battery electricity number altogether
According to.The data of one group of 5 battery capacity of acquisition in 5 minutes.Then 5 data that electric quantity collector organizes this upload client.
And client obtains this group of data.
Step 120, when the battery capacity of the battery capacity data of i-th group of preset group number and (i-1)-th group of preset group number
When the difference between maximum value and minimum value in data is less than the first preset threshold, the battery of i-th group of preset group number is determined
Valid data group subject to electricity data.
Specifically, electric quantity collector is due to being every the data of upload in 5 minutes.Preset group number is exactly 5 data.And
Electric quantity collector is likely to be at working condition or sleep state within this 5 minutes.Once it is in running order,
This group of data may float up and down larger, i.e., can wherein have invalid data.For example, first minute electricity within 5 minutes
80%, second minute electricity 20%, third minute electricity 50%, four minutes electricity 60%, the 5th minute electricity 10%.It is practical
On, this group of data are exactly invalid data.And specifically differentiate one group of data whether subject to valid data group, i.e. between five data on
Lower floating is in scheduled preset range.It just needs to take corresponding identification tactic.And the differentiation taken in present specification
Strategy is are as follows:
Maximum in the battery capacity data of battery capacity data and (i-1)-th group of preset group number in i-th group of data
Difference between value and minimum value is less than the first preset threshold (such as 15%), it is determined that the battery electricity of i-th group of preset group number
Measure valid data group subject to data.That is, client is to count primary quasi- valid data group every 10 minutes.
Determine that valid data group is only the first step subject to a certain group of data, it is also necessary to subsequent step is executed, it is final true
Fixed battery capacity data to be shown.Specifically include step 130- step 150.
Step 130, the battery capacity data of i-th group of preset group number are pre-processed, obtains the first data.
Optionally, carrying out pretreatment to the battery capacity data of i-th group of preset group number may include:
Remove the maximum value and a minimum value in the battery capacity data of i-th group of preset group number, then obtains
Peak value in the battery capacity data of remaining set number is as the first data.
It is of course also possible to obtain by other means, such as the average value of the battery capacity data of preset group number is obtained, made
For the first data.
Step 140, when determining the absolute difference between the first data and the second data less than the second preset threshold, really
Fixed first data are valid data.
Specifically, the second data are as follows: the number obtained after being pre-processed to the battery capacity data of the preset group number of kth group
According to the battery capacity data of the preset group number of kth group are before obtaining i-th group of the battery capacity data of preset group number
The battery capacity data of preset group number acquired in period, and the battery capacity data of the preset group number of kth group be the period close to
The quasi- valid data group of the battery capacity data of i-th group of preset group number, i are positive integer more than or equal to 2, k be greater than
Or the positive integer equal to 1, k are less than i.
That is, client does primary screening, filters out standard after each group of data for receiving electric quantity collector upload
Valid data group.In a specific example, such as the data that second period uploads can be used as standard effectively after screening
Data group, the data that the period 3 uploads are determined as invalid data group after screening, and the data that the 4th period uploads are passed through
Valid data group subject to being determined after screening.It is possible to which the data that second period uploads to be interpreted as to the preset group number of kth group
Battery capacity data, and the 4th period upload data be interpreted as i-th group preset group number battery capacity data.Kth
The battery capacity data of the preset group number of group and the battery capacity data of i-th group of preset group number are period adjacent quasi- significant figure
According to group.That is, period here close to the period as the second period and third period for being not ordinary meaning close to, and
It is to say in multiple quasi- valid data groups, only adjacent two quasi- valid data groups corresponding period.Wherein, i can be opens from 2
The positive integer of beginning value, k can be the value positive integer since 1, and k is less than i.Certainly, from the battery of the preset group number of kth group
The process that the second data are obtained in electricity data is similar with the process of the first data is obtained, and which is not described herein again.
After getting the first data and the second data in valid data group, it is also necessary to judge the first data and the second data
Between absolute difference down payment less than the second preset threshold (such as 10%), and this process, it can be understood as secondary sieve
Select process.In stable state when seeking to further determine that the display of battery capacity, stabilization here is that is battery is electric
Amount is just in normal consumption, rather than fluctuation is very big because certain state leads to battery capacity.
If difference between the two illustrates that the first data are valid data really really less than the second preset threshold.
Step 150 can be executed.
Step 150, battery capacity hundred corresponding with the first data is obtained in the preset battery capacity percentage table of comparisons
Divide ratio, as the electricity data finally shown.
The preset battery capacity percentage table of comparisons is as follows, which is only the ginseng obtained according to experimental data
Examine table.Those skilled in the art can be adaptively adjusted according to the actual situation, which, can not just for the sake of helping reader to understand
As the standard actually executed.
Serial number |
Practical charge value |
Display scale |
1 |
100% |
100% |
2 |
99%~90% |
90% |
3 |
89%~81% |
80% |
4 |
80%~72% |
70% |
5 |
71%~64% |
60% |
6 |
63%~56% |
50% |
7 |
55%-48% |
40% |
8 |
47%-39% |
30% |
9 |
38%-30% |
20% |
10 |
29%-20% |
10% |
11 |
19%-0% |
5% |
Table 1
In above-mentioned implementation process, default i is from 2 values.In fact, also, there is a special case.It is exactly when first
When period acquires the battery capacity data of preset group number, without reference to foundation, so the default of period 1 acquisition can not be determined
Group number battery capacity data whether subject to valid data, can only default the period 1 acquisition preset group number battery capacity
Valid data group subject to data.The battery capacity data of 1st group of preset group number are pre-processed, will after obtaining third data
Third data are as the valid data obtained for the first time.
Here the process for obtaining third data is similar with the first data, the process of the second data is obtained, and repeats no more.
It is further alternative, after step 150, can also include:
The data of the final display electricity of preset times are counted, preset times here are, for example, 5 times.That is, such as
The data of fruit 5 minutes as a cycle acquisition, and subsequent is really with 10 minutes for a week when judge quasi- valid data group
Phase.Therefore, it is a cycle that subsequent process, which is at least all 10 minutes, then if preset times are 5 times, really 50 minutes
It is recycled for one.
When the number that charge value is 0 in the data of the final display electricity of preset times be more than or equal to twice, and
When number of the charge value less than or equal to 80% is less than or equal to 2 times, display electricity is low battery and issues warning information.
Alternatively, when the number that charge value is 0 in the data of the final display electricity of preset times is 0 time, and charge value is big
It is more than or equal to 2 times in or equal to 30% number, electricity is shown that state from low battery is switched to normal power supply state.
A kind of electricity calibration method provided in an embodiment of the present invention periodically obtains multiple groups battery capacity data, from every
The difference between maximum value and minimum value is determined in one group of battery capacity data, if difference is said less than the first preset threshold
Valid data group subject to bright this group of battery capacity data.Data in alignment valid data group are pre-processed, and the first number is obtained
According to when determining the difference between the first data and the second data less than the second preset data, it is determined that the first data are effective
Data.And what this second data was obtained again by the mode for obtaining the first data, and the second data are in the first data
What the period before obtained.Compared by the absolute difference between two data, determines absolute difference less than the second preset threshold
When, it is determined that the first data are valid data.Then it is obtained and the first data in the preset battery capacity percentage table of comparisons
Corresponding battery capacity percentage, as final display result.Different battery capacity data are acquired by different cycles, so
Battery capacity data are screened afterwards, choose quasi- valid data group, then choose valid data, and valid data and having before
Imitating absolute difference between data in a certain range just can be with.The process of so many screening can be filtered out due to battery
Under in running order, voltage data up and down fluctuate caused by show battery capacity error in data the case where.Finishing screen
The battery capacity data selected can accurately embody actual battery capacity data.User is avoided because the battery of mistake is electric
Amount display and take for button cell damage, directly throw away and caused by the unnecessary wasting of resources.
Embodiment 2
It is corresponding with embodiment 1, the embodiment of the invention also provides a kind of electricity calibrating installation, it is specific as shown in Fig. 2,
The device includes: acquiring unit 201 and processing unit 202.
Acquiring unit 201, the battery capacity data of the preset group number for obtaining i-th group, the wherein electricity of institute's preset group number
Pond electricity data periodically acquires;
Processing unit 202, for the battery capacity data and (i-1)-th group of preset group number when i-th group of preset group number
When the difference between maximum value and minimum value in battery capacity data is less than the first preset threshold, i-th group of preset group is determined
Valid data group subject to several battery capacity data;
The battery capacity data of i-th group of preset group number are pre-processed, the first data are obtained;
When determining the absolute difference between the first data and the second data less than the second preset threshold, the first number is determined
According to for valid data;
Acquiring unit 201 is also used to, and is obtained in the preset battery capacity percentage table of comparisons corresponding with the first data
Battery capacity percentage, as the electricity data finally shown, wherein the second data are as follows: to the electricity of the preset group number of kth group
The data that pond electricity data obtains after being pre-processed, the battery capacity data of the preset group number of kth group are to obtain i-th group
The battery capacity data of preset group number acquired in period before the battery capacity data of preset group number, and kth group is pre-
If the battery capacity data for organizing number are the period close to the quasi- valid data group of the battery capacity data of i-th group of preset group number, i is
Positive integer more than or equal to 2, k are the positive integer more than or equal to 1, and k is less than i.
Optionally, processing unit 202 is also used to, and the battery capacity data that definition obtains the 1st group of preset group number are for the first time
The quasi- valid data group obtained, and the battery capacity data of the 1st group of preset group number are pre-processed, obtain third data
Afterwards, using third data as the valid data obtained for the first time.
Optionally, processing unit 202 is specifically used for:
Remove the maximum value and a minimum value in the battery capacity data of preset group number;
The peak value in the battery capacity data of remaining set number is chosen as the first data;
Wherein, quasi- valid data group is i-th group of data or kth group data.
Optionally, device further include: statistic unit 203, the data of the final display electricity for counting preset times;
Display unit 204, for when preset times final display electricity data in charge value be 0 number be greater than
Or be equal to twice, and charge value less than or equal to 80% number be less than or equal to 2 times when, display electricity be low battery
And issue warning information.
Optionally, display unit 204 is also used to, when charge value is 0 in the data of the final display electricity of preset times
Number is 0 time, and number of the charge value more than or equal to 30% is more than or equal to 2 times, shows state from low electricity electricity
Amount is switched to normal power supply state.
Function performed by each component is in above-described embodiment 1 in electricity calibrating installation provided in an embodiment of the present invention
It has been described in detail, therefore is not described in detail here.
A kind of electricity calibrating installation provided in an embodiment of the present invention periodically obtains multiple groups battery capacity data, from every
The difference between maximum value and minimum value is determined in one group of battery capacity data, if difference is said less than the first preset threshold
Valid data group subject to bright this group of battery capacity data.Data in alignment valid data group are pre-processed, and the first number is obtained
According to when determining the difference between the first data and the second data less than the second preset data, it is determined that the first data are effective
Data.And what this second data was obtained again by the mode for obtaining the first data, and the second data are in the first data
What the period before obtained.Compared by the absolute difference between two data, determines absolute difference less than the second preset threshold
When, it is determined that the first data are valid data.Then it is obtained and the first data in the preset battery capacity percentage table of comparisons
Corresponding battery capacity percentage, as final display result.Different battery capacity data are acquired by different cycles, so
Battery capacity data are screened afterwards, choose quasi- valid data group, then choose valid data, and valid data and having before
Imitating absolute difference between data in a certain range just can be with.The process of so many screening can be filtered out due to battery
Under in running order, voltage data up and down fluctuate caused by show battery capacity error in data the case where.Finishing screen
The battery capacity data selected can accurately embody actual battery capacity data.User is avoided because the battery of mistake is electric
Amount display and take for button cell damage, directly throw away and caused by the unnecessary wasting of resources.
Embodiment 3
In addition, being stored thereon with computer program the embodiment of the invention also provides a kind of computer readable storage medium
Instruction, realizes the method and step of above-described embodiment 1 when the program instruction is by client executing.
Although above having used general explanation and specific embodiment, the present invention is described in detail, at this
On the basis of invention, it can be made some modifications or improvements, this will be apparent to those skilled in the art.Therefore,
These modifications or improvements without departing from theon the basis of the spirit of the present invention are fallen within the scope of the claimed invention.