Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for calculating a remaining battery capacity of a mobile terminal according to an embodiment of the present invention.
S101: acquiring motion state information of the mobile terminal;
in the embodiment, the motion state information of the mobile terminal is obtained by obtaining the acceleration of the mobile terminal at different moments and analyzing the acceleration of the mobile terminal at different moments, and the validity of the parameter for calculating the residual capacity of the mobile terminal battery is judged according to the motion state of the mobile terminal, so that the residual capacity of the mobile terminal battery is accurately calculated.
S102: acquiring an effective voltage value of a mobile terminal battery according to the motion state information;
in this embodiment, according to the obtained motion state information of the mobile terminal, the validity of the parameter collected by the mobile terminal and used for calculating the remaining power of the battery of the mobile terminal is determined, for example, the validity of the voltage value collected by the mobile terminal and used for calculating the remaining power of the battery of the mobile terminal is determined, so as to obtain the valid voltage value used by the mobile terminal for calculating the remaining power of the battery of the mobile terminal.
S103: calculating the residual electric quantity of the mobile terminal battery according to the effective voltage value;
in this embodiment, after obtaining the effective voltage value used by the mobile terminal to calculate the remaining battery capacity of the mobile terminal, the remaining battery capacity of the mobile terminal is calculated by using a current integration method, and according to the obtained effective voltage value used by the mobile terminal to calculate the remaining battery capacity of the mobile terminal, the current magnitude of the mobile terminal at each time is calculated, and then the current magnitude is substituted into a current integration method formula to calculate the remaining battery capacity of the mobile terminal, or by using an open-circuit voltage method, according to the obtained effective voltage value used by the mobile terminal to calculate the remaining battery capacity of the mobile terminal, the remaining battery capacity corresponding to the effective voltage value is correspondingly found out from an open-circuit voltage-remaining battery capacity relation curve, so as to obtain the remaining battery capacity of the mobile terminal.
Of course, as will be understood by those skilled in the art, the method for calculating the remaining battery capacity of the mobile terminal includes, but is not limited to, the above two methods, and the method for calculating the remaining battery capacity of the mobile terminal using the voltage of the battery of the mobile terminal can be the method for calculating the remaining battery capacity of the mobile terminal described in the embodiment, and is not limited herein.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for calculating remaining battery power of a mobile terminal according to another embodiment of the present invention.
S201: acquiring motion state information of the mobile terminal;
in the embodiment, the motion state information of the mobile terminal is obtained by obtaining the acceleration of the mobile terminal at different moments and analyzing the acceleration of the mobile terminal at different moments, and the validity of the parameter for calculating the residual capacity of the mobile terminal battery is judged according to the motion state of the mobile terminal, so that the residual capacity of the mobile terminal battery is accurately calculated.
Optionally, a first preset time is taken as an interval, a first acceleration and a second acceleration of the mobile terminal are obtained, and the motion state of the mobile terminal is analyzed by obtaining a vector difference value between the first acceleration and the second acceleration, however, as understood by those skilled in the art, multiple sets of acceleration values of the mobile terminal may be obtained at the interval for analyzing the motion state of the mobile terminal, where the greater the number of sets of acceleration values of the mobile terminal obtained, the more accurate the analysis result is, the more the acceleration values of the two sets of mobile terminals are used for analysis in the present embodiment, which is only by way of example, and not limited to the number of sets of acceleration values of the mobile terminal obtained in the present embodiment.
Optionally, the first preset time may be 1 millisecond, 2 millisecond, 3 millisecond, and the like, in order to implement real-time monitoring of the acceleration of the mobile terminal, the first preset time is in the order of milliseconds, and the shorter the first preset time is, the shorter the cycle interval for acquiring the acceleration of the mobile terminal is, the closer the cycle interval is to the specific motion state of the mobile terminal, the more accurate the analysis result is, and the like, which is not limited herein.
S202: analyzing the motion state of the mobile terminal;
in this embodiment, a first preset time is taken as an interval, a first acceleration and a second acceleration of the mobile terminal are obtained, a vector difference between the first acceleration and the second acceleration is obtained, if the vector difference between the first acceleration and the second acceleration is greater than a preset acceleration difference, the mobile terminal is in an abnormal motion state, and if the vector difference between the first acceleration and the second acceleration is not greater than the preset acceleration difference, the mobile terminal is in a normal motion state.
Optionally, the vector difference between the first acceleration and the second acceleration is obtained by taking a three-dimensional coordinate system as a reference system, that is, a vector subtraction operation is performed on the first acceleration and the second acceleration, the preset acceleration difference includes a preset acceleration absolute value difference and a preset acceleration direction difference, after the vector subtraction operation is performed on the first acceleration and the second acceleration, the absolute value of the obtained vector difference is compared with the preset acceleration absolute value difference, and the acceleration direction change of the obtained vector difference is compared with the preset acceleration direction difference (mainly comparing the angle of the change of the acceleration direction), after the vector subtraction operation is performed on the first acceleration and the second acceleration, the absolute value of the obtained vector difference is greater than the preset acceleration absolute value difference and/or the acceleration direction change of the obtained vector difference is greater than the preset acceleration direction difference, for example, the first acceleration is 9m/s, after the first preset time, the acceleration of the mobile terminal is a second acceleration of-6 m/s, the absolute value of the vector difference is 15m/s, which is greater than the preset acceleration absolute value difference, and the acceleration direction change of the first acceleration and the second acceleration is greater than 90 degrees, which is greater than the preset acceleration direction difference, then the mobile terminal is determined to be in an abnormal motion state, otherwise, the mobile terminal is determined to be in a normal motion state.
Optionally, the preset acceleration difference includes a preset acceleration absolute value difference and a preset acceleration direction difference, the preset acceleration absolute value difference may be 10m/s, 15m/s, 20m/s, and the like, and the preset acceleration direction difference may be 90 degrees, 100 degrees, 120 degrees, and the like, as will be understood by those skilled in the art, the preset acceleration absolute value difference and the preset acceleration direction difference include, but are not limited to, the above situations, and can be used to determine that the mobile terminal has abnormal motion, and both the preset acceleration absolute value difference and the preset acceleration direction difference described in this embodiment can be, but are not limited to, the preset acceleration absolute value difference and the preset acceleration direction difference described in this embodiment.
S203: obtaining an effective voltage value of a mobile terminal battery;
in this embodiment, a first voltage value and a second voltage value of the mobile terminal battery are obtained at a second preset time interval, and validity of the obtained first voltage value and second voltage value of the mobile terminal battery is determined in combination with a motion state of the mobile terminal at a corresponding moment, so as to obtain an effective voltage value of the mobile terminal battery for subsequent calculation of the remaining power of the mobile terminal battery.
Optionally, with a second preset time as an interval, obtaining a first voltage value and a second voltage value of the mobile terminal battery, obtaining a first difference value between the first voltage value and the second voltage value, obtaining a first absolute value of the first difference value, and determining whether the first absolute value is greater than the preset voltage difference value: if the first absolute value is larger than the preset voltage difference value and the mobile terminal is in an abnormal motion state, the abnormal conditions such as large-amplitude vibration or drop of the mobile terminal occur, the battery and the mobile terminal battery connector are separated for a short time or have poor contact, the pressure difference is increased, and the current voltage value is not adopted for calculating the residual electric quantity of the battery, so that the first voltage value is taken as an effective voltage value for calculating the residual electric quantity of the battery subsequently; if the first insulation value does not exceed the preset voltage difference value, the motion state of the mobile terminal is combined, the mobile terminal can be judged to be in a normal motion state, the first insulation value is within a normal error range and can be ignored, and therefore the first voltage value and the second voltage value can be effective voltage values. It should be noted that, the mobile terminal is in a normal motion state, and the mobile terminal battery and the battery connector are in a stable connection state, so that the condition of increasing the voltage difference is not generated, that is, the first absolute value does not exceed the preset voltage difference value.
Of course, as will be understood by those skilled in the art, the voltage values of the plurality of sets of mobile terminals may be obtained at intervals of the second preset time, and used for analyzing the motion state of the mobile terminal, so as to obtain the effective voltage value of the battery of the mobile terminal, where the more the voltage values of the mobile terminals are obtained, the more accurate the analysis result is, the voltage values of the two sets of mobile terminals are used for analysis in the present embodiment, which is only an example, and thus, the number of the voltage values of the mobile terminals obtained in the present embodiment is not limited.
Optionally, the second preset time may be 1 millisecond, 2 milliseconds, 3 milliseconds, and the like, in order to implement real-time monitoring on the battery voltage of the mobile terminal, the second preset time is in the order of milliseconds, and the shorter the second preset time is, the shorter the cycle interval for acquiring the battery voltage of the mobile terminal is, the closer the cycle interval is to the specific voltage change condition of the mobile terminal is, the more accurate the analysis result is, and the method is not limited herein.
Optionally, the preset voltage difference may be 70mV, 80mV, 90mV, or the like, which is not limited herein, and the preset voltage difference may include but is not limited to the above situation, and the determination of the preset voltage difference needs to reflect that the mobile terminal generates abnormal motion, which causes abnormal rise and fall of the voltage at two ends of the battery, so as to determine the validity of the voltage at two ends of the battery of the mobile terminal, and further obtain the valid voltage value of the battery of the mobile terminal.
S204: acquiring temperature curve information of a mobile terminal battery;
in this embodiment, the resistance of the mobile terminal battery has a linear relationship with the temperature, and the relationship curves of the resistance of the mobile terminal battery and the temperature are different at different temperatures, so that the mobile terminal battery can have multiple sets of resistance-temperature relationship curves, find the corresponding resistance-temperature relationship curve, i.e., the temperature curve information, according to the temperature of the mobile terminal battery, and obtain the resistance of the mobile terminal battery at the moment by combining the current temperature. And taking a third preset time as an interval, acquiring a first temperature value and a second temperature value of the mobile terminal, and judging the effectiveness of the acquired first temperature value and the second temperature value of the mobile terminal battery by combining the motion state of the mobile terminal at the corresponding moment, so as to acquire temperature curve information of the mobile terminal battery for calculating the residual electric quantity of the mobile terminal battery subsequently.
Optionally, the first temperature value and the second temperature value of the mobile terminal are obtained at a periodic interval of a third preset time, a second difference value between the first temperature value and the second temperature value is obtained, and a second absolute value of the second difference value is obtained. Judging whether the second absolute value is larger than a preset temperature difference value: if the second absolute value is greater than the preset temperature difference value and the mobile terminal is in a normal motion state, it is indicated that the temperature rise of the mobile terminal is caused by heat generated by the mobile terminal during operation, and therefore a temperature curve at a corresponding temperature needs to be selected as temperature curve information of the mobile terminal, that is, the temperature curve corresponding to the second temperature value is the temperature curve information of the mobile terminal; if the second absolute value is larger than the preset temperature difference value and the mobile terminal is in an abnormal motion state, the abnormal situation such as large-amplitude vibration or falling of the mobile terminal is caused, so that the temperature of the mobile terminal is abnormally increased, and therefore, a temperature curve corresponding to the first temperature value is selected as temperature curve information of the mobile terminal; if the second absolute value does not exceed the preset temperature difference value, the second difference value can be considered as the normal temperature rise of the mobile terminal, and therefore the temperature curves corresponding to the first temperature value and the second temperature value can be both used as the temperature curve information of the mobile terminal.
Of course, as will be understood by those skilled in the art, a plurality of sets of temperature values of the mobile terminal may be obtained at intervals of a third preset time, and are used for analyzing the motion state of the mobile terminal, so as to obtain the temperature curve information of the battery of the mobile terminal, where the more the sets of temperature values of the mobile terminal are obtained, the more accurate the analysis result is, and the present embodiment analyzes the temperature values of the two sets of mobile terminals, which is only an example, and does not limit the sets of temperature values of the mobile terminal obtained in the present embodiment.
Optionally, the third preset time may be 1 millisecond, 2 milliseconds, 3 milliseconds, and the like, in order to implement real-time monitoring of the temperature of the battery of the mobile terminal, the third preset time is in the order of milliseconds, and the shorter the third preset time is, the shorter the cycle interval for acquiring the temperature of the battery of the mobile terminal is, the closer the cycle interval is to the specific temperature change condition of the mobile terminal, the more accurate the analysis result is, and the method is not limited herein.
Optionally, the preset temperature difference may be 1 ℃, 2 ℃, 3 ℃, and the like, and certainly, as understood by those skilled in the art, the preset temperature difference includes but is not limited to the above situations, and the determination of the preset temperature difference needs to reflect that the mobile terminal has abnormal conditions such as large amplitude vibration or drop, and the temperature of the battery of the mobile terminal is abnormally increased, and the preset temperature difference satisfying the above conditions may be the preset temperature difference set forth in this embodiment, and is not limited herein.
S205: calculating the residual capacity of the mobile terminal battery;
in this embodiment, the remaining battery capacity of the mobile terminal is calculated according to the obtained effective voltage value and the temperature curve information of the mobile terminal. The remaining capacity of the battery of the mobile terminal can be calculated by adopting a current integration method, an open-circuit voltage method or the like. Of course, the calculation method using the battery voltage and the temperature curve information of the mobile terminal can be a calculation method for calculating the remaining power of the battery of the mobile terminal in the embodiment, and is not limited herein.
Alternatively, the remaining capacity of the battery of the mobile terminal is calculated by a current integration method, which essentially calculates the remaining capacity of the battery by accumulating the charged or discharged capacity while the battery of the mobile terminal is charged or discharged, while compensating the calculation result according to the discharge rate and the temperature of the battery. Setting the residual capacity of the battery in the initial charge-discharge state as SOC
0Setting the residual battery capacity of the mobile terminal at a certain time as SOC, SOC and SOC
0The functional relationship between the two is
And i is the current of the battery at the moment, the current resistance value of the battery of the mobile terminal is determined according to the obtained effective voltage value of the mobile terminal and the temperature curve information of the mobile terminal, so that the current i of the battery at the moment is calculated, and the residual electric quantity of the battery of the mobile terminal is further calculated.
Optionally, the remaining capacity of the mobile terminal battery is calculated by using an open-circuit voltage method, which is essentially to indirectly fit a one-to-one correspondence relationship between the open-circuit voltage of the mobile terminal battery and the remaining capacity of the mobile terminal battery according to a variation relationship between the open-circuit voltage of the mobile terminal battery and the lithium ion concentration inside the battery. The method comprises the steps of discharging the battery of the mobile terminal at a fixed discharge rate (which can be 1C) after the battery is fully charged, stopping discharging until the voltage of the battery is reduced to the cut-off voltage of the battery, obtaining a relation curve between the open-circuit voltage and the residual capacity of the battery according to the discharging process, and obtaining the residual capacity of the battery corresponding to the current effective voltage value according to the obtained effective voltage values at two ends of the battery and the relation curve between the open-circuit voltage and the residual capacity of the battery when the battery is in an actual working state, thereby calculating the residual capacity of the battery of the mobile terminal.
S206: compensating the calculation result of the residual electric quantity of the mobile terminal battery;
in this embodiment, the method for calculating the remaining power of the mobile terminal in the above embodiment ignores the influence of the self-discharge rate, the aging degree and the charge-discharge rate of the battery on the remaining power of the battery to a certain extent, and the internal resistance of the battery at different temperatures or different life periods is greatly different, which may cause a large error to the calculation result of the remaining power of the battery of the mobile terminal in the past for a long time.
S207: displaying the residual electric quantity of the mobile terminal battery;
in this embodiment, the calculation result is displayed on the user interface of the mobile terminal according to the calculated remaining power of the battery of the mobile terminal, and may be displayed in a percentage form, a bar graph form, or a combination form of the two, which is not limited herein.
In summary, the present invention obtains the motion state information of the mobile terminal according to the motion state of the mobile terminal, obtains the effective voltage value and the temperature curve information of the mobile terminal according to the motion state information of the mobile terminal, and further calculates the remaining power of the battery of the mobile terminal, and introduces a correction coefficient to the calculation result according to the obtained effective voltage value and the temperature curve information of the mobile terminal, so as to improve the accuracy of the calculation result of the remaining power of the battery of the mobile terminal.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
In this embodiment, the mobile terminal 300 includes a processor 301, a detection circuit 302 and a first sensing device 303, the processor 301 is respectively connected to the detection circuit 302 and the first sensing device 303, the detection circuit 302 is used for collecting a voltage value of a battery 304 of the mobile terminal 300, for example, the current voltage value of the battery 304 of the mobile terminal 300 is obtained through a circuit and a DC converter, the first sensing device 303 is used for collecting motion state information of the mobile terminal 300, the mobile terminal 300 further includes a battery connector 305 that can be connected to a circuit board of the mobile terminal 300 through a pin or an FPC, and is electrically connected to the battery 304 of the mobile terminal 300 for supplying power to the mobile terminal 300, the mobile terminal 300 further includes a display device 306 for displaying a calculation result of the remaining power of the battery 304 of the mobile terminal 300, the processor 301 can execute a program to implement the method for calculating the remaining power of the battery of the mobile terminal as described in the above embodiments, and will not be described in detail herein.
Optionally, the first sensing device 303 may be an acceleration sensor, such as a gravitational acceleration sensor, a direction sensor, an angle sensor, etc., which can monitor the change of the acceleration of the mobile terminal 300 in real time, and all of the first sensing devices 303 are the first sensing device 303 described in this embodiment, which is not limited herein.
Optionally, the mobile terminal 300 further includes a second sensing device 307, where the second sensing device 307 may be a temperature sensor and is configured to collect a temperature value of the battery 304 of the mobile terminal 300, different temperature values of the battery 304 of the mobile terminal 300 correspond to different temperature curve information, and the processor 301 may calculate a charging state or a discharging state of the battery 304 of the mobile terminal 300 according to the motion state information, the effective voltage value, and the temperature curve information of the mobile terminal 300, so as to calculate the remaining power of the battery 304 of the mobile terminal 300.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a memory device according to an embodiment of the invention.
In the embodiment, the storage device 400 stores the program data 401, and the program data 401 can be executed to implement the method for calculating the remaining battery power of the mobile terminal described in the above embodiment, which will not be described herein again.
In the several embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are illustrative, and for example, the division of the modules or units into one logical functional division may be implemented in practice in another logical functional division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes performed by the present specification and drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.