Capacitance estimation method and device based on improved variational Bayesian Kalman filtering
By improving the variational Bayesian Kalman filter method and combining a pre-charge model with fixed-point iterative operations, the problem of the standard Kalman filter algorithm's inability to adapt to time-varying measurement noise in capacity estimation is solved, thus achieving higher-precision capacity estimation.
Patent Information
- Application Number
- CN202511609998.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-01-30
AI Technical Summary
In existing technologies, the standard Kalman filter algorithm cannot adapt to time-varying noise, resulting in poor accuracy of capacitance estimation.
An improved variational Bayesian Kalman filter method is adopted. The prior distribution parameters are estimated by the posterior distribution parameters based on time k-1. The capacitance of the capacitor is calculated by N fixed-point iterations combined with the pre-charge model. The capacitance is estimated using the capacitor voltage and current information.
This improves the accuracy of capacitance estimation, reduces the impact of noise on state estimation, and enhances the precision of capacitor capacitance estimation.
Smart Images

Figure CN121432276A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for estimating equipment parameters, specifically a capacitance estimation method and apparatus based on an improved variational Bayesian Kalman filter. Background Technology
[0002] The standard Kalman filter (KF) is an optimal recursive estimation algorithm used to estimate the internal state of a linear system with uncertainties. The KF algorithm is often used to estimate the parameters of devices when they are difficult to measure and determine directly.
[0003] When capacitance is difficult to measure and determine directly, the state of charge and capacitance of the battery in the system are considered as hidden states of the system. The measured voltage and current are used as observations, and these unmeasurable parameters are dynamically and optimally estimated using Kernel-Frankel (KF) estimation. Generally, this algorithm has good performance for state estimation of linear state-space models, but it cannot adapt to time-varying noise, resulting in poor accuracy of the estimated capacitance. Summary of the Invention
[0004] The technical problem to be solved by the present invention is that the above-mentioned methods commonly used in the prior art cannot adaptively measure noise, resulting in poor accuracy of the estimated capacitance. In order to solve the above problem, the present invention provides a capacitance estimation method and device based on improved variational Bayesian Kalman filtering.
[0005] The content of this invention includes: In a first aspect, embodiments of the present invention provide a capacitance estimation method based on an improved variational Bayesian Kalman filter, comprising: Based on the posterior distribution parameters estimated at time k-1, the prior distribution parameters at time k are obtained. The posterior distribution parameters include posterior degrees of freedom, posterior scale matrix, posterior mean, and posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom, prior scale matrix, prior mean, and prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the posterior distribution parameters at time k, where N is a positive integer; The estimated value of the state vector at time k is determined based on the posterior distribution parameters at time k; Using a pre-built pre-charge model, the capacitance of the capacitor is calculated based on the estimated value to obtain the estimated capacitance; The measurement information includes capacitor voltage, the state vector includes model parameters of the pre-charge model, and the measurement noise covariance matrix is the covariance matrix of random noise in the measurement process of the measurement information.
[0006] Optionally, the pre-charge model is: ; in, Let be the capacitor voltage at time k. Let the capacitor voltage be at time k-1. Let K be the capacitor current at time k. Let the capacitor current be at time k-1. Let be the noise vector at time k. and For regression coefficients, The state vector includes autoregressive coefficients. , and .
[0007] Optionally, the posterior degrees of freedom parameters for performing i+1 fixed-point iterations at time k. The posterior scale matrix The posterior mean and the posterior covariance matrix for: ; ; ; ; in, Let the prior mean be the result of performing i fixed-point iterations at time k. Let the prior covariance matrix be the result of performing i fixed-point iterations at time k. Let be the prior degrees of freedom parameter at time k. Let k be the prior scaling matrix at time k. for The observation matrix is used to construct a linear relationship between the state vector and the measurement information. Let be the measurement noise covariance matrix of the (i+1)th fixed-point iteration operation during the k-th filtering process. Let i be the measurement information at time k, where i is a positive integer.
[0008] Optionally, the prior mean of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior mean of the (i+1)th fixed-point iteration operation, and the prior covariance matrix of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior covariance matrix of the (i+1)th fixed-point iteration operation.
[0009] Optionally, the step of performing N fixed-point iterations based on the measurement information at time k and the prior distribution parameters at time k to obtain the posterior distribution parameters at time k includes: Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the first posterior distribution parameters, which are the posterior distribution parameters obtained by performing N fixed-point iteration operations at time k. The posterior distribution parameter at time k is determined based on the first posterior distribution parameter and the second posterior distribution parameter, wherein the second posterior distribution parameter is the posterior distribution parameter after performing N fixed-point iteration operations at time k-1.
[0010] Optionally, the posterior mean at time k and the posterior covariance matrix for: ; ; in, Let N be the posterior mean of the fixed-point iterations performed at time k. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k-1. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k. The posterior covariance matrix is the result of performing N fixed-point iterations at time k-1.
[0011] Optionally, determining the estimated value of the state vector at time k based on the posterior distribution parameters at time k includes: A first independent distribution of the state vector is determined based on the posterior mean and the posterior covariance matrix, and a second independent distribution of the measurement noise covariance matrix is determined based on the posterior degrees of freedom parameter and the posterior scale matrix. The first independent distribution and the second independent distribution are used to approximate the joint posterior PDF of the state vector and the measurement noise covariance matrix. The estimated value of the state vector at time k is determined based on the first independent distribution.
[0012] Secondly, embodiments of the present invention also provide a capacitance estimation device based on an improved variational Bayesian Kalman filter, comprising: An estimation module is used to estimate the prior distribution parameters at time k based on the posterior distribution parameters at time k-1. The posterior distribution parameters include posterior degrees of freedom, a posterior scale matrix, a posterior mean, and a posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom, a prior scale matrix, a prior mean, and a prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. The iterative operation module is used to perform N fixed-point iterative operations based on the measurement information at time k and the prior distribution parameters at time k, to obtain the posterior distribution parameters at time k, where N is a positive integer; A determination module is used to determine the estimated value of the state vector at time k based on the posterior distribution parameters at time k; The calculation module is used to calculate the capacitance of the capacitor based on the estimated value using a pre-built pre-charge model, so as to obtain the estimated capacitance. The measurement information includes capacitor voltage, the state vector includes model parameters of the pre-charge model, and the measurement noise covariance matrix is the covariance matrix of random noise in the measurement process of the measurement information.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a program stored in the memory and executable on the processor; the processor is configured to read the program in the memory to implement the steps in the capacitance estimation method based on improved variational Bayesian Kalman filtering as described in the first aspect.
[0014] Fourthly, embodiments of the present invention provide a readable storage medium for storing a program, which, when executed by a processor, implements the steps in the capacitance estimation method based on improved variational Bayesian Kalman filtering as described in the first aspect.
[0015] The beneficial effect of this invention is that, in the embodiments of this invention, a capacitance estimation method based on improved variational Bayesian Kalman filtering is proposed, which can be used for capacitor capacitance estimation. In the embodiments of this invention, the variational Bayesian method is used to derive the calculation formulas of the state vector and the measurement noise covariance matrix during the fixed-point iteration process, which accurately corrects the influence of noise on state estimation and improves the accuracy of capacitor capacitance estimation. Attached Figure Description
[0016] Appendix Figure 1 This is one of the flowcharts illustrating the capacitance estimation method based on improved variational Bayesian Kalman filtering provided in an embodiment of the present invention. Appendix Figure 2a The DC link circuit is a DC support circuit topology for subway vehicles. Appendix Figure 2b The equivalent circuit for the pre-charging process of the DC support circuit topology of a subway car. Appendix Figure 3 A schematic diagram illustrating the derivation process of the capacitance estimation method based on improved variational Bayesian Kalman filtering provided in an embodiment of the present invention; Appendix Figure 4 The second flowchart illustrates the capacitance estimation method based on improved variational Bayesian Kalman filtering provided in this embodiment of the invention. Appendix Figure 5 A schematic diagram of a capacitance estimation device based on an improved variational Bayesian Kalman filter provided in an embodiment of the present invention; Appendix Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0017] In this application's embodiments, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. In this application's embodiments, the term "multiple" refers to two or more, and other quantifiers are similar. The terms "first," "second," etc., in the specification and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It should be understood that such terms can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited to the number of objects. For example, the first object can be one or multiple.
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0020] This application provides a capacitance estimation method and apparatus based on an improved variational Bayesian Kalman filter, aiming to improve the accuracy of capacitance estimation.
[0021] Please see Figure 1 , Figure 1 This is a flowchart illustrating the capacitance estimation method based on improved variational Bayesian Kalman filtering provided in an embodiment of the present invention. The method specifically includes the following steps: Step 101: Based on the posterior distribution parameters at time k-1, the prior distribution parameters at time k are estimated. The posterior distribution parameters include posterior degrees of freedom, posterior scale matrix, posterior mean, and posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom, prior scale matrix, prior mean, and prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. Step 102: Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the posterior distribution parameters at time k, where N is a positive integer; Step 103: Determine the estimated value of the state vector at time k based on the posterior distribution parameters at time k; Step 104: Using the pre-built pre-charge model, calculate the capacitance of the capacitor based on the estimated value to obtain the estimated capacitance. The measurement information includes capacitor voltage, the state vector (SS) includes model parameters of the pre-charge model, and the measurement noise covariance matrix (MNCM) is the covariance matrix of random noise in the measurement process of the measurement information.
[0022] The capacitance of a capacitor is a parameter that is difficult to measure directly in a system. Therefore, the capacitance estimation method based on the improved variational Bayes Kalman filter provided in this embodiment of the invention accurately estimates the capacitance of a capacitor by combining the variational Bayes (VB) method with the KF algorithm.
[0023] In practical implementation, a pre-charging circuit containing the capacitor to be estimated is pre-constructed, and a pre-charging model is built based on the system characteristics of the pre-charging circuit. Based on the pre-charging model, the parameters of the object to be estimated can be calculated according to the measurement information and model parameters. The measurement information refers to directly measurable real-time data; in the pre-charging model, the measurement information is the capacitor voltage. The model parameters used for calculation serve as state vectors, representing the hidden states of the system. The measurement noise covariance matrix represents the random noise generated during the measurement process.
[0024] For example, the method provided in this embodiment of the invention can be used for capacitance estimation. The following description uses an example of this invention applied to a capacitance estimation scenario to illustrate the pre-charging model and the calculation method of the capacitor capacitance. Please refer to... Figure 2a Taking the DC support circuit on a subway car as an example, the capacitance and equivalent series resistance of the film capacitor are respectively... C and R C This indicates the series resistance in the circuit. R 1. A resistor connected in parallel with the capacitor for charging. R 2 is used for discharging, and K is the contactor.
[0025] Before the circuit operates, the capacitor is pre-charged to its rated voltage. During this process, the inverter and discharge resistor are disconnected. The charging process ends when the difference between the grid voltage and the capacitor voltage is less than 50V. Then, switch K is closed, the inverter and circuit are connected, and operation begins. Considering the stable ambient temperature during the pre-charging process, and to avoid overfitting of lifetime predictions due to frequent state monitoring, a DC-supported capacitor model is chosen for the pre-charging process. The equivalent circuit during the pre-charging process is as follows: Figure 2b As shown. It should be noted that this topology is not limited to the inverter system studied, but can be extended to general DC / AC and AC / DC / AC converters.
[0026] Existing voltage sensors are integrated at the input and output terminals, and a pre-charge model is established and the capacitance is calculated by using the input voltage and capacitor voltage.
[0027] ;(Formula 1) ;(Formula 2) in, U 1( s ) and U 2( s They are respectively u 1( t ) and u 2( t The complex frequency domain form of ).
[0028] set up T The sampling period is defined, and discretization is performed using a nonlinear transformation: ;(Formula 3) Then, the discretized Equation 2 is expressed as follows: ;(Formula 4) ;(Formula 5) in, and These are regression coefficients; once obtained... and The estimated value of the DC support capacitance can be calculated using the following formula: ;(Formula 6) It should be understood that, due to the properties of film capacitors... The value of is very small, and the actual change in capacitor voltage it causes is not significant. Furthermore, signal processing is difficult, making it unsuitable as a primary state monitoring indicator for thin-film capacitors. Therefore... The calculation formula will not be elaborated here.
[0029] Specifically, the voltage signal obtained from measurements in the pre-charge model often contains inherent noise and system interference. Therefore, it includes a random error term. The expression for Formula 4 is the pre-charge model: ;(Formula 7) Based on the foregoing, (k) represents the capacitor voltage measured at time k. Let be the capacitor voltage at time k-1. Let K be the capacitor current at time k. Let K be the capacitor current at time k-1. Let be the noise vector at time k. and For regression coefficients, For autoregressive coefficients, the state vector includes , and .
[0030] According to Formula 6 above, after determining After determining the value of , the DC support capacity can be calculated according to Formula 6. For the pre-charge model in Formula 7, its linear state-space model can be reconstructed as follows: ;(Formula 8) ;(Formula 9) in, Discrete time k The unknown state vector, containing autoregressive coefficients regression coefficient and , Corresponding capacitor voltage , and Both are noise vectors that follow an uncorrelated Gaussian distribution (GD), and they can reflect random noise in the model and the measurement process, respectively.
[0031] State transition matrix and observation matrix The expressions are as follows: ;(Formula 10) ;(Formula 11) Observation matrix It is a data vector containing all known measurements related to system dynamics at time k (past capacitor voltages) Current capacitor current and past capacitor current Its function is to linearly correlate the state vector (model parameters) to be estimated with the actual measured value (current capacitor voltage), establishing a bridge between the "state vector" and the "measurement information".
[0032] In measuring noise covariance matrix In situations where the information is unknown, Bayesian filtering provides a joint estimation method. and The framework consists of two phases: time-based updates and measurement updates.
[0033] During the time update phase, according to the Chapman-Kolmogorov equation, in the unknown... In the case of state vector and measurement noise covariance matrix The prior joint distribution can be updated according to the following formula 12:
[0034] In the measurement update phase, the primary approach is based on Bayesian estimation principles. The core of this approach is to combine prior and observational information and use Bayes' theorem to estimate the probability of an event occurring. This is done when the unknown parameters are... X =[ x 1, x 2,…,x k The observation data is Z =[ z 1, z 2,…, z k When ], the posterior distribution P( X | Z The solution can be found as follows: ;(Formula 13) Wherein, P( X ) is a parameter X The prior distribution, Let be the likelihood function, representing the likelihood under known parameters. X In the case of the deviation between the model output and the actual observed values, P( Z ) is related to parameters X Irrelevant constants.
[0035] Acquiring measurement information at time k After that, the state vector and measurement noise covariance matrix The posterior joint distribution is updated according to Bayes' theorem, i.e.: ;(Formula 14) It should be understood that, in order to achieve optimal solution estimation within the Bayesian framework, the system's state vector must first be determined. and measurement noise covariance matrix The prior distribution. In some embodiments, and The PDFs are Gaussian and inverse Wittsch distributions, respectively.
[0036] Under this assumption, The prior matrix PDF follows a Gaussian distribution, that is: ;(Formula 15) in, PDF representing GD, and These are the prior mean and prior error covariance matrix of GD, respectively.
[0037] Choosing a prior distribution for the unknown parameters within the domain of the conjugate exponential function ensures consistency between the forms of the prior and posterior distribution functions. This allows for simultaneous estimation... and It is necessary to Choose a conjugate prior distribution. In Bayesian statistics, the inverse Wissaud distribution is often used as the conjugate prior to the covariance matrix of the Gaussian distribution. Considering measurement noise... Following the GD distribution, the inverse Wishart distribution (IWD) is chosen as the measurement noise covariance matrix. The conjugate prior distribution of is expressed as follows: ;(Formula 16) in, PDF representing IWD, and These are the prior degrees of freedom parameters and the prior scale matrix of the IWD, respectively.
[0038] Known For dimension h For a random symmetric positive definite matrix, its prior PDF representation is shown in Equation 17: ; in, for The gamma function of dimension, This is the trace operation of a matrix.
[0039] According to the above formula, when hour, The expectation is expressed as: ;(Formula 18) in, This indicates the expected operation.
[0040] Based on Formula 12, the prior PDF is combined. The solution can be equivalent to a time update of the distribution parameters. Therefore, in this embodiment, the prior distribution parameters at the current time are estimated based on the posterior distribution parameters at the previous time step.
[0041] Specifically, the standard KF time update equations, formulas 19 and 20, and the heuristic equations, formulas 21 and 22, are as follows: ;(Formula 19) ;(Formula 20) ;(Formula 21) ;(Formula 22) in, , , and This represents the posterior distribution parameters at the previous time step. yes The covariance matrix, and The time update steps are consistent with those of the standard Kalman filter.
[0042] Due to the positive prediction model It cannot be determined; this parameter represents the state at time k-1. Next, the system transitions to the state at time k. The conditional probability is introduced in this embodiment using a variance decay factor. ρ ∈(0,1) propagates the approximate posterior of the previous iteration, ensuring that in Formula 16... It follows the set IWD distribution, taking into account the variation law of measurement noise in actual application, and sets... ρ =1-10 -4 .
[0043] The variational Bayesian method is based on the Bayesian estimation principle and expectation-maximization theory, and incorporates variational approximation theory. This method uses a simple known distribution to approximate the joint posterior distribution of multiple unknown variables to obtain a suboptimal solution. It achieves high-precision parameter estimation with relatively little computation, and can solve problems such as excessively high dimensionality of the unknown parameter matrix and complex probability density function calculations.
[0044] Optionally, in some embodiments, determining the estimated value of the state vector at time k based on the posterior distribution parameters at time k includes: A first independent distribution of the state vector is determined based on the posterior mean and the posterior covariance matrix, and a second independent distribution of the measurement noise covariance matrix is determined based on the posterior degrees of freedom parameter and the posterior scale matrix. The first independent distribution and the second independent distribution are used to approximate the joint posterior PDF of the state vector and the measurement noise covariance matrix. The estimated value of the state vector at time k is determined based on the first independent distribution.
[0045] According to Formula 12, the joint posterior PDF The estimation can be transformed into a measurement update of the distribution parameters, but this is difficult to solve in practice. Therefore, in this embodiment, a mean-field approximation strategy is adopted to apply the joint posterior PDF. It can be approximated as follows: ;(Formula 23) in, Represents an approximate form of the posterior PDF. It is the first independent distribution of the state vector. To measure the second independent distribution of the noise covariance matrix, after determining the first and second independent distributions, the joint posterior PDF can be approximately estimated. Through the above method, after approximate decomposition, the parameters... and The distributions between them are independent of each other, avoiding the coupling problem between them.
[0046] Next, the marginal approximation function in Formula 14 is used. Derivation parameters and The calculation formula is as follows. The logarithmic form of the approximate marginal function is as follows: ;(Formula 24) Where F represents the variational confidence lower bound: ;(Formula 25) Wherein, KL represents the KL divergence between the approximate PDF and the real PDF, as shown in Formula 26:
[0047] Given that KL divergence represents the difference between two distributions, its value... ≥0, and if and only if At this point, the KL divergence reaches its minimum value of 0, and the difference between the approximate value and the true value is minimized. In the Bayesian sense, to achieve this... As close as possible The KL divergence must be minimized.
[0048] However, due to the real It is unknown, and the problem of minimizing the KL divergence cannot be solved analytically. This is because the logarithmic probability density function of the observation set is unknown. Is with and For irrelevant constants, minimizing the KL divergence implies maximizing the variational lower bound function. Therefore, the parameters... and The posterior PDF is achieved by maximizing the variational lower bound function.
[0049] The variational lower bound function is processed to obtain the following formula 27:
[0050] Under the constraint of maximizing the variational confidence lower bound, Equation 27 is applied with respect to the parameters respectively. and Taking the derivative and setting it to zero, we obtain an approximate general solution for each parameter that satisfies the following equation: ;(Formula 28) ;(Formula 29) in, This represents the expectation operation. and To be independent of and The constant term. Here, the conjugate function chosen above ensures that the posterior distribution of each parameter is consistent with its true posterior form.
[0051] Note that constraint equations 28 and 29 are implicit solutions. Before calculating each parameter, the probability distribution of the other parameter must be known, and the expectation of the logarithmic joint PDF with respect to the other parameter must be calculated under this probability distribution. Therefore, the variable component updates should first be initialized using the prior distribution, and then the unknown parameters should be estimated iteratively until the algorithm converges. Next, the fixed-point iterative formulas for equations 28 and 29 will be derived.
[0052] Combining the characteristics of observational information and prior distribution assumptions for each variable, the joint PDF in Equations 28 and 29 It can be approximated by three independent distributions and a constant term. The product is shown in Formula 30:
[0053] Substituting into the function expression, the logarithmic form of the combined PDF is shown in Formula 31:
[0054] Substituting formula 30 into formula 28, we get formula 32:
[0055] therefore, It can be converted to an IWD PDF, specifically, the... The result of the fixed-point iteration operation As shown in Equation 33, its posterior degrees of freedom and posterior scale matrix are respectively and : ;(Formula 33) in, Refers to the first Second fixed-point iteration Refers to the first The fixed-point iteration.
[0056] Through N fixed-point iterations, it is possible to... To solve this, specifically, during the (i+1)th fixed-point iteration operation, its posterior degrees of freedom parameters... and posterior scale matrix Update using the following formulas respectively: ;(Formula 34) ;(Formula 35) Then, calculate based on the expected value of IWD. : ;(Formula 36) Similarly, by substituting formula 30 into formula 29, we can obtain formula 37:
[0057] therefore, It can be converted to GD's PDF, specifically, the first... The result of the fixed-point iteration operation As shown in Equation 38, its posterior mean and posterior covariance matrix are respectively and : ;(Formula 38) Through N fixed-point iterations, it is possible to... To solve this problem, specifically during the (i+1)th fixed-point iteration operation, where... and Update using the following formula: ;(Formula 39) ;(Formula 40) During the fixed-point iteration process, the variational approximation updates of the prior and posterior matrices are asynchronous, and their computational accuracy is limited by the KF prior matrix. and .
[0058] Optionally, in some embodiments, the prior mean of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior mean of the (i+1)th fixed-point iteration operation, and the prior covariance matrix of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior covariance matrix of the (i+1)th fixed-point iteration operation.
[0059] In this embodiment, a novel prior matrix update mechanism is designed for fixed-point iteration. This mechanism uses the posterior matrix of the current fixed-point iteration. and Constructing the prior matrix and ,Right now: ;(Formula 41) . (Formula 42) In this way, the posterior distribution parameters obtained in each iteration are used as the starting point for the next iteration, so that the solution process can continue to optimize based on the information extracted in the previous iteration. This can help the algorithm converge to the fixed point more quickly and may make the convergence process more stable.
[0060] As an optional implementation, the posterior distribution parameters at time k can be obtained by performing N fixed-point iteration operations based on the measurement information at time k and the prior distribution parameters at time k.
[0061] Alternatively, as another optional implementation, step 102 includes: Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the first posterior distribution parameters, which are the posterior distribution parameters obtained by performing N fixed-point iteration operations at time k. The posterior distribution parameter at time k is determined based on the first posterior distribution parameter and the second posterior distribution parameter, wherein the second posterior distribution parameter is the posterior distribution parameter after performing N fixed-point iteration operations at time k-1.
[0062] Taking the posterior mean and posterior covariance matrix as an example, when the number of iterations at a fixed point reaches a set threshold N, the posterior mean at time k is... The final filtered output is the current And last time The element-wise average. Similarly, the posterior covariance matrix at time k. yes and The element-wise averaging filtering formula is as follows: ;(Formula 43) ;(Formula 44) In this embodiment, a second posterior distribution parameter (i.e., historical information) is introduced as a regularization term, ensuring that the posterior distribution parameter at time k not only matches the current data well but also aligns with historical trends. This approach enhances the robustness of the entire system, producing smoother, more stable, and more reliable estimation results, significantly reducing sensitivity to instantaneous noise and outliers, and achieving an excellent balance between tracking system changes and maintaining estimation stability.
[0063] It is worth noting that fixed-point iteration converges quickly, and a few iterations are enough to rapidly correct state biases and achieve accurate state estimation results. However, the number of iterations cannot be too few, as this can easily lead to inaccurate posterior approximations and fail to fully optimize the state distribution parameters. Conversely, the number of iterations cannot be too many, otherwise it may conversely reduce estimation performance.
[0064] like Figure 3 As shown in the figure, as a specific implementation, firstly, a state vector is pre-selected. and measurement noise covariance matrix The prior PDF. Specifically, the state vector. Prior PDF The noise covariance matrix follows a Gaussian pattern, as shown in Equation 15 above. Prior PDF It follows an inverse Wissaud distribution, as shown in Formula 16 above.
[0065] Next, the standard KF time update equation and heuristic equation are used for prediction. and Specifically, based on the aforementioned formulas 19-22, the prior PDF is combined. The solution can be equivalent to a time update of the distribution parameters, therefore the prior distribution parameters at the current time can be obtained. , , and .
[0066] Then, considering the joint posterior PDF The solution is difficult, so the VB approximation equation shown in Equation 23 is used to combine the a posteriori PDF. Approximately the first independent distribution Second independent distribution The product of . Under the constraint of minimizing the Kullback-Leibler (KL) divergence (variable confidence) lower bound maximization, the approximate general solution equations for each parameter are solved, yielding Equations 28 and 29.
[0067] Then, use Formula 30 to decompose the PDF. And transform formulas 28 and 29 into and The recurrence relation is given. To ensure the convergence of the algorithm, the approximate posterior PDF is estimated through fixed-point iteration. During the fixed-point iteration process, a local prior matrix update is introduced. This process updates the fixed-point posterior PDF at each iteration. The prior PDF of the fixed point is passed through Equations 41 and 42. The local variable prior matrix effectively reduces the asynchronous error of the fixed-point iteration, minimizes the impact of noise, and makes the filtered output closer to the optimal solution.
[0068] Finally, the posterior PDF obtained from the Nth fixed-point iteration at the current time is... The result obtained from the Nth fixed-point iteration at the previous time step We perform averaging to obtain the posterior PDF at the current time.
[0069] This method is applied to the capacitor estimation process, as follows: Figure 4 As shown, it mainly includes the following four steps: pre-charge sampling, time update, variational measurement update, and filtered output.
[0070] Specifically, at each moment in the pre-charge sampling process, the voltage signal at the current moment is acquired using existing sensors as measurement information. Next, a time update step is employed to estimate the prior distribution parameters at the current moment based on the posterior distribution parameters of the previous moment. Then, a variational measurement update step initializes the parameters using the predicted values from the time update step, obtaining the initial values at i=0. Then, based on the new measurement information obtained at the current moment and the designed locally variable prior matrix, the variational Bayesian approximate distribution parameters of the state vector and the measurement noise covariance matrix are estimated. The filtering output step averages and filters the posterior distribution parameters obtained from the measurement update step (after performing N fixed-point iterations at the current moment) and the posterior distribution parameters from the previous moment (after performing N fixed-point iterations), outputting the finally estimated posterior distribution parameters for the current moment, which are then used for capacitance calculation and the next filtering step.
[0071] At each moment during the pre-charge sampling process, the aforementioned pre-charge sampling, time update, variational measurement update, and filtering output steps are executed. After the pre-charge process is completed, the capacity calculated at the final moment is determined, and this capacity is the final estimated capacity. Using this method, a highly accurate capacity estimate can be obtained after the pre-charge process.
[0072] In this embodiment, a novel state update mechanism is designed by combining a locally variable prior matrix and an average filtered output. This mechanism effectively reduces asynchronous errors in the measurement update step and minimizes the impact of noise on estimation accuracy. Using this method, the influence of noise on state estimation is accurately corrected. In engineering scenarios, compared with the highest-accuracy algorithm currently available, the average error is reduced by approximately 70%.
[0073] Please see Figure 5 This invention also provides a capacitance estimation device 500 based on an improved variational Bayesian Kalman filter, comprising: The estimation module 501 is used to estimate the prior distribution parameters at time k based on the posterior distribution parameters at time k-1. The posterior distribution parameters include posterior degrees of freedom parameters, posterior scale matrix, posterior mean, and posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom parameters, prior scale matrix, prior mean, and prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. The iterative operation module 502 is used to perform N fixed-point iterative operations based on the measurement information at time k and the prior distribution parameters at time k to obtain the posterior distribution parameters at time k, where N is a positive integer; The determination module 503 is used to determine the estimated value of the state vector at time k based on the posterior distribution parameters at time k; The calculation module 504 is used to calculate the capacitance of the capacitor based on the estimated value using a pre-built pre-charge model to obtain the estimated capacitance. The measurement information includes capacitor voltage, the state vector includes model parameters of the pre-charge model, and the measurement noise covariance matrix is the covariance matrix of random noise in the measurement process of the measurement information.
[0074] Optionally, the pre-charge model is: ; in, Let be the capacitor voltage at time k. Let the capacitor voltage be at time k-1. Let K be the capacitor current at time k. Let the capacitor current be at time k-1. Let be the noise vector at time k. and For regression coefficients, The state vector includes autoregressive coefficients. , and .
[0075] Optionally, the posterior degrees of freedom parameters for performing i+1 fixed-point iterations at time k. The posterior scale matrix The posterior mean and the posterior covariance matrix for: ; ; ; ; in, Let the prior mean be the result of performing i fixed-point iterations at time k. Let the prior covariance matrix be the result of performing i fixed-point iterations at time k. Let be the prior degrees of freedom parameter at time k. Let k be the prior scaling matrix at time k. for The observation matrix is used to construct a linear relationship between the state vector and the measurement information. Let be the measurement noise covariance matrix of the (i+1)th fixed-point iteration operation during the k-th filtering process. Let i be the measurement information at time k, where i is a positive integer.
[0076] Optionally, the prior mean of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior mean of the (i+1)th fixed-point iteration operation, and the prior covariance matrix of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior covariance matrix of the (i+1)th fixed-point iteration operation.
[0077] Optionally, the step of performing N fixed-point iterations based on the measurement information at time k and the prior distribution parameters at time k to obtain the posterior distribution parameters at time k includes: Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the first posterior distribution parameters, which are the posterior distribution parameters obtained by performing N fixed-point iteration operations at time k. The posterior distribution parameter at time k is determined based on the first posterior distribution parameter and the second posterior distribution parameter, wherein the second posterior distribution parameter is the posterior distribution parameter after performing N fixed-point iteration operations at time k-1.
[0078] Optionally, the posterior mean at time k and the posterior covariance matrix for: ; ; in, Let N be the posterior mean of the fixed-point iterations performed at time k. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k-1. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k. The posterior covariance matrix is the result of performing N fixed-point iterations at time k-1.
[0079] Optionally, determining the estimated value of the state vector at time k based on the posterior distribution parameters at time k includes: A first independent distribution of the state vector is determined based on the posterior mean and the posterior covariance matrix, and a second independent distribution of the measurement noise covariance matrix is determined based on the posterior degrees of freedom parameter and the posterior scale matrix. The first independent distribution and the second independent distribution are used to approximate the joint posterior PDF of the state vector and the measurement noise covariance matrix. The estimated value of the state vector at time k is determined based on the first independent distribution.
[0080] The capacitance estimation device 500 based on improved variational Bayesian Kalman filtering provided in this application embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0081] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0082] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0083] like Figure 6As shown, this application provides an electronic device 600, including: a memory 602, a processor 601, and a program stored in the memory 602 and executable on the processor 601; the processor 601 is used to read the program in the memory 602 to implement the steps in the capacitance estimation method based on the improved variational Bayesian Kalman filter as described above.
[0084] This application also provides a readable storage medium storing a program that, when executed by a processor, implements the various processes of the above-described embodiment of the capacitance estimation method based on the improved variational Bayesian Kalman filter, and achieves the same technical effect. To avoid repetition, it will not be described again here. The readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (such as compact disks (CDs), digital video discs (DVDs), Blu-ray discs (BDs), high-definition universal discs (HVDs), etc.), and semiconductor storage (such as read-only memory (ROMs), erasable programmable read-only memory (EPROMs), electrically erasable programmable read-only memory (EEPROMs), non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0085] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0086] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0087] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A capacitance estimation method based on improved variational Bayesian Kalman filtering, characterized in that, include: Based on the posterior distribution parameters estimated at time k-1, the prior distribution parameters at time k are obtained. The posterior distribution parameters include posterior degrees of freedom, posterior scale matrix, posterior mean, and posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom, prior scale matrix, prior mean, and prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the posterior distribution parameters at time k, where N is a positive integer; The estimated value of the state vector at time k is determined based on the posterior distribution parameters at time k; Using a pre-built pre-charge model, the capacitance of the capacitor is calculated based on the estimated value to obtain the estimated capacitance; The measurement information includes capacitor voltage, the state vector includes model parameters of the pre-charge model, and the measurement noise covariance matrix is the covariance matrix of random noise in the measurement process of the measurement information.
2. The method according to claim 1, characterized in that, The pre-charging model is as follows: ; in, Let be the capacitor voltage at time k. Let the capacitor voltage be at time k-1. Let K be the capacitor current at time k. Let the capacitor current be at time k-1. Let be the noise vector at time k. and For regression coefficients, The state vector includes autoregressive coefficients. , and .
3. The method according to claim 1, characterized in that, The posterior degrees of freedom parameters of the fixed-point iteration operation performed at time k (i+1 times) The posterior scale matrix The posterior mean and the posterior covariance matrix for: ; ; ; ; in, Let the prior mean be the result of performing i fixed-point iterations at time k. Let the prior covariance matrix be the result of performing i fixed-point iterations at time k. Let be the prior degrees of freedom parameter at time k. Let k be the prior scaling matrix at time k. for The observation matrix is used to construct a linear relationship between the state vector and the measurement information. Let be the measurement noise covariance matrix of the (i+1)th fixed-point iteration operation during the k-th filtering process. Let i be the measurement information at time k, where i is a positive integer.
4. The method according to claim 3, characterized in that, The prior mean of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior mean of the (i+1)th fixed-point iteration operation, and the prior covariance matrix of the (i+1)th fixed-point iteration operation at time k is constructed using the posterior covariance matrix of the (i+1)th fixed-point iteration operation.
5. The method according to claim 1, characterized in that, The method performs N fixed-point iterations based on the measurement information at time k and the prior distribution parameters at time k to obtain the posterior distribution parameters at time k, including: Based on the measurement information at time k and the prior distribution parameters at time k, perform N fixed-point iteration operations to obtain the first posterior distribution parameters, which are the posterior distribution parameters obtained by performing N fixed-point iteration operations at time k. The posterior distribution parameter at time k is determined based on the first posterior distribution parameter and the second posterior distribution parameter, wherein the second posterior distribution parameter is the posterior distribution parameter after performing N fixed-point iteration operations at time k-1.
6. The method according to claim 5, characterized in that, The posterior mean at time k and the posterior covariance matrix for: ; ; in, Let N be the posterior mean of the fixed-point iterations performed at time k. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k-1. Let N be the posterior covariance matrix obtained by performing N fixed-point iterations at time k. The posterior covariance matrix is the result of performing N fixed-point iterations at time k-1.
7. The method according to claim 1, characterized in that, The determination of the estimated value of the state vector at time k based on the posterior distribution parameters at time k includes: A first independent distribution of the state vector is determined based on the posterior mean and the posterior covariance matrix, and a second independent distribution of the measurement noise covariance matrix is determined based on the posterior degrees of freedom parameter and the posterior scale matrix. The first independent distribution and the second independent distribution are used to approximate the joint posterior PDF of the state vector and the measurement noise covariance matrix. The estimated value of the state vector at time k is determined based on the first independent distribution.
8. A capacitance estimation device based on an improved variational Bayesian Kalman filter, characterized in that, include: An estimation module is used to estimate the prior distribution parameters at time k based on the posterior distribution parameters at time k-1. The posterior distribution parameters include posterior degrees of freedom, a posterior scale matrix, a posterior mean, and a posterior covariance matrix. The posterior distribution parameters are used to determine the joint posterior probability density function PDF of the state vector and the measurement noise covariance matrix. The prior distribution parameters include prior degrees of freedom, a prior scale matrix, a prior mean, and a prior covariance matrix. The prior distribution parameters are used to determine the joint prior PDF of the state vector and the measurement noise covariance matrix. k is a positive integer greater than 1. The iterative operation module is used to perform N fixed-point iterative operations based on the measurement information at time k and the prior distribution parameters at time k, to obtain the posterior distribution parameters at time k, where N is a positive integer; A determination module is used to determine the estimated value of the state vector at time k based on the posterior distribution parameters at time k; The calculation module is used to calculate the capacitance of the capacitor based on the estimated value using a pre-built pre-charge model, so as to obtain the estimated capacitance. The measurement information includes capacitor voltage, the state vector includes model parameters of the pre-charge model, and the measurement noise covariance matrix is the covariance matrix of random noise in the measurement process of the measurement information.
9. An electronic device, comprising: A memory, a processor, and a program stored in the memory and executable on the processor; characterized in that the processor is configured to read the program from the memory to implement the steps in the capacitance estimation method based on the improved variational Bayesian Kalman filter as described in any one of claims 1 to 7.
10. A readable storage medium for storing a program, characterized in that, When the program is executed by the processor, it implements the steps in the capacitance estimation method based on the improved variational Bayesian Kalman filter as described in any one of claims 1 to 7.
