An electronic device, comprising a processor and a computer readable medium, wherein the computer readable medium stores computer readable codes that are readable by the processor, and the processor executes these computer readable codes to perform the following steps:
- acquiring a charging instruction;
- acquiring a discharging voltage value and its corresponding capacity and a voltage threshold of a battery to be detected according to the charging instruction;
- acquiring a charging capacity of the battery to be detected according to the discharging voltage value and the voltage threshold of the battery to be detected;
- and
- acquiring a capacity of the battery to be detected according to the capacity corresponding to the discharging voltage value of the battery to be detected and the charging capacity of the battery to be detected;
- wherein the step of acquiring a charging capacity of the battery to be detected according to the discharging voltage value and the voltage threshold of the battery to be detected comprises:
- judging whether the discharging voltage value of the battery to be detected reaches the voltage threshold, wherein the voltage threshold includes a lower limit voltage threshold and an upper limit voltage threshold, the lower limit voltage threshold is typically a voltage value at which the battery to be detected cannot output power, and the upper limit voltage threshold is typically a voltage value at which the battery to be detected outputs the maximum power;
- when the discharging voltage value of the battery to be detected does not reach the lower limit voltage threshold, taking a remaining capacity Wremaining of the battery to be detected as the capacity W0 corresponding to the discharging voltage value of the battery to be detected;
- when the discharging voltage value of the battery to be detected reaches the lower limit voltage threshold, initiating a timer T1 to start timing;
- when the discharging voltage value of the battery to be detected is not less than the lower limit voltage threshold but less than the upper limit voltage threshold, keeping the timer T1 in a state of timing, and acquiring a constant current charging duration t1 and a constant current charging capacity W1 of the battery to be detected;
- when the discharging voltage value of the battery to be detected reaches the upper limit voltage threshold, ending the timing of the timer T1, and simultaneously initiating a timer T3 to start timing;
- and
- when the discharging voltage value of the battery to be detected is not less than the upper limit voltage threshold, keeping the timer T3 in a state of timing, and acquiring a constant voltage charging duration t3 and a constant voltage charging capacity W3 of the battery to be detected;
- and
- wherein the step of acquiring the constant voltage charging capacity W3 of the battery to be detected comprises:
- acquiring a nominal capacity Wnominal of the battery to be detected;
- acquiring a total constant voltage charging duration T2 and a total constant voltage charging capacity W2 according to the nominal capacity Wnominal of the battery to be detected, the constant current charging current I1 of the battery to be detected and the constant current charging capacity W1 of the battery to be detected;
- and
- acquiring the constant voltage charging capacity W3 of the battery to be detected according to the constant voltage charging duration t3 recorded by the timer T3, the total constant voltage charging duration T2 and the total constant voltage charging capacity W2.