Charging method, device, equipment, storage medium and program product

Based on the pre -charging process of the terminal, based on the preset current and voltage estimation model, the battery status is accurately judged, the problem of long pre -charging charging time in the existing technology is solved, and the efficiency and accuracy of the pre -charging charging is improved.

CN119382287APending Publication Date: 2025-01-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411629332.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In the prior art, due to posterior estimation during the pre-charging process, the terminal frequently stops charging, which takes a long time and reduces the pre-charging efficiency.

Method used

By meeting the pre -charging conditions, the battery is charged based on the pre -charging current based on the pre -charging current, and the opening voltage of the battery is estimated based on the voltage estimated model estimated model during the pre -charging process. Therefore, precisely stop pre -charging charging.

Benefits of technology

It is realized that there is no need to stop the charging process in the pre -charging process, which improves the pre -charging efficiency, and by accurately judge the battery status to ensure the accuracy of the charging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119382287A_ABST
    Figure CN119382287A_ABST
Patent Text Reader

Abstract

The invention relates to a charging method and device, equipment, a storage medium and a program product. The method comprises the following steps: pre-charging a battery of a terminal based on a preset pre-charging current under the condition that a pre-charging condition is met; in the pre-charging process, estimating the battery open-circuit voltage of the battery based on a voltage estimation model; determining whether a pre-charging exit condition is satisfied according to the estimated open-circuit voltage of the battery; and stopping pre-charging the battery under the condition that the pre-charging quit condition is met. By adopting the method, the pre-charging efficiency of the terminal can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of charging technology, and in particular to a charging method, device, equipment, storage medium and program product. Background Art

[0002] The battery management system in current terminals is very complex, and includes a variety of functions to ensure the safety, life and performance of the battery. Pre-charge charging is one of the important functions. During the pre-charge stage, the battery management system will limit the charging current, which is usually small, so as to reduce polarization and heat accumulation to protect the battery. For example, the terminal will shut down after the battery in the terminal is over-discharged. When recharging, it will be pre-charged for a period of time. When certain conditions are met, the terminal will be turned on, and the pre-charge will be exited, and then the normal charging method will be adopted.

[0003] In the related art, the terminal is first pre-charged to the power-on voltage, then stops charging for a period of time, and compares the difference between the current battery voltage and the power-on voltage, and continues pre-charging according to the design principle of replenishing the difference.

[0004] However, since this solution is a posteriori estimation, each judgment requires charging to be stopped, which is time-consuming and causes the terminal pre-charging time to be too long. Summary of the invention

[0005] Based on this, it is necessary to provide a charging method, device, equipment, storage medium and program product that can improve the terminal pre-charging efficiency in response to the above technical problems.

[0006] In a first aspect, the present application provides a charging method. The method comprises:

[0007] When the pre-charging condition is met, pre-charging the battery of the terminal based on a preset pre-charging current;

[0008] During the pre-charge process, the battery open circuit voltage of the battery is estimated based on the voltage estimation model;

[0009] Determining whether a pre-charge exit condition is met according to the estimated open circuit voltage of the battery;

[0010] When the pre-charge exit condition is met, the pre-charge of the battery is stopped.

[0011] In a second aspect, the present application also provides a charging device. The device includes:

[0012] A charging module, used to pre-charge the battery of the terminal based on a preset pre-charge current when the pre-charge condition is met;

[0013] An estimation module, used for estimating the battery open circuit voltage of the battery based on a voltage estimation model during pre-charging and charging;

[0014] A determination module, used to determine whether a pre-charge exit condition is met according to the estimated open circuit voltage of the battery;

[0015] The control module is used to stop pre-charging the battery when the pre-charging exit condition is met.

[0016] In a third aspect, the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in any one of the first aspects are implemented.

[0017] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect above.

[0018] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.

[0019] The above-mentioned charging method, device, equipment, storage medium and program product pre-charge the battery of the terminal based on the preset pre-charge current when the pre-charge condition is met; in the process of pre-charge, the battery open circuit voltage of the battery is estimated based on the voltage estimation model; it is determined whether the pre-charge exit condition is met according to the estimated battery open circuit voltage; when the pre-charge exit condition is met, the pre-charge of the battery is stopped. That is, while pre-charging is performed based on the preset pre-charge current, it is determined whether the pre-charge exit condition is met, and pre-charging is stopped when it is determined that the pre-charge exit condition is met. In this way, there is no stage of stopping charging during the pre-charge process, which ensures the pre-charge efficiency, and whether the pre-charge exit condition is met can be determined based on the battery open circuit voltage, which ensures the accuracy of stopping pre-charge. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 is a schematic flow chart of a charging method in one embodiment;

[0022] Figure 2 A schematic diagram of a flow chart for determining whether a pre-charging condition is met in one embodiment;

[0023] Figure 3 A schematic diagram of a process for estimating a battery open circuit voltage in one embodiment;

[0024] Figure 4 A schematic diagram of a first-order equivalent circuit model of a battery in an embodiment;

[0025] Figure 5 A schematic diagram of a process for determining battery identification parameters in one embodiment;

[0026] Figure 6 is a schematic flow chart of another charging method in one embodiment;

[0027] Figure 7 is a structural block diagram of a charging device in one embodiment;

[0028] Figure 8 FIG. 4 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0029] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It should be understood that many specific details are set forth in the following description to facilitate a full understanding of the present application, but the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0031] It will be understood that “at least one” means one or more, and “plurality” means two or more.

[0032] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, wholes, steps, operations, components, parts, or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts, or combinations thereof. At the same time, the term "and / or" used in this specification includes any and all combinations of the relevant listed items.

[0033] The pre-charge and charging process of the battery in the electronic device is mainly managed and implemented by the Battery Management System (BMS). At present, the battery management system of electronic devices is very complex. It includes a variety of functions to ensure the safety, life and performance of the battery, and pre-charge and charging is a key part of these functions. Usually, after the electronic device is connected to the charger, it first detects whether it can enter the pre-charge and charging stage. If it enters the pre-charge and charging stage, the battery management system will limit the charging current of the battery at this stage. Usually, the pre-charge current is small to reduce polarization and heat accumulation, thereby protecting the battery.

[0034] The existing pre-charge method is: first charge according to the pre-charge current, and then check whether the battery terminal voltage is higher than a certain threshold after an interval of 2s. If it is higher, it means that the battery open circuit voltage may be higher than the threshold. At this time, stop charging, and wait for 5s under software control, and then recheck the difference between the battery terminal voltage and the above threshold. If the battery terminal voltage is less than the above threshold, it means that the battery voltage is artificially high due to the influence of floating pressure. At this time, the threshold is updated: new threshold = original threshold + original threshold - current battery terminal voltage + 20mv; for example, if the battery terminal voltage is re-detected to be 3.35v after stopping charging for 5s, then the new threshold = 3.4 + 3.4-3.35 + 0.02 = 3.452V. After the threshold is updated, continue pre-charge.

[0035] It can be seen that the current method of judging whether to continue pre-charging and charging after excessive discharge of the battery is a posteriori estimation; that is, pre-charging and charging for a period of time, then stopping charging for a period of time, and then re-comparing the difference between the current battery voltage and the power-on voltage, and continuing pre-charging and charging according to the design principle of making up for the difference. However, since this scheme is a posteriori estimation, it is often necessary to stop charging for a period of time in the middle, resulting in a waste of charging time. Secondly, due to the influence of the battery diffusion capacitance, it takes several minutes for the battery to actually fall back. To avoid this influence, a certain step length (20mv) is superimposed on each difference calculation, which also leads to a waste of charging time to a certain extent. In summary, in the existing pre-charging and charging scheme, the overall pre-charging time is increased due to the waiting time of the posteriori estimation and the influence of the anti-fool voltage difference, and the pre-charging efficiency is low.

[0036] In view of this, an embodiment of the present application provides a charging method that can improve the efficiency of pre-charging.

[0037] It should be noted that the charging method provided in the embodiment of the present application, its execution subject may be a charging device, and the charging device may be implemented as part or all of the electronic device through software, hardware, or a combination of software and hardware. Optionally, the charging device may be referred to as part or all of the AP (Application Processor) or the fuel gauge chip of the electronic device to execute the charging method. Among them, the electronic device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices may be smart speakers, smart TVs, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc., and the embodiments of the present application do not limit the type of the electronic device. In the following method embodiments, the execution subject is an electronic device for explanation.

[0038] In one embodiment, Figure 1 As shown, a charging method is provided, the method comprising:

[0039] Step 101, when the pre-charging condition is met, pre-charging the battery of the terminal based on a preset pre-charging current.

[0040] Pre-charge conditions are pre-deployed in electronic devices. When the electronic device is connected to the charger, at the initial moment of connection, it can be determined whether the pre-charge conditions are met, so that if the pre-charge conditions are met, it is determined to perform pre-charge first, so that the battery of the terminal can be pre-charged based on the preset pre-charge current.

[0041] It is understandable that one of the functions of the pre-charge charging method is to protect the battery, but the charging current in the pre-charge charging stage is less than the charging current in other charging stages. Therefore, after the pre-charge charging process is completed, the electronic device can switch to other charging methods to charge the battery to ensure the overall charging efficiency, wherein the charging current when charging in other charging methods is greater than the preset pre-charge current during pre-charge charging. Optionally, other charging methods may refer to fast charging methods or ordinary charging methods, which are not fully exemplified here.

[0042] Optionally, the pre-charging process can be achieved through wireless charging or wired charging, which is not specifically limited here.

[0043] Optionally, whether the pre-charging condition is met may be determined based on the current battery voltage of the battery. The battery voltage may be a battery terminal voltage or a battery open circuit voltage.

[0044] Exemplarily, it may be determined that the pre-charge condition is met when the electronic device is turned off after the battery is over-discharged. Alternatively, it may be determined that the pre-charge condition is met when the battery power is less than a preset power threshold, and the preset power threshold may be a default value when the electronic device leaves the factory or a setting by the user. Alternatively, it may be determined that the pre-charge condition is met when the electronic device is turned off. Various situations in which pre-charge is met are not fully exemplified here.

[0045] Optionally, the preset pre-charge current is preset in the electronic device. Therefore, after the pre-charge condition is met, the electronic device reads the preset pre-charge current and controls the charging process of the battery based on the preset pre-charge current.

[0046] Step 102 : during the pre-charging process, estimating the battery open circuit voltage of the battery based on a voltage estimation model.

[0047] A voltage estimation model is deployed in the electronic device to continuously estimate the battery open circuit voltage of the battery during the pre-charge process. Optionally, during the pre-charge process, the battery open circuit voltage of the battery can be periodically estimated based on the voltage estimation model, for example, the current battery open circuit voltage is estimated once every fixed time interval, and the fixed time can be, for example, 2 seconds, etc., which is not specifically limited here. Optionally, during the pre-charge process, the battery open circuit voltage of the battery can be estimated in real time based on the voltage estimation model.

[0048] It should be noted that the battery open circuit voltage can accurately represent the current voltage of the battery. However, during the charging process, since the charging path is turned on and there are resistors and RC networks in the charging path, the electronic device will not be able to accurately obtain the battery open circuit voltage. Therefore, a voltage estimation model is used in the embodiment of the present application to estimate the battery open circuit voltage.

[0049] Optionally, the electronic device can read the battery terminal voltage of the battery and estimate the battery open circuit voltage of the battery according to the battery terminal voltage and the voltage estimation model. Here, the battery terminal voltage refers to the voltage of the battery after the load is connected during actual operation; it is the voltage across the external circuit, also called the external circuit voltage or the circuit terminal voltage; and the voltage of the battery in the open circuit state is the battery open circuit voltage.

[0050] Optionally, a fuel gauge chip of the electronic device monitors the battery terminal voltage in real time, so the battery terminal voltage can be obtained from the fuel gauge chip.

[0051] Optionally, the fuel gauge chip also monitors data such as battery temperature and battery current of the battery in real time.

[0052] Step 103, determining whether a pre-charge exit condition is met based on the estimated battery open circuit voltage.

[0053] That is, the electronic device is pre-deployed with pre-charge exit conditions; during the pre-charge charging process, the battery open circuit voltage is continuously estimated, and whether the pre-charge exit conditions are met is determined based on the estimated battery open circuit voltage.

[0054] Exemplarily, gradual pre-charging can gradually increase the battery open circuit voltage. When the battery open circuit voltage is high, switching to other charging methods will not affect battery performance, and the pre-charging exit condition will be met at this time.

[0055] Step 104, when the pre-charge exit condition is met, stop pre-charging the battery.

[0056] After stopping the pre-charging of the battery, other charging methods can be used to charge the battery until it is fully charged or the electronic device is disconnected from the charger.

[0057] The above charging method, when the pre-charging condition is met, pre-charges the battery of the terminal based on a preset pre-charging current; during the pre-charging process, the battery open circuit voltage of the battery is estimated based on the voltage estimation model; whether the pre-charging exit condition is met is determined based on the estimated battery open circuit voltage; when the pre-charging exit condition is met, the battery is stopped from being pre-charged. That is, while pre-charging is performed based on the preset pre-charging current, it is determined whether the pre-charging exit condition is met, and pre-charging is stopped when it is determined that the pre-charging exit condition is met. In this way, during the pre-charging process, there is no stage of stopping charging, which ensures the pre-charging efficiency, and whether the pre-charging exit condition is met can be determined based on the battery open circuit voltage, which ensures the accuracy of stopping pre-charging.

[0058] In one embodiment, Figure 2 A schematic diagram of a process for determining whether a pre-charging condition is met is shown. The method further includes:

[0059] Step 201, obtaining the initial voltage of the battery before pre-charging.

[0060] That is, at the initial moment after the charger is connected, before charging begins, the electronic device may first determine the voltage of the battery at that moment as the initial voltage.

[0061] Optionally, the initial voltage is the battery terminal voltage of the battery at the initial moment. Optionally, the initial voltage can be obtained from a fuel gauge chip.

[0062] Step 202, determining whether the initial voltage is greater than a target voltage threshold.

[0063] Target voltage thresholds are pre-deployed in electronic devices.

[0064] Exemplarily, the initial voltage may be subtracted from the target voltage threshold to determine whether the initial voltage is greater than the target voltage threshold based on the difference. For example, if the difference is obtained by subtracting the target voltage threshold from the initial voltage, then if the difference is greater than 0, it is determined that the initial voltage is greater than the target voltage threshold.

[0065] Step 203: If not, determine whether the pre-charge condition is met.

[0066] If the initial voltage is greater than the target voltage threshold, it indicates that charging the battery using other charging methods will not affect the battery performance. Therefore, it is determined that the pre-charge condition is not met. At this time, other charging methods can be directly used to charge the battery.

[0067] If the initial voltage is not greater than the target voltage threshold, it indicates that the pre-charge charging method is currently needed to charge the battery to ensure battery performance and avoid battery performance degradation. Therefore, it is determined that the pre-charge condition is met at this time.

[0068] In an optional implementation, the target voltage threshold is a preset fixed voltage value, such as 3.4V.

[0069] In another optional implementation, the target voltage threshold may be determined according to the state of the electronic device at the initial moment after the charger is connected. For example, if the electronic device is in a shutdown state caused by overdischarge of the battery at the initial moment after the charger is connected, the target voltage threshold is the first voltage threshold. If the electronic device is in a power-on state at the initial moment after the charger is connected, the target voltage threshold is the second voltage threshold. Optionally, the first voltage threshold is 3.4V, and the second voltage threshold may be set by the user, which is not specifically limited here.

[0070] In the embodiment of the present application, since the battery voltage is closely related to the charging state of the battery, by determining the relationship between the initial voltage and the target voltage threshold, it is accurately determined whether the pre-charging is currently being entered.

[0071] The process of estimating the battery open circuit voltage is described below.

[0072] In one embodiment, during the pre-charging process, the battery open circuit voltage of the battery is estimated based on a voltage estimation model, including: at each estimation moment during the pre-charging process, based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters, determining the battery open circuit voltage of the battery at the current estimation moment.

[0073] Among them, when the current estimation time is the first estimation time of the pre-charge charging process, the reference estimation parameter is a preset initial value. When the current estimation time is not the first estimation time of the pre-charge charging process, the reference estimation parameter is determined according to the estimation process of the previous estimation time. Based on this, it can be seen that in the pre-charge charging process, based on the battery charging parameters and the reference estimation parameters, the voltage estimation model is used to continuously iteratively estimate the battery open circuit voltage of the battery at the current estimation time.

[0074] As the pre-charging time increases, the iteration accuracy increases gradually, and the estimated battery open circuit voltage approaches the most realistic battery open circuit voltage.

[0075] Optionally, the voltage estimation model is implemented based on a recursive algorithm.

[0076] Optionally, the voltage estimation model is implemented based on a recursive least squares algorithm.

[0077] In this way, since the battery open circuit voltage continues to increase during the pre-charging process, the battery open circuit voltage of the battery at the current estimation moment is continuously estimated iteratively based on the voltage estimation model, which can gradually improve the accuracy of the estimated battery open circuit voltage and ensure that the electronic device can effectively calculate a reliable battery open circuit voltage in real time during the pre-charging stage.

[0078] In one embodiment, based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters, the battery open circuit voltage of the battery at the current estimation moment is determined, including: based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters, the battery open circuit voltage of the battery at the current estimation moment is determined using a recursive least squares algorithm with a forgetting factor.

[0079] That is, the above recursive least squares algorithm may be a recursive least squares algorithm with a forgetting factor.

[0080] Among them, the recursive least squares method is a recursive algorithm used to solve linear regression problems. Its goal is to estimate system parameters by minimizing the sum of squares of errors. The recursive least squares method with forgetting factor introduces a forgetting factor based on the standard recursive least squares algorithm (RLS), so that new data has a greater weight than old data, thereby speeding up the response to parameter changes. Therefore, based on this algorithm, the speed and accuracy of iteration can be further enhanced.

[0081] The forgetting factor can be, for example, 0.95 to 0.995, and when the forgetting factor is 1, it means that nothing is forgotten. In the case of low sampling frequency, a smaller forgetting factor (for example, 0.95) is better, because it can forget old data faster and adapt to new data faster, thereby better tracking the dynamic changes of the system.

[0082] In the embodiment of the present application, the voltage estimation model is implemented using a recursive least squares algorithm with a forgetting factor to ensure the response speed of the model and the accuracy of the model output results.

[0083] In one embodiment, Figure 3 A schematic diagram of a process for estimating the open circuit voltage of a battery is shown. Based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, the recursive least squares algorithm with a forgetting factor is used to determine the battery open circuit voltage of the battery at the current estimation time, including:

[0084] Step 301, based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, the battery identification parameters at the current estimation time are determined using a recursive least squares algorithm with a forgetting factor. The battery identification parameters at least include the electrical parameters of the path where the battery is located and the battery state.

[0085] like Figure 4 The first-order equivalent circuit model of a lithium battery in an electronic device is shown as an example, where R0 is the ohmic resistance in the charging circuit, R p and C p The RC network in the charging circuit is formed, R p It is called diffusion resistance, C p It is called diffusion capacitance. Among them, R0 is used to represent the resistance of the battery component as the charge in the double layer accumulates and dissipates. The RC network is used to simulate the diffusion voltage. This slow voltage change trend is due to the slow diffusion of lithium ions in the battery, which causes the polarization phenomenon caused by the imbalance of electrode ion concentration. Uocv is the open circuit voltage of the battery, U p is the voltage across the RC network, U t is the battery terminal voltage, and I is the loop current.

[0086] According to circuit principles, the electrical behavior of the first-order equivalent circuit model can be written in discrete time form:

[0087]

[0088] The dynamic voltage is defined as:

[0089]

[0090] Substituting the dynamic voltage expression into the terminal voltage expression yields:

[0091]

[0092] Among them, setting And define the identification vector of the model:

[0093]

[0094] Right now:

[0095] Among them, e is a natural constant; k is the sampling time, U p (k+1) is the voltage across the RC network at the k+1th sampling time; △T is the sampling time; I(k) is the loop current at the kth sampling time, which is also the battery current; U ocv (k) is the open circuit voltage of the battery at the kth sampling time; R0(k) is R0; U t (k-1) is the battery terminal voltage at the k-1 sampling time. φ k =[I(k-1),I(k),1,U t (k-1)] T The T in it stands for transpose.

[0096] From this we can see that:

[0097]

[0098] Here, from Formula 4, θ k (3) = (1-α)U OCV (k-1);θ k (4) = α.

[0099] In summary, based on the identification vector θ k The parameters in and the battery open circuit voltage U at the last estimation moment OCV (k-1) can determine the battery open circuit voltage at the current estimation time.

[0100] Therefore, θ k As a battery identification parameter, when estimating the battery open circuit voltage, the battery identification parameter must be determined first. OCV (k-1) represents the open circuit voltage of the battery at time k-1, so it represents the battery state in the battery identification parameters; α is an electrical parameter; since θ k (3) According to U OCV (k-1) determines, θ k (4) is equal to α, therefore, the battery identification parameters at least include the electrical parameters of the path where the battery is located and the battery status.

[0101] As can be seen from the above description, the recursive least squares method with forgetting factor introduces a forgetting factor, which makes the new data have a greater weight than the old data, thereby speeding up the response speed to parameter changes. Therefore, in the embodiment of the present application, based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, the recursive least squares algorithm with forgetting factor is used to determine the battery identification parameters at the current estimation time.

[0102] The recursive least squares method with forgetting factor is as follows:

[0103]

[0104] θ k =θ k-1 +K k (U t (k)-θ k-1 φ k )(8)

[0105] K k is the error gain of k sampling times; P k-1 is the error covariance matrix of k-1 samplings; λ is the forgetting factor; φ k is the state variable of the kth sampling. In the embodiment of the present application, the kth sampling may represent the current estimation time, and correspondingly, the k-1th sampling represents the previous estimation time.

[0106] Based on this, the battery identification parameter θ at the previous estimation time k The process is described below.

[0107] In one embodiment, Figure 5 A schematic diagram of a process for determining battery identification parameters is shown. Based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, the battery identification parameters at the current estimation time are determined using a recursive least squares algorithm with a forgetting factor, including:

[0108] Step 501, update the state space equation according to the battery charging parameters to obtain the battery state variable at the current estimation time. The state variable at the current estimation time is used to characterize the battery state at the current estimation time and the previous estimation time.

[0109] In addition, based on formulas 6 to 8, it can be seen that the reference estimation parameters include the battery identification parameters θ at the last estimation time k-1 and the error covariance matrix P at the previous estimation time k-1 .

[0110] Step 502, determining the estimation error at the current estimation time according to the battery charging parameters, the battery identification parameters at the previous estimation time and the battery state variable at the current estimation time.

[0111] Step 503, determining the error gain at the current estimation time according to the error covariance matrix at the previous estimation time, the battery state variable at the current estimation time, and the forgetting factor.

[0112] Step 504 , determining the battery identification parameters at the current estimation time according to the battery identification parameters at the previous estimation time, the error gain at the current estimation time, and the estimation error at the current estimation time.

[0113] Exemplarily, at the current estimation time, the electronic device reads the battery charging parameters at the current estimation time. The battery charging parameters may include the battery terminal voltage U t (k) and battery current I(k), etc. Optionally, the battery terminal voltage and battery current at the current estimation moment can be read from the fuel gauge chip.

[0114] Next, the identification vector φ in Formula 4 is k As a state variable, according to Formula 4, the state space equation can be: k =[I(k-1),I(k),1,U t (k-1)] T I(k) can be read from the fuel gauge chip, I(k-1) and U t (k-1) has also been read at the last estimation time. Therefore, by updating the state space equation according to the battery charging parameters, the battery state variables at the current estimation time can be obtained.

[0115] Based on formula 8, (U t (k)-θ k-1 φ k ) represents the estimation error, so the estimation error is set as: y(k)=(U t (k)-θ k-1 φ k ). It can be seen that according to the battery terminal voltage U in the battery charging parameters at the current estimation time t (k), the battery identification parameter θ at the last estimation time k-1 And the battery state variable φ at the current estimated time calculated in the previous step k The estimation error y(k) at the current estimation moment can be calculated.

[0116] Secondly, according to Formula 6, the estimated gain at the current estimation time is: And, according to φ k available Therefore, according to the error covariance matrix P at the last estimation moment k-1 , the battery state variable φ at the current estimation time k and the forgetting factor λ, the error gain at the current estimation moment can be determined. It should be noted that the forgetting factor can be preset; and if it is the first estimation moment, at this time P k-1 is the initial error covariance matrix P0, where P0 is a pre-set initial value; optionally, P0 is set as large as possible, for example, 1e6. In addition, the initial battery impedance can be set to 0, and the initial battery open circuit voltage can also be set to the battery terminal voltage at the time of the first estimation (the closer to the actual value, the faster the convergence). In this way, the initial iteration results can be closer to the reliable measurement value.

[0117] According to formula 8, the battery identification parameter at the current estimation time is: θ k =θ k-1 +K k (U t (k)-θ k-1 φ k ). It can be seen that according to the battery identification parameter θ at the last estimation time k-1 , the error gain K at the current estimation time k The battery identification parameters at the current estimation time can be determined by combining the estimation error y(k) at the current estimation time.

[0118] In addition, since the error covariance matrix at the current estimation time is needed for the next estimation, the error covariance matrix at the current estimation time is also calculated for use in the calculation process of the next battery identification parameters.

[0119] Exemplarily, the method further includes: determining the error covariance matrix at the current estimation moment according to the error covariance matrix at the previous estimation moment, the error gain at the current estimation moment, the battery state variable at the current estimation moment, and the forgetting factor.

[0120] That is, from Formula 7, we can see that P k =(P k-1 -K k φ k T P k-1 ) / λ, that is, the error covariance matrix P at the last estimation time k-1 , the error gain K at the current estimation time k , the battery state variable φ at the current estimation time k and the forgetting factor λ, the error covariance matrix P at the current estimation moment can be determined k .

[0121] Step 302, determining the battery open circuit voltage at the current estimation time according to the battery identification parameters at the current estimation time and the battery open circuit voltage determined at the previous estimation time.

[0122] According to Formula 5, the battery open circuit voltage at the current estimation time is: U OCV (k) = θ k (4)U OCV (k-1)+θ k (3). From the above, we can estimate θ k , so we can get θ k (4) and θ k (3). And, U OCV(k-1) is estimated at the last estimation time and recorded in the electronic device, so the battery open circuit voltage U at the current estimation time can be estimated OCV (k).

[0123] θ k (4) As the first battery identification parameter, θ k (3) As the second battery identification parameter, it can be known that the battery open circuit voltage at the current estimation time is determined according to the battery identification parameter at the current estimation time and the battery open circuit voltage determined at the previous estimation time, including: determining the product of the first battery identification parameter and the battery open circuit voltage at the previous estimation time, that is, θ k (4)U OCV (k-1); the sum of the product and the second battery identification parameter is used as the battery open circuit voltage at the current estimation moment.

[0124] Optionally, during the experiment, you can use θ k (3) to update the value of the resistor R0, and to verify whether the estimated battery open circuit voltage at the current estimation time meets the accuracy requirement based on the updated resistor R0.

[0125] It is understandable that judging the estimated U OCV (k) is the open circuit voltage of the battery with float voltage removed.

[0126] In the embodiment of the present application, the battery parameters and reference estimation parameters at the current estimation time can be determined, and the battery open circuit voltage at the previous estimation time can be combined to iteratively estimate the battery open circuit voltage at the current estimation time, thereby enhancing the response and adaptability of the battery open circuit voltage representation to the power supply condition. The recursive least squares algorithm with a forgetting factor is combined to speed up the response to parameter changes, thereby better tracking the dynamic changes of the system and ensuring the estimation accuracy and reliability.

[0127] The pre-charge process is described below.

[0128] In one embodiment, pre-charging a battery in a terminal based on a preset pre-charging current includes: pre-charging the battery in turn based on each pre-charging current, and the charging time for each pre-charging of the battery based on each pre-charging current is the preset charging time.

[0129] The preset pre-charge current includes a plurality of different pre-charge currents.

[0130] In this way, different pre-charge currents are used for alternating charging, and the charging current of the battery achieves a step state. In this way, the above-mentioned recursive least squares algorithm with forgetting factor can converge, avoiding the algorithm divergence caused by constant current, thereby ensuring the efficiency of algorithm convergence.

[0131] In one embodiment, the preset pre-charge current includes a first pre-charge current and a second pre-charge current.

[0132] That is, the first pre-charge current and the second pre-charge current are used alternately to pre-charge the battery, and the charging time for pre-charging the battery based on each pre-charge current is the preset charging time.

[0133] In this way, the current step can be guaranteed to make the algorithm converge, and the high complexity of the algorithm can be avoided.

[0134] In one embodiment, the first pre-charge current is smaller than the second pre-charge current; wherein the first pre-charge current is 0.95 times the standard pre-charge current; and the second pre-charge current is 1.05 times the standard pre-charge current.

[0135] Optionally, the standard pre-charge current can be 300 mA or 500 mA, which can be determined according to actual needs without specific limitation.

[0136] Taking into account the low power consumption of the bare-metal MCU program loaded in the pre-charging stage, the preset charging current is basically equal to the current entering the battery. From the power perspective, the average power of charging with the standard pre-charging current A, 95% A and 105% A is the same, and the test accuracy allows the current entering the battery to have an error of about 10% from the standard value. Therefore, the first pre-charging current can be set to 0.95 times the standard pre-charging current; the second pre-charging current can be set to 1.05 times the standard pre-charging current.

[0137] Optionally, the preset charging time is determined based on multiple experiments, for example, 3 seconds, or a shorter time, which is not specifically limited here.

[0138] It is understandable that parameters such as the first pre-charge current, the second pre-charge current and the preset charging time can be stored in a register of the charging chip of the electronic device and can be called when in use.

[0139] Based on the above, exemplarily, the pre-charge charging process is: first charge with a first pre-charge current and record the start charging time of charging with the first pre-charge current, and then in the process of charging with the first pre-charge current, the current system time can be periodically obtained to determine whether the difference between the current system time and the start charging time is greater than 3 seconds, if not, it is determined that the preset charging time has not yet been reached, and then continue to charge with the first pre-charge current; conversely, if it is determined that the difference is greater than 3 seconds, switch to charging with the second pre-charge current and record the start charging time of charging with the second pre-charge current, and then continue to obtain the current system time periodically in the process of charging with the second pre-charge current to determine whether the difference between the current system time and the start charging time of charging with the second pre-charge current is greater than 3 seconds, if not, it is determined that the preset charging time has not yet been reached, and then continue to charge with the second pre-charge current; conversely, if it is determined that the difference is greater than 3 seconds, repeat the above process and continue to charge with the first pre-charge current.

[0140] In one embodiment, determining whether the pre-charge exit condition is met is based on the real-time estimated battery open circuit voltage, including: if the battery open circuit voltage is greater than a target voltage threshold, determining that the pre-charge exit condition is met.

[0141] Optionally, if the electronic device is in a shutdown state due to over-discharge of the battery at the initial moment of connecting to the charger, the electronic device can remain in the shutdown state during the pre-charging process, and when the pre-charging stops and switches to other charging methods, the electronic device is controlled to start up and load the operating system of the electronic device. Based on this, the battery power of the electronic device can be 1% after it is turned on.

[0142] In this way, pre-charging can be exited at the appropriate time and switched to other charging methods, while ensuring that battery performance does not degrade and that the battery charging efficiency is high.

[0143] For ease of understanding, the following is a complete example to illustrate the charging method provided by the embodiment of the present application. Figure 6 As shown:

[0144] 1. When the electronic device is started after connecting to the charger, the BootLoader is run, and the current battery terminal voltage batt_volt is read from the fuel gauge chip. During startup, the charging function is not turned on, and there is no floating voltage, so the battery terminal voltage at this time is equal to the current battery open circuit voltage.

[0145] Secondly, if it is determined that the current battery terminal voltage batt_volt is greater than the preset power-on voltage threshold, it indicates that the device can be powered on normally, and the operating system of the electronic device is loaded and run; otherwise, the pre-charging process is entered.

[0146] 2. Enter the pre-charge process. In the pre-charge process, two functional algorithm modules deployed in the electronic device operate in parallel. One is the current control module that performs pre-charge, and the other is the voltage estimation module that identifies the battery open circuit voltage online. The voltage estimation module will run an online parameter identification algorithm based on ffrls (recursive least squares with forgetting factor). Among them, the relevant parameters need to be initialized before running, such as initializing the battery impedance to 0, the initial battery open circuit voltage is the battery terminal voltage read at the beginning, and the initial error covariance matrix is ​​set as large as possible, so that the initial iteration results are more reliable in the measured value.

[0147] 3. The voltage estimation module can be executed periodically in a thread every 2 seconds. In addition, the battery terminal voltage and battery current collected by the fuel gauge parameters can be updated every 1 second. The following operations are mainly performed in the thread:

[0148] (1) Obtain the battery terminal voltage and battery current at the current moment;

[0149] (2) updating the state space equation based on the battery terminal voltage and battery current to obtain the battery state variable at the current estimation time;

[0150] (3) determining the estimation error at the current estimation time based on the acquired parameters;

[0151] (4) determining the error gain at the current estimation time based on the acquired parameters;

[0152] (5) Update the covariance matrix at the current estimation time;

[0153] (6) determining the battery identification parameters at the current estimation time based on the acquired parameters;

[0154] (7) Determine the battery open circuit voltage at the current estimation time based on the acquired parameters.

[0155] The voltage estimation module cyclically determines whether the battery open circuit voltage at the current estimation moment exceeds the power-on voltage threshold (for example, 3.4V). If so, the pre-charging process is exited. At this time, the normal power-on process can be jumped to load the operating system and run.

[0156] 4. When entering the pre-charge process, assuming that the standard pre-charge current is set to A (A is 300 mA or A is 500 mA), set A*95% as a smaller current in the charging IC register, and set A*105% as a larger current in the charging IC register.

[0157] First, charge with a relatively small current and record the start time of charging with a relatively small current. Then, in the process of charging with a relatively small current, the current system time can be periodically obtained to determine whether the difference between the current system time and the start time of charging is greater than 3 seconds. If not, it is determined that the preset charging time has not yet been reached, and charging with a relatively small current continues. On the contrary, if it is determined that the difference is greater than 3 seconds, switch to charging with a relatively large current and record the start time of charging with a relatively large current. Then, in the process of charging with a relatively large current, the current system time can be periodically obtained to determine whether the difference between the current system time and the start time of charging with a relatively large current is greater than 3 seconds. If not, it is determined that the preset charging time has not yet been reached, and charging with a relatively large current continues. On the contrary, if it is determined that the difference is greater than 3 seconds, the above process is repeated to continue charging with a relatively small current.

[0158] In an embodiment of the present application, an optimized pre-charging method is provided, which can effectively calculate a reliable battery open-circuit voltage in real time during the pre-charging stage of an electronic device, and thereby accurately determine the timing of jumping from the pre-charging stage to normal startup and loading of an operating system. Compared with the existing a posteriori estimation scheme, this real-time estimation scheme can effectively shorten the pre-charging time, and can allow users to boot up the computer to the desktop with 1% battery instead of 2%\3% or other values.

[0159] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0160] Based on the same inventive concept, the embodiment of the present application also provides a charging device for implementing the above-mentioned charging method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more charging device embodiments provided below can refer to the limitations on the charging method above, and will not be repeated here.

[0161] In one embodiment, Figure 7 As shown, a charging device is provided, and the charging device 700 includes: a charging module 701, an estimation module 702, a determination module 703 and a control module 704, wherein:

[0162] The charging module 701 is used to pre-charge the battery of the terminal based on a preset pre-charge current when the pre-charge condition is met;

[0163] An estimation module 702, used for estimating a battery open circuit voltage of the battery based on a voltage estimation model during pre-charging;

[0164] A determination module 703 is used to determine whether a pre-charge exit condition is met according to the estimated battery open circuit voltage;

[0165] The control module 704 is used to stop pre-charging the battery when the pre-charging exit condition is met.

[0166] In one embodiment, the estimation module 702 is specifically used to: at each estimation moment in the pre-charging process, determine the battery open circuit voltage of the battery at the current estimation moment based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters; wherein, when the current estimation moment is not the first estimation moment of the pre-charging process, the reference estimation parameters are determined according to the estimation process of the previous estimation moment.

[0167] In one embodiment, the estimation module 702 is specifically used to determine the battery open circuit voltage of the battery at the current estimation moment by using a recursive least squares algorithm with a forgetting factor based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters.

[0168] In one embodiment, the estimation module 702 is specifically used to: determine the battery identification parameters at the current estimation moment based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters using a recursive least squares algorithm with a forgetting factor, wherein the battery identification parameters include at least the electrical parameters of the path where the battery is located and the battery status; determine the battery open circuit voltage at the current estimation moment based on the battery identification parameters at the current estimation moment and the battery open circuit voltage determined at the previous estimation moment.

[0169] In one embodiment, the reference estimation parameters include the battery identification parameters at the last estimation moment and the error covariance matrix at the last estimation moment; the estimation module 702 is specifically used to determine the battery identification parameters at the current estimation moment based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters using a recursive least squares algorithm with a forgetting factor, including: updating the state space equation according to the battery charging parameters to obtain the battery state variable at the current estimation moment; the state variable at the current estimation moment is used to characterize the battery state of the battery at the current estimation moment and the last estimation moment; determining the estimation error at the current estimation moment according to the battery charging parameters, the battery identification parameters at the last estimation moment and the battery state variable at the current estimation moment; determining the error gain at the current estimation moment according to the error covariance matrix at the last estimation moment, the battery state variable at the current estimation moment and the forgetting factor; determining the battery identification parameters at the current estimation moment according to the battery identification parameters at the last estimation moment, the error gain at the current estimation moment and the estimation error at the current estimation moment.

[0170] In one embodiment, the device also includes an error calculation module for determining the error covariance matrix at the current estimation moment based on the error covariance matrix at the previous estimation moment, the error gain at the current estimation moment, the battery state variable at the current estimation moment, and the forgetting factor.

[0171] In one embodiment, the estimation module 702 is specifically used to: determine the product of the first battery identification parameter and the battery open circuit voltage at the last estimation time; and use the sum of the product and the second battery identification parameter as the battery open circuit voltage at the current estimation time.

[0172] In one embodiment, the preset pre-charge current includes multiple different pre-charge currents; the charging module 701 is specifically used to: pre-charge and charge the battery in turn based on each pre-charge current, and the charging time for pre-charging the battery based on each pre-charge current is the preset charging time.

[0173] In one embodiment, the preset pre-charge current includes a first pre-charge current and a second pre-charge current.

[0174] In one embodiment, the first pre-charge current is smaller than the second pre-charge current; wherein the first pre-charge current is 0.95 times the standard pre-charge current; and the second pre-charge current is 1.05 times the standard pre-charge current.

[0175] In one embodiment, the device also includes a condition judgment module, which is used to: obtain the initial voltage of the battery before pre-charging; determine whether the initial voltage is greater than a target voltage threshold; if not, determine that the pre-charging condition is met.

[0176] In one embodiment, the determination module 703 is specifically used to: if the battery open circuit voltage is greater than the target voltage threshold, determine that the pre-charge exit condition is met.

[0177] Each module in the above charging device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0178] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and the external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a charging method is implemented. The display unit of the electronic device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the electronic device casing, or an external keyboard, touchpad or mouse.

[0179] Those skilled in the art will understand that Figure 8 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0180] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0181] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0182] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A charging method, characterized in that: The method comprises: When the pre-charging condition is met, pre-charging the battery of the terminal based on a preset pre-charging current; During the pre-charging process, estimating the battery open circuit voltage of the battery based on a voltage estimation model; Determining whether a pre-charge exit condition is met according to the estimated open circuit voltage of the battery; When the pre-charge exit condition is met, the pre-charge charging of the battery is stopped.

2. The method according to claim 1, characterized in that In the pre-charging process, estimating the battery open circuit voltage of the battery based on the voltage estimation model includes: At each estimation time in the pre-charging process, based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, determining the battery open circuit voltage of the battery at the current estimation time; Wherein, when the current estimation time is not the first estimation time of the pre-charging process, the reference estimation parameter is determined according to the estimation process of the previous estimation time.

3. The method according to claim 2, characterized in that The step of determining the battery open circuit voltage of the battery at the current estimation time based on the battery charging parameters collected at the current estimation time and the reference estimation parameters includes: Based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, a recursive least squares algorithm with a forgetting factor is used to determine the battery open circuit voltage of the battery at the current estimation time.

4. The method according to claim 3, characterized in that The method of determining the battery open circuit voltage of the battery at the current estimation time by using a recursive least squares algorithm with a forgetting factor based on the battery charging parameters collected at the current estimation time and the reference estimation parameters includes: Based on the battery charging parameters collected at the current estimation time and the reference estimation parameters, a recursive least squares algorithm with a forgetting factor is used to determine the battery identification parameters at the current estimation time, wherein the battery identification parameters at least include the electrical parameters of the path where the battery is located and the battery state; The battery open circuit voltage at the current estimation moment is determined according to the battery identification parameters at the current estimation moment and the battery open circuit voltage determined at the previous estimation moment.

5. The method according to claim 4, characterized in that The reference estimation parameters include the battery identification parameters at the last estimation moment and the error covariance matrix at the last estimation moment; the battery identification parameters at the current estimation moment are determined by using a recursive least squares algorithm with a forgetting factor based on the battery charging parameters collected at the current estimation moment and the reference estimation parameters, including: According to the battery charging parameters, the state space equation is updated to obtain the battery state variable at the current estimation time; the state variable at the current estimation time is used to characterize the battery state at the current estimation time and the previous estimation time; Determining an estimation error at a current estimation time according to the battery charging parameter, the battery identification parameter at the previous estimation time, and the battery state variable at the current estimation time; Determine the error gain at the current estimation time according to the error covariance matrix at the previous estimation time, the battery state variable at the current estimation time, and the forgetting factor; The battery identification parameter at the current estimation moment is determined according to the battery identification parameter at the previous estimation moment, the error gain at the current estimation moment, and the estimation error at the current estimation moment.

6. The method according to claim 5, characterized in that The method further comprises: The error covariance matrix at the current estimation moment is determined according to the error covariance matrix at the previous estimation moment, the error gain at the current estimation moment, the battery state variable at the current estimation moment, and the forgetting factor.

7. The method according to claim 4, characterized in that The battery identification parameters include a first battery identification parameter and a second battery identification parameter; the determining the battery open circuit voltage at the current estimation time according to the battery identification parameters at the current estimation time and the battery open circuit voltage determined at the previous estimation time includes: Determine the product of the first battery identification parameter and the battery open circuit voltage at the last estimation moment; The sum of the product and the second battery identification parameter is used as the battery open circuit voltage at the current estimation moment.

8. The method according to any one of claims 1 to 7, characterized in that: The preset pre-charge current includes a plurality of different pre-charge currents; The pre-charging of the battery in the terminal based on the preset pre-charging current includes: Based on the pre-charge currents, the batteries are pre-charged in turn, and the charging time for each pre-charge current to pre-charge the batteries is a preset charging time.

9. The method according to claim 8, characterized in that The preset pre-charge current includes a first pre-charge current and a second pre-charge current.

10. The method according to claim 9, characterized in that The first pre-charge current is less than the second pre-charge current; Among them, the first pre-charge current is 0.95 times the standard pre-charge current; the second pre-charge current is 1.05 times the standard pre-charge current.

11. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Obtaining an initial voltage of the battery before pre-charging; determining whether the initial voltage is greater than a target voltage threshold; If not, it is determined that the pre-charge condition is met.

12. The method according to claim 11, characterized in that The determining whether the pre-charge exit condition is met according to the estimated battery open circuit voltage includes: If the battery open circuit voltage is greater than the target voltage threshold, it is determined that the pre-charge exit condition is met.

13. A charging device, characterized in that: The device comprises: A charging module, used to pre-charge the battery of the terminal based on a preset pre-charge current when the pre-charge condition is met; An estimation module, used for estimating the battery open circuit voltage of the battery based on a voltage estimation model during pre-charging; A determination module, used to determine whether a pre-charge exit condition is met according to the estimated open circuit voltage of the battery; The control module is used to stop pre-charging the battery when the pre-charging exit condition is met.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

15. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.