A lithium battery state of charge prediction method
Patent Information
- Application Number
- CN202410247419.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-05
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2044-03-05
AI Technical Summary
然而,在样本数量不足时会采用联邦学习的方式,联邦学习不仅会因为各客户端之间训练量存在差异性,导致训练得到的全局模型会发生偏移,还会增加中央服务器的计算开销
[0037] This invention proposes a battery management solution for the electric vehicle industry that achieves the dual goals of reducing the computational overhead of the central server while optimizing model performance through the application of federated learning.
Smart Images

Figure CN118153625B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of lithium battery state of charge prediction, and in particular relates to a method for predicting the state of charge of lithium batteries. Background Technology
[0002] With the rapid development of the electric vehicle industry, battery technology, as its core component, has attracted increasing attention. Lithium-ion batteries, due to their advantages such as small size, light weight, short charging time, and low environmental pollution, have become an indispensable energy storage device in the electric vehicle industry. In battery management systems, accurate monitoring of the battery's State of Charge (SOC) is crucial for ensuring battery performance. SOC not only directly affects the driving range of an electric vehicle, providing a clear percentage display of remaining battery power, allowing users to rationally plan their power usage and avoid the risk of running out of power en route, but also plays a vital role in ensuring battery health and extending battery life. Therefore, accurate SOC estimation not only provides strong support for battery fault diagnosis and lifespan prediction but also facilitates users' trip planning.
[0003] In recent years, data-driven methods have been widely adopted due to their effectiveness in predicting the state of charge (SOC) of lithium-ion batteries. These methods can capture the nonlinear relationship between input and output without requiring in-depth understanding of the complex chemical reactions within the battery, and have been widely used in fields such as automotive battery fault diagnosis. However, when the number of samples is insufficient, federated learning is used. Federated learning not only suffers from biases in the global model due to differences in training data among clients, but also increases the computational overhead of the central server. Electric vehicles face variable environments in real-world operation, such as changes in temperature and operating conditions, causing discrepancies between the model built from actual operating data and the training data, leading to insufficient feature extraction capabilities. Data-driven methods also suffer from large prediction errors due to fluctuations in the training process. Summary of the Invention
[0004] To address the problems existing in the background art, the present invention provides a method for predicting the state of charge of a lithium battery, comprising:
[0005] S1: Each client normalizes the operating data during the lithium battery operation process to build a local training set; and uses SE attention to optimize the BiGRU model to build a lithium battery prediction model.
[0006] S2: Under the federated learning framework, each client uses its local training set to train the lithium battery prediction model a preset number of times to obtain a local model, and uses an adaptive model weight pruning strategy to prune the parameters of the local model. Then, the pruned local model is uploaded to the server, and the server aggregates the global model. The global model includes: after the server receives the local models uploaded by each client, it calculates the aggregation weight for each client based on the number of local training sets of each client, and then aggregates the local models uploaded by each client based on the aggregation weight of each client to obtain the global model.
[0007] S3: Repeat step S2 until the preset number of times is reached to obtain the trained lithium battery prediction model. Input the data to be verified into the trained lithium battery prediction model to obtain the initial prediction result of the battery state of charge.
[0008] S4: The weighted regression optimization of the Savitzky-Golay filter, which uses Gaussian distribution to calculate the weights, is used to filter the initial prediction results and obtain the final prediction results.
[0009] Preferably, the operating data of the lithium battery during operation includes, but is not limited to, one or more of the following: current, voltage, and temperature within a preset time period.
[0010] Preferably, the lithium battery prediction model includes a BiGRU module, a first dimension transformation module, an SE attention module, a second dimension transformation module, and a fully connected layer connected in series; wherein the first dimension transformation module is configured to transform the dimension X of the input feature. (b,w,c) Transform into X (b,c,w,1) The second dimension transformation module is configured to transform the dimension X′ of the input features. (b,c,w,1) Transform into X′ (b,w,c) Where b represents the batch size, c represents the number of feature categories, and w represents the length of the sliding window.
[0011] Preferably, the step of pruning the parameters of the local model using an adaptive model weight pruning strategy includes:
[0012] S21: Calculate the absolute value of the weight gradient of each network layer in the lithium battery prediction model. When the absolute value of the weight gradient is less than a constant a, calculate the standard deviation σ of the weight parameter of the network layer. Set k times the standard deviation σ as the threshold b = kσ. Iterate through each weight parameter of the network layer. If the weight parameter is less than the threshold b, set the weight parameter to 0.
[0013] S22: After processing the weight parameters of all network layers using step S21, obtain the pruned local model of the weight parameters of all network layers.
[0014] Preferably, the absolute values of the weight gradients of the network layer include:
[0015]
[0016]
[0017] Where L represents the loss function, a i w represents the activation function of the i-th network layer; i z represents the weight parameters of the i-th network layer; i The input to the activation function in the i-th network layer is represented by the weighted input; T represents the transpose; δ i This represents the error term of the i-th network layer; This represents the absolute value of the weight gradient of the i-th network layer.
[0018] Preferably, the standard deviation of the network layer weight parameters includes:
[0019]
[0020] Where, N i w' represents the number of weight parameters in the i-th network layer; j The j-th weight parameter in the i-th network layer; μ represents the average value of the weight parameters in the i-th network layer.
[0021] Preferably, the global model obtained by aggregating the local models uploaded by each client includes:
[0022]
[0023]
[0024] Among them, w glob This represents the parameters of the global model after server aggregation; K represents the number of clients; n k w represents the number of local samples for the k-th client; k This represents the model parameters uploaded by the kth client.
[0025] Preferably, the step of using a weighted regression optimization of the Savitzky-Golay filter to filter the initial prediction results using weights calculated by a Gaussian distribution includes:
[0026] S41: Calculate the distance from each data point in the data to be verified to the center data point:
[0027]
[0028] Where, d iThe distance from the i-th data point to the center data point in the data to be verified is represented by N, where N represents the number of data points in the data to be verified, and i represents the i-th data point in the data to be verified.
[0029] S42: Calculate the weights of the data points in the data to be verified based on the Gaussian distribution;
[0030]
[0031] Among them, w” i σ' represents the weight of the i-th data point in the data to be verified; σ' represents the parameter that controls the width of the weight distribution.
[0032] S43: Construct a weighted residual sum of squares problem based on the weights of the data points in the data to be verified and the initial prediction results of the battery state of charge. Solve the weighted residual sum of squares problem with the objective of minimizing the weighted residual sum of squares to obtain the final prediction result.
[0033] Preferably, the weighted residual sum of squares problem includes:
[0034]
[0035] Among them, y i p(x) represents the observation value of the i-th data point in the data to be verified; i ) represents the i-th data point x in the data to be verified. i The initial prediction results.
[0036] The present invention has at least the following beneficial effects
[0037] This invention proposes a battery management solution for the electric vehicle industry that achieves the dual goals of reducing the computational overhead of the central server while optimizing model performance through the application of federated learning.
[0038] This invention employs SE attention and BiGRU to construct a network training model, which enhances effective information and suppresses ineffective information, thereby strengthening the learning of the training model and improving the network's feature extraction capabilities.
[0039] This invention, within the federated learning framework, employs dynamic model pruning techniques and an improved federated algorithm to achieve distributed data training and resource optimization, thereby accelerating computational efficiency and improving the prediction accuracy of lithium batteries.
[0040] This invention employs weighted regression to optimize the Savitzky-Golay filter, reducing the impact of fluctuations during the training process on the prediction results. Attached Figure Description
[0041] Figure 1This is a schematic diagram of the method flow of the present invention;
[0042] Figure 2 This is a schematic diagram of the lithium battery prediction model of the present invention. Detailed Implementation
[0043] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0044] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0045] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0046] Example 1: This invention provides an implementation method for predicting the state of charge of a lithium battery, comprising: firstly, normalizing the acquired current, voltage, and temperature data; randomly assigning different training samples to different clients; training each client using the proposed BiGRU-SE network; after each client iterates the same number of times, pruning its model parameters according to an adaptive model weight pruning strategy and transmitting them to the central server; the central server performing global model calculation using the proposed federated algorithm formula; and inverse quantizing the globally calculated parameters and transmitting them to each server; repeating the above steps until the results of each server converge or the number of iterations is reached.
[0047] Please see Figure 1This invention provides a method for predicting the state of charge of a lithium battery, comprising:
[0048] S1: Each client normalizes the operating data during the lithium battery operation process to build a local training set; and uses SE attention to optimize the BiGRU model to build a lithium battery prediction model.
[0049] S2: Under the federated learning framework, each client uses its local training set to train the lithium battery prediction model a preset number of times to obtain a local model, and uses an adaptive model weight pruning strategy to prune the parameters of the local model. Then, the pruned local model is uploaded to the server, and the server aggregates the global model. The global model includes: after the server receives the local models uploaded by each client, it calculates the aggregation weight for each client based on the number of local training sets of each client, and then aggregates the local models uploaded by each client based on the aggregation weight of each client to obtain the global model.
[0050] S3: Repeat step S2 until the preset number of times is reached to obtain the trained lithium battery prediction model. Input the data to be verified into the trained lithium battery prediction model to obtain the initial prediction result of the battery state of charge.
[0051] S4: The weighted regression optimization of the Savitzky-Golay filter, which uses Gaussian distribution to calculate the weights, is used to filter the initial prediction results and obtain the final prediction results.
[0052] Preferably, the operating data of the lithium battery during operation includes, but is not limited to, one or more of the following: current, voltage, and temperature within a preset time period.
[0053] In this embodiment, the data preprocessing involves normalizing the current, voltage, and temperature, limiting their values to the range [-1, 1].
[0054] The data is divided into sliding windows, and then the data is divided into blocks according to the block size and input into the BIGRU network. The data dimension is then increased and the dimension is transformed. Then it is input into the SE attention to obtain the added feature data. After that, the dimension is reduced. Finally, it is passed through a fully connected layer to obtain the output value SOC.
[0055] Preferably, the lithium battery prediction model includes a BiGRU module, a first dimension transformation module, an SE attention module, a second dimension transformation module, and a fully connected layer connected in series; wherein the first dimension transformation module is configured to transform the dimension X of the input feature. (b,w,c) Transform into X (b,c,w,1) The second dimension transformation module is configured to transform the dimension X′ of the input features. (b,c,w,1) Transform into X′ (b,w,c)Where b represents the batch size, c represents the number of feature categories, and w represents the length of the sliding window.
[0056] Preferably, the step of pruning the parameters of the local model using an adaptive model weight pruning strategy includes:
[0057] S21: Calculate the absolute value of the weight gradient of each network layer in the lithium battery prediction model. When the absolute value of the weight gradient is less than a constant a, calculate the standard deviation σ of the weight parameter of the network layer. Set k times the standard deviation σ as the threshold b = kσ. Iterate through each weight parameter of the network layer. If the weight parameter is less than the threshold b, set the weight parameter to 0.
[0058] S22: After processing the weight parameters of all network layers using step S21, obtain the pruned local model of the weight parameters of all network layers.
[0059] Preferably, the absolute values of the weight gradients of the network layer include:
[0060]
[0061]
[0062] Where L represents the loss function, a i w represents the activation function of the i-th network layer; i z represents the weight parameters of the i-th network layer; i The input to the activation function in the i-th network layer is represented by the weighted input; T represents the transpose; δ i This represents the error term of the i-th network layer; This represents the absolute value of the weight gradient of the i-th network layer.
[0063] Preferably, the standard deviation of the network layer weight parameters includes:
[0064]
[0065] Where, N i w' represents the number of weight parameters in the i-th network layer; j The j-th weight parameter in the i-th network layer; μ represents the average value of the weight parameters in the i-th network layer.
[0066] Preferably, the global model obtained by aggregating the local models uploaded by each client includes:
[0067]
[0068]
[0069] Among them, w globThis represents the parameters of the global model after server aggregation; K represents the number of clients; n k w represents the number of local samples for the k-th client; k This represents the model parameters uploaded by the kth client.
[0070] Preferably, the step of using a weighted regression optimization of the Savitzky-Golay filter to filter the initial prediction results using weights calculated by a Gaussian distribution includes:
[0071] S41: Calculate the distance from each data point in the data to be verified to the center data point:
[0072]
[0073] Where, d i The distance from the i-th data point to the center data point in the data to be verified is represented by N, where N represents the number of data points in the data to be verified, and i represents the i-th data point in the data to be verified.
[0074] S42: Calculate the weights of the data points in the data to be verified based on the Gaussian distribution;
[0075]
[0076] Among them, w” i σ' represents the weight of the i-th data point in the data to be verified; σ' represents the parameter that controls the width of the weight distribution.
[0077] S43: Construct a weighted residual sum of squares problem based on the weights of the data points in the data to be verified and the initial prediction results of the battery state of charge. Solve the weighted residual sum of squares problem with the objective of minimizing the weighted residual sum of squares to obtain the final prediction result.
[0078] Preferably, the weighted residual sum of squares problem includes:
[0079]
[0080] Among them, y i p(x) represents the observation value of the i-th data point in the data to be verified; i ) represents the i-th data point x in the data to be verified. i The initial prediction results.
[0081] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0082] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for predicting the state of charge of a lithium battery, characterized in that, include: S1: Each client normalizes the operating data during the lithium battery operation process and constructs a local training set; A lithium battery prediction model was constructed by optimizing the BiGRU model using SE attention. The operating data of the lithium battery during operation includes: current, voltage, and temperature within a preset time period; The lithium battery prediction model includes a BiGRU module, a first dimension transformation module, an SE attention module, a second dimension transformation module, and a fully connected layer connected in series; wherein the first dimension transformation module is configured to transform the dimension of the input features. Transform into The second dimension transformation module is configured to transform the dimensions of the input features. Transform into ,in, Indicates batch size. Represents the number of feature categories. Indicates the length of the sliding window; S2: Under the federated learning framework, each client uses its local training set to train the lithium battery prediction model a preset number of times to obtain a local model, and uses an adaptive model weight pruning strategy to prune the parameters of the local model. Then, the pruned local model is uploaded to the server, and the server aggregates the global model. The global model includes: after the server receives the local models uploaded by each client, it calculates the aggregation weight for each client based on the number of local training sets of each client, and then aggregates the local models uploaded by each client based on the aggregation weight of each client to obtain the global model. The global model obtained by aggregating the local models uploaded by each client includes: in, This represents the parameters of the global model after server aggregation; K represents the number of clients; Indicates the first Number of local samples per client; Indicates the first Model parameters uploaded by each client; S3: Repeat step S2 until the preset number of times is reached to obtain the trained lithium battery prediction model. Input the data to be verified into the trained lithium battery prediction model to obtain the initial prediction result of the battery state of charge. S4: The Savitzky-Golay filter is optimized by weighted regression using Gaussian distribution to filter the initial prediction results and obtain the final prediction results.
2. The method for predicting the state of charge of a lithium battery according to claim 1, characterized in that, The method of pruning the parameters of the local model using an adaptive model weight pruning strategy includes: S21: Calculate the absolute value of the weight gradient of each network layer in the lithium battery prediction model. When the absolute value of the weight gradient is less than a constant a, calculate the standard deviation of the weight parameters of that network layer. Standard deviation Set k times as the threshold Iterate through each weight parameter of the network layer. If the weight parameter is less than the threshold... Set the weight parameter to 0; S22: After processing the weight parameters of all network layers using step S21, the pruned local model is obtained.
3. The method for predicting the state of charge of a lithium battery according to claim 2, characterized in that, The absolute values of the weight gradients of the network layers include: Where L represents the loss function, Indicates the first Activation functions for each network layer; Indicates the first Weight parameters of each network layer; Indicates the first The weighted input of the activation function in each network layer; T represents the transpose; Indicates the first Error terms for each network layer; Indicates the first The absolute value of the weight gradient of each network layer.
4. The method for predicting the state of charge of a lithium battery according to claim 2, characterized in that, The standard deviation of the network layer weight parameters includes: in, Indicates the first The number of weight parameters in each network layer; No. The first in the network layer One weight parameter; Indicates the first The average value of the weight parameters in each network layer.
5. The method for predicting the state of charge of a lithium battery according to claim 1, characterized in that, The step of using a weighted regression optimization of the Savitzky-Golay filter, which calculates weights using a Gaussian distribution, to filter the initial prediction results includes: S41: Calculate the distance from each data point in the data to be verified to the center data point: in, This indicates the first data in the data to be verified. The distance from each data point to the center data point This indicates the number of data points in the data to be verified. Indicates the first in the data to be verified One data point; S42: Calculate the weights of the data points in the data to be verified based on the Gaussian distribution; in, This indicates the first data in the data to be verified. The weight of each data point; This parameter controls the width of the weight distribution. S43: Construct a weighted residual sum of squares problem based on the weights of the data points in the data to be verified and the initial prediction results of the battery state of charge. Solve the weighted residual sum of squares problem with the objective of minimizing the weighted residual sum of squares to obtain the final prediction result.
6. The method for predicting the state of charge of a lithium battery according to claim 5, characterized in that, The weighted residual sum of squares problem includes: in, This indicates the first data in the data to be verified. Observations of data points; This indicates the first data in the data to be verified. Data points The initial prediction results.
Citation Information
Patent Citations
Product quality prediction system based on federal learning
CN115689317A
Electric vehicle short-term load prediction method considering charging behavior information privacy protection
CN117117830A