Battery pack BMS control power distribution method and system

By introducing hypergraph model and spectral clustering algorithms into the BMS system, combined with multi-layer hypergraph convolutional neural network and attention mechanism, it solves the problem of difficulty in dealing with the complexity of large-scale battery pack systems in traditional BMS, and achieves more accurate and reasonable power allocation, ensuring the safety and reliability of the system.

CN119560656AInactive Publication Date: 2025-03-04SHENZHEN BAIQIANCHENG ELECTRONICS CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510093989.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional BMS power distribution methods are difficult to effectively deal with the complex interaction relationships and dynamic characteristics changes between battery cells in large-scale battery pack systems, and it is difficult to accurately capture the nonlinear and time-varying operating characteristics of battery cells.

Method used

By introducing hypergraph model and spectral clustering algorithm, the large-scale battery pack system is divided into multiple subsystems, and the multi-layer hypergraph convolutional neural network and ReLU activation function are used to perform deep extraction and nonlinear transformation of battery cell characteristics. A hypergraph network structure based on attention mechanism is designed, a recursive Bayesian algorithm is used for state estimation, and an improved gradient descent algorithm is used for iterative optimization.

Benefits of technology

It improves the accuracy and rationality of power distribution, reduces the computing complexity of the system, and maintains the topological relationship between battery cells, ensuring the safety and reliability of the power distribution scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119560656A_ABST
    Figure CN119560656A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of battery pack BMS, and discloses a battery pack BMS control power distribution method and system, and the method comprises the steps: collecting a voltage value, a current value, a temperature value and a state-of-charge value of each battery unit in a battery pack, and calculating the number of subsystems; performing spectral clustering operation on the battery units in the system state matrix to obtain a hypergraph Laplacian matrix; performing multilayer hypergraph convolution operation and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix; calculating a target power characteristic matrix between the battery unit node and the corresponding power transmission path; establishing a dual-constraint optimization model to obtain a battery pack state quantity and a battery pack observed quantity; and carrying out iterative calculation until the difference value of the power distribution schemes of two adjacent iterations is smaller than a preset threshold value, and outputting a target power distribution scheme, thereby improving the accuracy and rationality of power distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of battery pack BMS, and in particular to a battery pack BMS power distribution control method and system. Background Art

[0002] Traditional BMS power allocation methods are mainly based on simple rule control or linear optimization algorithms, which are difficult to effectively handle the complex interaction relationships and dynamic characteristics changes between battery cells in large-scale battery pack systems.

[0003] Currently, the power distribution control of battery packs faces several key challenges. First, the working characteristics of battery cells are significantly nonlinear and time-varying, and traditional power distribution methods are difficult to accurately capture these complex dynamic characteristics. Second, there are a large number of battery cells in large-scale battery pack systems, and the power transmission relationship between each cell is intricate. Existing methods are difficult to effectively model this complex topological structure relationship. The performance differences and aging degrees of battery cells are inconsistent, which means that power distribution needs to consider multiple constraints at the same time, which increases the difficulty of designing control strategies. Summary of the invention

[0004] The present invention provides a method and system for controlling power distribution of a battery pack BMS, which improves the accuracy and rationality of power distribution.

[0005] In a first aspect, the present invention provides a method for controlling power distribution of a battery pack BMS, the method comprising: The voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack are collected to construct a system state matrix, and the number of subsystems is calculated based on the system state matrix; Performing spectral clustering operations on the battery cells in the system state matrix according to the number of subsystems to obtain multiple subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; Performing multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery cell; Constructing a hypergraph attention network according to the initial power feature matrix, and calculating a target power feature matrix between battery cell nodes and corresponding power transmission paths; Based on the target power characteristic matrix, a dual-constraint optimization model including voltage power constraint and capacity balance constraint is established, and a recursive Bayesian operation is performed on the state parameters of the battery pack to obtain the battery pack state quantity and the battery pack observation quantity; The battery pack state quantity and the battery pack observation quantity are input into a gradient descent optimizer for iterative calculation until the difference between power allocation schemes of two adjacent iterations is less than a preset threshold, and then a target power allocation scheme is output.

[0006] In a second aspect, the present invention provides a battery pack BMS control power distribution system, the battery pack BMS control power distribution system comprising: A collection module, used to collect the voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack, construct a system state matrix, and calculate the number of subsystems based on the system state matrix; A clustering module, used for performing spectral clustering operation on the battery cells in the system state matrix according to the number of subsystems, obtaining multiple subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; A processing module, used to perform multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery unit; A calculation module, used to construct a hypergraph attention network according to the initial power feature matrix, and calculate a target power feature matrix between a battery cell node and a corresponding power transmission path; Establishing a module for establishing a dual-constraint optimization model including voltage-power constraints and capacity balance constraints based on the target power characteristic matrix, performing recursive Bayesian operations on the state parameters of the battery pack, and obtaining a battery pack state quantity and a battery pack observation quantity; The output module is used to input the battery pack state quantity and the battery pack observation quantity into the gradient descent optimizer for iterative calculation until the difference between the power allocation schemes of two adjacent iterations is less than a preset threshold, and then output the target power allocation scheme.

[0007] A third aspect of the present invention provides a computer device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned battery pack BMS control power distribution method.

[0008] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned battery pack BMS power distribution control method.

[0009] In the technical solution provided by the present invention, by introducing a hypergraph model and a spectral clustering algorithm, a large-scale battery pack system is divided into multiple subsystems, which reduces the computational complexity of the system, while maintaining the topological relationship between battery cells, making the power allocation more accurate and reasonable. A multi-layer hypergraph convolutional neural network and a ReLU activation function are used to deeply extract and nonlinearly transform the battery cell features, thereby enhancing the model's ability to express the nonlinear dynamic characteristics of the battery pack system. A hypergraph network structure based on an attention mechanism is designed, and the accuracy and rationality of power allocation are improved by adaptively learning the correlation strength between battery cell nodes and power transmission paths. A dual-constraint optimization model including voltage power constraints and capacity balance constraints is constructed, and a recursive Bayesian algorithm is used for state estimation to ensure the safety and reliability of the power allocation scheme. An improved gradient descent algorithm is used for iterative optimization, and the stability and convergence efficiency of the optimization process are guaranteed by dynamically adjusting the learning rate and setting the convergence threshold. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0011] Figure 1 A schematic diagram of the steps of a method for controlling power distribution of a battery pack BMS in an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a battery pack BMS controlling power distribution system according to an embodiment of the present invention; Figure 3 It is a schematic block diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0012] An embodiment of the present invention provides a method and system for controlling power distribution of a battery pack BMS. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0013] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the method for controlling power distribution of a battery pack BMS in an embodiment of the present invention includes: Step S1, collecting the voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack, constructing a system state matrix, and calculating the number of subsystems based on the system state matrix; It is understandable that the execution subject of the present invention may be a battery pack BMS controlling a power distribution system, or may be a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking a server as an execution subject as an example.

[0014] Specifically, a unique identification number is set for each battery cell in the battery pack to facilitate the subsequent accurate management and operation of the battery cell status data. Through the identification number, the voltage value, current value, temperature value and state of charge value of each battery cell are collected in order, and these data are arranged in this order to form an initial data sequence. The initial data sequence is normalized. For example, the minimum-maximum normalization or standard normal distribution normalization is used to map data of different ranges to a unified standardized interval. These standardized data are rearranged according to the identification number of the battery cell, and are represented in a matrix form to construct a system state matrix. Each row of the system state matrix represents a battery cell, and each column represents a specific state parameter, such as voltage, current, temperature or state of charge value. Based on the system state matrix, the similarity between the battery cells is calculated. The data of each pair of battery cells in the system state matrix is ​​calculated by the Euclidean distance method, and the Euclidean distance can quantify the distance relationship between the battery cells in the multidimensional feature space. By calculating the Euclidean distance of the battery cells pair by pair, a symmetrical distance matrix is ​​obtained, and each element in the matrix represents the distance between the two battery cells. Based on the distance matrix, a connection relationship matrix between battery cells is constructed. The connection relationship matrix reflects the strength of association between battery cells. By setting a distance threshold, battery cells with a distance less than the threshold are regarded as connected nodes. The connection relationship matrix is ​​subjected to eigenvalue decomposition to obtain an eigenvalue sequence and a corresponding eigenvector matrix. Each eigenvalue in the eigenvalue sequence reflects the importance of the corresponding eigenvector in the data. After these eigenvalues ​​are arranged in descending order, they provide a basis for determining the number of subsystems. Specifically, the difference between adjacent eigenvalues ​​is calculated to obtain a difference sequence, and the difference sequence is arranged in descending order to form a difference sorting sequence. In the difference sorting sequence after descending order, the size of each difference reflects the degree of mutation of the importance of the corresponding eigenvalue. By analyzing the difference sorting sequence, the position where the difference changes most significantly, that is, the position where the inflection point is located, is detected. Generally, the position corresponding to the inflection point represents the best point for subsystem division. The sequence number value corresponding to the maximum inflection point is taken as the optimal number of eigenvalues, that is, the number of subsystems. This number reflects the natural grouping of battery cells with similar state characteristics in the battery pack. Based on the optimal number of eigenvalues, the first M columns of the eigenvector matrix are selected as basis vectors of the eigensubspace, where M is the number of subsystems.

[0015] Step S2, performing spectral clustering operation on the battery cells in the system state matrix according to the number of subsystems to obtain multiple subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; Specifically, based on the system state matrix and the eigenvector matrix calculated in the previous step, a similarity matrix between battery cells is constructed. The construction of the similarity matrix is ​​the basis of spectral clustering. Each element of the matrix represents the similarity between two battery cells. In order to accurately quantify this similarity, the Gaussian kernel function is used for calculation. The Gaussian kernel function is a similarity measurement tool in the form of ,in and Represent the state vectors of the two battery cells respectively, is a tuning parameter used to control the sensitivity of similarity. In this way, a complete similarity matrix is ​​obtained, which is symmetrical and effectively reflects the similarity of state characteristics between battery cells. The similarity matrix is ​​normalized by diagonal matrix to obtain a standardized Laplace matrix. The normalization process calculates the diagonal matrix of the similarity matrix , whose diagonal elements are the sum of the elements in each row of the similarity matrix, that is By formula Calculate the normalized Laplace matrix The construction of the standardized Laplace matrix not only retains the similarity information between battery cells, but also reduces the impact caused by the large difference in node connectivity. eigenvectors, which correspond to the smallest eigenvalues ​​of the Laplacian matrix. That is, the number of subsystems. These eigenvectors are combined into a feature matrix, and each row of the matrix represents the embedded representation of a battery cell in a low-dimensional space. These embedded representations can effectively capture the state characteristics of the battery cell and provide a good feature representation for subsequent clustering. In order to standardize the data distribution in the feature matrix, each row of the feature matrix is ​​normalized by L2 norm so that the vector length of each row is 1. Normalization helps to improve the stability of clustering and makes the eigenvectors have a more consistent scale in subsequent clustering. The normalized feature matrix is ​​input into the K-means clustering algorithm, and the battery cells are divided into subsystems, and generate the subsystem partitioning result matrix of the battery cells. Based on the subsystem partitioning result matrix, a hypergraph structure is constructed. The battery cells in the same subsystem are taken as hypergraph nodes, and hyperedges are established according to the power transmission relationship between these nodes to obtain the hypergraph structure of the subsystem. The characteristic of the hypergraph structure is that its hyperedges connect multiple nodes at the same time, so it can well reflect the complex power transmission relationship between battery cells. After the hypergraph structure is constructed, the node degree matrix and hyperedge degree matrix of the hypergraph are calculated. The node degree matrix represents the weighted sum of the hyperedges in which each node participates, while the hyperedge degree matrix represents the weighted sum of the nodes contained in each hyperedge. Based on the definition of the hypergraph, the connection relationship between each node and the hyperedge is counted to obtain the corresponding degree matrix. Based on the node degree matrix, the hyperedge degree matrix and the adjacency matrix of the subsystem hypergraph structure, the Laplace matrix of the hypergraph is calculated. The hypergraph Laplace matrix is ​​defined as the node degree matrix minus the adjacency matrix, that is ,in is the node degree moment, is the hypergraph adjacency matrix. The hypergraph Laplacian matrix is ​​the core of hypergraph analysis, which can characterize the interaction between nodes in the hypergraph. Through the above process, the spectral clustering operation of the system state matrix is ​​finally realized, and the hypergraph structure of multiple subsystems and the corresponding hypergraph Laplacian matrix are obtained.

[0016] Step S3, performing multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery unit; Specifically, the hypergraph Laplacian matrix is ​​eigen-decomposed into an eigenvalue diagonal matrix and an eigenvector orthogonal matrix, wherein the eigenvalue diagonal matrix represents the spectral characteristics of the hypergraph Laplacian matrix, and the eigenvector orthogonal matrix provides the projection representation of the hypergraph nodes in the feature space. The eigenvalues ​​in the eigenvalue diagonal matrix are polynomially transformed to generate a spectral filter coefficient matrix. The polynomial transformation uses Chebyshev polynomials or other efficient numerical methods to adjust the filter strength of different frequency bands by nonlinearly transforming the eigenvalues ​​to highlight the features related to the target task. The spectral filter coefficient matrix determines how the convolution operation acts on the spectral information of the hypergraph. The hypergraph convolution kernel matrix is ​​constructed using the eigenvector orthogonal matrix and the spectral filter coefficient matrix. The convolution kernel matrix can capture the high-order relationships between nodes in the hypergraph and map them into a low-dimensional feature space for extracting local and global features of the battery cell. The first-layer convolution parameter matrix is ​​obtained by performing matrix multiplication operation on the input battery cell features and the convolution kernel matrix. The first layer of convolution results are input into the ReLU activation function for nonlinear transformation. The form of the ReLU activation function is , which is used to remove negative information in the convolution results and enhance the expression ability of nonlinear features. Through this processing. The first-layer activation output matrix is ​​obtained, which contains the preliminary enhancement results of the hypergraph convolution kernel on the battery cell features. Based on the first-layer activation output matrix, the second-layer convolution operation is performed, and the hypergraph convolution kernel is used to further refine the features of the output results of the first layer to generate the second-layer convolution result matrix. The second-layer convolution result matrix is ​​input into the ReLU activation function again for nonlinear processing to obtain the second-layer activation output matrix. The second-layer activation output matrix is ​​transformed by the fully connected layer. The fully connected layer performs weighted summation of the input features through the weight matrix, and completes the dimensional mapping in combination with the bias term, and finally generates the initial power feature matrix of the battery cell.

[0017] Step S4: construct a hypergraph attention network according to the initial power feature matrix, and calculate the target power feature matrix between the battery cell node and the corresponding power transmission path; Specifically, based on the initial power feature matrix, the node feature matrix and the hyperedge feature matrix in the hypergraph structure are constructed to form a hypergraph feature representation. The node feature matrix represents the features of each battery cell in the hypergraph, while the hyperedge feature matrix captures the relationship and attributes of the power transmission path between the battery cells. This representation can simultaneously characterize the high-dimensional features of nodes and paths. The node feature matrix and the hyperedge feature matrix are linearly transformed to generate a node query matrix and a hyperedge key matrix. The linear transformation is achieved by multiplying a trainable weight matrix and adding a bias term. Its function is to map the original features into a shared latent feature space so that the features of the nodes and hyperedges can be calculated in a mutually correlated manner. In this way, the node query matrix encodes the power demand features of the battery cells, while the hyperedge key matrix reflects the capacity and efficiency features of the power transmission path. Based on the node query matrix and the hyperedge key matrix, the node-hyperedge attention score is calculated. The calculation of the attention score is completed by a dot product operation. The query vector of each node is dot-producted with the key vector of the hyperedge and converted into an attention coefficient through a normalization function (such as a softmax function). The obtained node-hyperedge attention coefficient matrix reflects the importance relationship between the node and different hyperedges, that is, the priority of a battery cell in the power allocation path. The node-hyperedge attention coefficient matrix is ​​weighted and aggregated with the hyperedge features to generate the neighborhood feature matrix of the node. The hyperedge features are weighted by the attention coefficient to aggregate the power transmission information of the neighborhood into the node features, so that the features of each node not only contain its own information, but also reflect its interactive relationship in the local hypergraph structure. The neighborhood feature matrix is ​​processed by multi-head attention. The multi-head attention mechanism enables the model to capture the relationship characteristics between nodes and hyperedges from different angles by introducing multiple parallel attention heads. Each attention head independently calculates a set of node-hyperedge attention coefficients and the corresponding neighborhood feature aggregation results. The multi-head attention output matrix is ​​obtained by splicing the outputs of multiple heads together and performing linear transformation. The multi-head attention output matrix is ​​spliced ​​and linearly transformed to generate a single-layer hypergraph attention feature. The single-layer attention feature represents the overall output of the hypergraph attention network at the current level, containing the multi-dimensional interactive relationship information between the battery cell node and the power transmission path. In order to improve the stability of features and optimize the training process of the model, the single-layer hypergraph attention features are subjected to residual connection and layer normalization. Residual connection alleviates the gradient vanishing problem in deep networks by adding input features to the output of the current layer, while layer normalization accelerates the convergence of the model by adjusting the distribution of features to maintain consistency between different layers. The normalized attention features are input into the feedforward neural network for transformation. The feedforward neural network consists of multiple layers of fully connected layers, and the features are processed by nonlinear activation functions to generate the target power feature matrix.

[0018] Step S5: establishing a dual-constraint optimization model including voltage-power constraints and capacity balance constraints based on the target power characteristic matrix, performing recursive Bayesian operations on the state parameters of the battery pack, and obtaining the battery pack state quantity and the battery pack observation quantity; Specifically, the power characteristics of each battery cell are extracted from the target power characteristic matrix, and the safe operating range of the battery cell, including the voltage range, is calculated. , Current range and power range , and map the constraints on these power characteristics. The mapping process is achieved by establishing a voltage-power constraint vector, where the power characteristics of each battery cell must satisfy that its voltage, current and power do not exceed the above working range. By performing such mapping operations on the power characteristics of all battery cells, a power constraint matrix is ​​constructed to define the basic operating limits of the battery cells. Based on the power constraint matrix, the capacity balancing constraint is considered. The core goal of capacity balancing is to ensure that there is a linear correlation between the power allocation ratio of the battery cells in each subsystem and their rated capacity, so as to avoid overcharging or over-discharging caused by uneven battery capacity. By analyzing the rated capacity and actual power allocation of the battery cells in each subsystem, a capacity balancing constraint matrix is ​​established, which reflects the power balancing requirements between the battery cells in each subsystem. The power constraint matrix and the capacity balancing constraint matrix are combined to construct a unified optimization framework through the Lagrange multiplier method. A Lagrangian optimization function is defined, which contains penalty terms for power constraints and capacity balancing constraints, and Lagrangian multipliers are introduced to handle constraints. The form of the optimization function is written as a linear combination of the objective function and the constraint term, where the Lagrange multiplier is used to adjust the weight of the constraint on the objective function. Based on the Lagrangian optimization function, a state transfer equation is established to describe the state change of the battery pack at different time steps. The core of the state transfer equation is to use the dynamic characteristics of the power distribution of the battery unit and combine the dual constraints to describe the evolution of the battery pack state from the current moment to the next moment. At the same time, combined with the power transmission path and sensor measurement characteristics, an observation equation is constructed to describe how the observed quantity of the battery pack is associated with its actual state quantity. By combining the state transfer equation with the observation equation, a complete state space model is constructed. A recursive Bayesian operation is performed on the state space model to estimate the state quantity of the battery pack. The recursive Bayesian operation starts from the initial conditions and updates the state distribution through prior probability calculation. According to the state transfer equation, the state prior probability distribution is generated for the current estimate of the battery pack state, thereby predicting the possible state value of the battery pack at the next moment. The posterior probability is calculated based on the state prior probability distribution. By combining the actual observation data and the observation equation, the state prior probability distribution is modified to obtain the posterior probability distribution. The calculation of the posterior probability distribution is completed through the Bayesian formula, which combines the prior distribution with the likelihood function of the observed data to generate the optimal distribution of the state estimate. Based on the maximum a posteriori probability criterion, the optimal state value is extracted from the posterior probability distribution and used as the state quantity of the battery pack. The battery pack state quantity is substituted into the observation equation to calculate the observation probability and obtain the battery pack observation quantity.

[0019] Step S6: Input the battery pack state quantity and the battery pack observation quantity into the gradient descent optimizer for iterative calculation until the difference between the power allocation schemes of two adjacent iterations is less than a preset threshold, and then output the target power allocation scheme.

[0020] Specifically, the battery pack state quantity and the battery pack observation quantity are vertically spliced, and the dynamic state and static observation information of the battery pack are integrated into a unified feature space. The spliced ​​results are normalized to eliminate the differences between different feature dimensions and ensure that the data is distributed within an appropriate range. The normalization adopts the minimum-maximum normalization or standard normalization method to generate the initial power allocation vector. The objective function is constructed for the initial power allocation vector, and the total energy consumption, power transmission loss minimization and battery unit balance maximization are taken as optimization goals. At the same time, safety and constraints are introduced into the objective function through the penalty function. Based on the objective function, the gradient vector of the current iteration step is calculated. The gradient vector reflects the rate of change of the objective function with respect to the power allocation vector. Its calculation is derived by the analytical expression of the objective function, or by the numerical approximation method. The gradient vector is multiplied by the learning rate to obtain the update step vector. The learning rate is a key parameter for controlling the size of each iteration step. If it is too large, the optimization will not converge, and if it is too small, the convergence speed will be slowed down. By combining the learning rate with the gradient vector, the search path of the power allocation vector in the feature space can be effectively adjusted. Subtract the initial power allocation vector from the update step vector to obtain The power allocation vector of the iteration. Adjust the power allocation scheme along the direction where the objective function value decreases fastest. In order to determine whether the iteration has reached the convergence state, calculate the The power allocation vector of the first iteration is The difference between the power allocations of the first iteration. The iterative difference is calculated by the Euclidean norm of the two power allocations. The difference reflects the change range of the current two iterations. The calculated iterative difference is compared with the preset threshold. If the difference is greater than the preset threshold, it is considered that the current power allocation scheme has not yet reached the optimal level, and the first iteration is changed. The power allocation vector of the iteration is used as the new initial value to continue iterative calculation; if the difference is less than or equal to the preset threshold, the optimization process is determined to have converged, and the current power allocation vector is determined to be the optimal power allocation vector. After obtaining the optimal power allocation vector, in order to ensure that it meets the safety requirements of actual operation, the safety constraint check of the battery cell is performed. The power value of each battery cell in the optimal power allocation vector is checked one by one to verify whether it meets the voltage of the battery cell. , Current and temperature If the power value exceeds the safe range, it needs to be corrected. The correction method adopts the clipping method, that is, adjusting the value exceeding the interval to the nearest boundary value, or introducing a nonlinear adjustment function for smooth correction to reduce the impact of mutations on system stability. After the correction is completed, the power allocation vector that meets the safety constraints is output as the final target power allocation solution.

[0021] In the embodiment of the present invention, by introducing the hypergraph model and spectral clustering algorithm, the large-scale battery pack system is divided into multiple subsystems, which reduces the computational complexity of the system, while maintaining the topological relationship between the battery cells, making the power allocation more accurate and reasonable. A multi-layer hypergraph convolutional neural network and ReLU activation function are used to deeply extract and nonlinearly transform the battery cell features, thereby enhancing the model's ability to express the nonlinear dynamic characteristics of the battery pack system. A hypergraph network structure based on the attention mechanism is designed, and the accuracy and rationality of power allocation are improved by adaptively learning the correlation strength between the battery cell nodes and the power transmission path. A dual-constraint optimization model including voltage power constraints and capacity balance constraints is constructed, and the recursive Bayesian algorithm is combined for state estimation to ensure the safety and reliability of the power allocation scheme. An improved gradient descent algorithm is used for iterative optimization, and the stability and convergence efficiency of the optimization process are guaranteed by dynamically adjusting the learning rate and setting the convergence threshold.

[0022] In a specific embodiment, the process of executing step S1 may specifically include the following steps: Setting a unique identification number for each battery cell in the battery pack, and sorting the collected voltage values, current values, temperature values, and state of charge values ​​in the order of the identification numbers to obtain an initial data sequence; Normalizing the initial data sequence to obtain a standardized data sequence, and arranging the standardized data sequence into a matrix form according to the identification numbers of the battery cells to obtain a system state matrix; Calculate the Euclidean distance value for each pair of battery cells in the system state matrix, construct a distance matrix, and generate a connection relationship matrix between battery cells based on the distance matrix; Performing eigenvalue decomposition operation on the connection relationship matrix to obtain an eigenvalue sequence and an eigenvector matrix, calculating the difference between adjacent eigenvalues ​​based on the eigenvalue sequence to obtain a difference sequence, and arranging the difference sequence in descending order to obtain a difference sorting sequence; Perform inflection point detection on the difference sorting sequence, and take the sequence number corresponding to the maximum inflection point as the optimal number of eigenvalues; The optimal number of eigenvalues ​​is set to the number of subsystems, and the first M columns of the eigenvector matrix are used as basis vectors of the eigensubspace, where M is the number of subsystems.

[0023] Specifically, a unique identification number is assigned to each battery cell in the battery pack. Indicates The number of the battery cells, , Indicates the total number of battery cells. Collect the status data of each battery cell in numerical order, including voltage , Current ,temperature and state of charge (SOC) , and sort these data by number to construct the initial data sequence In order to ensure the consistency of data in subsequent operations, the initial data sequence is normalized to eliminate the dimensional differences of different physical quantities (such as voltage and temperature). Assume that the normalization formula is: ; in Represents the original data, and Respectively The minimum and maximum values ​​of the data, is the normalized value. Taking voltage as an example, the normalized voltage value is: ; in and are the minimum and maximum values ​​of the collected voltage data respectively. Through similar operations, the normalized current, temperature and SOC values ​​are obtained. The normalized data are arranged in a matrix according to the battery number to form a system state matrix , among which The row corresponds to The characteristics of the battery cells are normalized as follows: , , , ,Right now: ; In order to quantify the state difference between battery cells, the Euclidean distance is calculated for each pair of battery cells in the system state matrix. The formula for the Euclidean distance is: ; in Indicates battery cell and The distance between and Respectively and The battery cell is The values ​​on the feature dimensions. After calculation, we get a symmetric distance matrix : ; Based on distance matrix , generate the connection relationship matrix between battery cells . Set a threshold ,when season ,otherwise .matrix Describes the connection relationship between battery cells. Perform eigenvalue decomposition to obtain the eigenvalue sequence and the eigenvector matrix ,in is a diagonal matrix containing all eigenvalues. Compute the difference between adjacent eigenvalues: ; in is the difference between adjacent eigenvalues, and the difference sequence is obtained . Arrange the difference sequence in descending order to form a difference sorting sequence. Perform inflection point detection on the difference sorting sequence. The inflection point usually appears where the eigenvalue changes the most, which corresponds to the maximum value of the difference. Assume that the sequence number corresponding to the maximum inflection point is , then As the optimal number of eigenvalues, it is also set as the number of subsystems. From the eigenvector matrix Before extraction Columns are used as the basis vectors of the feature subspace. The basis vector matrix of the feature subspace is: ; Each column represents a basis vector.

[0024] In a specific embodiment, the process of executing step S2 may specifically include the following steps: Based on the system state matrix and the eigenvector matrix, a similarity matrix is ​​constructed, wherein the similarity value of the similarity matrix is ​​calculated by a Gaussian kernel function; The similarity matrix is ​​normalized by the angle matrix to obtain a standardized Laplace matrix, and the first M eigenvectors of the standardized Laplace matrix are combined into a feature matrix, where M is the number of subsystems; Each row of the feature matrix is ​​normalized by L2 norm to obtain a normalized feature matrix, and the normalized feature matrix is ​​input into a K-means clustering algorithm to obtain a subsystem partitioning result matrix of the battery cell; Based on the subsystem partition result matrix, the battery units in the same subsystem are constructed as hypergraph nodes, and the power transmission relationship between nodes is constructed as hyperedges to obtain the subsystem hypergraph structure; Calculate the node degree matrix and hyperedge degree matrix of the subsystem hypergraph structure to obtain the degree matrix of the hypergraph; Based on the degree matrix and the adjacency matrix of the subsystem hypergraph structure, a hypergraph Laplacian matrix is ​​calculated, where the hypergraph Laplacian matrix is ​​equal to the degree matrix minus the adjacency matrix.

[0025] Specifically, based on the system state matrix and the eigenvector matrix Construct a similarity matrix, where Is a description The battery cells State information on feature dimensions, It is the eigenvector matrix obtained from the previous analysis, which is used to extract the information required for subsystem partitioning. In order to quantify the similarity between battery cells, a similarity matrix is ​​constructed The similarity value is calculated by the Gaussian kernel function, and its formula is: ; in and They represent the first and The characteristic vector of each battery cell, represents the Euclidean norm, is the bandwidth parameter of the Gaussian kernel, which controls the decay rate of the similarity. By calculating all battery cell pairs, we get a symmetric similarity matrix , whose elements Indicates battery cell and Calculate the diagonal matrix of the similarity matrix , whose diagonal elements Represents the similarity matrix The sum of the row elements, that is: ; Based on the similarity matrix and the angle matrix, construct the standardized Laplace matrix , and its calculation formula is: ; in is the identity matrix, It is the inverse square root matrix of the angle matrix, which is used to normalize the values ​​of the similarity matrix so that it meets the normalization conditions required for spectral clustering. Perform eigenvalue decomposition to obtain the eigenvalue sequence and the corresponding eigenvector matrix. Assume that the eigenvalues ​​are arranged in ascending order as , and the front The eigenvectors corresponding to the smallest eigenvalues ​​are combined into a characteristic matrix ,in is the number of subsystems determined through preliminary analysis. In order to standardize the data distribution of the feature matrix, Each row of Norm normalization. The normalization formula is: ; in is the feature matrix No. row vector, It is norm, the normalized feature matrix is ​​recorded as The purpose of normalization is to adjust the eigenvector of each battery cell to the unit sphere to improve the stability of subsequent clustering. enter -Means clustering algorithm, where the number of clusters , to divide the subsystems of the battery cell. -Mean clustering minimizes the sum of squared Euclidean distances between each data point and the center of its cluster, and finally outputs the subsystem partition result matrix .matrix Elements Indicates battery cell Is it a subsystem? , if it belongs to, it is 1, otherwise it is 0. Based on the subsystem partition result matrix , the battery cells in the same subsystem are regarded as hypergraph nodes, and hyperedges are constructed according to the power transmission relationship between nodes to form a subsystem hypergraph structure. Hypergraph nodes represent battery cells, and hyperedges represent the connection relationship between these nodes or the power transmission path they participate in. In order to quantify the hypergraph structure, the node degree matrix is ​​calculated and the hyperedge degree matrix The diagonal elements of the node degree matrix are Representation Node The total weight of the connected hyperedges, and the diagonal elements of the hyperedge degree matrix Represents a hyperedge The total weight of the connected nodes. Based on the node degree matrix and the hyperedge degree matrix, calculate the adjacency matrix of the hypergraph , whose elements Representation Node Is it a superedge? The hypergraph Laplacian matrix is ​​calculated by the following formula : ; in is the transpose of the adjacency matrix, is the inverse of the hyperedge degree matrix. Hypergraph Laplacian matrix Used to describe the global structural properties of hypergraphs.

[0026] In a specific embodiment, the process of executing step S3 may specifically include the following steps: Performing eigendecomposition on the hypergraph Laplacian matrix to obtain an eigenvalue diagonal matrix and an eigenvector orthogonal matrix, and performing polynomial transformation on the eigenvalues ​​in the eigenvalue diagonal matrix to obtain a spectral filter coefficient matrix; Construct a hypergraph convolution kernel matrix based on the eigenvector orthogonal matrix and the spectral filter coefficient matrix to obtain the first-layer convolution parameter matrix; Perform matrix multiplication on the input battery cell features and the first-layer convolution parameter matrix to obtain the first-layer convolution result, and input the first-layer convolution result into the ReLU activation function for nonlinear transformation to obtain the first-layer activation output matrix; Perform a second-layer convolution operation on the first-layer activation output matrix to obtain a second-layer convolution result matrix, and perform a ReLU activation function on the second-layer convolution result matrix to obtain a second-layer activation output matrix; The fully connected layer is transformed based on the second layer activation output matrix to obtain the initial power feature matrix of the battery cell.

[0027] Specifically, for the hypergraph Laplacian matrix Perform eigendecomposition to obtain the eigenvalue diagonal matrix and the eigenvector orthogonal matrix ,satisfy .in, is a diagonal matrix containing the eigenvalues ​​of the Laplacian matrix, is an orthogonal matrix, each column is the eigenvector corresponding to the eigenvalue. In order to introduce frequency domain information into the hypergraph convolution operation, the eigenvalue is transformed polynomially to construct the spectral filter coefficient matrix . Let the polynomial transformation be ,in are the polynomial coefficients of the filter, is the eigenvalue, is the degree of the polynomial. By substituting all eigenvalues ​​into the polynomial, a diagonal matrix is ​​generated: ; This matrix represents the filtering operation on different eigenvalues ​​in the frequency domain. Sum spectral filter coefficient matrix , construct the hypergraph convolution kernel matrix , and its calculation formula is: ; matrix Represents the convolution operation on the node features in the hypergraph, combining the global structural information and local connection characteristics of the hypergraph. Input battery cell feature matrix ,in is the number of battery cells, is the feature dimension of each unit, which is combined with the first layer convolution parameter matrix Perform matrix multiplication to obtain the result of the first layer of convolution: ; in, , is the feature dimension after the first layer of convolution. To introduce nonlinear characteristics, the first layer of convolution result Input the ReLU activation function to get the first layer activation output matrix: ; Where ReLU It is an element-by-element operation. The output matrix of the first layer activation is Continue with the second layer of convolution operation in a similar way, by comparing it with the second layer convolution parameter matrix Perform matrix multiplication to obtain the second layer of convolution result: ; And process it again through the ReLU activation function to get the second layer activation output matrix: ; The second layer of convolution further enhances the ability of feature extraction and captures higher-order hypergraph structure information. The second layer activation output matrix Input to the fully connected layer, and map the high-dimensional features into the initial power feature matrix through linear transformation . Let the weight matrix of the fully connected layer be and the bias vector is , the calculation formula of the initial power characteristic matrix is: ; matrix ,in is the output feature dimension, and each row represents the power feature of a battery cell.

[0028] In a specific embodiment, the process of executing step S4 may specifically include the following steps: Based on the initial power feature matrix, a node feature matrix and a hyperedge feature matrix of a hypergraph structure are constructed to obtain a hypergraph feature representation; Perform linear transformation on the node feature matrix and the hyperedge feature matrix respectively to obtain the node query matrix and the hyperedge key value matrix; The node-hyperedge attention score is calculated based on the node query matrix and the hyperedge key value matrix to obtain the node-hyperedge attention coefficient matrix, and the node-hyperedge attention coefficient matrix is ​​weightedly aggregated with the hyperedge features to obtain the node neighborhood feature matrix; Perform multi-head attention processing on the neighborhood feature matrix to obtain a multi-head attention output matrix, and then concatenate and linearly transform the multi-head attention output matrix to obtain a single-layer hypergraph attention feature; The single-layer hypergraph attention features are subjected to residual connection and layer normalization to obtain normalized attention features, which are then input into a feedforward neural network for transformation to obtain a target power feature matrix.

[0029] Specifically, the initial power characteristic matrix Based on Indicates the number of battery cells, It is the dimension of power characteristics. Using the topological relationship and functional interaction of battery cells, a node feature matrix of hypergraph structure is constructed. and the hyperedge feature matrix Node feature matrix Directly inherits the value of the initial power characteristic matrix, while the hyperedge characteristic matrix The construction of needs to be based on the definition of hyperedges, that is, to aggregate the set features connecting several nodes, such as calculating the eigenvalue of each hyperedge by weighted average. and the hyperedge feature matrix After that, they are linearly transformed to extract key features. Let the weight matrix and Linear transformations for node and hyperedge features, respectively, where is the dimension of the embedding space. The node query matrix and the hyperedge key matrix The calculation formula is: ; Node query matrix and the hyperedge key matrix Represents the feature projection of nodes and hyperedges in the attention mechanism. Based on the node query matrix and the hyperedge key value matrix, the node-hyperedge attention score is calculated. The calculation of the attention score is realized by the dot product operation, and its formula is: ; in Is a node and super edge The attention coefficient, Representation and Node The set of connected hyperedges, and The nodes are and super edge The attention scores are normalized by the softmax operation to obtain the node-hyperedge attention coefficient matrix . Using the attention coefficient matrix Perform weighted aggregation on hyperedge features to generate the neighborhood feature matrix of the node The formula is: ; Neighborhood feature matrix It represents the feature representation of each node aggregated through its associated hyperedges, integrating the global information of the hyperedges. Multi-head attention processing is performed to enrich the feature expression ability. Each attention head independently calculates a set of attention scores and aggregate results. The output matrix of an attention head is: ; in and It is The coefficient matrix and feature matrix of the attention heads. The multi-head attention output matrix is ​​obtained by concatenating and linearly transforming the outputs of all attention heads: ; in is the output weight matrix, is the output feature dimension. Multi-head attention output matrix is the feature representation of a single-layer hypergraph attention. In order to improve the stability of the model and optimize the performance, residual connections and layer normalization are performed on it. Suppose the input is , then the normalized attention feature is calculated as: ; LayerNorm is the layer normalization operation. The normalized attention feature matrix Input into the feedforward neural network (FFN), and further extract the target power feature matrix through two layers of linear transformation and nonlinear activation function The specific formula is: ; in is the weight matrix, is the bias vector, is a non-linear activation function (such as ReLU).

[0030] In a specific embodiment, the process of executing step S5 may specifically include the following steps: Map the power characteristics of each battery cell in the target power characteristic matrix to the constraints, construct the voltage power constraint vector according to the safe working range [Vmin, Vmax], [Imin, Imax], [Pmin, Pmax] of the battery cell, and obtain the power constraint matrix; Based on the power constraint matrix, a linear correlation operation is performed on the power allocation ratio of the battery cells in each subsystem and their rated capacity to obtain a capacity balance constraint matrix; The power constraint matrix and the capacity balancing constraint matrix are processed by Lagrange multiplier method to construct the Lagrange optimization function; The state transfer equation is established according to the Lagrangian optimization function, and the observation equation is constructed based on the state transfer equation to obtain a complete state space model; Perform recursive Bayesian prior probability calculation on the complete state space model to obtain the state prior probability distribution; The posterior probability is calculated based on the state prior probability distribution, and the state fusion is performed through the maximum a posteriori probability criterion to obtain the battery pack state quantity, and the battery pack state quantity is substituted into the observation equation to calculate the observation probability and obtain the battery pack observation quantity.

[0031] Specifically, for the target power feature matrix The power characteristics of each battery cell in the express The power characteristics of each battery cell, The power characteristic dimension of each battery cell. According to the safe operating range of the battery cell, including voltage , Current and power , the characteristics of each battery cell are mapped item by item. The mapping rules are implemented by the tailoring method, for example: ; in is a matrix Middle The battery cell is The power characteristics of the dimension, and are the safety lower limit and upper limit of this dimension respectively. After mapping, the power constraint matrix is ​​generated , each element of which satisfies the safe operating range of the battery cell. After obtaining the power constraint matrix, the capacity balance constraint matrix is ​​constructed. Assume that the rated capacity of each battery cell is , its power distribution ratio should satisfy the balance, that is, the actual power distribution of each battery unit With its capacity The capacity balancing constraint can be expressed as: ; in is the capacity balancing constraint matrix, Denotes the operation of constructing a diagonal matrix. This matrix represents the balance between the power allocation and capacity of each battery cell. The power constraint matrix and the capacity balance constraint matrix are combined to construct an optimization model using the Lagrange multiplier method. Assuming the objective function is the optimality of power allocation (such as minimizing total power loss) and the comprehensive objective of constraints, the optimization problem is expressed as: ; in is the objective function of power allocation, are additional constraints (such as minimizing the power difference between nodes), is a Lagrange multiplier that weighs the impact of different constraints on the optimization objective. By taking the partial derivative of the Lagrangian function and setting it to zero, the solution to the optimization problem, i.e., the optimal value of power allocation, is obtained. Based on the solution to the optimization problem, a state transfer equation is constructed to describe the dynamic evolution of the battery pack state. Assume that the state quantity is , the observed quantity is , the transfer equation is expressed as: ; in is the state transition matrix, is the control matrix, is the control input, is the process noise, satisfying The observation equation describes the relationship between the observed quantity and the state quantity: ; in is the observation matrix, is the observation noise, satisfying . Through the state transfer equation and observation equation, a complete state space model is constructed. Recursive Bayesian estimation is performed on the state space model. The prior distribution of the state quantity is calculated by prior update: ; in is the state transition probability. Based on the prior distribution, the posterior distribution is calculated in combination with the current observation data: ; in is the observation probability. The state estimate is extracted from the posterior distribution using the maximum a posteriori probability (MAP) criterion: ; Substitute the estimated state quantity into the observation equation, calculate the observation probability distribution, and obtain the estimated value of the observation quantity.

[0032] In a specific embodiment, the process of executing step S6 may specifically include the following steps: The battery pack state quantity and the battery pack observation quantity are vertically spliced, and the splicing result is normalized to obtain the initial power allocation vector; The objective function is constructed for the initial power allocation vector to obtain the optimized objective function, and the gradient vector of the current iteration step is calculated based on the optimized objective function, and the gradient vector is multiplied by the learning rate to obtain the updated step vector; Subtract the initial power allocation vector from the update step vector to obtain the power allocation vector for the k+1th iteration; Performing norm calculation on the power allocation vector of the k+1th iteration and the power allocation vector of the kth iteration to obtain an iteration difference; The iterative difference is compared with a preset threshold value. If it is greater than the preset threshold value, the power allocation vector of the k+1th iteration is used as a new iteration initial value to continue iterative calculation. If it is less than the preset threshold value, the current power allocation vector is determined as the optimal power allocation vector. The optimal power allocation vector is subjected to a battery cell safety constraint check, and power correction is performed based on the safe operating range [Vmin, Vmax], [Imin, Imax], [Tmin, Tmax] of the voltage, current and temperature values ​​of each battery cell to obtain a power allocation vector that meets the safety constraints, and the power allocation vector that meets the safety constraints is output as the target power allocation solution.

[0033] Specifically, the battery pack status quantity and battery pack observations Perform vertical splicing operations to generate feature fusion matrix ,in is a vector containing state and observation information. In order to ensure the consistency of the numerical range of each dimensional feature, the splicing result is normalized. The normalization formula is: ; in represents the first elements, is the normalized value, and are the minimum and maximum values ​​of the concatenated vector respectively. The normalized result constitutes the initial power allocation vector . Construct the optimization objective function based on the initial power allocation vector. Objective function The optimality and balance of power distribution should be reflected, such as minimizing the sum of squares of battery unit power losses while considering distribution balance and constraints. The objective function is defined as: ; in is the target power allocation vector, is the regularization coefficient, is an equilibrium constraint, such as , indicating the power distribution ratio of each battery unit With the mean Based on the optimization objective function, the gradient vector of the current iteration step is calculated. , the gradient formula is: ; in is the partial derivative of the constraint term with respect to the power vector. The calculated gradient vector is combined with the learning rate Multiply them together to get the update step vector: ; Then the initial power allocation vector is subtracted from the update step vector to obtain The power allocation vector for the iteration: ; To determine whether the iteration has converged, The power allocation vector of the first iteration is The power allocation vector of the iteration is calculated as follows: ; The difference is compared with the preset threshold If the difference is greater than the threshold, it is considered that the current power allocation scheme has not converged. As the new initial value, the iteration continues. If the difference is less than or equal to the threshold, the iteration is considered to have converged. Determine the optimal power allocation vector. Perform battery cell safety constraint check on the optimal power allocation vector. Suppose the voltage and safe operating range of each battery cell are , the current range is , the temperature range is For each power allocation value , calculate the corresponding voltage, current and temperature according to the battery characteristics, and verify whether they are within the safe range. If not, correct the power value. For example, if the current is out of range , corrected as follows: ; in and is the power upper and lower limits calculated based on battery characteristics and constraints. The corrected power allocation vector The safe operating range of all battery cells is met and output as the final target power allocation solution.

[0034] The above describes the method for controlling power distribution of a battery pack BMS in an embodiment of the present invention. The following describes the system for controlling power distribution of a battery pack BMS in an embodiment of the present invention. Figure 2 In one embodiment of the present invention, a battery pack BMS control power distribution system includes: The acquisition module is used to collect the voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack, build a system state matrix, and calculate the number of subsystems based on the system state matrix; A clustering module is used to perform spectral clustering operations on the battery cells in the system state matrix according to the number of subsystems, obtain multiple subsystem hypergraph structures, and calculate the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; A processing module is used to perform multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery unit; A calculation module, used to construct a hypergraph attention network according to the initial power feature matrix, and calculate the target power feature matrix between the battery cell nodes and the corresponding power transmission paths; Establish a module for establishing a dual-constraint optimization model including voltage-power constraints and capacity balance constraints based on the target power characteristic matrix, and perform recursive Bayesian operations on the state parameters of the battery pack to obtain the battery pack state quantity and battery pack observation quantity; The output module is used to input the battery pack state quantity and the battery pack observation quantity into the gradient descent optimizer for iterative calculation until the difference between the power allocation schemes of two adjacent iterations is less than a preset threshold, and then output the target power allocation scheme.

[0035] Through the collaboration of the above components, the large-scale battery pack system is divided into multiple subsystems by introducing the hypergraph model and spectral clustering algorithm, which reduces the computational complexity of the system, while maintaining the topological relationship between battery cells, making the power allocation more accurate and reasonable. A multi-layer hypergraph convolutional neural network and ReLU activation function are used to deeply extract and nonlinearly transform the battery cell features, enhancing the model's ability to express the nonlinear dynamic characteristics of the battery pack system. A hypergraph network structure based on the attention mechanism is designed, and the accuracy and rationality of power allocation are improved by adaptively learning the correlation strength between battery cell nodes and power transmission paths. A dual-constraint optimization model including voltage power constraints and capacity balance constraints is constructed, and the recursive Bayesian algorithm is combined for state estimation to ensure the safety and reliability of the power allocation scheme. An improved gradient descent algorithm is used for iterative optimization, and the stability and convergence efficiency of the optimization process are guaranteed by dynamically adjusting the learning rate and setting the convergence threshold.

[0036] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0037] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0038] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0039] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0040] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0041] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0042] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for controlling power distribution of a battery pack BMS, characterized in that: The method comprises: The voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack are collected to construct a system state matrix, and the number of subsystems is calculated based on the system state matrix; Performing spectral clustering operations on the battery cells in the system state matrix according to the number of subsystems to obtain multiple subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; Performing multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery cell; Constructing a hypergraph attention network according to the initial power feature matrix, and calculating a target power feature matrix between battery cell nodes and corresponding power transmission paths; Based on the target power characteristic matrix, a dual-constraint optimization model including voltage power constraint and capacity balance constraint is established, and a recursive Bayesian operation is performed on the state parameters of the battery pack to obtain the battery pack state quantity and the battery pack observation quantity; The battery pack state quantity and the battery pack observation quantity are input into a gradient descent optimizer for iterative calculation until the difference between power allocation schemes of two adjacent iterations is less than a preset threshold, and then a target power allocation scheme is output.

2. The method for controlling power distribution of a battery pack BMS according to claim 1, characterized in that: The collecting of the voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack, constructing a system state matrix, and calculating the number of subsystems based on the system state matrix includes: Setting a unique identification number for each battery cell in the battery pack, and sorting the collected voltage values, current values, temperature values, and state of charge values ​​in the order of the identification numbers to obtain an initial data sequence; Normalizing the initial data sequence to obtain a standardized data sequence, and arranging the standardized data sequence into a matrix form according to the identification numbers of the battery cells to obtain a system state matrix; Calculating the Euclidean distance value for each pair of battery cells in the system state matrix, constructing a distance matrix, and generating a connection relationship matrix between battery cells based on the distance matrix; Performing an eigenvalue decomposition operation on the connection relationship matrix to obtain an eigenvalue sequence and an eigenvector matrix, calculating differences between adjacent eigenvalues ​​based on the eigenvalue sequence to obtain a difference sequence, and arranging the difference sequence in descending order to obtain a difference sorting sequence; Perform inflection point detection on the difference sorting sequence, and use the sequence number value corresponding to the maximum inflection point as the optimal eigenvalue number; The optimal eigenvalue number is set to the number of subsystems, and the first M columns of the eigenvector matrix are used as basis vectors of the eigensubspace, where M is the number of subsystems.

3. The method for controlling power distribution of a battery pack BMS according to claim 2, characterized in that: The performing of spectral clustering operation on the battery cells in the system state matrix according to the number of subsystems to obtain a plurality of subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure, includes: Based on the system state matrix and the eigenvector matrix, a similarity matrix is ​​constructed, wherein similarity values ​​of the similarity matrix are calculated by a Gaussian kernel function; Performing angle matrix normalization processing on the similarity matrix to obtain a standardized Laplace matrix, and combining the first M eigenvectors of the standardized Laplace matrix into a feature matrix, where M is the number of subsystems; Performing L2 norm normalization on each row of the feature matrix to obtain a normalized feature matrix, and inputting the normalized feature matrix into a K-means clustering algorithm to obtain a subsystem division result matrix of the battery cell; Based on the subsystem partition result matrix, the battery units in the same subsystem are constructed as hypergraph nodes, and the power transmission relationship between the nodes is constructed as a hyperedge to obtain a subsystem hypergraph structure; Calculating the node degree matrix and the hyperedge degree matrix for the subsystem hypergraph structure to obtain the degree matrix of the hypergraph; A hypergraph Laplacian matrix is ​​calculated based on the degree matrix and the adjacency matrix of the subsystem hypergraph structure, wherein the hypergraph Laplacian matrix is ​​equal to the degree matrix minus the adjacency matrix.

4. The method for controlling power distribution of a battery pack BMS according to claim 3, characterized in that: The hypergraph Laplacian matrix is ​​subjected to multi-layer hypergraph convolution operation and ReLU activation function processing to obtain an initial power feature matrix of the battery unit, including: Performing eigendecomposition on the hypergraph Laplacian matrix to obtain an eigenvalue diagonal matrix and an eigenvector orthogonal matrix, and performing polynomial transformation on the eigenvalues ​​in the eigenvalue diagonal matrix to obtain a spectral filter coefficient matrix; Constructing a hypergraph convolution kernel matrix based on the eigenvector orthogonal matrix and the spectral filter coefficient matrix to obtain a first-layer convolution parameter matrix; Performing matrix multiplication operation on the input battery cell features and the first layer convolution parameter matrix to obtain the first layer convolution result, and inputting the first layer convolution result into the ReLU activation function for nonlinear transformation to obtain the first layer activation output matrix; Performing a second-layer convolution operation on the first-layer activation output matrix to obtain a second-layer convolution result matrix, and performing a ReLU activation function on the second-layer convolution result matrix to obtain a second-layer activation output matrix; A full connection layer transformation is performed based on the second layer activation output matrix to obtain an initial power feature matrix of the battery cell.

5. The method for controlling power distribution of a battery pack BMS according to claim 4, characterized in that: The step of constructing a hypergraph attention network according to the initial power feature matrix and calculating a target power feature matrix between a battery cell node and a corresponding power transmission path includes: Based on the initial power feature matrix, a node feature matrix and a hyperedge feature matrix of a hypergraph structure are constructed to obtain a hypergraph feature representation; Performing linear transformation on the node feature matrix and the hyperedge feature matrix respectively to obtain a node query matrix and a hyperedge key value matrix; Calculating the node-hyperedge attention score based on the node query matrix and the hyperedge key value matrix to obtain a node-hyperedge attention coefficient matrix, and performing a weighted aggregation operation on the node-hyperedge attention coefficient matrix and the hyperedge feature to obtain a neighborhood feature matrix of the node; Performing multi-head attention processing on the neighborhood feature matrix to obtain a multi-head attention output matrix, and concatenating and linearly transforming the multi-head attention output matrix to obtain a single-layer hypergraph attention feature; The single-layer hypergraph attention features are subjected to residual connection and layer normalization processing to obtain normalized attention features, and the normalized attention features are input into a feedforward neural network for transformation to obtain a target power feature matrix.

6. The method for controlling power distribution of a battery pack BMS according to claim 5, characterized in that: The dual-constraint optimization model including voltage power constraint and capacity balance constraint is established based on the target power characteristic matrix, and the state parameters of the battery pack are subjected to recursive Bayesian operation to obtain the battery pack state quantity and the battery pack observation quantity, including: Perform constraint mapping on the power characteristics of each battery cell in the target power characteristic matrix, construct a voltage power constraint vector according to the safe operating range [Vmin, Vmax], [Imin, Imax], [Pmin, Pmax] of the battery cell, and obtain a power constraint matrix; Based on the power constraint matrix, a linear correlation operation is performed on the power allocation ratio of the battery cells in each subsystem and the rated capacity thereof to obtain a capacity balance constraint matrix; Processing the power constraint matrix and the capacity balancing constraint matrix using the Lagrange multiplier method to construct a Lagrange optimization function; Establishing a state transfer equation according to the Lagrangian optimization function, and constructing an observation equation based on the state transfer equation to obtain a complete state space model; Performing recursive Bayesian prior probability calculation on the complete state space model to obtain state prior probability distribution; The posterior probability is calculated based on the state prior probability distribution, and the state fusion is performed through the maximum a posteriori probability criterion to obtain the battery pack state quantity, and the battery pack state quantity is substituted into the observation equation to calculate the observation probability to obtain the battery pack observation quantity.

7. The method for controlling power distribution of a battery pack BMS according to claim 6, characterized in that: The step of inputting the battery pack state quantity and the battery pack observation quantity into a gradient descent optimizer for iterative calculation until the difference between the power allocation schemes of two adjacent iterations is less than a preset threshold, and outputting a target power allocation scheme comprises: Performing a vertical splicing operation on the battery pack state quantity and the battery pack observation quantity, and normalizing the splicing result to obtain an initial power allocation vector; Constructing an objective function for the initial power allocation vector to obtain an optimized objective function, calculating a gradient vector of a current iteration step based on the optimized objective function, and performing a product operation on the gradient vector and a learning rate to obtain an updated step vector; Subtracting the initial power allocation vector from the update step vector to obtain a power allocation vector for the k+1th iteration; Performing norm calculation on the power allocation vector of the k+1th iteration and the power allocation vector of the kth iteration to obtain an iteration difference; Compare the iterative difference with a preset threshold value, if it is greater than the preset threshold value, use the power allocation vector of the k+1th iteration as a new iteration initial value to continue iterative calculation, if it is less than the preset threshold value, determine the current power allocation vector as the optimal power allocation vector; The optimal power allocation vector is subjected to a battery cell safety constraint check, and power correction is performed based on a safe operating range [Vmin, Vmax], [Imin, Imax], [Tmin, Tmax] of the voltage value, current value, and temperature value of each battery cell to obtain a power allocation vector that satisfies the safety constraints, and the power allocation vector that satisfies the safety constraints is output as a target power allocation scheme.

8. A battery pack BMS control power distribution system, characterized in that: Used to execute the battery pack BMS control power distribution method according to any one of claims 1 to 7, the battery pack BMS control power distribution system comprises: A collection module, used to collect the voltage value, current value, temperature value and state of charge value of each battery cell in the battery pack, construct a system state matrix, and calculate the number of subsystems based on the system state matrix; A clustering module, used for performing spectral clustering operation on the battery cells in the system state matrix according to the number of subsystems, obtaining multiple subsystem hypergraph structures, and calculating the hypergraph Laplace matrix corresponding to each subsystem hypergraph structure; A processing module, used to perform multi-layer hypergraph convolution operations and ReLU activation function processing on the hypergraph Laplacian matrix to obtain an initial power feature matrix of the battery unit; A calculation module, used to construct a hypergraph attention network according to the initial power feature matrix, and calculate a target power feature matrix between a battery cell node and a corresponding power transmission path; Establishing a module for establishing a dual-constraint optimization model including voltage-power constraints and capacity balance constraints based on the target power characteristic matrix, performing recursive Bayesian operations on the state parameters of the battery pack, and obtaining a battery pack state quantity and a battery pack observation quantity; The output module is used to input the battery pack state quantity and the battery pack observation quantity into the gradient descent optimizer for iterative calculation until the difference between the power allocation schemes of two adjacent iterations is less than a preset threshold, and then output the target power allocation scheme.

9. A computer device, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and is characterized in that when the processor executes the computer program, the battery pack BMS power distribution control method described in any one of claims 1 to 7 is implemented. 10 . A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is enabled to execute the method for controlling power distribution of a battery pack BMS according to any one of claims 1 to 7 .

Citation Information

Cited By

  • BMS battery management system and control method thereof

    CN120978242A

  • Energy storage facility safety early warning protection method and system

    CN121276384A

  • A method and system for early warning protection of energy storage facilities

    CN121276384B

  • Intelligent power utilization energy consumption optimization method and system for network construction type energy storage

    CN121566573A

  • A smart power consumption optimization method and system for network construction type energy storage

    CN121566573B