Disclosure of Invention
Aiming at the defects existing in the prior art, the invention aims to provide a sectional type electric quantity detection method based on a detachable battery, which aims to solve the problem of low battery analysis efficiency.
In order to achieve the above purpose, the invention is realized by the following technical scheme that the sectional type electric quantity detection method based on the detachable battery comprises the following steps:
step S1, acquiring capacity, charging power, charging voltage, charging current, discharging power and open voltage of a battery to be detected, and obtaining battery data;
step S2, charging the electroless battery, and recording current change, voltage change and charging time length of the battery in the charging process to obtain charging data;
Discharging the full-charge battery, and recording current change, voltage change and discharge duration of the battery in the discharging process to obtain discharge data;
according to the battery data, fitting the charging data and the discharging data by using Kalman filtering to obtain Kalman gain of the battery in the charging process and Kalman gain of the battery in the discharging process;
Step S3, analyzing the power amplification states of the charging and discharging of the single battery according to the Kalman gain of the battery in the charging process and the Kalman gain of the battery in the discharging process to obtain a primary battery report;
And S4, summarizing and feeding back the battery report, and continuously updating the battery data and updating the battery report.
Further, the specific steps of the step S2 are as follows:
S21, recording the capacity of a battery to be detected as rC, the charging power as rP and the discharging power as dP;
step S22, acquiring the charging time of the battery and marking as rt;
Acquiring the actual charging current of the battery in the charging time length, and recording as ir 1、ir2~irrt;
acquiring the actual charging voltage of the battery in the charging time length, and recording the actual charging voltage as ur 1、ur2~urrt;
Wherein ir 1 and ur 1 represent the actual charging current and the actual charging voltage, respectively, corresponding to the 1 st second, ir 2 and ur 2 represent the actual charging current and the actual charging voltage, respectively, corresponding to the 2 nd second, and so on, ir rt and ur rt represent the actual charging current and the actual charging voltage, respectively, corresponding to the rt second;
Ir 1~irrt and ur 1~urrt as charging data;
Step S23, acquiring the discharge time length of the battery, and recording the discharge time length as dt;
acquiring the actual discharge current of the battery within the discharge time length, and recording as id 1、id2~iddt;
Obtaining the actual discharge voltage of the battery within the discharge time length, and recording as ud 1、ud2~uddt;
wherein id 1 and ud 1 respectively represent an actual discharge current and an actual discharge voltage corresponding to the 1 st second, id 2 and ud 2 respectively represent an actual discharge current and an actual discharge voltage corresponding to the 2 nd second, and similarly, id dt and ud dt respectively represent an actual discharge current and an actual discharge voltage corresponding to the dt th second;
Id 1~iddt and ud 1~uddt are used as discharge data;
step S24, the charging voltage is recorded as iU, the charging current is recorded as iI, and the charging data are fitted;
Step S25, the open voltage is recorded as oU, the open current is recorded as oI, and the discharge data are fitted;
And step S26, summarizing the data in the steps S21-S25, and entering the step S3.
Further, the specific steps of the step S24 are as follows:
Step S241, defining a calculation formula a1:
Wherein Qb (i) represents the percentage of the electric quantity of the battery in the ith second in the charging process, the value range of i is 1-rt, ir j represents the actual charging current in the jth second in the charging process, and the value range of j is 1~i;
Substituting ir 1~irrt into a calculation formula a1, and calculating the electric quantity percentages of the 1 st to the rt seconds of the battery in the charging process to obtain Qb (1)、Qb(2)~Qb(rt);
wherein Qb (1) represents the percentage of charge of the battery during charging for 1 second, qb (2) represents the percentage of charge of the battery during charging for 2 seconds, and so on, qb (rt) represents the percentage of charge of the battery during charging for rt seconds;
step S242, defining a calculation formula a2:
Wherein Pbr (i) represents the actual charging power percentage of the ith second of the battery in the charging process, ir i represents the actual charging current of the ith second in the charging process, ur i represents the actual charging voltage of the ith second in the charging process, and the value range of i is 1-rt;
Substituting ir 1~irrt and ur 1~urrt into a calculation formula a2, and calculating the actual charging power percentage of the battery from 1 st to rt seconds in the charging process to obtain Pbr (1)、Pbr(2)~Pbr(rt);
Where Pbr (1) represents the actual charge power percentage of the battery during charging for 1 second, pcr (2) represents the actual charge power percentage of the battery during charging for 2 seconds, and Pcr (rt) represents the actual charge power percentage of the battery during charging for rt seconds;
step 243, summarizing the data in the steps S241-S242, constructing a charging change matrix of the battery, and marking the charging change matrix as a matrix A, wherein the mathematical expression of the matrix A is as follows:
dividing the matrix A according to the time sequence to obtain a matrix A (1), a matrix A (2) -a matrix A (rt);
The 1 st second partition is matrix A (1), and the mathematical expression of matrix A (1) is:
The 2 nd second partition is matrix A (2), and the mathematical expression of matrix A (2) is:
Similarly, the rt second segment is divided into a matrix A (rt), and the mathematical expression of the matrix A (rt) is as follows:
Step S244, calculating the Kalman gain of the battery for 1 second in the charging process by taking the matrix RO as an initial state, and marking the Kalman gain as Krk (1), wherein the mathematical expression of the matrix RO is as follows:
Step S245, calculating the Kalman gain of the battery for 2 seconds in the charging process by taking the matrix A (1) as an initial state, and recording the Kalman gain as Krk (2);
Step S246, repeating the same step of calculation Krk (1)~Krk(2), and calculating the Kalman gain corresponding to the 3 rd to the rt seconds in the charging process to obtain Krk (3)~Krk(rt).
Further, the specific steps of the step S244 are as follows:
Step S2441, calculating a state transition matrix of which the matrix RO is changed into a matrix A (1) and marking the state transition matrix as a matrix A (O-1), wherein the calculation formula of the matrix A (O-1) is as follows:
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
Step S2442, calculating error demonstration of the matrix RO, and recording the error demonstration as a matrix RRO, wherein the mathematical calculation formula of the matrix RRO is as follows:
Wherein-represents matrix subtraction;
The error of the calculated matrix A (1) is exemplified as matrix RA (1), and the mathematical formula of matrix RA (1) is:
The error transition matrix from the matrix RO to the matrix A (1) is calculated and is marked as a matrix QA (1), and the mathematical calculation formula of the matrix QA (1) is as follows:
QA(1)=RA(1)-RRO;
step S2443, calculating an error covariance matrix of the matrix RO, which is denoted as a matrix Pk -(O), and calculating a matrix Pk -(O) by the following formula:
Pk -(O)=(1/4)×(APk-(O) T×APk-(O)), wherein x represents matrix multiplication, T represents transpose of matrix, APk -(O) represents transition matrix of matrix Pk -(O), and APk -(O) has the following formula:
APk -(O) = RO- [ (1/4) ×i×ro ] wherein, -represents matrix subtraction, I represents a1 matrix;
Step S2444, calculating a pre-error covariance matrix of the matrix A (1), which is recorded as a matrix PK (1) -, and calculating a matrix PK (1) - by the following formula:
PK (1) -=A(O-1)×Pk-(O)×(A(O-1))T+QA(1), wherein x represents matrix multiplication, T represents transpose of matrix, and + represents matrix addition;
The calculation formula for calculating the Kalman gain Krk (1) of the battery at 1 second in the charging process is as follows:
further, the specific steps of step S245 are as follows:
Step S2451, calculating a state transition matrix in which the matrix a (1) becomes the matrix a (2), and recording the state transition matrix as a matrix a (1-2);A(1-2), wherein the calculation formula is as follows:
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
Step S2452, obtaining an error proof matrix RA (1) of the matrix A (1);
The error of the calculated matrix A (2) is exemplified as matrix RA (2), and the mathematical formula of matrix RA (2) is:
Wherein-represents matrix subtraction;
The error transition matrix from matrix A (1) to matrix A (2) is calculated and is marked as matrix QA (2), and the mathematical calculation formula of matrix QA (2) is as follows:
QA(2)=RA(2)-RA(1);
Step S2453, calculating an error covariance matrix of RA (1), which is recorded as a matrix Pk -(1), and calculating a matrix Pk -(1) by the following formula:
Pk -(1)=(1/4)×(APk-(1) T×APk-(1)), wherein x represents matrix multiplication, T represents a transpose of the matrix, APk -(1) represents a transition matrix of the matrix Pk -(1), and the calculation formula of the matrix APk -(1) is:
APk -(1)=A(1)-[(1/4)×I×A(1) ], wherein, -represents matrix subtraction, I represents a1 matrix;
Step S2454, calculating a pre-error covariance matrix of the matrix a (2), denoted as a matrix PK (2) -, and calculating a matrix PK (2) - by:
PK (1) -=A(1-2)×Pk-(1)×(A(1-2))T+QA(2), wherein x represents matrix multiplication, T represents transpose of matrix, and + represents matrix addition;
The calculation formula for calculating the Kalman gain Krk (2) of the battery for the 2 nd second in the charging process is as follows:
Further, the specific steps of the step S25 are as follows:
step S251, defining a calculation formula a3:
Wherein Yb (i) represents the percentage of the residual electric quantity of the battery in the ith second in the discharging process, the value range of i is 1-rt, id j represents the actual charging current in the jth second in the charging process, and the value range of j is 1~i;
Substituting id 1~iddt into a calculation formula a3, and calculating the electric quantity percentages of the 1 st to ddt th seconds of the battery in the charging process to obtain Yb (1)、Yb(2)~Yb(dt);
Wherein Yb (1) represents the percentage of the electric quantity of the battery in the 1 st second in the discharging process, yb (2) represents the percentage of the residual electric quantity of the battery in the 2 nd second in the discharging process, and similarly Yb (dt) represents the percentage of the residual electric quantity of the battery in the dt th second in the discharging process;
step S252, defining a calculation formula a4:
Wherein Pbd (i) represents the actual charging power percentage of the ith second of the battery in the charging process, id i represents the actual charging current of the ith second in the charging process, ud i represents the actual charging voltage of the ith second in the charging process, and the value range of i is 1-dt;
Substituting id 1~iddt and ud 1~uddt into a calculation formula a4, and calculating the actual charging power percentages of the 1 st to dt th seconds of the battery in the charging process to obtain Pbd (1)、Pbd(2)~Pbd(dt);
Where Pbd (1) represents the actual charge power percentage of the battery during charging for 1 second, pbd (2) represents the actual charge power percentage of the battery during charging for 2 seconds, and Pbd (dt) represents the actual charge power percentage of the battery during charging for dt seconds;
step 253, summarizing the data in the steps 251-252, and constructing a charging change matrix of the battery, wherein the charging change matrix is marked as a matrix B, and the mathematical expression of the matrix B is as follows:
Dividing the matrix B according to the time sequence to obtain a matrix B (1), a matrix B (2) -a matrix B (dt);
The 1 st second partition is matrix B (1), and the mathematical expression of matrix B (1) is:
the 2 nd second partition is matrix B (2), and the mathematical expression of matrix B (2) is:
similarly, the dt th second is divided into a matrix B (dt), and the mathematical expression of the matrix B (dt) is as follows:
step S254, calculating Kalman gain of the battery for 1 second by taking the matrix DO as an initial state, and marking the Kalman gain as Kdk (1), wherein the mathematical expression of the matrix DO is as follows:
Step S255, repeating the same step of calculation Kdk (1), and calculating the Kalman gain corresponding to the 2 nd to the rt second in the discharging process to obtain Kdk (2)~Kdk(dt).
Further, the specific steps of the step S254 are as follows:
In step S2541, the state transition matrix, in which the calculated matrix DO becomes the matrix B (1), is denoted as a matrix B (O-1), and the calculated formula of the matrix B (O-1) is as follows:
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
step S2542, calculating error evidence of the matrix DO, and recording the error evidence as a matrix RBO, wherein the mathematical calculation formula of the matrix RBO is as follows:
Wherein-represents matrix subtraction;
The error of the calculated matrix B (1) is identified as matrix RB (1), and the mathematical formula of matrix RB (1) is:
The error transition matrix from the matrix DO to the matrix B (1) is calculated and is marked as a matrix QB (1), and the mathematical calculation formula of the matrix QB (1) is as follows:
QB(1)=RB(1)-RBO;
Step S2543, calculating an error covariance matrix of the matrix DO, which is recorded as a matrix Pd -(O), and calculating a matrix Pd -(O) by the following formula:
Pd -(O)=(1/4)×(APd-(O) T×APd-(O)), wherein x represents matrix multiplication, T represents a transpose of the matrix, APd -(O) represents a transition matrix of the matrix Pd -(O), and APd -(O) has a formula:
APk -(O) = DO- [ (1/4) ×i×do ] wherein, -represents matrix subtraction, I represents a1 matrix;
Step S2544, calculating a pre-error covariance matrix of the matrix B (1), and recording as a calculation formula of the PD (1) -;PD(1) - as follows:
PD (1) -=B(O-1)×PD-(O)×(B(O-1))T+QB(1), wherein x represents matrix multiplication, T represents transposition of a matrix, and +represents matrix addition;
the calculation formula for calculating the Kalman gain Kdk (1) of the battery at 1 second in the discharging process is as follows:
Further, the specific steps of the step S3 are as follows:
S31, analyzing the power amplification state of the battery in the charging process according to the Kalman gain of the battery in the charging process;
defining a relation b1-1, [ Krk (i)-Krk(i-1)]×[Krk(i-1)-Krk(i-2) ] >0;
The relation b1-2 is [ Krk (i)-Krk(i-1)]×[Krk(i+1)-Krk(i) ] <0;
the relation b1-3 is [ Krk (i+1)-Krk(i)]×[Krk(i+2)-Krk(i+1) ] >0;
Wherein Krk (i) represents the Kalman gain corresponding to the ith second in the battery charging process, krk (i+1) represents the Kalman gain corresponding to the (i+1) th second in the battery charging process, krk (i-2) represents the Kalman gain corresponding to the (i-2) th second in the battery charging process, i has a value range of 1-rt, and rt represents the charging time of the battery;
substituting Kalman gain Krk (1)~Krk(rt) in the battery charging process into the relational expressions b1-1 to b1-3, extracting Kalman gain which simultaneously satisfies the relational expressions b1-1 to b1-3 as charging outage;
Step S32, extracting the time corresponding to the 1 st charging breakpoint, and recording the time as rrt (1);
Extracting the time corresponding to the 2 nd charging breakpoint, and recording the time as rrt (2);
And by analogy, extracting the time corresponding to the dr-th charging breakpoint, and recording the time as rrt (dr);
Wherein rrt (1)~rrt(dr) satisfies rrt (1)<rrt(2)<~<rrt(dr) < rt;
taking 1 to rrt (1) seconds as a 1 st charging time period, and analyzing the power amplification state of the battery from the beginning of charging to a 1 st charging breakpoint;
Step S33, taking rrt (1) to rrt (2) seconds as a2 nd charging time period, taking rrt (3) to rrt (3) seconds as a3 rd charging time period, taking rrt (dr-1) to rrt (dr) seconds as a dr charging time period, and taking rrt (dr) to rrt (rt) seconds as a (dr+1) th charging time period;
Repeatedly analyzing the same steps of the power amplification state of the battery in the 1 st charging time period, and analyzing the power amplification state of the battery in the 2 nd to (dr+1) th charging time periods in the charging process;
Step S34, repeatedly analyzing the same step of the power amplification state in the battery charging process, and analyzing the power amplification state in the battery discharging process;
summarizing the power amplification state of the battery in the charging process and the power amplification state of the battery in the discharging process, and taking the power amplification state and the power amplification state as a primary battery report;
Step S35, obtaining the number of all the batteries to be detected and marking as tb, randomly sampling all the batteries to be detected as sample batteries, wherein the number of the sample batteries is marked as bn, and the relation between bn and tb is less than or equal to (tb multiplied by 15 percent);
Repeating the same steps of analyzing the power amplification state of the single battery to obtain the power amplification state of the sample battery;
And according to the power amplification state of the sample battery, weighting and updating the time period division in the primary battery report by using an average function and MATLAB software in a numpy library to obtain the battery report.
Further, the specific steps of the step S32 are as follows:
step S321, obtaining Kalman gain Krk (1) corresponding to the 1 st second in the battery charging process;
acquiring a Kalman gain Krk (rrt(1)) corresponding to the rrt (1) seconds in the battery charging process;
Judging the size of [ Krk (rrt(1))-rrt(1) ], and determining a power amplification equation of the battery in the 1 st charging time period;
step S322, if [ Krk (rrt(1))-rrt(1) ] >0, the battery is in a fast charge state;
acquiring actual charging current, actual charging voltage, electric quantity percentage and actual charging power percentage of a battery in a1 st time period;
sequentially solving a relation equation of the electric quantity percentage of the battery in a quick charge state and the actual charging current by using MATLAB software by taking the electric quantity percentage as an independent variable and the actual charging current, the actual charging voltage and the actual charging power percentage as dependent variables, and recording as fQi 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging voltage is recorded as fQu 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging power percentage is recorded as fQP 1 (Qb);
fQi 1(Qb)、fQu1 (Qb) and fQP 1 (Qb) are used as power amplification equations for rapidly charging the battery in the 1 st charging period;
step 323, if [ Krk (rrt(1))-rrt(1) ] <0, the battery is in the slow charge state;
Repeating the process of fQi 1(Qb)、fQu1 (Qb) and fQP 1 (Qb), and calculating a relation equation of the electric quantity percentage of the battery in the slow charge state and the actual charge current by using MATLAB software, wherein the relation equation is recorded as fQi 1 (Qb');
The relation equation of the electric quantity percentage and the actual charging voltage is recorded as fQu 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging power percentage is recorded as fQP 1 (Qb);
fQi 1(Qb)`、fQu1 (Qb) and fQP 1 (Qb) are used as power amplification equations for the battery to be charged slowly in the 1 st charging time period;
step S324, if [ Krk (rrt(1))-rrt(1) ] =0, the battery is in a stable state;
Calculating the average value of the actual charging current of the battery in the 1 st time period, which is marked as air (1), the average value of the actual charging voltage, which is marked as aur (1), the average value of the electric quantity percentage, which is marked as aQb (1), and the average value of the actual charging power percentage, which is marked as aPbr (1);
Air (1)、aur(1)、aQb(1) and aPbr (1) are used as a power amplification equation for stabilizing the electric quantity of the battery in the 1 st charging period.
Compared with the prior art, the invention has the beneficial effects that:
The method has the advantages that the sectional battery detection is high in accuracy, the battery voltage is divided into a plurality of sections through analyzing the charging and discharging processes of the battery, and then analysis and mathematical modeling are carried out, so that the actual capacity of the battery in each stage can be reflected more accurately, and the accuracy of electric quantity detection is improved.
The battery mathematical modeling method establishes the charge and discharge data model of the battery by acquiring the charge and discharge voltage and current changes of the battery, can dynamically represent the electric quantity and the working state of the battery, and effectively improves the measurement accuracy of the electric quantity.
Simple operation and high efficiency:
The invention can automatically set the equipment parameters measured by the battery according to the factory parameters of the battery, is simple to operate and friendly to practitioners, can complete the charging and discharging process of the battery in real time, can accurately simulate and realize quick detection aiming at the electric quantity change of the battery at each moment, and improves the electric quantity measuring speed of the battery.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, the method for detecting the sectional power based on the detachable battery includes:
it should be noted that, the "battery" in the present invention means "detachable battery";
Step S1, acquiring capacity, (rated) charging power, charging voltage, charging current, (rated) discharging power and open voltage of a battery to be detected, and obtaining battery data;
it should be noted that the "battery to be detected" in the present invention refers to a battery for detecting the battery power by using the present invention (a method for detecting the sectional power based on a detachable battery), the "open voltage" refers to the voltage across the positive and negative electrodes of the battery during the discharging process of the battery, and the "open current" refers to the current generated by the battery during the discharging process of the battery
Step S2, charging the electroless battery by using a charging circuit, and recording current change, voltage change and charging time length of the battery in the charging process to obtain charging data;
Discharging the full-charge battery by using a discharging circuit, and recording current change, voltage change and discharging time length of the battery in the discharging process to obtain discharging data;
according to the battery data, fitting the charging data and the discharging data by using Kalman filtering to obtain Kalman gain of the battery in the charging process and Kalman gain of the battery in the discharging process;
It should be noted that, the "no-power battery" and the "full-power battery" in the present invention are the same battery, that is, the battery is charged first and then discharged;
the specific steps of step S2 are as follows:
Step S21, the capacity of the battery to be detected is recorded as rC, (rated) charging power is recorded as rP, and (rated) discharging power is recorded as dP;
step S22, referring to FIG. 2, a charging circuit is constructed;
disconnecting the external power supply, connecting the electroless battery with the protection resistor in parallel, and connecting the electroless battery with the external power supply to form a charging circuit;
the method comprises the steps that voltmeters V1 are connected to two ends of a non-electric battery, an ammeter A1 is connected to a branch of the non-electric battery, an ammeter A2 is connected to a branch of a resistor R, and an ammeter A3 is connected to a main circuit of a charging circuit;
The ammeter A3 is used for measuring the total current of the charging circuit, the ammeter A1 is used for measuring the current flowing through the battery, the voltmeter V3 is used for measuring the voltage at two ends of the battery in the charging process, the ammeter A2 is used for measuring the current flowing through the protection resistor, and the resistor R represents the protection resistor;
step S23, setting i to represent the total current of the charging circuit, i1 to represent the current flowing through the battery, and i2 to represent the current flowing through the protection resistor;
The voltage and the current of the external power supply are sequentially adjusted to the charging voltage and the charging current, and the external power supply is turned on to charge the electroless battery;
Taking the external power supply as a timing starting point, taking the external power supply as a charging time length of the battery when the external power supply is turned on to i1=0 and i2 is equal to i for the first time, and recording the charging time length as rt (unit: seconds);
Reading the indication of the ammeter A1 in the charging time length as the actual charging current of the battery, and recording as ir 1、ir2~irrt;
Reading the indication of the voltmeter V1 in the charging time length as the actual charging voltage of the battery, and recording as ur 1、ur2~urrt;
Wherein ir 1 and ur 1 represent the actual charging current and the actual charging voltage, respectively, corresponding to the 1 st second, ir 2 and ur 2 represent the actual charging current and the actual charging voltage, respectively, corresponding to the 2 nd second, and so on, ir rt and ur rt represent the actual charging current and the actual charging voltage, respectively, corresponding to the rt second;
Ir 1~irrt and ur 1~urrt as charging data;
step S24, referring to FIG. 3, a discharge circuit is constructed;
The switch is disconnected, and then the full-charge battery is connected with the switch and the testing machine M in series to form a discharging circuit;
The two ends of the full-charge battery are connected with a voltmeter V2, and the main circuit of the discharging circuit is connected with an ammeter A4;
the voltmeter V2 is used for measuring voltages at two ends of the battery in the discharging process, and the ammeter A4 is used for measuring currents of the discharging circuit;
Let U2 denote the voltage across the battery during discharge, i4 denote the current of the discharge circuit;
Closing a switch to discharge the full-charge battery;
Taking a "closed switch" as a timing starting point, taking the "closed switch" to the time of "i4=0 and u2=0" as the discharge time length of the battery, and taking the discharge time length as dt (unit: seconds);
Reading the indication of the ammeter A4 in the discharge time length as the actual discharge current of the battery, and recording as id 1、id2~iddt;
Reading an indication of the voltmeter V2 in the discharge time length as the actual discharge voltage of the battery, and recording as ud 1、ud2~uddt;
wherein id 1 and ud 1 respectively represent an actual discharge current and an actual discharge voltage corresponding to the 1 st second, id 2 and ud 2 respectively represent an actual discharge current and an actual discharge voltage corresponding to the 2 nd second, and similarly, id dt and ud dt respectively represent an actual discharge current and an actual discharge voltage corresponding to the dt th second;
Id 1~iddt and ud 1~uddt are used as discharge data;
it should be noted that, the "detachable battery" in the present invention is mainly used for mobile phones, so the tester M in the discharging circuit refers to mobile phones;
step S25, the charging voltage is recorded as iU, the charging current is recorded as iI, and the charging data are fitted;
Step S251, defining a calculation formula a1:
Wherein Qb (i) represents the percentage of the electric quantity of the battery in the ith second in the charging process, the value range of i is 1-rt, ir j represents the actual charging current in the jth second in the charging process, and the value range of j is 1~i;
Substituting ir 1~irrt into a calculation formula a1, and calculating the electric quantity percentages of the 1 st to the rt seconds of the battery in the charging process to obtain Qb (1)、Qb(2)~Qb(rt);
wherein Qb (1) represents the percentage of charge of the battery during charging for 1 second, qb (2) represents the percentage of charge of the battery during charging for 2 seconds, and so on, qb (rt) represents the percentage of charge of the battery during charging for rt seconds;
step S252, defining a calculation formula a2:
Wherein Pbr (i) represents the actual charging power percentage of the ith second of the battery in the charging process, ir i represents the actual charging current of the ith second in the charging process, ur i represents the actual charging voltage of the ith second in the charging process, and the value range of i is 1-rt;
Substituting ir 1~irrt and ur 1~urrt into a calculation formula a2, and calculating the actual charging power percentage of the battery from 1 st to rt seconds in the charging process to obtain Pbr (1)、Pbr(2)~Pbr(rt);
Where Pbr (1) represents the actual charge power percentage of the battery during charging for 1 second, pcr (2) represents the actual charge power percentage of the battery during charging for 2 seconds, and Pcr (rt) represents the actual charge power percentage of the battery during charging for rt seconds;
Step 253, summarizing the data in the steps 251-252, and constructing a charging change matrix of the battery, wherein the charging change matrix is recorded as a matrix A, and the mathematical expression of the matrix A is as follows:
dividing the matrix A according to the time sequence to obtain a matrix A (1), a matrix A (2) -a matrix A (rt);
The 1 st second partition is matrix A (1), and the mathematical expression of matrix A (1) is:
The 2 nd second partition is matrix A (2), and the mathematical expression of matrix A (2) is:
Similarly, the rt second segment is divided into a matrix A (rt), and the mathematical expression of the matrix A (rt) is as follows:
Step S254, calculating the Kalman gain of the battery for 1 second in the charging process by taking the matrix RO as an initial state, and marking the Kalman gain as Krk (1), wherein the mathematical expression of the matrix RO is as follows:
in step S2541, the state transition matrix, in which the calculated matrix RO is changed to the matrix A (1), is denoted as the matrix A (O-1), and the calculated formula of the matrix A (O-1) is as follows:
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
step S2542, calculating error evidence of the matrix DO, and recording the error evidence as a matrix RBO, wherein the mathematical calculation formula of the matrix RBO is as follows:
Wherein-represents matrix subtraction;
The error of the calculated matrix A (1) is exemplified as matrix RA (1), and the mathematical formula of matrix RA (1) is:
The error transition matrix from the matrix RO to the matrix A (1) is calculated and is marked as a matrix QA (1), and the mathematical calculation formula of the matrix QA (1) is as follows:
QA(1)=RA(1)-RRO;
step S2543, calculating an error covariance matrix of the matrix RO, which is recorded as a matrix Pk -(O), and calculating a matrix Pk -(O) by the following formula:
Pk -(O)=(1/4)×(APk-(O) T×APk-(O)), wherein x represents matrix multiplication, T represents transpose of matrix, APk -(O) represents transition matrix of matrix Pk -(O), and APk -(O) has the following formula:
APk -(O) = RO- [ (1/4) ×i×ro ]; wherein-represents matrix subtraction, I represents a 1 matrix (i.e. a matrix of 4 rows and 4 columns, each row and column being 1);
Step S2544, calculating a pre-error covariance matrix of the matrix A (1), which is recorded as a matrix PK (1) -, and calculating a matrix PK (1) - by the following formula:
PK (1) -=A(O-1)×Pk-(O)×(A(O-1))T+QA(1), wherein x represents matrix multiplication, T represents transpose of matrix, and + represents matrix addition;
The calculation formula for calculating the Kalman gain Krk (1) of the battery at 1 second in the charging process is as follows:
Step S255, calculating the Kalman gain of the battery for 2 seconds in the charging process by taking the matrix A (1) as an initial state, and recording as Krk (2);
In step S2551, the state transition matrix, in which the calculation matrix A (1) is changed to the matrix A (2), is recorded as the calculation formula of the matrix A (1-2);A(1-2):
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
Step S2552, obtaining an error proof matrix RA (1) of the matrix A (1);
The error of the calculated matrix A (2) is exemplified as matrix RA (2), and the mathematical formula of matrix RA (2) is:
Wherein-represents matrix subtraction;
The error transition matrix from matrix A (1) to matrix A (2) is calculated and is marked as matrix QA (2), and the mathematical calculation formula of matrix QA (2) is as follows:
QA(2)=RA(2)-RA(1);
step S2553, calculating an error covariance matrix of RA (1), which is recorded as a matrix Pk -(1), and calculating a matrix Pk -(1) by the following formula:
Pk -(1)=(1/4)×(APk-(1) T×APk-(1)), wherein x represents matrix multiplication, T represents a transpose of the matrix, APk -(1) represents a transition matrix of the matrix Pk -(1), and the calculation formula of the matrix APk -(1) is:
APk -(1)=A(1)-[(1/4)×I×A(1) ]; wherein-represents a matrix subtraction, I represents a1 matrix (i.e., a matrix of 4 rows and 4 columns, each row and column being 1);
step S2554, calculating a pre-error covariance matrix of the matrix A (2), which is recorded as a matrix PK (2) -, and calculating a matrix PK (2) - by the following formula:
PK (1) -=A(1-2)×Pk-(1)×(A(1-2))T+QA(2), wherein x represents matrix multiplication, T represents transpose of matrix, and + represents matrix addition;
The calculation formula for calculating the Kalman gain Krk (2) of the battery for the 2 nd second in the charging process is as follows:
step S256, repeating the same step of calculation Krk (1)~Krk(2) (namely step S254-step S255), and calculating Kalman gains corresponding to the 3 rd to rt seconds in the charging process to obtain Krk (3)~Krk(rt);
s26, marking an open voltage as oU, marking an open current as oI, and fitting discharge data;
Step S261, defining a calculation formula a3:
Wherein Yb (i) represents the percentage of the residual electric quantity of the battery in the ith second in the discharging process, the value range of i is 1-rt, id j represents the actual charging current in the jth second in the charging process, and the value range of j is 1~i;
Substituting id 1~iddt into a calculation formula a3, and calculating the electric quantity percentages of the 1 st to ddt th seconds of the battery in the charging process to obtain Yb (1)、Yb(2)~Yb(dt);
Wherein Yb (1) represents the percentage of the electric quantity of the battery in the 1 st second in the discharging process, yb (2) represents the percentage of the residual electric quantity of the battery in the 2 nd second in the discharging process, and similarly Yb (dt) represents the percentage of the residual electric quantity of the battery in the dt th second in the discharging process;
Step S262, defining a calculation formula a4:
Wherein Pbd (i) represents the actual charging power percentage of the ith second of the battery in the charging process, id i represents the actual charging current of the ith second in the charging process, ud i represents the actual charging voltage of the ith second in the charging process, and the value range of i is 1-dt;
Substituting id 1~iddt and ud 1~uddt into a calculation formula a4, and calculating the actual charging power percentages of the 1 st to dt th seconds of the battery in the charging process to obtain Pbd (1)、Pbd(2)~Pbd(dt);
Where Pbd (1) represents the actual charge power percentage of the battery during charging for 1 second, pbd (2) represents the actual charge power percentage of the battery during charging for 2 seconds, and Pbd (dt) represents the actual charge power percentage of the battery during charging for dt seconds;
step 263, summarizing the data in the steps 261-262, and constructing a charging change matrix of the battery, wherein the charging change matrix is recorded as a matrix B, and the mathematical expression of the matrix B is as follows:
Dividing the matrix B according to the time sequence to obtain a matrix B (1), a matrix B (2) -a matrix B (dt);
The 1 st second partition is matrix B (1), and the mathematical expression of matrix B (1) is:
the 2 nd second partition is matrix B (2), and the mathematical expression of matrix B (2) is:
similarly, the dt th second is divided into a matrix B (dt), and the mathematical expression of the matrix B (dt) is as follows:
step S264, calculating Kalman gain of the battery for 1 second by taking the matrix DO as an initial state, and marking the Kalman gain as Kdk (1), wherein the mathematical expression of the matrix DO is as follows:
Step S2641, calculating a state transition matrix of which the matrix DO is changed to a matrix B (1) and marking the state transition matrix as a matrix B (O-1), and calculating a matrix B (O-1) by the following calculation formula:
wherein x represents matrix multiplication, T represents a transpose of the matrix, and-1 represents an inverse of the matrix;
Step S2642, calculating error evidence of the matrix DO, namely a matrix RDO, wherein the mathematical calculation formula of the matrix RDO is as follows:
Wherein-represents matrix subtraction;
The error of the calculated matrix B (1) is identified as matrix RB (1), and the mathematical formula of matrix RB (1) is:
The error transition matrix from the matrix DO to the matrix B (1) is calculated and is marked as a matrix QB (1), and the mathematical calculation formula of the matrix QB (1) is as follows:
QB(1)=RB(1)-RBO;
Step S2643, calculating an error covariance matrix of the matrix DO, which is recorded as a matrix Pd -(O), and calculating a matrix Pd -(O) by the following formula:
Pd -(O)=(1/4)×(APd-(O) T×APd-(O)), wherein x represents matrix multiplication, T represents a transpose of the matrix, APd -(O) represents a transition matrix of the matrix Pd -(O), and APd -(O) has a formula:
APk -(O) = DO- [ (1/4) ×i×do ]; wherein, -represents matrix subtraction, I represents a 1 matrix (i.e., a matrix of 4 rows and 4 columns, each row and column being 1);
Step S2644, calculating a pre-error covariance matrix of matrix B (1), denoted as PD (1) -;PD(1) -, by:
PD (1) -=B(O-1)×PD-(O)×(B(O-1))T+QB(1), wherein x represents matrix multiplication, T represents transposition of a matrix, and +represents matrix addition;
the calculation formula for calculating the Kalman gain Kdk (1) of the battery at 1 second in the discharging process is as follows:
Step 265, repeating the same step as the calculation Kdk (1) (i.e. step 264), and calculating the Kalman gains corresponding to the 2 nd to rt seconds in the discharging process to obtain Kdk (2)~Kdk(dt).
Step S3, analyzing the power amplification states of the charging and discharging of the single battery according to the Kalman gain of the battery in the charging process and the Kalman gain of the battery in the discharging process to obtain a primary battery report;
the specific steps of step S3 are as follows:
S31, analyzing the power amplification state of the battery in the charging process according to the Kalman gain of the battery in the charging process;
defining a relation b1-1, [ Krk (i)-Krk(i-1)]×[Krk(i-1)-Krk(i-2) ] >0;
The relation b1-2 is [ Krk (i)-Krk(i-1)]×[Krk(i+1)-Krk(i) ] <0;
the relation b1-3 is [ Krk (i+1)-Krk(i)]×[Krk(i+2)-Krk(i+1) ] >0;
wherein Krk (i) represents the Kalman gain corresponding to the ith second in the battery charging process, krk (i+1) represents the Kalman gain corresponding to the (i+1) th second in the battery charging process, krk (i-2) represents the Kalman gain corresponding to the (i-2) th second in the battery charging process, i has a value range of 1-rt, and rt represents the charging time of the (electroless) battery;
substituting Kalman gain Krk (1)~Krk(rt) in the battery charging process into the relational expressions b1-1 to b1-3, extracting Kalman gain which simultaneously satisfies the relational expressions b1-1 to b1-3 as charging outage;
Step S32, extracting the time corresponding to the 1 st charging breakpoint, and recording the time as rrt (1);
Extracting the time corresponding to the 2 nd charging breakpoint, and recording the time as rrt (2);
And by analogy, extracting the time corresponding to the dr-th charging breakpoint, and recording the time as rrt (dr);
Wherein rrt (1)~rrt(dr) satisfies rrt (1)<rrt(2)<~<rrt(dr) < rt;
Taking 1 (second) to rrt (1) (second) as a1 st charging time period, and analyzing the power amplification state from the beginning of charging to a1 st charging breakpoint;
step S321, obtaining Kalman gain Krk (1) corresponding to the 1 st second in the battery charging process;
acquiring a Kalman gain Krk (rrt(1)) corresponding to the rrt (1) seconds in the battery charging process;
Judging the size of [ Krk (rrt(1))-rrt(1) ], and determining a power amplification equation of the battery in the 1 st charging time period;
step S322, if [ Krk (rrt(1))-rrt(1) ] >0, the battery is in a fast charge state;
Acquiring an actual charging current, an actual charging voltage, an electric quantity percentage and an actual charging power percentage of the battery in a 1 st time period (namely, in step S253, all parameters of the 1 st row to the rrt (1) th row of the matrix a);
The electric quantity percentage is taken as an independent variable, the actual charging current, the actual charging voltage and the actual charging power percentage are taken as dependent variables, MATLAB software (MATLAB is totally called Matrix Laboratory and is application software for solving mathematical problems such as matrix operation, numerical solution, function optimization and ordinary differential equation solving) is used for sequentially solving a relation equation of the electric quantity percentage of the battery in a quick charging state and the actual charging current, and the relation equation is recorded as fQi 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging voltage is recorded as fQu 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging power percentage is recorded as fQP 1 (Qb);
fQi 1(Qb)、fQu1 (Qb) and fQP 1 (Qb) are used as power amplification equations for rapidly charging the battery in the 1 st charging period;
step 323, if [ Krk (rrt(1))-rrt(1) ] <0, the battery is in the slow charge state;
Repeating the process of fQi 1(Qb)、fQu1 (Qb) and fQP 1 (Qb), and calculating a relation equation of the electric quantity percentage of the battery in the slow charge state and the actual charge current by using MATLAB software, wherein the relation equation is recorded as fQi 1 (Qb');
The relation equation of the electric quantity percentage and the actual charging voltage is recorded as fQu 1 (Qb);
The relation equation of the electric quantity percentage and the actual charging power percentage is recorded as fQP 1 (Qb);
fQi 1(Qb)`、fQu1 (Qb) and fQP 1 (Qb) are used as power amplification equations for the battery to be charged slowly in the 1 st charging time period;
step S324, if [ Krk (rrt(1))-rrt(1) ] =0, the battery is in a stable state;
Calculating the average value of the actual charging current of the battery in the 1 st time period, which is marked as air (1), the average value of the actual charging voltage, which is marked as aur (1), the average value of the electric quantity percentage, which is marked as aQb (1), and the average value of the actual charging power percentage, which is marked as aPbr (1);
Air (1)、aur(1)、aQb(1) and aPbr (1) are used as a power amplification equation (namely a parameter equation) for stabilizing the electric quantity of the battery in the 1st charging time period;
It should be noted that, because the physical quantities such as the actual charging current, the actual charging voltage, the internal resistance of the battery, the impedance of the battery and the like of the battery change all the time during charging, the relationship between the electric quantity percentage and the actual charging current, the relationship between the electric quantity percentage and the actual charging voltage and the relationship between the electric quantity percentage and the actual charging power percentage may be linear or nonlinear, and a certain stable mathematical function expression is difficult to be given, the invention only makes a method statement here, and no specific or complete mathematical expression exists, and similarly, the discharging process of the battery is also vice versa.
Step S33, taking rrt (1) (seconds) to rrt (2) (seconds) as a 2 nd charging time period, taking rrt (3) (seconds) to rrt (3) (seconds) as a3 rd charging time period, taking rrt (dr-1) (seconds) to rrt (dr) (seconds) as a dr (dr+1) th charging time period, taking rrt (dr) (seconds) to rrt (rt) (seconds) as a (dr+1) th charging time period;
repeatedly analyzing the same step (namely, step S321 to step S324) of the power amplification state of the battery in the 1 st charging time period, and analyzing the power amplification state of the battery in the 2 nd to (dr+1) th charging time periods in the charging process;
Step S34, repeatedly analyzing the same step (namely, step S31-step S33) of the power amplification state in the battery charging process, and analyzing the power amplification state in the battery discharging process;
summarizing the power amplification state of the battery in the charging process and the power amplification state of the battery in the discharging process, and taking the power amplification state and the power amplification state as a primary battery report;
Step S35, obtaining the number of all the batteries to be detected and marking as tb, randomly sampling all the batteries to be detected as sample batteries, wherein the number of the sample batteries is marked as bn, and the relation between bn and tb is less than or equal to (tb multiplied by 15 percent);
Repeating the same steps (namely, step S31-step S34 in step S2 and step S3) of analyzing the power amplification state of the single battery to obtain the power amplification state of the sample battery;
And according to the power amplification state of the sample battery, weighting and updating the time period division in the primary battery report by using an average function and MATLAB software in a numpy library to obtain the battery report.
And S4, summarizing and feeding back the battery report, and continuously updating the battery data and updating the battery report.
The above formulas are all formulas for removing dimensions and taking numerical calculation, the formulas are formulas for obtaining the latest real situation by collecting a large amount of data and performing software simulation, preset parameters in the formulas are set by a person skilled in the art according to the actual situation, if weight coefficients and proportion coefficients exist, the set sizes are specific numerical values obtained by quantizing the parameters, the subsequent comparison is convenient, and the proportional relation between the weight coefficients and the proportion coefficients is not influenced as long as the proportional relation between the parameters and the quantized numerical values is not influenced.
It should be noted that the foregoing embodiments are merely illustrative embodiments of the present invention, and not restrictive, and the scope of the invention is not limited to the embodiments, and although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that any modification, variation or substitution of some of the technical features of the embodiments described in the foregoing embodiments may be easily contemplated within the scope of the present invention, and the spirit and scope of the technical solutions of the embodiments do not depart from the spirit and scope of the embodiments of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.