A BMS battery management system and a control method thereof
By constructing a battery state matrix and feature fusion, combined with fuzzy logic control and adaptive droop control, precise power allocation among battery packs in the BMS system is achieved. This solves the shortcomings of traditional BMS systems in detecting and balancing changes in battery pack dynamic characteristics, and improves the accuracy and stability of the system.
Patent Information
- Application Number
- CN202511173475.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-08-21
AI Technical Summary
Traditional BMS systems are not very accurate in detecting battery operation activities and estimating state parameters, have poor real-time performance, and are difficult to accurately grasp the dynamic characteristics of the battery pack. Furthermore, existing battery balancing control strategies cannot adapt to dynamic changes under different operating conditions, which can easily lead to over-balancing or under-balancing.
By constructing a battery state matrix, extracting global and local feature vectors, performing feature fusion, establishing a fuzzy logic control rule base, and combining an adaptive adjustment algorithm to calculate droop parameters, a PWM control signal is generated to achieve precise power allocation and balance among battery packs.
It improves the accuracy of battery operation activity detection and state parameter estimation, enhances the integrity and robustness of feature extraction, reduces current surges during the equalization process, and ensures the stability and controllability of the equalization process.
Smart Images

Figure CN120978242B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of BMS battery management, and particularly relates to a BMS battery management system and a control method thereof. BACKGROUND
[0002] The performance and reliability of a power battery management system (BMS) are increasingly important. Traditional BMS systems have problems such as low accuracy and poor real-time performance in battery operation activity detection and state parameter estimation, and are difficult to accurately grasp the dynamic characteristic changes of the battery pack. Especially under complex working conditions, due to the inevitable consistency differences between the individual cells in the battery pack, the overall performance of the battery pack is reduced, which seriously affects the service life and safety of the battery.
[0003] At present, the battery management method adopted by most BMS systems mainly relies on convolution layers with local receptive fields for feature extraction, which cannot effectively capture global information in the battery operation process, and the feature transferability between different working conditions is poor. At the same time, the existing battery equalization control strategy often uses fixed control parameters, which is difficult to adapt to the dynamic changes of the battery pack under different working conditions, and is prone to cause problems of excessive equalization or insufficient equalization. SUMMARY
[0004] The present application provides a BMS battery management system and a control method thereof, thereby realizing accurate allocation of power between battery packs and ensuring the stability and controllability of the equalization process.
[0005] The first aspect of the present application provides a control method of a BMS battery management system, which comprises:
[0006] The BMS battery management system collects voltage data, current data and temperature data of the battery cells in the battery pack, and constructs a battery state matrix;
[0007] Based on the battery state matrix, a global feature vector and a local feature vector are extracted, and feature fusion is performed on the global feature vector and the local feature vector to obtain a fused feature vector;
[0008] A fuzzy logic control rule library is established according to the fused feature vector, a droop parameter is calculated by a droop coefficient self-adaptive adjustment algorithm, and a battery power balance control parameter is obtained;
[0009] Based on the battery power balance control parameter, a PWM control signal is generated to control the power balance of the battery pack, and the balance current size and direction are obtained.
[0010] The second aspect of the present application provides a BMS battery management system, which comprises:
[0011] The acquisition module is configured to acquire voltage data, current data and temperature data of the battery monomers in the battery pack through a BMS battery management system and construct a battery state matrix;
[0012] The extraction module is configured to extract a global feature vector and a local feature vector based on the battery state matrix, and perform feature fusion on the global feature vector and the local feature vector to obtain a fused feature vector;
[0013] The establishment module is configured to establish a fuzzy logic control rule library according to the fused feature vector, calculate droop parameters through a droop coefficient self-adaptive adjustment algorithm, and obtain battery power balance control parameters;
[0014] The control module is configured to generate a PWM control signal based on the battery power balance control parameters, perform power balance control on the battery pack, and obtain balance current size and direction.
[0015] Compared with the prior art, the application has the following beneficial effects: by establishing a battery state matrix and covariance fitting criteria, combining the characteristics of Hermitian Toeplitz matrix, the accuracy of battery operation activity detection and state parameter estimation is significantly improved, and the accuracy of system control is ensured; the ConvFormer feature extraction network is used, the global-local features are extracted in parallel through the linear state predictor and the separable random CNN, and the integrity and robustness of feature extraction are enhanced; the cross-attention mechanism is introduced for feature fusion, the complementarity of the global feature vector and the local feature vector is fully utilized, and the feature expression ability is improved; based on the combination of fuzzy logic control and adaptive droop control, the droop coefficient is dynamically adjusted, the current impact in the balancing process is reduced, and the battery thermal stress is reduced; the closed-loop adjustment mechanism of the PWM control signal is adopted, the accurate distribution of the power between the battery packs is realized, and the stability and controllability of the balancing process are ensured. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0017] The structure, proportion, size and the like shown in the drawings of the specification are only used to cooperate with the content disclosed in the specification, to be understood and read by those skilled in the art, and do not have technical significance to limit the conditions that the application can be implemented. Any modification of the structure, change of the proportion relationship or adjustment of the size, without affecting the effect that the application can produce and the purpose that the application can achieve, should still fall within the scope covered by the disclosed technology.
[0018] Figure 1 is a flowchart of the control method of the BMS battery management system provided by the embodiment of the application;
[0019] Figure 2 is a structural schematic block diagram of the BMS battery management system provided by the embodiment of the application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the application.
[0021] The flowchart shown in the drawings is only an example description, and does not necessarily include all the contents and operations / steps, nor does it have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially combined, so that the actual execution order may be changed according to the actual situation.
[0022] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification and the appended claims of the application, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0023] It should be further understood that the term "and / or" used in the specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations. Please refer to Figure 1 One embodiment of the control method of the BMS battery management system in the embodiments of the application includes:
[0024] Step 100, collecting voltage data, current data and temperature data of the battery monomers in the battery pack by the BMS battery management system, and constructing a battery state matrix;
[0025] It can be understood that the execution subject of the present application can be a BMS battery management system, and can also be a terminal or a server, and the specific embodiments are not limited herein. The server is taken as an example for description of the embodiments of the present application.
[0026] Specifically, the BMS battery management system collects data of the battery cells in the battery pack, and obtains voltage, current and temperature data of each battery cell in real time, and records these data in a continuous sampling manner, so as to ensure that the data can fully reflect the running state of the battery pack. The maximum and minimum value standardization operation is performed on the collected voltage data, current data and temperature data. The maximum and minimum values of each data dimension are normalized to map the data to the interval [0, 1], eliminate the difference in data dimension, and make the data of different dimensions comparable on the same scale, so as to obtain normalized parameter data. The normalized parameter data is subjected to abnormal value screening. The screening process is based on a statistical analysis method or a machine learning algorithm, for example, setting an upper and lower threshold range to eliminate parameter points beyond the reasonable range, or identifying and excluding data points deviating from the main group through a clustering algorithm. After the abnormal value screening, the effective parameter data remaining after the screening more truly reflects the actual running state of the battery pack. The effective parameter data after the screening is arranged and combined, and is organized into a time sequence matrix containing three columns of voltage, current and temperature parameters in time sequence. Each row of the time sequence matrix represents the state of the battery cell at a certain time, and the columns correspond to the voltage, current and temperature three physical parameters respectively. Through this construction method, the time sequence matrix can completely record the dynamic characteristics of each parameter changing with time during the battery operation. In order to extract the feature information of the battery state, Hermite transformation is performed on the constructed time sequence matrix. Hermite transformation is a mathematical method for constructing a symmetric positive definite matrix, which generates an initial feature matrix by performing conjugate transpose operation on the time sequence matrix. The diagonal elements and the non-diagonal elements of the feature matrix contain the autocorrelation and cross-correlation of the parameters in the time sequence matrix respectively. The correlation coefficient calculation is performed on the diagonal elements of the initial feature matrix to obtain a main diagonal feature matrix, and each element in the matrix reflects the autocorrelation strength of the corresponding parameter in the time sequence. At the same time, the cross-correlation analysis is performed on the non-diagonal elements of the initial feature matrix to capture the coupling relationship or cooperative variation law among the voltage, current and temperature, and form a non-diagonal feature matrix, and each element in the matrix represents the correlation size and direction between two parameters. The main diagonal feature matrix and the non-diagonal feature matrix are subjected to matrix splicing operation to obtain a battery state matrix.
[0027] Step 200, extracting a global feature vector and a local feature vector based on the battery state matrix, and performing feature fusion on the global feature vector and the local feature vector to obtain a fused feature vector;
[0028] Specifically, the battery state matrix is divided into training data sub-matrix and test data sub-matrix. The training data sub-matrix is used for subsequent feature vector extraction and optimization, and the test data sub-matrix is reserved for model validation. The sample division adopts random division or time series division, etc. to ensure that the training data can fully represent the state characteristics of the battery operation. The training data sub-matrix is processed by zero mean centering to eliminate the mean deviation of the data and enhance the independence and stability of the features. Zero mean centering is achieved by subtracting the mean value of each column from the corresponding column. The centered data matrix is obtained after processing. The covariance of the centered data matrix is calculated, and the covariance between the columns of the centered data matrix is calculated to obtain a symmetric matrix, where each element represents the linear correlation between two parameters. The diagonal elements of the covariance matrix represent the variance of each parameter, and the non-diagonal elements represent the covariance relationship between different parameters. Based on the covariance matrix, combined with the original battery state matrix, a minimization objective function is constructed, which aims to describe the minimum error relationship between the training data sub-matrix and its feature distribution, in order to optimize the representation ability of the data. The constructed minimization objective function needs to add certain constraints to improve the practical application value of the model. The constraint construction unit adds constraints such as voltage interval, current limit and temperature range to the objective function. These constraints are set based on the physical characteristics and safe operation requirements of the battery, such as limiting the voltage range of the battery within a certain interval to prevent overcharging or overdischarging, limiting the current to control the high charging and discharging rate, and limiting the temperature range to avoid damage to the battery due to high or low temperature. After adding these constraints, the minimization objective function is converted into a constrained optimization function. In order to enhance the robustness of the constrained optimization function, L2 regularization is performed. The purpose of regularization is to prevent overfitting of the model, by introducing a penalty term proportional to the square of the parameter value, limiting the size of the parameter, and ensuring that the sensitivity of the optimization function to abnormal data points is reduced. After regularization, the optimization function is converted into a regularized optimization function. The regularized optimization function is converted into a maximum likelihood form, and a probability optimization function is obtained by constructing a log-likelihood function. The probability optimization function can maximize the probability of data occurrence under given data conditions, so as to more intuitively reflect the explanatory ability of parameters to data distribution. Gradient descent operation is performed on the probability optimization function. Gradient descent is an iterative optimization algorithm that updates parameters to approach the optimal solution by calculating the gradient information of the function and constantly updating the parameters along the gradient descent direction. In the operation process, the learning rate is set to control the step size of each parameter update, and the global or local optimal solution is converged after multiple iterations. Through gradient descent operation, the battery state parameter set is obtained. Based on the battery state parameter set, global feature vectors and local feature vectors are generated.The global feature vector is a result of overall description of the state of the entire battery pack, extracted by statistical summary of the parameter set, such as calculating the mean value, extreme value and other information of all battery cell voltages, currents and temperatures; and the local feature vector focuses on describing the operating characteristics of a single battery cell or some key battery cells, including the operating state of the minimum voltage battery or the characteristic change of the maximum temperature battery. The global feature vector and the local feature vector are fused to generate a fused feature vector.
[0029] The battery state parameter set is input into a linear state predictor. The linear state predictor performs a simple linear transformation on the input data, ensuring that the feature distribution of the parameter set is optimized and adapted for subsequent neural network processing. After passing through the predictor, the data is input into a first fully connected layer containing 128 neurons. The fully connected layer is a neural network structure that performs feature transformation on the input data through a linear combination of weight matrices and bias terms to generate first intermediate features. To introduce non-linear representation capabilities, the first intermediate features are processed through a ReLU activation function. ReLU is a non-linear activation function that effectively suppresses the gradient vanishing problem in neural networks and balances between computational efficiency and effectiveness. After ReLU activation, the first activation features are obtained. The first activation features are input into a second fully connected layer containing 256 neurons, which generates second intermediate features through higher-dimensional feature mapping. Similarly, these features are also subjected to ReLU activation function operations to generate second activation features. The second activation features are input into a third fully connected layer containing 512 neurons, which extracts global feature vectors through large-scale parameter calculations and higher feature dimensions. At the same time, in order to obtain fine-grained local features, the battery state parameter set is input into a feature extraction network based on the ConvFormer architecture. ConvFormer is a feature extraction architecture that combines the advantages of convolutional neural networks and Transformers, which reduces computational complexity through depthwise separable convolution operations while retaining efficient feature extraction capabilities. In the first stage of the network, the parameter set is input into the first depthwise separable convolution layer, which extracts local features of the parameter set through sliding window operations of the convolution kernel to generate first convolution features. The first convolution features are subjected to max-pooling operations, which compress the feature dimensions while highlighting significant features to form first pooling features. The first pooling features are input into the second depthwise separable convolution layer to extract higher-order local features and generate second convolution features. The second convolution features are subjected to max-pooling operations again to obtain more concentrated second pooling features. The second pooling features are input into the third depthwise separable convolution layer to generate third convolution features through deeper convolution operations. These features contain detailed information of the battery state parameters and their complex local patterns. In the final stage of feature extraction, the third convolution features are flattened to map high-dimensional features into one-dimensional feature vectors, simplifying the data structure to adapt to subsequent fully connected layer processing. The one-dimensional feature vector is input into the first fully connected layer to generate the first feature vector, and the first feature vector is subjected to dimension reduction processing through the second fully connected layer to generate the local feature vector. The local feature vector can accurately describe the operating state of a specific battery cell or local area in the battery pack, thereby supplementing the detailed information lacking in the global feature vector. Cross-attention calculations are performed based on the global feature vector and the local feature vector.The cross-attention mechanism is an efficient information interaction method that captures the mutual relationship between the global feature vector and the local feature vector by calculating the attention weight between them. The cross-attention mechanism assigns weights according to the correlation between each dimension in the global feature and each dimension in the local feature, generates a fused feature representation, and obtains a fused feature vector.
[0030] The global feature vector is linearly transformed to obtain a query matrix through weight matrix operation, and the local feature vector is linearly transformed to obtain a key matrix through weight matrix operation. The role of the weight matrix is to map the input high-dimensional feature to a new space, so that the query matrix and the key matrix can produce meaningful similarity measurement through dot product operation. Based on the query matrix and the key matrix, matrix multiplication is performed to obtain an attention score matrix. Each element in the attention score matrix represents the correlation between a feature in the global feature vector and a feature in the local feature vector. Through correlation calculation, the importance of global and local features in information interaction is revealed. The attention score matrix is subjected to Softmax normalization operation to convert the input value range to a probability distribution between 0 and 1, while maintaining the relative relationship between input values. Through Softmax normalization operation, an attention weight matrix is generated, and each element in the matrix represents the attention weight between a feature in the global feature vector and a feature in the local feature vector. The attention weight reflects the contribution of a local feature to the global feature in the global and local feature interaction process. After obtaining the attention weight matrix, the local feature vector is linearly transformed to generate a value matrix through an independent weight matrix operation. The value matrix is the core part of attention calculation, which stores the specific information of the local feature vector. Based on the attention weight matrix and the value matrix, matrix multiplication is performed to generate an attention output matrix. In order to enhance the robustness and representation ability of the model, residual connection operation is performed on the attention output matrix. The residual connection directly adds the original global feature vector to the attention output matrix, preserving the new feature while maintaining the information integrity of the original feature, generating a residual feature matrix. In order to optimize the feature representation, layer normalization operation is performed on the residual feature matrix to eliminate the numerical difference between features, enhance the stability and generalization ability of the model. By normalizing each layer of features, the features are guaranteed to be on a unified scale, while suppressing the influence of outliers on feature representation, obtaining a fused feature vector.
[0031] Step 300: Establishing a fuzzy logic control rule base according to the fused feature vector, calculating the droop parameter through the droop coefficient adaptive adjustment algorithm, and obtaining the battery power balance control parameter;
[0032] It should be noted that the fusion feature vector is input into the fuzzification unit to perform fuzzy partitioning on the key operating state variables of the battery pack. The voltage difference variable (range [2.5V, 4.2V]), the state of charge difference variable (range [0%, 100%]), and the temperature difference variable (range [0℃, 60℃]) in the fusion feature vector are partitioned by triangular membership functions. Triangular membership functions are a simple and efficient fuzzification method that maps continuous numerical values to fuzzy sets, used to describe the membership degree of different state variables. For example, in the interval of voltage difference, three fuzzy sets of low voltage difference, medium voltage difference, and high voltage difference are set, and each set defines its value range and membership degree by a triangular membership function. The state of charge difference and temperature difference variables are also divided into similar fuzzy sets according to their intervals. After fuzzification, the fusion feature vector is converted into fuzzy input variables. The fuzzy input variables are sent to the fuzzy rule matching unit to establish the correspondence between the voltage difference, state of charge difference, and temperature difference three input variables and the power balance control strategy, forming a control rule set. The design of control rules is based on the operating characteristics and goals of the battery pack, such as "if the voltage difference is low, the state of charge difference is high, and the temperature difference is moderate, then the power distribution needs to be increased to a high level" or "if the voltage difference is high, the state of charge difference is low, and the temperature difference is high, then the power distribution needs to be reduced". These rules are expressed in language form or implemented through logical expressions. These rule sets form a complete fuzzy logic control rule base, covering various possible battery operating states. After rule matching is completed, the control rule set is input into the rule calculation unit, and the rule activation degree matrix is obtained by calculating the product of the membership value and the weight coefficient of each rule. The membership value is calculated by the membership function of the fuzzy input variable, and the activation degree of each rule is determined by the product of its membership value and the corresponding weight coefficient. The purpose of this step is to evaluate the influence degree of each rule under the current battery state. In the generated rule activation degree matrix, each element represents the contribution size of a certain rule to the current battery state. Based on the rule activation degree matrix, the fuzzy control quantity is obtained by weighted average operation, and the fuzzy control output is generated. The fuzzy control quantity is input into the centroid method defuzzification unit. The centroid method is a defuzzification method that converts the fuzzy control quantity into an accurate control quantity by calculating the centroid position of all rule outputs. The centroid position is calculated according to the membership distribution of the rule output, and the contribution proportion of each rule in the output is determined, thereby generating a certain value to obtain the accurate control quantity. The accurate control quantity is subjected to feature mapping transformation to convert the accurate control quantity into a droop coefficient increment. The droop coefficient is a dynamic adjustment parameter that reflects the relationship between voltage and power, used to realize the balanced distribution of battery power. The droop coefficient increment is a fine tuning value for the reference droop coefficient, reflecting the actual demand of the current battery state for power balance. In calculating the droop coefficient, the increment is linearly combined with the reference droop coefficient to generate a dynamic droop coefficient.The dynamic droop coefficient is input into a power distribution calculation module, and the power distribution of the battery pack is adjusted according to the droop control principle. The dynamic droop coefficient directly affects the charging and discharging power of each battery monomer. By adjusting the relationship between the voltage and the power of the battery monomer, the overall power balance of the battery pack is ultimately achieved. Through the above steps, the battery power balance control parameter is obtained.
[0033] Step 400, generating a PWM control signal based on the battery power balance control parameter, and performing power balance control on the battery pack to obtain the balance current size and direction.
[0034] Specifically, the battery power balance control parameter is input into a distribution function, and linear proportional operation is performed according to the size of the state difference between the battery packs to generate the power distribution weight of each battery module. According to the characteristic parameters of the voltage difference, state of charge difference and temperature difference of each battery module, the demand degree of different modules for the balance current is determined. The distribution function adopts a linear proportional model, so that the module with larger state difference is allocated higher weight, and the module with state close to the normal range is allocated lower weight. The power distribution weight is compared with the preset balance start threshold to screen out the battery module that needs to be balanced. If the power distribution weight of a certain module exceeds the threshold, the module will be marked as a to-be-balanced object to form a balance demand matrix. The balance demand matrix is a key data structure that records the modules that need to be balanced and their specific demands. The balance demand matrix is input into a carrier comparator to perform modulation operation based on a triangular carrier to generate an initial PWM waveform. The triangular carrier is used as a reference signal, and the power weight signal in the demand matrix is compared in real time to determine the duty cycle of the PWM waveform. The generated initial PWM waveform is an unmodified high-frequency signal, and its accuracy and stability have an important influence on subsequent control. In order to prevent the MOSFET switch tube of the upper and lower bridge arms from being short-circuited during high-frequency switching, the initial PWM waveform is further processed, and a 0.5 microsecond dead zone delay is inserted at the interval of each waveform. Through the staggered processing of the rising edge and the falling edge, it is ensured that the switching actions of the upper and lower bridge arms will not overlap, and safe and reliable upper and lower bridge arm drive signals are generated. Based on the upper and lower bridge arm drive signals, the conduction sequence of the MOSFET switch tube in the H-bridge circuit is controlled to realize the construction of the bidirectional power flow path and generate the working waveform of the converter. The H-bridge circuit is the core execution unit of the balance current regulation, and the current is shunted and looped between the battery modules through accurate PWM signal control. The generated converter working waveform is a direct manifestation of power flow, and its frequency and amplitude are determined by the duty cycle of the PWM signal, which is dynamically adjusted by the state of the battery pack. In order to obtain real-time balance current information, the converter working waveform is connected to a sampling resistor, and real-time current values are obtained through shunt sampling and signal amplification. The real-time current value is a key feedback signal for the closed-loop control of the battery management system. The selection of the sampling resistor and the design of the signal amplification circuit need to accurately match the current range and the dynamic characteristics of the system to ensure the accuracy of the sampling signal and the low distortion of the amplification process. Based on the deviation calculation of the real-time current value and the target balance current, the proportional term and the integral term are introduced for PID operation to generate a compensation control quantity. As a closed-loop control algorithm, the proportional term of the PID control is used to quickly respond to the current deviation, and the integral term is used to adjust the cumulative error to ensure that the system can gradually tend to be stable. Through PID operation, the calculated compensation control quantity reflects the dynamic adjustment demand between the real-time current and the target current.The compensation control quantity is superimposed to the PWM modulation signal to adjust the duty cycle online, and the PWM signal is optimized to realize the dynamic adjustment of the balanced current output. Through real-time adjustment of the duty cycle, the size and direction of the current are flexibly controlled, so that the current distribution in the battery pack accurately meets the balancing demand.
[0035] In the embodiments of the application, by establishing a battery state matrix and a covariance fitting criterion, combining the characteristics of Hermitian Toeplitz matrix, the accuracy of battery operation activity detection and state parameter estimation is significantly improved, and the accuracy of system control is guaranteed; the ConvFormer feature extraction network is adopted, the global-local features are extracted in parallel through the linear state predictor and the separable random CNN, and the integrity and robustness of feature extraction are enhanced; the cross attention mechanism is introduced for feature fusion, the complementarity of global feature vectors and local feature vectors is fully utilized, and the feature expression capability is improved; based on the combination of fuzzy logic control and adaptive droop control, the droop coefficient is dynamically adjusted to reduce the current impact in the balancing process and reduce the battery thermal stress; the closed-loop adjustment mechanism of the PWM control signal is adopted to realize the accurate distribution of power among the battery packs and ensure the stability and controllability of the balancing process.
[0036] In a specific embodiment, the process of step 100 can specifically include the following steps:
[0037] The BMS battery management system collects data of the battery cells in the battery pack to obtain continuously sampled voltage data, current data and temperature data, and performs maximum and minimum value normalization operation on the voltage data, current data and temperature data to obtain normalized parameter data;
[0038] The normalized parameter data is subjected to outlier screening to obtain effective parameter data, and the effective parameter data is subjected to permutation and combination to construct a time sequence matrix containing three columns of voltage, current and temperature parameters;
[0039] The time sequence matrix is subjected to Hermitian transformation to construct a symmetric positive definite initial feature matrix through conjugate transpose operation, and the correlation coefficient of the diagonal elements of the initial feature matrix is calculated to obtain a main diagonal feature matrix;
[0040] The off-diagonal elements of the initial feature matrix are subjected to cross-correlation analysis to obtain an off-diagonal feature matrix, and the main diagonal feature matrix and the off-diagonal feature matrix are subjected to matrix splicing operation to obtain a battery state matrix.
[0041] Specifically, the BMS battery management system continuously collects data of each battery cell in the battery pack to obtain voltage data, current data and temperature data of each battery cell. These data are respectively denoted as V i , I iand T i Where i represents the i-th battery cell, and the sampling time point is t. j The collected raw data is represented as V. i (t j ), I i (t j ) and T i (t j ), where j = 1, 2, ..., m, representing the j-th sampling time, and m is the total number of samplings. The collected raw data is standardized by maximum and minimum values to normalize all data to the interval [0, 1]. The standardization formula is:
[0042]
[0043] in, It is the normalized data; X i (t j ) is the raw data (voltage, current, or temperature); It is the minimum value of the original data, that is It is the maximum value of the original data, that is After standardization, outlier filtering is performed on the normalized data to remove noisy or erroneous measurements. Outlier filtering is achieved through rules based on the mean and standard deviation, specifically:
[0044]
[0045] Where, μ X It is a parameter The mean is defined as:
[0046]
[0047] σ X It is a parameter The standard deviation is defined as:
[0048]
[0049] Beyond the above range Outliers are considered outliers and removed from the dataset. The filtered valid data is used to construct a time-series matrix. A time-series matrix is a two-dimensional array that records the normalized values of voltage, current, and temperature for each battery cell at different time points. Its structure is as follows:
[0050]
[0051] Each row of matrix S corresponds to the state of a sampling time, and each column corresponds to the normalized data of voltage, current or temperature. The Hermitian transformation is performed on the constructed time sequence matrix S to construct a symmetric positive definite initial feature matrix through conjugate transpose. The formula of Hermitian transformation is:
[0052] H = S H S;
[0053] wherein H is the initial feature matrix; S H is the conjugate transpose of the time sequence matrix S, and the conjugate transpose is the transpose operation of the matrix and takes the conjugate of the complex element (if the element is a real number, the conjugate operation is equivalent to the ordinary transpose). The diagonal elements of the initial feature matrix H represent the autocorrelation of each parameter, and the non-diagonal elements represent the cross-correlation between different parameters. The correlation coefficient calculation is performed on the diagonal elements of H to obtain the main diagonal feature matrix, and the calculation formula is:
[0054]
[0055] wherein Cov(X i ,X i 0) is the autocovariance of parameter X i , indicating the degree of change of X i ; Var(X i ) is the variance of parameter X i , defined as:
[0056]
[0057] The diagonal feature matrix D = diag(H), wherein diag(H) represents the diagonal matrix composed of the diagonal elements of matrix H. At the same time, the cross-correlation analysis is performed on the non-diagonal elements of the initial feature matrix H, and the formula is:
[0058]
[0059] wherein Cov(X i ,X j ) is the covariance of parameters X i and X j , used to represent the degree of linear correlation between them. The main diagonal feature matrix D and the non-diagonal feature matrix R ′ are subjected to matrix splicing operation to generate the battery state matrix M:
[0060] M = D + R ′ ;
[0061] The battery state matrix M combines the autocorrelation and cross-correlation of voltage, current and temperature parameters, and can comprehensively reflect the running state of the battery pack.
[0062] In a specific embodiment, the process of performing step 200 can specifically include the following steps:
[0063] The battery state matrix is sample-divided to obtain a training data submatrix, and the training data submatrix is subjected to zero-mean centering processing to obtain a centered data matrix;
[0064] The centered data matrix is subjected to covariance calculation to obtain a covariance matrix, and a minimization objective function is constructed based on the covariance matrix and the battery state matrix;
[0065] The minimization objective function is input into a constraint construction unit to obtain a constraint optimization function by adding constraint conditions of voltage intervals, current limits, and temperature ranges;
[0066] The constraint optimization function is subjected to L2 regularization processing to obtain a regularization optimization function, and the regularization optimization function is converted into a maximum likelihood form to obtain a probability optimization function by constructing a log-likelihood function;
[0067] The probability optimization function is subjected to gradient descent operation to obtain a battery state parameter set;
[0068] Based on the battery state parameter set, a global feature vector and a local feature vector are generated, and the global feature vector and the local feature vector are subjected to feature fusion to obtain a fused feature vector.
[0069] Specifically, the dimension of the battery state matrix M is n x k, where n represents the number of samples, and k represents the feature dimension (including multiple statistical or transformed results of voltage, current, and temperature). M is divided into a training data submatrix M train and a test data submatrix M test according to a certain proportion. M train is subjected to zero-mean centering processing to eliminate the mean offset of the features and make the data centralized at the origin. The formula for zero-mean centering is:
[0070] M centered = M train - μ M ;
[0071] where M centered is the centered data matrix; is the mean vector of the training data; n train represents the number of training data samples, and M train [i, :] represents the feature vector of the i-th sample. After zero-mean centering, M centered is subjected to covariance calculation to generate a covariance matrix. The covariance matrix is used to describe the linear relationship between different features, and its calculation formula is:
[0072]
[0073] where Σ is the covariance matrix; denotes the transpose of the centered matrix; is the dot product result between features, which captures the correlation of features. The minimization objective function is constructed based on the covariance matrix and the battery state matrix. The objective function is defined as:
[0074]
[0075] where L is the objective function value; Tr(·) denotes the trace operation of a matrix, which is the sum of diagonal elements of a matrix; Σ -1 is the inverse matrix of the covariance matrix, which measures the synergy between features; is the regularization term, where denotes the two-norm of matrix M (i.e., the sum of the squares of all elements), and λ is the regularization strength parameter. To make the objective function more consistent with the physical constraints of the actual battery operation, it is input to the constraint construction unit and the constraint conditions of voltage interval, current limit, and temperature range are added. For example, the voltage range is set to [V min ,V max ], the current range is [I min ,I max ], and the temperature range is [T min ,T max ]. These constraint conditions are expressed in the form of inequalities as:
[0076] V min ≤V≤V max ,I min ≤I≤I max ,T min ≤T≤T max ;
[0077] After combining the constraint conditions, the objective function becomes a constrained optimization function. The L2 regularization is performed on the constrained optimization function to suppress overfitting and enhance the generalization ability of the model. The mathematical form of regularization is:
[0078]
[0079] where the regularization term increases the penalty of high-amplitude weight values for the objective function, making the optimization more stable. The regularization optimization function is converted to the maximum likelihood form. According to probability theory, the goal of maximum likelihood estimation is to maximize the probability of observed data by selecting model parameters. Through logarithmic transformation, the regularization optimization function is rewritten as a log-likelihood function:
[0080] L log =-logP(M|Σ);
[0081] where P(M|Σ) is a conditional probability distribution function based on the covariance matrix Σ. Gradient descent operation is performed on the log-likelihood function to iteratively optimize the battery state parameter set. The update formula of gradient descent is:
[0082]
[0083] where M (t) is the parameter of the t-th iteration; η is the learning rate; is the gradient of the objective function. The battery state parameter set obtained by optimization is used to generate the global feature vector and the local feature vector. The global feature vector is generated by taking the average value of the parameters of all samples:
[0084]
[0085] The local feature vector is generated by selecting the parameters of a specific sample, for example, selecting the parameters corresponding to the sample with the largest voltage difference. The global feature vector and the local feature vector are fused by feature fusion, and the fusion method is weighted average or other fusion mechanism, for example:
[0086] F fusion = αF global +(1-α)F local ;
[0087] where α is the fusion weight, controlling the proportion of the influence of global and local features on the final result.
[0088] In a specific embodiment, the process of generating the global feature vector and the local feature vector based on the battery state parameter set, and fusing the global feature vector and the local feature vector to obtain the fused feature vector can specifically include the following steps:
[0089] Input the battery state parameter set into the linear state predictor, perform feature transformation through the first fully connected layer containing 128 neurons to obtain the first intermediate feature;
[0090] Perform ReLU activation function operation on the first intermediate feature to obtain the first activation feature through nonlinear transformation, and input the first activation feature into the second fully connected layer containing 256 neurons to obtain the second intermediate feature;
[0091] Perform ReLU activation function operation on the second intermediate feature to obtain the second activation feature, and input the second activation feature into the third fully connected layer containing 512 neurons to obtain the global feature vector;
[0092] Input the battery state parameter set into the ConvFormer feature extraction network, perform feature extraction through the first deep separable convolution layer to obtain the first convolution feature;
[0093] The first convolutional feature is subjected to a max-pooling operation to obtain a first pooled feature, and the first pooled feature is input into a second deep separable convolutional layer to obtain a second convolutional feature;
[0094] The second convolutional feature is subjected to a max-pooling operation to obtain a second pooled feature, and the second pooled feature is input into a third deep separable convolutional layer to obtain a third convolutional feature;
[0095] The third convolutional feature is subjected to a flattening process to obtain a one-dimensional feature vector, and the one-dimensional feature vector is input into a first fully connected layer to obtain a first feature vector, and the first feature vector is input into a second fully connected layer for dimension reduction processing to obtain a local feature vector;
[0096] Cross-attention calculation is performed based on the global feature vector and the local feature vector to obtain a fusion feature vector.
[0097] Specifically, the battery state parameter set is represented as a matrix X ∈ R n×k , where n is the number of battery state samples, and k is the feature dimension of each sample (such as voltage difference, current difference, temperature difference, etc.). X is input into a linear state predictor, and the core of the predictor is a set of fully connected layers for feature transformation. Through the first fully connected layer, X is projected into a new feature space, and the calculation formula is:
[0098] Z1 = XW1 + b1;
[0099] , where Z1 ∈ R n×128 is the first intermediate feature; W1 ∈ R k×128 is a weight matrix representing a linear mapping from the input feature space to a 128-dimensional space; and b1 ∈ R 128 is a bias vector representing the offset for each dimension of the output feature. After completing the linear transformation, the ReLU activation function is applied to Z1, and the formula is:
[0100]
[0101] , where is the first activation feature. The ReLU function introduces nonlinearity by setting negative values to 0, thereby improving the expression ability of the model. The first activation feature is input into the second fully connected layer, and the formula is:
[0102]
[0103] , where Z2 ∈ R n×256 is the second intermediate feature; W2 ∈ R 128×256 , and b2 ∈ R 256are the weight matrix and bias vector of the second layer, respectively. Similarly, apply the ReLU activation function to Z2 to obtain the second activation feature:
[0104]
[0105] wherein, Input the second activation feature into the third fully connected layer for further feature transformation:
[0106]
[0107] wherein, Z3∈R n×512 is the global feature vector; W3∈R 256×512 and b3∈R 512 are the weight matrix and bias vector of the third layer, respectively. At the same time, input the battery state parameter set X into the ConvFormer feature extraction network, and extract the features through the first deep separable convolution layer. Deep separable convolution is an efficient convolution method, which is divided into two steps of deep convolution and pointwise convolution to reduce the computational complexity. The calculation formula of the first convolution feature is:
[0108] F1 = DepthwiseConv(X, K1) + PointwiseConv(X, K2);
[0109] wherein, is the first convolution feature, DepthwiseConv is the deep convolution operation; PointwiseConv is the pointwise convolution operation; K1, K2 are the convolution kernels. Perform maximum pooling operation on F1 to obtain the first pooling feature:
[0110] P1 = MaxPool(F1);
[0111] wherein, MaxPool is a pooling operation that selects the maximum value in the local window. Input the first pooling feature P1 into the second deep separable convolution layer to calculate the second convolution feature:
[0112] F2 = DepthwiseConv(P1, K3) + PointwiseConv(P1, K4);
[0113] Perform maximum pooling operation on F2 again to obtain the second pooling feature P2, and repeat the above process to extract the third convolution feature F3 through the third deep separable convolution layer. Then perform flattening processing on F3, the formula is:
[0114] V = Flatten(F3);
[0115] wherein, V∈R n×dis a one-dimensional feature vector, and d is the dimension of the flattened features. V is input into the first fully connected layer for feature dimension reduction:
[0116] V1 = V W4 + b4;
[0117] V1 is input into the second fully connected layer for further dimension reduction to obtain the local feature vector:
[0118] V2 = V1 W5 + b5;
[0119] wherein V2 ∈ R n×l is a local feature vector, and W4, W5 and b4, b5 are corresponding weights and biases. Cross-attention calculation is performed based on the global feature vector Z3 and the local feature vector V2. Cross-attention is realized through the calculation of query, key and value matrices, and the formula is:
[0120] Q = Z3 W q , K = V2 W k , and V = V2 W v ;
[0121]
[0122] wherein Q, K and V are query, key and value matrices, respectively; W q , W k , and W v are weight matrices of linear transformation; and A is the cross-attention output, i.e., the fusion feature vector. Through the above steps, the global and local features are extracted from the battery state parameter set, and finally the two features are fused through the cross-attention mechanism to obtain a fusion feature vector with rich semantic information.
[0123] In a specific embodiment, the process of performing cross-attention calculation based on the global feature vector and the local feature vector to obtain the fusion feature vector can specifically include the following steps:
[0124] linearly transforming the global feature vector to obtain a query matrix through weight matrix operation, and linearly transforming the local feature vector to obtain a key matrix through weight matrix operation;
[0125] performing matrix multiplication operation based on the query matrix and the key matrix to obtain an attention score matrix;
[0126] performing Softmax normalization operation on the attention score matrix to obtain an attention weight matrix, and linearly transforming the local feature vector to obtain a value matrix through weight matrix operation;
[0127] performing matrix multiplication operation based on the attention weight matrix and the value matrix to obtain an attention output matrix;
[0128] The residual connection operation is performed on the attention output matrix, and a residual feature matrix is obtained by adding the global feature vector. The layer normalization operation is performed on the residual feature matrix to obtain the fusion feature vector.
[0129] Specifically, the global feature vector F global is linearly transformed to generate a query matrix (Query), and the formula is:
[0130] Q=F global W Q ;
[0131] wherein, is the query matrix; is the query weight matrix, d q represents the feature dimension of the query matrix. Similarly, the local feature vector F local is linearly transformed to generate a key matrix (Key), and the formula is:
[0132] K=F local W K ;
[0133] wherein, is the key matrix; is the key weight matrix, d k is the feature dimension of the key matrix. The query matrix and the key matrix respectively capture the representation information of the global feature and the local feature in different dimensions. The dot product of the query matrix and the key matrix is calculated by matrix multiplication to obtain an attention score matrix, and the formula is:
[0134] S=QK T ;
[0135] wherein, S∈R n×n is the attention score matrix; K T is the transpose of the key matrix; each element S ij represents the dot product result of the i-th row of the query matrix and the j-th row of the key matrix, reflecting the correlation between the two. Since the values in the attention score matrix may range widely, in order to avoid numerical instability problems, the dot product result is divided by for scaling, and the formula is:
[0136]
[0137] wherein, is a scaling factor used to maintain gradient stability. The scaled attention score matrix is subjected to Softmax normalization operation to convert it into a probability distribution, and the formula is:
[0138]
[0139] wherein, A∈Rn×n is an attention weight matrix; each element A ij denotes the normalized attention weight between the i-th row of query vector and the j-th row of key vector. Meanwhile, the local feature vector F local The value matrix (Value) is generated by linear transformation, and the formula is as follows:
[0140] V=F local W V ;
[0141] wherein, is a value matrix; is a value weight matrix, d v denotes the feature dimension of the value matrix. The attention output matrix is calculated based on the attention weight matrix A and the value matrix V, and the formula is as follows:
[0142] O=AV;
[0143] wherein, is an attention output matrix; O denotes the weighted sum result of local features based on attention weights, which integrates the contribution of different local features in the global context. In order to enhance the expression ability of the model, the residual connection operation is performed on the attention output matrix O, and the global feature vector F global is added, and the formula is as follows:
[0144] R=O+F global ;
[0145] wherein, is a residual feature matrix; the residual connection retains the original information of the global feature, and at the same time, the local feature enhancement information of the attention output matrix is integrated. The layer normalization processing is performed on the residual feature matrix R to eliminate the numerical difference between different features and enhance the stability of the model, and the formula is as follows:
[0146]
[0147] wherein, F fusion,i is the i-th sample of the fusion feature vector; is the mean of the residual feature matrix; is the variance of the residual feature matrix; ∈ is a small value to prevent division by zero; γ and β are learnable parameters for adjusting the scale and offset of the normalization result.
[0148] In a specific embodiment, the process of performing step 300 can specifically include the following steps:
[0149] The fusion feature vector is input into a fuzzification processing unit, and triangular membership function division is performed on the voltage difference variable in the interval [2.5V, 4.2V], the state of charge difference variable in the interval [0%, 100%], and the temperature difference variable in the interval [0℃, 60℃], to obtain fuzzy input variables;
[0150] Fuzzy rule matching is performed on the fuzzy input variables, a corresponding relationship between the voltage difference, the state of charge difference, the temperature difference, and the power balance control strategy is established, and a control rule set is obtained;
[0151] The control rule set is input into a rule calculation unit, the product of the membership value and the weight coefficient of each rule is calculated, a rule activation degree matrix is obtained, and weighted average operation is performed based on the rule activation degree matrix, to obtain a fuzzy control quantity;
[0152] The fuzzy control quantity is input into a gravity method defuzzification unit, the gravity position of each rule output is calculated, an accurate control quantity is obtained, and feature mapping transformation is performed on the accurate control quantity, to obtain a droop coefficient increment;
[0153] Linear combination operation is performed on the droop coefficient increment and the reference droop coefficient, to obtain a dynamic droop coefficient, and power distribution calculation is performed on the dynamic droop coefficient, to obtain a battery power balance control parameter.
[0154] Specifically, the fusion feature vector is expressed as F fusion =[ΔV, ΔSOC, ΔT], wherein ΔV ∈ [2.5, 4.2] represents the voltage difference variable; ΔSOC ∈ [0, 100] represents the state of charge difference variable; and ΔT ∈ [0, 60] represents the temperature difference variable. These variables respectively represent three key indicators of the battery state. They are input into a fuzzification processing unit, and triangular membership functions are used to map each variable to three fuzzy sets of low (L), medium (M), and high (H). For the voltage difference ΔV, the membership functions of low, medium, and high are respectively defined as:
[0155]
[0156]
[0157] Similar membership functions are defined on the state of charge difference ΔSOC and the temperature difference ΔT, to represent the membership degrees of them belonging to the low, medium, and high sets. After fuzzification, the membership values of each variable are input into a fuzzy rule matching module. Fuzzy rule matching is based on a predefined rule base, for example, if ΔV is high and ΔSOC is high and ΔT is medium, the balance current needs to be reduced; if ΔV is medium and ΔSOC is medium and ΔT is low, the balance current needs to be increased; and if ΔV is low and ΔSOC is low and ΔT is high, the balance current remains unchanged. Let the output of the ith rule be C iThe activation degree of each rule is determined by the minimum value of the membership values of the input variables (using the intersection operation "min" principle in fuzzy logic), and the formula is:
[0158] μ i = min(μ V,i (ΔV), μ SOC,i (ΔSOC), μ T,i (ΔT));
[0159] where μ i is the membership value of rule i; μ V,i (ΔV), μ SOC,i (ΔSOC), and μ T,i (ΔT) are the membership values of the voltage difference, state of charge difference, and temperature difference in the i-th rule, respectively. The rule membership value is multiplied by the corresponding weight coefficient w i to obtain the rule activation value:
[0160] A i = μ i · w i ;
[0161] where w i is the weight of rule i, reflecting the influence of the rule on the final output. The fuzzy control variable C fuzzy is calculated by weighted average operation, and the formula is:
[0162]
[0163] where m is the total number of rules, and C i is the output value of rule i. The fuzzy control variable is input into the fuzzy resolution unit by the barycenter method, and the fuzzy resolution is converted into an accurate control variable by calculating the barycenter position of all rule outputs, and the formula is:
[0164]
[0165] where C precise is the accurate control variable; a and b are the lower limit and upper limit of the fuzzy control output, respectively; and μ C (x) is the membership function of the fuzzy control variable. The accurate control variable obtained by fuzzy resolution is transformed by characteristic mapping to calculate the droop coefficient increment:
[0166] Δα = f(C precise );
[0167] where f(·) is a characteristic mapping function used to map the control variable to the adjustment range of the droop coefficient. The droop coefficient increment is linearly combined with the reference droop coefficient to calculate the dynamic droop coefficient:
[0168] α dynamic = αbase + Δα;
[0169] wherein α base is the reference droop coefficient. The power distribution parameters are calculated by the dynamic droop coefficient to achieve power balance within the battery pack, and the battery power balance control parameters are obtained. The formula is:
[0170] P i = α dynamic · V i ;
[0171] wherein P i is the power distribution value of the i-th battery module, and V i is the voltage value of the corresponding battery module.
[0172] In a specific embodiment, the process of performing step 400 can specifically include the following steps:
[0173] The battery power balance control parameters are input into a distribution function, and linear proportional operation is performed according to the size of the state difference between the battery packs, to obtain the power distribution weight of each battery module;
[0174] The power distribution weight and the balance start threshold value are compared in size, and the battery modules exceeding the threshold value are marked as objects to be balanced, to obtain a balance demand matrix;
[0175] The balance demand matrix is input into a carrier comparator, and modulation operation is performed based on a triangular carrier, to obtain an initial PWM waveform, and a dead zone delay is inserted into the initial PWM waveform at intervals of 0.5 microseconds, to perform staggered processing of rising edges and falling edges, to obtain upper and lower bridge arm driving signals;
[0176] Based on the upper and lower bridge arm driving signals, the conduction sequence of the MOSFET switch tubes in the H-bridge circuit is controlled, a bidirectional power flow path is generated, and a converter working waveform is obtained;
[0177] The converter working waveform is connected to a sampling resistor, and shunt sampling and signal amplification are performed, to obtain real-time current values;
[0178] Based on the deviation calculation of the real-time current values and the target balance current, PID operation is performed in combination with the integral term and the proportional term, to obtain a compensation control amount, and the compensation control amount is superimposed on the PWM modulation signal to adjust the duty cycle online, to obtain the balance current size and direction.
[0179] Specifically, the battery power balance control parameters are represented as a vector P = [P1, P2, …, P n ], wherein P iPn is the power control demand of the ith battery module, n is the number of battery modules. These control parameters are calculated based on the state difference of the battery. The P is input into the distribution function, and the power distribution weight is obtained by linear scaling operation, and the formula is:
[0180]
[0181] Where W i is the power distribution weight of the ith battery module; is the average value of the power of all battery modules; the numerator represents the power deviation of the ith module, and the denominator is used to normalize the weight, so that The calculated power distribution weight W = [W1, W2, …, W n ] reflects the state difference of each battery module relative to the average power. The allocation weight of each module is compared with the balance start threshold T balance , and the formula is:
[0182]
[0183] Where D i is the balance demand flag of the ith module, 1 indicates the need for balance, and 0 indicates no need; T balance is the preset balance start threshold, which is used to filter modules with small state differences. The balance demand flags of all modules are combined into a balance demand matrix D = [D1, D2, …, D n ], which determines which battery modules need to participate in power balance. The balance demand matrix is input into the carrier comparator to perform PWM modulation based on the triangular carrier signal. The triangular carrier signal is represented as:
[0184]
[0185] Where V tri (t) is the voltage of the triangular carrier; A is the amplitude of the carrier; T is the period of the carrier; t is the time. PWM modulation generates an initial PWM waveform by comparing the balance demand signal V demand (t) and the triangular carrier signal V tri (t), and the formula is:
[0186]
[0187] Where V PWM(t) is the PWM output signal. In order to prevent the short circuit of the MOSFET switch tube of the upper and lower bridge arms when switching, the dead time is inserted in the PWM waveform. The rising edge and the falling edge of each PWM waveform are staggered by 0.5 microseconds to form the safe upper and lower bridge arm driving signals. Based on the upper and lower bridge arm driving signals, the conduction sequence of the MOSFET switch tube in the H-bridge circuit is controlled, so as to realize the construction of the bidirectional power flow path. In the H-bridge circuit, when one MOSFET of the upper bridge arm and another MOSFET of the lower bridge arm are turned on, the current forms a power flow through the battery module. The corresponding converter working waveform is determined by the conduction state, and the frequency and amplitude are controlled by the PWM signal. The converter working waveform is connected to the sampling resistor R s , and the real-time current value I real (t) is obtained by shunt sampling, and the formula is:
[0188]
[0189] Wherein, I real (t) is the real-time current; V s (t) is the voltage across the sampling resistor. The deviation calculation is performed between I real (t) and the target balanced current I target , and the formula is:
[0190] ΔI(t)=I tanget -I real (t);
[0191] Wherein ΔI(t) is the real-time current deviation. The PID operation is performed on the deviation by combining the proportional term and the integral term, and the calculation formula of the compensation control quantity is:
[0192]
[0193] Wherein, C PID (t) is the compensation control quantity; K p and K i are the proportional gain and the integral gain, respectively. The compensation control quantity is superimposed into the PWM modulation signal, the duty cycle is adjusted online, and the formula is:
[0194] V adjusted (t)=V PWM (t)+C PID (t);
[0195] The real-time adjusted PWM signal is finally generated, which is used to control the size and direction of the balanced current, so as to achieve the purpose of power balance.
[0196] The control method of the BMS battery management system in the embodiment of the application is described above, and the BMS battery management system 10 in the embodiment of the application is described below. Please refer toFigure 2 In an embodiment of the present application, the BMS battery management system 10 includes:
[0197] The acquisition module 11 is configured to acquire voltage data, current data and temperature data of the battery cells in the battery pack through the BMS battery management system, and construct a battery state matrix.
[0198] The extraction module 12 is configured to extract a global feature vector and a local feature vector based on the battery state matrix, and perform feature fusion on the global feature vector and the local feature vector to obtain a fused feature vector.
[0199] The establishment module 13 is configured to establish a fuzzy logic control rule library according to the fused feature vector, calculate droop parameters through a droop coefficient self-adaptive adjustment algorithm, and obtain battery power balance control parameters.
[0200] The control module 14 is configured to generate a PWM control signal based on the battery power balance control parameters, perform power balance control on the battery pack, and obtain a balance current size and direction.
[0201] Through the cooperation of the above components, the precision of battery operation activity detection and state parameter estimation is significantly improved by establishing a battery state matrix and a covariance fitting criterion, combined with the characteristics of Hermitian Toeplitz matrix, which ensures the accuracy of system control; the ConvFormer feature extraction network is adopted to extract global-local features in parallel through a linear state predictor and a separable stochastic CNN, which enhances the integrity and robustness of feature extraction; the cross-attention mechanism is introduced for feature fusion, which fully utilizes the complementarity of global feature vectors and local feature vectors, and improves the feature expression ability; based on the combination of fuzzy logic control and adaptive droop control, the droop coefficient is dynamically adjusted to reduce the current impact in the balancing process and reduce the battery thermal stress; the closed-loop adjustment mechanism of the PWM control signal is adopted to realize the accurate distribution of power among the battery packs, and ensure the stability and controllability of the balancing process.
[0202] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0203] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing an electronic device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0204] The above-described embodiments are merely used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some of the technical features; and these modifications or replacements do not cause the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A control method of a BMS battery management system, characterized by, The method comprises: Collecting voltage data, current data and temperature data of battery monomers in the battery pack through a BMS battery management system, and constructing a battery state matrix; specifically comprising: collecting data of battery monomers in the battery pack through the BMS battery management system to obtain continuously sampled voltage data, current data and temperature data, and performing maximum and minimum value standardization operation on the voltage data, current data and temperature data to obtain normalized parameter data; performing outlier screening on the normalized parameter data to obtain effective parameter data, and performing permutation and combination on the effective parameter data to construct a time sequence matrix containing three columns of voltage, current and temperature parameters; performing Hermite transformation on the time sequence matrix to construct a symmetric positive definite initial feature matrix through conjugate transpose operation, and performing correlation coefficient calculation on the diagonal elements of the initial feature matrix to obtain a main diagonal feature matrix; performing cross-correlation analysis on the non-diagonal elements of the initial feature matrix to obtain a non-diagonal feature matrix, and performing matrix splicing operation on the main diagonal feature matrix and the non-diagonal feature matrix to obtain a battery state matrix; Based on the battery state matrix, a global feature vector and a local feature vector are extracted, and feature fusion is performed on the global feature vector and the local feature vector to obtain a fused feature vector; specifically comprising: performing linear transformation on the global feature vector to obtain a query matrix through weight matrix operation, and performing linear transformation on the local feature vector to obtain a key matrix through weight matrix operation; performing matrix multiplication operation based on the query matrix and the key matrix to obtain an attention score matrix; performing Softmax normalization operation on the attention score matrix to obtain an attention weight matrix, and performing linear transformation on the local feature vector to obtain a value matrix through weight matrix operation; performing matrix multiplication operation based on the attention weight matrix and the value matrix to obtain an attention output matrix; performing residual connection operation on the attention output matrix to obtain a residual feature matrix by adding the global feature vector, and performing layer normalization operation on the residual feature matrix to obtain a fused feature vector; According to the fusion feature vector, a fuzzy logic control rule base is established, a droop coefficient adaptive adjustment algorithm is used to calculate the droop parameter, and a battery power balance control parameter is obtained; specifically including: inputting the fusion feature vector into a fuzzy processing unit, dividing the voltage difference variable in the [2.5V, 4.2V] interval, the state of charge difference variable in the [0%, 100%] interval, and the temperature difference variable in the [0℃, 60℃] interval by a triangular membership function to obtain fuzzy input variables; the fuzzy input variables are matched with fuzzy rules to establish the corresponding relationship between the voltage difference, the state of charge difference, the temperature difference and the power balance control strategy, and a control rule set is obtained; the control rule set is input into a rule calculation unit, the product of the membership value and the weight coefficient of each rule is calculated, a rule activation degree matrix is obtained, and a weighted average operation is performed based on the rule activation degree matrix to obtain a fuzzy control quantity; the fuzzy control quantity is input into a centroid method de-fuzzification unit, the centroid positions of each rule output are calculated, an accurate control quantity is obtained, and the accurate control quantity is subjected to feature mapping transformation to obtain a droop coefficient increment; the droop coefficient increment and the reference droop coefficient are subjected to linear combination operation to obtain a dynamic droop coefficient, and the dynamic droop coefficient is subjected to power distribution calculation to obtain a battery power balance control parameter; Based on the battery power balance control parameter, a PWM control signal is generated to control the power balance of the battery pack, and the balance current size and direction are obtained; specifically including: inputting the battery power balance control parameter into a distribution function, performing linear proportional operation according to the size of the state difference between the battery packs to obtain the power distribution weight of each battery module; the power distribution weight and the balance start threshold value are compared in size, the battery modules exceeding the threshold value are marked as objects to be balanced, and a balance demand matrix is obtained; the balance demand matrix is input into a carrier comparator, modulation operation is performed based on a triangular carrier, an initial PWM waveform is obtained, a dead zone delay is inserted into the initial PWM waveform at intervals of 0.5 microseconds, and the rising edge and the falling edge are subjected to staggered processing to obtain upper and lower bridge arm drive signals; the on-off sequence of the MOSFET switch tube in the H-bridge circuit is controlled based on the upper and lower bridge arm drive signals, a bidirectional power flow path is generated, and a converter working waveform is obtained; the converter working waveform is connected to a sampling resistor for shunt sampling and signal amplification to obtain a real-time current value; based on the real-time current value and the target balance current, a deviation is calculated, a PID operation is performed in combination with an integral term and a proportional term to obtain a compensation control quantity, and the compensation control quantity is superimposed on the PWM modulation signal to adjust the duty cycle online to obtain the balance current size and direction.
2. The control method of a BMS battery management system according to claim 1, wherein, The global feature vector and the local feature vector are extracted based on the battery state matrix, and the global feature vector and the local feature vector are fused to obtain a fusion feature vector, including: The battery state matrix is divided into samples to obtain a training data submatrix, and the training data submatrix is subjected to zero mean centering processing to obtain a centered data matrix; Perform covariance calculation on the center data matrix to obtain a covariance matrix, and construct a minimization objective function based on the covariance matrix and the battery state matrix; Input the minimization objective function into a constraint construction unit to obtain a constraint optimization function by adding constraint conditions of voltage interval, current limit, and temperature range; Perform L2 regularization processing on the constraint optimization function to obtain a regularization optimization function, and convert the regularization optimization function into a maximum likelihood form to obtain a probability optimization function by constructing a log-likelihood function; Perform gradient descent operation on the probability optimization function to obtain a battery state parameter set; Generate a global feature vector and a local feature vector based on the battery state parameter set, and perform feature fusion on the global feature vector and the local feature vector to obtain a fused feature vector.
3. The control method of a BMS battery management system according to claim 2, wherein, The global feature vector and the local feature vector are generated based on the battery state parameter set, and the global feature vector and the local feature vector are fused to obtain a fused feature vector, comprising: Input the battery state parameter set into a linear state predictor to perform feature transformation through a first fully connected layer containing 128 neurons to obtain a first intermediate feature; Perform ReLU activation function operation on the first intermediate feature to obtain a first activation feature through nonlinear transformation, and input the first activation feature into a second fully connected layer containing 256 neurons to obtain a second intermediate feature; Perform ReLU activation function operation on the second intermediate feature to obtain a second activation feature, and input the second activation feature into a third fully connected layer containing 512 neurons to obtain a global feature vector; Input the battery state parameter set into a ConvFormer feature extraction network to perform feature extraction through a first deep separable convolution layer to obtain a first convolution feature; Perform maximum pooling operation on the first convolution feature to obtain a first pooling feature, and input the first pooling feature into a second deep separable convolution layer to obtain a second convolution feature; Perform maximum pooling operation on the second convolution feature to obtain a second pooling feature, and input the second pooling feature into a third deep separable convolution layer to obtain a third convolution feature; Perform flattening processing on the third convolution feature to obtain a one-dimensional feature vector, and input the one-dimensional feature vector into a first fully connected layer to obtain a first feature vector, and input the first feature vector into a second fully connected layer for dimension reduction processing to obtain a local feature vector; Perform cross-attention calculation based on the global feature vector and the local feature vector to obtain a fused feature vector.
4. A BMS battery management system characterized by, A control method for performing the BMS battery management system as claimed in any one of claims 1-3, the BMS battery management system comprising: An acquisition module for acquiring voltage data, current data, and temperature data of battery cells in a battery pack through a BMS battery management system and constructing a battery state matrix; An acquisition module for acquiring voltage data, current data, and temperature data of battery cells in a battery pack through a BMS battery management system and constructing a battery state matrix; The extraction module is configured to extract a global feature vector and a local feature vector based on the battery state matrix, and perform feature fusion on the global feature vector and the local feature vector to obtain a fused feature vector; The establishment module is configured to establish a fuzzy logic control rule library according to the fused feature vector, calculate a droop parameter by using a droop coefficient adaptive adjustment algorithm, and obtain a battery power balance control parameter; The control module is configured to generate a PWM control signal based on the battery power balance control parameter, perform power balance control on the battery pack, and obtain a balance current size and direction.
Citation Information
Patent Citations
Charging control method and system for pure electric vehicle
CN119116763A
Storage battery quick charging safety control method, device and equipment and storage medium
CN119231717A