Battery charge state detection method and device, equipment and program product

By constructing a state-space model and dynamically updating the forgetting factor of the measurement noise covariance matrix, the problem of insufficient accuracy of battery state of charge detection in complex scenarios by the Kalman filter algorithm is solved, and accurate and stable detection of battery state of charge is achieved.

CN121955748APending Publication Date: 2026-05-01CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
Filing Date
2026-03-26
Publication Date
2026-05-01

Smart Images

  • Figure CN121955748A_ABST
    Figure CN121955748A_ABST
Patent Text Reader

Abstract

The invention relates to a battery charge state detection method and device, equipment and a program product. The method comprises the following steps: updating a forgetting factor of a measurement noise covariance matrix of a state space model according to a comparison result of an actual error of a prediction circuit parameter measurement value and a theoretical error of the prediction circuit parameter measurement value to obtain an updated measurement noise covariance matrix, and performing positive qualitative correction on the updated measurement noise covariance matrix to obtain an updated state space model, and converting the actual circuit parameter measurement value into the target charge state of the battery at the target moment through the updated state space model. By adopting the method, the detection precision and robustness of the state of charge of the battery in a complex scene can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Battery state-of-charge detection methods, devices, equipment and procedures Technical Field

[0001] This application relates to the field of battery testing technology, and in particular to a method, apparatus, computer equipment, and computer program product for detecting the state of charge of a battery. Background Technology

[0002] Battery state of charge (SOC) detection has always been a focus of the automotive industry, as accurate SOC detection can provide a reliable foundation for technologies such as intelligent driving, energy management, and range optimization.

[0003] In related technologies, the State of Charge (SOC) of a battery is estimated based on the Kalman filter algorithm. However, this method relies too heavily on prior knowledge of sensor measurement noise. When the battery's operating conditions change (such as high-current charging / discharging switching, sudden load changes, etc.), the prior knowledge cannot adapt to this change, leading to a significant decrease in the accuracy and stability of the SOC estimation, and even the possibility of not being able to obtain an SOC estimation result. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for detecting battery state of charge that can improve the detection accuracy and robustness of battery state of charge in complex scenarios, in order to address the above-mentioned technical problems.

[0005] In a first aspect, this application provides a method for detecting the state of charge of a battery, including:

[0006] The initial state of charge of the battery is obtained, and the initial state of charge is converted into the predicted circuit parameter measurement values ​​of the battery at the target time by constructing a state-space model based on the state of charge of the battery.

[0007] The difference between the measured value of the predicted circuit parameters and the measured value of the actual circuit parameters of the battery at the target time is determined to obtain the actual error of the measured value of the predicted circuit parameters.

[0008] The predicted measurement covariance of the measured values ​​of the predicted circuit parameters is determined, and the innovation covariance is determined based on the predicted measurement covariance; the innovation covariance is used to characterize the theoretical error of the measured values ​​of the predicted circuit parameters.

[0009] Based on the comparison between the actual error and the theoretical error, the forgetting factor of the measurement noise covariance matrix of the state space model is updated to obtain the updated measurement noise covariance matrix; the forgetting factor is used to control the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix.

[0010] The updated measurement noise covariance matrix is ​​positively definite to obtain the updated state-space model;

[0011] The updated state-space model is used to convert the actual circuit parameter measurements into the target state of charge of the battery at the target time.

[0012] In one embodiment, both the actual circuit parameter measurement value and the predicted circuit parameter measurement value are vectors. Determining the difference between the predicted circuit parameter measurement value and the actual circuit parameter measurement value of the battery at the target time, to obtain the actual error of the predicted circuit parameter measurement value, includes:

[0013] The vector difference between the actual measured values ​​of the circuit parameters and the predicted measured values ​​of the circuit parameters is determined to obtain the innovation vector;

[0014] The sum of squares of the new information vector is determined to obtain the actual error.

[0015] In one embodiment, updating the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison between the actual error and the theoretical error includes:

[0016] The ratio of the sum of squares of the new information to the covariance of the new information is determined to obtain the comparison result;

[0017] The ratio is matched with multiple preset conditions, and the target condition that the ratio meets is determined among the multiple preset conditions; wherein, different preset conditions correspond to different measurement noise changes;

[0018] If the measurement noise change corresponding to the target condition is a sudden change, the value of the forgetting factor is reduced from the initial value to update the forgetting factor;

[0019] If the measurement noise change corresponding to the target condition is stable, the value of the forgetting factor is increased from the initial value to update the forgetting factor.

[0020] In one embodiment, when the measurement noise change corresponding to the target condition is a stable change, the target condition is that the ratio is greater than the first product of a first constant and a preset threshold, and the ratio is less than the second product of a second constant and the preset threshold; wherein, the first constant is less than the second constant; increasing the value of the forgetting factor from the initial value includes:

[0021] If the ratio is less than 1, a first update value is determined based on the ratio of the ratio to the first product;

[0022] If the ratio is greater than 1, a second update value is determined based on the ratio of the second product to the ratio.

[0023] The value of the forgetting factor is increased from the initial value using either the first update value or the second update value.

[0024] In one embodiment, when the measurement noise change corresponding to the target condition is a sudden change, if the sudden change is a decreasing sudden change, and the target condition is that the ratio is less than or equal to 1 and the ratio is less than or equal to the first product of a first constant and a preset threshold, then reducing the value of the forgetting factor from its initial value includes:

[0025] The third updated value is determined based on the ratio of the first product to the ratio.

[0026] The third update value is used to reduce the value of the forgetting factor from the initial value;

[0027] If the mutation is an increasing mutation, the target condition is that the ratio is greater than or equal to 1 and the ratio is greater than or equal to the second product of the second constant and the preset threshold; wherein, the first constant is less than the second constant; reducing the value of the forgetting factor from its initial value includes:

[0028] The fourth update value is determined based on the ratio of the stated ratio to the second product;

[0029] The fourth update value is used to reduce the value of the forgetting factor from the initial value.

[0030] In one embodiment, the positive definite correction of the updated measurement noise covariance matrix includes:

[0031] Determine the transpose of the updated measurement noise covariance matrix, and multiply the updated measurement noise covariance matrix by the transpose matrix to obtain a symmetric positive semi-definite matrix;

[0032] Extract the first main diagonal element of the symmetric positive semi-definite matrix, and then extract the second main diagonal element of the first main diagonal element;

[0033] The square root of the second main diagonal element is taken to obtain the measurement noise covariance matrix after positive definiteness correction.

[0034] In one embodiment, the state-space model further includes a state error covariance matrix. The process of converting the initial state of charge into predicted circuit parameter measurements of the battery at a target time using the state-space model constructed for the battery's state of charge includes:

[0035] The state error covariance is initialized based on the initial state of charge to obtain the first state error covariance matrix of the previous time step at the target time step;

[0036] Singular value decomposition is performed on the first state error covariance matrix, and the first state of charge prediction point set of the previous time step is generated based on the first state error covariance matrix after singular value decomposition.

[0037] The first state error covariance matrix is ​​updated based on the first state of charge prediction point set to obtain the second state error covariance matrix at the target time.

[0038] Singular value decomposition is performed on the second state error covariance matrix, and the second state of charge prediction point set at the target time is generated based on the second state error covariance matrix after singular value decomposition.

[0039] The second set of predicted state of charge points is input into the state space model to obtain the predicted circuit parameter measurements at the target time.

[0040] Secondly, this application also provides a battery state of charge detection device, comprising:

[0041] The acquisition module is used to acquire the initial state of charge of the battery and convert the initial state of charge into the predicted circuit parameter measurement values ​​of the battery at the target time through a state space model constructed for the state of charge of the battery.

[0042] The actual error determination module is used to determine the difference between the measured value of the predicted circuit parameters and the measured value of the actual circuit parameters of the battery at the target time, and to obtain the actual error of the measured value of the predicted circuit parameters.

[0043] The theoretical error determination module is used to determine the predicted measurement covariance of the measured values ​​of the predicted circuit parameters, and to determine the innovation covariance based on the predicted measurement covariance; the innovation covariance is used to characterize the theoretical error of the measured values ​​of the predicted circuit parameters.

[0044] The forgetting factor update module is used to update the forgetting factor of the measurement noise covariance matrix of the state space model based on the comparison result of the actual error and the theoretical error, so as to obtain the updated measurement noise covariance matrix; the forgetting factor is used to control the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix.

[0045] The model update module is used to perform positive definite correction on the updated measurement noise covariance matrix to obtain the updated state space model.

[0046] The output module is used to convert the actual circuit parameter measurements into the target state of charge of the battery at the target time using the updated state-space model.

[0047] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described battery state-of-charge detection method.

[0048] Fourthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described battery state-of-charge detection method.

[0049] The aforementioned battery state-of-charge detection method, device, computer equipment, and computer program products can reflect the real-time working state of the circuit sensor, which is close to the actual situation, by comparing the actual error and theoretical error of the measured values ​​of the predicted circuit parameters. Based on the comparison results, the forgetting factor of the measurement noise covariance matrix of the state-space model is dynamically updated. The forgetting factor controls the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix, thereby adaptively adjusting the balance between the noise dynamic tracking capability and noise robustness of the state-space model. At the same time, the positive definiteness of the measurement noise covariance matrix is ​​corrected to avoid the situation where the algorithm crashes and cannot output results. This enables accurate and stable detection of the target state of charge of the battery in complex scenarios. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0051] Figure 1 is an application environment diagram of the battery state-of-charge detection method provided in an embodiment of this application;

[0052] Figure 2 is a flowchart of the steps of a battery state-of-charge detection method provided in an embodiment of this application;

[0053] Figure 3 is a circuit diagram corresponding to the equivalent circuit model provided in an embodiment of this application;

[0054] Figure 4 is a diagram illustrating the update process of the measurement noise covariance matrix provided in an embodiment of this application;

[0055] Figure 5 is a flowchart of the state of charge detection process provided in an embodiment of this application;

[0056] Figure 6 is a structural block diagram of a battery state-of-charge detection device provided in an embodiment of this application;

[0057] Figure 7 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0058] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0059] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0060] The battery state-of-charge detection method provided in this application embodiment can be applied to the application environment shown in Figure 1. The terminal 102 communicates with the server 104 via a network. A data storage system can store the data that the server 104 needs to process. The data storage system can be integrated onto the server 104, or it can be located in the cloud or on another network server.

[0061] For example, terminal 102 sends a request to server 104 to detect the state of charge (SOC) of the battery. Server 104 obtains the initial SOC of the battery and converts it into predicted circuit parameter measurements of the battery at a target time using a state-space model constructed based on the SOC. Server 104 determines the difference between the predicted circuit parameter measurements and the actual circuit parameter measurements of the battery at the target time, thus obtaining the actual error of the state-space model. Server 104 determines the predicted measurement covariance of the predicted circuit parameter measurements and, based on the predicted measurement covariance, determines the innovation covariance. The innovation covariance is used to characterize the theoretical error of the state-space model. Based on the comparison between actual and theoretical errors, server 104 updates the forgetting factor of the measurement noise covariance matrix of the state-space model to obtain the updated measurement noise covariance matrix. The forgetting factor is used to control the weighting relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix. Server 104 performs positive definiteness correction on the updated measurement noise covariance matrix to obtain the updated state-space model. Server 104 uses the updated state-space model to convert the actual circuit parameter measurements into the target state of charge of the battery at the target time. Server 104 returns the target state of charge to terminal 102.

[0062] Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0063] In an exemplary embodiment, as shown in FIG2, a battery state of charge detection method is provided. Taking the application of this method to server 104 in FIG1 as an example, the method includes the following steps 202 to 212. Wherein:

[0064] Step 202: Obtain the initial state of charge of the battery, and convert the initial state of charge into the predicted circuit parameter measurement values ​​of the battery at the target time using a state-space model constructed for the state of charge of the battery.

[0065] The state-space model is a model that uses state variables to describe the dynamic system behavior of a battery, separating and modeling the battery's internal state, external input, and observed output. For example, the state-space model can be constructed based on the battery's equivalent circuit model, or through electrochemical principles, data-driven models, etc.

[0066] In practical implementation, the initial state of charge represents the initial state of charge, which can be initialized based on a preset algorithm (such as the ampere-hour integration method, estimator, etc.) or configured through prior knowledge. The state-space model takes the battery's state of charge as the system state variable and the measured values ​​of circuit parameters as input and output variables (e.g., current as input variable and voltage as output variable). It can model and observe the state changes of the battery system and predict the measured values ​​of circuit parameters at a target time (such as the next time after the current time) to obtain the predicted measured values ​​of circuit parameters.

[0067] For example, based on the second-order RC equivalent circuit model of the battery shown in Figure 3, Kirchhoff's voltage law (KVL) is applied to construct the battery dynamic characteristic equation as shown in equation (1):

[0068] (1)

[0069] in, For loop current, This is the load terminal voltage. Open circuit voltage, For ohmic internal resistance, R p R s C represents the two polarization resistors of the battery. p C s U represents the polarization capacitance corresponding to the two polarization resistors. p U s These are the polarization voltage values ​​across the two sets of RC series circuits, respectively.

[0070] Define the system state variables corresponding to the battery's state of charge: The input variable is The output variable is Discretizing equation (1) yields the discrete battery state-space equation and observation equation as shown in equation (2), i.e., the state-space model:

[0071] (2)

[0072] in, The sampling period is This can be the current sampling time. 1 can be the next sampling time (target time). The current at the current moment, , .

[0073] By initial state of charge The state-space model of input formula (2) is used to calculate the measured values ​​of the predicted circuit parameters at the target time.

[0074] In practical applications, offline parameter identification methods and HPPC (Hybrid Pulse Power Characterization) experiments can be used to obtain... , , , , The correspondence between each parameter and SOC and The correspondence between the SOC and the table is established to facilitate table lookup in subsequent algorithm calculations.

[0075] In some embodiments, the state-space model further includes a state error covariance matrix. The process of converting the initial state of charge into predicted circuit parameter measurements of the battery at a target time using the state-space model constructed for the battery's state of charge includes:

[0076] The state error covariance is initialized based on the initial state of charge to obtain the first state error covariance matrix of the previous time step at the target time step;

[0077] Singular value decomposition is performed on the first state error covariance matrix, and the first state of charge prediction point set of the previous time step is generated based on the first state error covariance matrix after singular value decomposition.

[0078] The first state error covariance matrix is ​​updated based on the first state of charge prediction point set to obtain the second state error covariance matrix at the target time.

[0079] Singular value decomposition is performed on the second state error covariance matrix, and the second state of charge prediction point set at the target time is generated based on the second state error covariance matrix after singular value decomposition.

[0080] The second set of predicted state of charge points is input into the state space model to obtain the predicted circuit parameter measurements at the target time.

[0081] In the specific implementation, the state-space model of equation (2) is rearranged to obtain:

[0082] (3)

[0083] in, For process noise, To measure noise, input variables (observed variables) are used. The output variable can be the voltage at both ends of the battery. It can be the battery current;

[0084] The initial state of charge is Then, the initial charged state state is used to initialize the state error covariance P, thus obtaining the first state error covariance matrix of the previous time step (such as the current time step) at the target time step. :

[0085] (4)

[0086] Furthermore, singular value decomposition is performed on equation (4):

[0087] (5)

[0088] in, and It is an orthogonal matrix, and its column vectors are respectively The left and right singular vectors, It is a diagonal matrix;

[0089] Furthermore, initialize the first set of predicted state-of-charge points to be generated, which is the weighting coefficient of the sigma point set of the system state variables at the previous time step:

[0090] (6)

[0091] in; System state variables The dimension; This is the scaling factor; it can be a non-negative number or 0. The mean weight of the center points of the sigma point set; The covariance weights of the center points of the sigma point set; The mean weight of the symmetric points of the sigma point set; The covariance weights of the symmetric points of the sigma point set; for The scaling factor for the distance between the point set and the sigma point set; used to reduce prediction errors caused by higher-order terms. A scaling factor that determines the degree of Sigma point diffusion; used to reduce the influence of higher-order terms. It is used to fuse prior information of random variables; it can improve the accuracy of variance. In practical applications, for Gaussian distributions, Setting the value to 2 yields better results.

[0092] Furthermore, the first set of predicted charge state points is generated based on equations (5) and (6):

[0093] (7)

[0094] in, This is the set of predicted points for the first state of charge at the previous time step. This represents the optimal estimate of the system state variables at the previous moment. This is the gain coefficient. ;

[0095] Based on the first state of charge prediction point set, substituting into equation (3), the target time is obtained. Prior estimate point set :

[0096] (8)

[0097] The mean of the prior estimated point set is:

[0098] (9)

[0099] The first state error covariance matrix is ​​updated using equations (8) and (9) to obtain the target time. The second state error covariance matrix:

[0100] (10)

[0101] Perform singular value decomposition on the second-state error covariance matrix:

[0102] (11)

[0103] The second state of charge prediction point set at the target time is generated using equation (11). :

[0104] (12)

[0105] in, The optimal estimate of the system state variables at the target time;

[0106] Substituting equation (12) into equation (3), the measured values ​​of the predicted circuit parameters at the target time are obtained through the state-space model. ,Right now The state-space model is based on until The predicted circuit parameter measurements are obtained by predicting all information at any given time.

[0107] In this embodiment, by performing singular value decomposition on the first state error covariance matrix and the second state error covariance matrix respectively, the numerical stability, positive definiteness and geometric structure of the state error covariance matrix are ensured, so that the generated first state of charge prediction point set and second state of charge prediction point set have good robustness and accuracy, thereby improving the prediction accuracy and prediction stability of the prediction circuit parameter measurement values ​​at the target time.

[0108] Step 204: Determine the difference between the measured value of the predicted circuit parameters and the measured value of the actual circuit parameters of the battery at the target time, and obtain the actual error of the measured value of the predicted circuit parameters;

[0109] In practical implementation, the actual circuit parameter measurement value at the target time can be obtained through sensor readings. For example, when the circuit parameter measurement value is the current, the current sensor of the battery can be read to obtain the actual circuit parameter measurement value at the target time.

[0110] The difference between the predicted circuit parameter measurements and the actual circuit parameter measurements can be calculated using a preset algorithm, including the difference, similarity index, and correlation index, to quantify the degree of difference between the predicted and actual circuit parameter measurements, i.e., the specific situation of the actual error.

[0111] In some embodiments, both the actual circuit parameter measurement value and the predicted circuit parameter measurement value are vectors. Determining the difference between the predicted circuit parameter measurement value and the actual circuit parameter measurement value of the battery at the target time, to obtain the actual error of the predicted circuit parameter measurement value, includes:

[0112] The vector difference between the actual measured values ​​of the circuit parameters and the predicted measured values ​​of the circuit parameters is determined to obtain the innovation vector;

[0113] The sum of squares of the new information vector is determined to obtain the actual error.

[0114] In practical implementation, the vector representation of the actual circuit parameter measurements is as follows: The vector representation of the predicted circuit parameter measurements is as follows Then the new information vector for:

[0115] (13)

[0116] The sum of squares of the new information is:

[0117] (14)

[0118] In this embodiment, the sum of squares of the new information can reflect the instantaneous difference between the measured values ​​of the actual circuit parameters and the measured values ​​of the predicted circuit parameters, transforming the vector difference into a difference index, thereby achieving real-time, unbiased and efficient quantification of the actual error.

[0119] Step 206: Determine the predicted measurement covariance of the predicted circuit parameter measurements, and determine the innovation covariance based on the predicted measurement covariance; the innovation covariance is used to characterize the theoretical error of the predicted circuit parameter measurements.

[0120] Among them, the predicted measurement covariance can be the covariance matrix of the predicted circuit parameter measurements, which is used to reflect the uncertainty of the predicted circuit parameter measurements.

[0121] Among them, the innovation covariance can theoretically reflect the uncertainty of the innovation. Specifically, it can be obtained by adding the prediction measurement covariance to the measurement noise, and thus characterize the theoretical error of the predicted circuit parameter measurement value.

[0122] In practical implementation, the predictive measurement covariance of the predicted circuit parameter measurements can be expressed as follows:

[0123] (15)

[0124] in, For covariance weights, Predicting circuit parameter measurements (which can also be expressed as) ), The mean of the measured values ​​of the predicted circuit parameters;

[0125] The new information covariance can be:

[0126] (16)

[0127] in, This represents the measurement noise from the previous moment.

[0128] Step 208: Based on the comparison between the actual error and the theoretical error, update the forgetting factor of the measurement noise covariance matrix of the state space model to obtain the updated measurement noise covariance matrix; the forgetting factor is used to control the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix.

[0129] The forgetting factor is a parameter in the measurement noise covariance matrix that controls the rate at which historical measurement noise is forgotten. A larger forgetting factor indicates a slower rate of forgetting historical measurement noise, a more important historical measurement noise covariance matrix, a more stable filtering effect on measurement noise, and stronger robustness of the measurement noise covariance matrix at the target time. Conversely, a smaller forgetting factor indicates a faster rate of forgetting historical measurement noise, a more important current measurement noise covariance matrix, a more sensitive perception of real-time changes in measurement noise, and stronger dynamic tracking capability of the measurement noise covariance matrix at the target time.

[0130] In the specific implementation, the historical measurement noise covariance matrix is ​​a historical estimate of the measurement noise covariance, and the current measurement noise covariance matrix is ​​an instantaneous estimate of the measurement noise covariance.

[0131] Let the historical measurement noise covariance matrix be... If the current measurement noise covariance matrix is ​​R, then the measurement noise covariance matrix at the target time is... for:

[0132] (17)

[0133] in, The weights of R, for The weight, , It is a forgetting factor.

[0134] The difference between actual error and theoretical error can reflect the deviation of the state-space model from the dynamic description of the battery's real physical system. Therefore, the forgetting factor can be updated based on the comparison between actual error and theoretical error.

[0135] For example, the greater the difference between the actual error and the theoretical error, the greater the change in measurement noise, and the more necessary it is to reduce the value of the forgetting factor to ensure real-time accuracy; conversely, the smaller the difference between the actual error and the theoretical error, the smaller the change in measurement noise, and the more necessary it is to increase the value of the forgetting factor to ensure the stability of measurement noise filtering.

[0136] In some embodiments, updating the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison between the actual error and the theoretical error includes:

[0137] The ratio of the sum of squares of the new information to the covariance of the new information is determined to obtain the comparison result;

[0138] The ratio is matched with multiple preset conditions, and the target condition that the ratio meets is determined among the multiple preset conditions; wherein, different preset conditions correspond to different measurement noise changes;

[0139] If the measurement noise change corresponding to the target condition is a sudden change, the value of the forgetting factor is reduced from the initial value to update the forgetting factor;

[0140] If the measurement noise change corresponding to the target condition is stable, the value of the forgetting factor is increased from the initial value to update the forgetting factor.

[0141] In the specific implementation, the sum of squares of the new information is shown in equation (14), the covariance of the new information is shown in equation (16), and equation (17) can be further transformed into:

[0142] (18)

[0143] The ratio of the sum of squares of new interest to the covariance of new interest for:

[0144] (19)

[0145] definition To control parameters, it can be done through The difference between the sum of squares of the innovation and the covariance of the innovation is quantified to characterize the comparison results between the two, and can also reflect the changes in measurement noise.

[0146] Will It can be matched with multiple preset conditions, which can be numerical judgment conditions (such as numerical range judgment conditions), complex logic judgment conditions, etc. Different preset conditions correspond to different measurement noise changes. For example, when the preset condition is a numerical judgment condition, multiple numerical ranges can be set, such as 0.9≤β. k ≤1.1 indicates that the measurement noise changes smoothly and the state-space model has a good fit; 1.1≤β k ≤1.5 indicates a slight increase in measurement noise and a slight mismatch in the state-space model; β k A value greater than 1.5 indicates a significant increase in measurement noise, suggesting a potential significant mismatch in the state-space model. The threshold values ​​within this range can be adjusted based on the specific characteristics of the sensor.

[0147] Further, determine If the target conditions are met, and the corresponding measurement noise changes abruptly, it indicates that factors such as battery condition and sensor condition may have undergone drastic changes. To improve the real-time estimation accuracy of measurement noise, the forgetting factor is reduced from its initial value to increase the weight of the current measurement noise covariance matrix and decrease the weight of the historical measurement noise covariance matrix. For example: , This is the initial value, ranging from 0.95 to 0.99. To adjust the value, you can... The specific values ​​will be determined.

[0148] If the measurement noise changes steadily under the target conditions, then factors such as battery condition and sensor condition can be considered to have no significant changes. To improve the filtering stability of the measurement noise, the forgetting factor is increased from its initial value to increase the weight of the historical measurement noise covariance matrix and decrease the weight of the current measurement noise covariance matrix. For example: , This is the initial value, ranging from 0.95 to 0.99. To adjust the value, you can... The specific values ​​will be determined.

[0149] In this embodiment, the forgetting factor is dynamically adjusted by measuring different changes in noise, automatically balancing the dynamic tracking capability and robustness of the measurement noise estimation, enhancing the system's adaptability to different battery operating conditions (such as steady-state operation, load sudden changes, sensor disturbances, etc.), thereby accurately estimating the battery's state of charge.

[0150] In some embodiments, when the measurement noise change corresponding to the target condition is a steady change, the target condition is that the ratio is greater than the first product of a first constant and a preset threshold, and the ratio is less than the second product of a second constant and the preset threshold; wherein, the first constant is less than the second constant; increasing the value of the forgetting factor from the initial value includes:

[0151] If the ratio is less than 1, a first update value is determined based on the ratio of the ratio to the first product;

[0152] If the ratio is greater than 1, a second update value is determined based on the ratio of the second product to the ratio.

[0153] The value of the forgetting factor is increased from the initial value using either the first update value or the second update value.

[0154] In practical implementation, if the measurement noise change corresponding to the target condition is a stationary change, then the target condition can be expressed as:

[0155] (20)

[0156] in, This is the ratio of the sum of squares of the new interest to the covariance of the new interest. The preset threshold can be set to 1, which indicates a normal state (actual error equals theoretical error). It is the first constant. The second constant is used to determine whether the measurement noise suddenly becomes a smaller value, while the first constant is used to determine whether the measurement noise suddenly becomes a larger value.

[0157] exist If the target conditions shown in equation (20) are met, the measurement noise is considered to be in a relatively stable phase, and the degree of change does not exceed the control threshold. >1 indicates that the actual error is greater than the theoretical error. <1 indicates that the actual error is greater than the theoretical error, so the forgetting factor will be... The value is increased from the initial value, and distinctions are made. >1 and Adaptive update for cases where <1:

[0158] (twenty one)

[0159] in, As the initial value, This is the first updated value. This is the second updated value. This is a forgetting factor variable, which can be preset. The larger the value, the better. The larger the adjustment range, the better. In practical applications, A value of 0.0015 is acceptable. One-fifth can be taken. 5 is acceptable.

[0160] In practical applications, a forgetting factor can also be set. Safety threshold boundaries, avoid The sudden change leads to excessive oscillation. For example, the safety threshold boundary is 0.95-0.99, calculated by equation (21). If the result of equation (21) is less than 0.95, then The value is 0.95; if the result of equation (21) is greater than 0.99, then The value is 0.99.

[0161] In this embodiment, when the measurement noise changes steadily, the weight of historical information is increased by increasing the forgetting factor, thereby enhancing the smoothness and steady-state accuracy of the measurement noise filtering. Furthermore, by introducing asymmetric proportional adjustment (i.e., the first update value and the second update value), a compensatory response is provided to the subtle directional differences between the actual error and the theory, further optimizing the unbiasedness of the measurement noise error estimation.

[0162] In some embodiments, when the measurement noise change corresponding to the target condition is a sudden change, if the sudden change is a decreasing sudden change, and the target condition is that the ratio is less than or equal to 1 and the ratio is less than or equal to the first product of a first constant and a preset threshold, then reducing the value of the forgetting factor from its initial value includes:

[0163] The third updated value is determined based on the ratio of the first product to the ratio.

[0164] The third update value is used to reduce the value of the forgetting factor from the initial value;

[0165] If the mutation is an increasing mutation, the target condition is that the ratio is greater than or equal to 1 and the ratio is greater than or equal to the second product of the second constant and the preset threshold; wherein, the first constant is less than the second constant; reducing the value of the forgetting factor from its initial value includes:

[0166] The fourth update value is determined based on the ratio of the stated ratio to the second product;

[0167] The fourth update value is used to reduce the value of the forgetting factor from the initial value.

[0168] In practical implementation, when the change in measurement noise corresponding to the target condition is an abrupt change, and the abrupt change is a decreasing abrupt change, the target condition can be expressed as:

[0169] (twenty two)

[0170] in, This is the ratio of the sum of squares of the new interest to the covariance of the new interest. The preset threshold can be set to 1, which indicates a normal state (actual error equals theoretical error). The first constant is used to determine whether the measurement noise suddenly becomes a smaller value.

[0171] exist Under the condition that the target conditions shown in equation (22) are met, it is considered that the measurement noise suddenly changes to a small value and the degree of change exceeds the control threshold (i.e., the first product). To ensure the real-time estimation accuracy of measurement noise, a forgetting factor will be used. The value is decreased from the initial value:

[0172] (twenty three)

[0173] in, As the initial value, This is the third updated value. This is a forgetting factor variable, which can be preset. The larger the value, the better. The larger the adjustment range.

[0174] When the change in measurement noise corresponding to the target condition is a sudden change, and the sudden change is an increasing sudden change, the target condition can be expressed as:

[0175] (twenty four)

[0176] in, This is the ratio of the sum of squares of the new interest to the covariance of the new interest. The preset threshold can be set to 1, which indicates a normal state (actual error equals theoretical error). This is the second constant, which is used to determine whether the measurement noise suddenly becomes a large value.

[0177] exist If the target conditions shown in equation (24) are met, it is considered that the measurement noise suddenly changes to a large value and the degree of change exceeds the control threshold (i.e., the second product). To ensure the real-time estimation accuracy of measurement noise, a forgetting factor will be used. The value is decreased from the initial value:

[0178] (25)

[0179] in, As the initial value, This is the fourth updated value. This is a forgetting factor variable, which can be preset. The larger the value, the better. The larger the adjustment range.

[0180] In practical applications, a forgetting factor can also be set. Safety threshold boundaries, avoid The abrupt change leads to excessive oscillation. For example, the safety threshold boundary of 0.95-0.99 is calculated using equation (23) or equation (25). If the result of equation (23) or equation (25) is less than 0.95, then The value is 0.95; if the result of equation (23) or equation (25) is greater than 0.99, then The value is 0.99.

[0181] In this embodiment, when the measurement noise changes abruptly, the forgetting factor is adjusted differently by applying the third and fourth update values ​​to distinguish between increasing and decreasing the abrupt change. This not only ensures the dynamic tracking capability of the state-space model of the measurement noise when the operating conditions change abruptly, but also accurately responds to measurement noise interference of different natures, effectively enhancing the anti-disturbance capability and numerical stability of the state of charge detection under sudden strong interference.

[0182] Step 210: Perform positive definite correction on the updated measurement noise covariance matrix to obtain the updated state-space model;

[0183] In practical implementation, when the measurement noise covariance matrix is ​​negative definite, it can lead to anomalies in the process of converting the actual circuit parameter measurements into the target state of charge. Therefore, in order to improve the stability and robustness of the state of charge detection, the updated measurement noise covariance matrix is ​​further corrected for positive definiteness.

[0184] For example, the positive definiteness of the measurement noise covariance matrix can be corrected by eigenvalues ​​or singular values, or by symmetric projection.

[0185] In some embodiments, the positive definite correction of the updated measurement noise covariance matrix includes:

[0186] Determine the transpose of the updated measurement noise covariance matrix, and multiply the updated measurement noise covariance matrix by the transpose matrix to obtain a symmetric positive semi-definite matrix;

[0187] Extract the first main diagonal element of the symmetric positive semi-definite matrix, and then extract the second main diagonal element of the first main diagonal element;

[0188] The square root of the second main diagonal element is taken to obtain the measurement noise covariance matrix after positive definiteness correction.

[0189] In the specific implementation, the corrected measurement noise covariance matrix for:

[0190] (26)

[0191] in, To update the measurement noise covariance matrix after the forgetting factor, for The transpose of the matrix, It is a symmetric positive semi-definite matrix. Indicates to Extract the first main diagonal element. This indicates that the second main diagonal element is extracted again from the first main diagonal element.

[0192] In this embodiment, by extracting the main diagonal elements twice, a numerically stable and strictly diagonally positive definite correction matrix is ​​constructed. This forces the diagonal elements of the corrected measurement noise covariance matrix to be non-negative, thus ensuring the physical meaning of the noise model and effectively improving the robustness of the state of charge detection.

[0193] In some embodiments, as shown in Figure 4, a flowchart of updating and positive definiteness correction of the measurement noise covariance matrix is ​​illustrated below:

[0194] The control factor is obtained by calculating the ratio of the sum of squares of the new ideas to the covariance of the new ideas. ;

[0195] right Determine the size:

[0196] like Then, the updated forgetting factor is calculated using equation (23). ;

[0197] like Then, the updated forgetting factor is calculated using equation (21). ;

[0198] like Then, the updated forgetting factor is calculated using equation (25). ;

[0199] Using the updated forgetting factor Update the measurement noise covariance matrix at target time k. ;

[0200] Application of formula (26) After performing positive definiteness correction, the corrected measurement noise covariance matrix is ​​obtained. .

[0201] Step 212: Using the updated state-space model, the actual circuit parameter measurements are converted into the target state of charge of the battery at the target time.

[0202] In practical implementation, the actual circuit parameter measurements can be converted into the target state of charge of the battery at the target time through a preset algorithm (such as the Kalman filter algorithm) and the updated state space model.

[0203] For example, calculate the predicted values ​​and covariances of the observed variables at the target time k, and the cross-covariance of x and y:

[0204] (27)

[0205] (28)

[0206] Where g() represents the updated state-space model. The observed variables (input variables) at time k-1. Let k be the predicted value of the system state variable (i.e., the state of charge of the battery) at time k. For time-based systems, The predicted value of the observed variable (output variable). These are the weighting coefficients. To calculate the weighted mean of the output variables, Let covariance be the predicted values ​​of the observed variable. Let be the measurement noise covariance matrix at time k-1.

[0207] Furthermore, the Kalman gain is calculated. :

[0208] (29)

[0209] Furthermore, update the estimated mean of the system state variables at the target time k. With the estimated value of the error covariance matrix :

[0210] (30)

[0211] Finally, update the state variable estimates according to equation (30). That is, the target state of charge at the target time k.

[0212] In some embodiments, as shown in Figure 5, a flowchart for detecting the target state of charge is also provided, as follows:

[0213] Based on the second-order RC equivalent circuit model of the battery, a state-space model as shown in equation (3) is constructed, including the state equation of the battery. and observation equations ;

[0214] Application formula (6) initialization requires generation The weighting coefficients of the Sigma point set (first state of charge prediction point set) at time -1 are generated using equation (7). The Sigma point set at time -1;

[0215] Applying equations (8), (9), and (10) to update the state variables and covariance (first state error covariance matrix) yields the target time. The second state error covariance matrix is ​​obtained by applying equation (11) to perform singular value decomposition on the second state error covariance matrix, and the target time is generated by applying equation (12). The Sigma point set (second state of charge prediction point set);

[0216] Use equation (19) to calculate the ratio of the sum of squares of new ideas to the covariance of new ideas. ,according to The size is calculated using the following formula (31) to calculate the forgetting factor in the Sage-Huas algorithm. :

[0217] (31)

[0218] use Update the measurement noise covariance matrix at target time k This updates the state-space model;

[0219] Using the updated state-space model, equations (27) to (30) are applied to update the predicted values ​​and covariance of the observed variables, calculate the Kalman gain, update the error covariance, update the estimated values ​​of the state variables, and output the target state of charge at the target time k. .

[0220] The embodiments of this application have the following advantages: By comparing the actual error and theoretical error of the predicted circuit parameter measurement values, the real-time working state of the circuit sensor can be reflected as close to the actual situation. Then, based on the comparison results, the forgetting factor of the measurement noise covariance matrix of the state space model is dynamically updated. The forgetting factor controls the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix, thereby adaptively adjusting the balance between the noise dynamic tracking capability and noise robustness of the state space model. At the same time, the positive definiteness of the measurement noise covariance matrix is ​​also corrected to avoid the situation where the algorithm crashes and cannot output results, so that the target state of charge of the battery can be detected accurately and stably in complex scenarios.

[0221] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0222] Based on the same inventive concept, this application also provides a battery state-of-charge (POC) detection device for implementing the battery POC detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the battery POC detection device provided below can be found in the limitations of the battery POC detection method described above, and will not be repeated here.

[0223] In one exemplary embodiment, as shown in FIG6, a battery state-of-charge detection device 60 is provided, comprising:

[0224] The acquisition module 602 is used to acquire the initial state of charge of the battery and convert the initial state of charge into the predicted circuit parameter measurement values ​​of the battery at the target time through a state space model constructed for the state of charge of the battery.

[0225] The actual error determination module 604 is used to determine the difference between the measured value of the predicted circuit parameters and the measured value of the actual circuit parameters of the battery at the target time, and to obtain the actual error of the measured value of the predicted circuit parameters.

[0226] The theoretical error determination module 606 is used to determine the predicted measurement covariance of the measured values ​​of the predicted circuit parameters, and to determine the innovation covariance based on the predicted measurement covariance; the innovation covariance is used to characterize the theoretical error of the measured values ​​of the predicted circuit parameters.

[0227] The forgetting factor update module 608 is used to update the forgetting factor of the measurement noise covariance matrix of the state space model according to the comparison result of the actual error and the theoretical error, so as to obtain the updated measurement noise covariance matrix; the forgetting factor is used to control the weight relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix.

[0228] The model update module 610 is used to perform positive definite correction on the updated measurement noise covariance matrix to obtain the updated state space model.

[0229] Output module 612 is used to convert the actual circuit parameter measurement values ​​into the target state of charge of the battery at the target time through the updated state space model.

[0230] In one embodiment, both the actual circuit parameter measurement value and the predicted circuit parameter measurement value are vectors. Determining the difference between the predicted circuit parameter measurement value and the actual circuit parameter measurement value of the battery at the target time, to obtain the actual error of the predicted circuit parameter measurement value, includes:

[0231] The vector difference between the actual measured values ​​of the circuit parameters and the predicted measured values ​​of the circuit parameters is determined to obtain the innovation vector;

[0232] The sum of squares of the new information vector is determined to obtain the actual error.

[0233] In one embodiment, updating the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison between the actual error and the theoretical error includes:

[0234] The ratio of the sum of squares of the new information to the covariance of the new information is determined to obtain the comparison result;

[0235] The ratio is matched with multiple preset conditions, and the target condition that the ratio meets is determined among the multiple preset conditions; wherein, different preset conditions correspond to different measurement noise changes;

[0236] If the measurement noise change corresponding to the target condition is a sudden change, the value of the forgetting factor is reduced from the initial value to update the forgetting factor;

[0237] If the measurement noise change corresponding to the target condition is stable, the value of the forgetting factor is increased from the initial value to update the forgetting factor.

[0238] In one embodiment, when the measurement noise change corresponding to the target condition is a stable change, the target condition is that the ratio is greater than the first product of a first constant and a preset threshold, and the ratio is less than the second product of a second constant and the preset threshold; wherein, the first constant is less than the second constant; increasing the value of the forgetting factor from the initial value includes:

[0239] If the ratio is less than 1, a first update value is determined based on the ratio of the ratio to the first product;

[0240] If the ratio is greater than 1, a second update value is determined based on the ratio of the second product to the ratio.

[0241] The value of the forgetting factor is increased from the initial value using either the first update value or the second update value.

[0242] In one embodiment, when the measurement noise change corresponding to the target condition is a sudden change, if the sudden change is a decreasing sudden change, and the target condition is that the ratio is less than or equal to 1 and the ratio is less than or equal to the first product of a first constant and a preset threshold, then reducing the value of the forgetting factor from its initial value includes:

[0243] The third updated value is determined based on the ratio of the first product to the ratio.

[0244] The third update value is used to reduce the value of the forgetting factor from the initial value;

[0245] If the mutation is an increasing mutation, the target condition is that the ratio is greater than or equal to 1 and the ratio is greater than or equal to the second product of the second constant and the preset threshold; wherein, the first constant is less than the second constant; reducing the value of the forgetting factor from its initial value includes:

[0246] The fourth update value is determined based on the ratio of the stated ratio to the second product;

[0247] The fourth update value is used to reduce the value of the forgetting factor from the initial value.

[0248] In one embodiment, the positive definite correction of the updated measurement noise covariance matrix includes:

[0249] Determine the transpose of the updated measurement noise covariance matrix, and multiply the updated measurement noise covariance matrix by the transpose matrix to obtain a symmetric positive semi-definite matrix;

[0250] Extract the first main diagonal element of the symmetric positive semi-definite matrix, and then extract the second main diagonal element of the first main diagonal element;

[0251] The square root of the second main diagonal element is taken to obtain the measurement noise covariance matrix after positive definiteness correction.

[0252] In one embodiment, the state-space model further includes a state error covariance matrix. The process of converting the initial state of charge into predicted circuit parameter measurements of the battery at a target time using the state-space model constructed for the battery's state of charge includes:

[0253] The state error covariance is initialized based on the initial state of charge to obtain the first state error covariance matrix of the previous time step at the target time step;

[0254] Singular value decomposition is performed on the first state error covariance matrix, and the first state of charge prediction point set of the previous time step is generated based on the first state error covariance matrix after singular value decomposition.

[0255] The first state error covariance matrix is ​​updated based on the first state of charge prediction point set to obtain the second state error covariance matrix at the target time.

[0256] Singular value decomposition is performed on the second state error covariance matrix, and the second state of charge prediction point set at the target time is generated based on the second state error covariance matrix after singular value decomposition.

[0257] The second set of predicted state of charge points is input into the state space model to obtain the predicted circuit parameter measurements at the target time.

[0258] Each module in the aforementioned battery state-of-charge detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.

[0259] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram is shown in Figure 7. The computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is connected to the system bus via the I / O interfaces. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device stores data including, but not limited to, initial state of charge (IBC). The I / O interfaces of the computer device are used for exchanging information between the processor and external devices. The communication interface of the computer device is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a battery IBC detection method.

[0260] Those skilled in the art will understand that the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0261] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the battery state-of-charge detection method described above.

[0262] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements a battery state-of-charge detection method.

[0263] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the battery state-of-charge detection method described above.

[0264] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0265] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory 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), magnetic 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0266] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 application.

[0267] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for detecting the state of charge of a battery, characterized in that, The method includes: acquiring the initial state of charge (SOC) of the battery; converting the initial SOC into predicted circuit parameter measurements of the battery at a target time using a state-space model constructed for the SOC; determining the difference between the predicted circuit parameter measurements and the actual circuit parameter measurements of the battery at the target time to obtain the actual error of the predicted circuit parameter measurements; determining the predicted measurement covariance of the predicted circuit parameter measurements; determining the innovation covariance based on the predicted measurement covariance; the innovation covariance being used to characterize the theoretical error of the predicted circuit parameter measurements; updating the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison between the actual error and the theoretical error to obtain an updated measurement noise covariance matrix; the forgetting factor being used to control the weighting relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix; performing positive definiteness correction on the updated measurement noise covariance matrix to obtain an updated state-space model; and converting the actual circuit parameter measurements into the target SOC of the battery at the target time using the updated state-space model.

2. The method according to claim 1, characterized in that, Both the actual circuit parameter measurement value and the predicted circuit parameter measurement value are vectors. Determining the difference between the predicted circuit parameter measurement value and the actual circuit parameter measurement value of the battery at the target time to obtain the actual error of the predicted circuit parameter measurement value includes: determining the vector difference between the actual circuit parameter measurement value and the predicted circuit parameter measurement value to obtain the innovation vector; and determining the sum of squares of the innovation vectors to obtain the actual error.

3. The method according to claim 2, characterized in that, The step of updating the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison result of the actual error and the theoretical error includes: determining the ratio of the sum of squares of innovation to the covariance of innovation to obtain the comparison result; matching the ratio with multiple preset conditions, and determining the target condition that the ratio meets among the multiple preset conditions; wherein, different preset conditions correspond to different measurement noise changes; when the measurement noise change corresponding to the target condition is an abrupt change, the value of the forgetting factor is decreased from the initial value to update the forgetting factor; when the measurement noise change corresponding to the target condition is a steady change, the value of the forgetting factor is increased from the initial value to update the forgetting factor.

4. The method according to claim 3, characterized in that, When the measurement noise change corresponding to the target condition is a stable change, the target condition is that the ratio is greater than the first product of a first constant and a preset threshold, and the ratio is less than the second product of a second constant and the preset threshold; wherein, the first constant is less than the second constant; increasing the value of the forgetting factor from the initial value includes: if the ratio is less than 1, determining a first update value based on the ratio of the ratio to the first product; if the ratio is greater than 1, determining a second update value based on the ratio of the second product to the ratio; and increasing the value of the forgetting factor from the initial value using either the first update value or the second update value.

5. The method according to claim 3, characterized in that, When the change in measurement noise corresponding to the target condition is a sudden change, if the sudden change is a decreasing sudden change, the target condition is that the ratio is less than or equal to 1 and the ratio is less than or equal to the first product of a first constant and a preset threshold. Reducing the value of the forgetting factor from its initial value includes: determining a third update value based on the ratio of the first product to the ratio; using the third update value to reduce the value of the forgetting factor from its initial value. If the sudden change is an increasing sudden change, the target condition is that the ratio is greater than or equal to 1 and the ratio is greater than or equal to the second product of a second constant and the preset threshold; wherein the first constant is less than the second constant. Reducing the value of the forgetting factor from its initial value includes: determining a fourth update value based on the ratio of the ratio to the second product; using the fourth update value to reduce the value of the forgetting factor from its initial value.

6. The method according to any one of claims 1 to 5, characterized in that, The step of performing positive definite correction on the updated measurement noise covariance matrix includes: determining the transpose matrix of the updated measurement noise covariance matrix; multiplying the updated measurement noise covariance matrix by the transpose matrix to obtain a symmetric positive semi-definite matrix; extracting the first main diagonal elements of the symmetric positive semi-definite matrix; extracting the second main diagonal elements of the first main diagonal elements; and taking the square root of the second main diagonal elements to obtain the positive definite corrected measurement noise covariance matrix.

7. The method according to any one of claims 1 to 5, characterized in that, The state-space model further includes a state error covariance matrix. The process of converting the initial state of charge (SOC) into predicted circuit parameter measurements at the target time using the state-space model constructed for the SOC of the battery includes: initializing the SOC based on the initial SOC to obtain a first SOC covariance matrix at the previous time step; performing singular value decomposition (SVD) on the first SOC covariance matrix and generating a first SOC prediction point set at the previous time step based on the SVD-derived first SOC prediction point set; updating the first SOC prediction point set to obtain a second SOC covariance matrix at the target time step; performing SVD on the second SOC covariance matrix and generating a second SOC prediction point set at the target time step; and inputting the second SOC prediction point set into the state-space model to obtain the predicted circuit parameter measurements at the target time step.

8. A battery state-of-charge detection device, characterized in that, The device includes: an acquisition module for acquiring the initial state of charge (SOC) of the battery and converting the SOC into predicted circuit parameter measurements of the battery at a target time using a state-space model constructed for the SOC; an actual error determination module for determining the difference between the predicted circuit parameter measurements and the actual circuit parameter measurements of the battery at the target time, thereby obtaining the actual error of the predicted circuit parameter measurements; and a theoretical error determination module for determining the predicted measurement covariance of the predicted circuit parameter measurements and determining the innovation covariance based on the predicted measurement covariance; the innovation covariance is used to characterize the theoretical error of the predicted circuit parameter measurements. The system includes a forgetting factor update module, which updates the forgetting factor of the measurement noise covariance matrix of the state-space model based on the comparison between the actual error and the theoretical error, to obtain an updated measurement noise covariance matrix. The forgetting factor controls the weighting relationship between the current measurement noise covariance matrix and the historical measurement noise covariance matrix in the measurement noise covariance matrix. A model update module performs positive definiteness correction on the updated measurement noise covariance matrix to obtain an updated state-space model. An output module converts the actual circuit parameter measurements into the target state of charge of the battery at the target time using the updated state-space model.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.