A battery state of charge evaluation method, electronic device and storage medium
Through the temporal self-attention deep network and state space model, combined with weight coefficients and normalization processing, the problem of poor adaptability of battery state-of-charge assessment for different types of batteries is solved, accurate assessment of battery state-of-charge is achieved, and the accuracy of the assessment is improved. Accuracy and generalization.
Patent Information
- Application Number
- CN202411016948.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-29
AI Technical Summary
Existing battery state-of-charge assessment methods have poor adaptability to different types of batteries, resulting in differences between the assessment results and the actual state-of-charge.
It uses temporal self-attention deep network and state space model to obtain battery data information, predict the state of charge value, and calculate the current state of charge value of the battery through weight coefficient and normalization processing to improve the accuracy and accuracy of evaluation. Generalizability.
The accuracy and precision of the state-of-charge assessment of different types of batteries are achieved, avoiding the limitations of a single model, improving the generalization and estimation accuracy of the assessment, making the obtained state-of-charge value closer to the true state of the battery.
Smart Images

Figure CN118549822B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery evaluation, and in particular to a battery state of charge evaluation method, electronic equipment and storage medium. Background Art
[0002] The battery management system (BMS) is a key technology to ensure the safety, efficiency and long life of batteries. Among the many battery performance parameters, the state of charge (SOC) is a core indicator that directly reflects the current charge level of the battery. Accurate estimation of SOC is crucial for battery energy management, safety monitoring and health maintenance.
[0003] However, since different types of batteries have different chemical compositions and reaction mechanisms, conventional state of charge assessment methods have poor adaptability to different types of batteries, which in turn leads to certain differences between the state of charge assessed for different types of batteries and the actual state of charge of the battery. Summary of the invention
[0004] The problem solved by the present invention is how to improve the accuracy of battery charge state assessment.
[0005] In order to solve the above problems, the present invention provides a battery state of charge evaluation method, electronic equipment and storage medium.
[0006] In a first aspect, the present invention provides a method for evaluating a battery state of charge, comprising:
[0007] Obtaining battery data information corresponding to the battery at the current moment and an initial state of charge set at a previous moment, wherein the initial state of charge set includes multiple initial state of charge values and corresponding initial weights at the previous moment;
[0008] According to the battery data information, a predicted state of charge value corresponding to the battery at the current moment is obtained through a preset time self-attention deep network;
[0009] According to each of the initial state of charge values in the initial state of charge set, obtaining a state of charge estimation value and an approximate state of charge prediction value corresponding to each of the initial state of charge values at a current moment through a preset state space model;
[0010] Determining a weight coefficient corresponding to each state of charge estimation value through a weight coefficient relationship according to the approximate state of charge prediction value and the state of charge prediction value corresponding to each state of charge estimation value;
[0011] Determining a temporary weight corresponding to the estimated state of charge value according to a product of the weight coefficient and the initial weight corresponding to the estimated state of charge value;
[0012] Obtaining a weight corresponding to each of the state of charge estimation values by normalizing the temporary weights corresponding to all of the state of charge estimation values;
[0013] The products of all the state of charge estimation values and the corresponding weights are summed to obtain the state of charge value of the battery at the current moment.
[0014] Optionally, before obtaining the battery data information corresponding to the battery at the current moment, the method further includes:
[0015] Obtain all current and voltage values within a preset time period before the current moment;
[0016] Determine an average current value according to all the current values, and determine an average voltage value according to all the voltage values;
[0017] The battery data information is generated according to the acquired current value, voltage value and corresponding ambient temperature of the battery at the current moment, as well as the average current value and the average voltage value.
[0018] Optionally, the temporal self-attention deep network includes a preset first gated recurrent unit, a second gated recurrent unit, a third gated recurrent unit and a decoder; the step of obtaining a predicted state of charge value corresponding to the current moment of the battery through a preset temporal self-attention deep network according to the battery data information includes:
[0019] Based on the battery data information, a query matrix is generated by the first gated cycle unit, a value matrix is generated by the second gated cycle unit, and a key matrix is generated by the third gated cycle unit;
[0020] Obtaining feature information according to the query matrix, the value matrix and the key matrix;
[0021] Obtaining the predicted value of the state of charge at the current moment through the decoder according to the characteristic information;
[0022] The characteristic information satisfies:
[0023] ;
[0024] Among them, output is the feature information, Q is the query matrix, K T is the transpose of the value matrix, V is the key matrix, d k is the second dimension of the query matrix, and softmax is the activation function.
[0025] Optionally, the state space model includes a preset state relationship and a measurement relationship; and obtaining, according to each of the initial state of charge values in the initial state of charge set, a current state of charge estimation value and an approximate state of charge prediction value corresponding to each of the initial state of charge values through a preset state space model, includes:
[0026] According to the initial state of charge value, through the state relationship, obtaining the estimated state of charge value at the current moment corresponding to the initial state of charge;
[0027] According to the state of charge estimation value, the approximate state of charge prediction value corresponding to the state of charge estimation value is obtained through the measurement relationship;
[0028] The state relationship satisfies:
[0029] ;
[0030] The measurement relationship satisfies:
[0031] ;
[0032] in, is the i-th initial state of charge value at the previous moment, is the estimated value of the i-th state of charge at the current moment, I k-1 is the current value of the battery at the previous moment, C norm is the rated capacity of the battery, △t is the sampling period, ω k is the preset process Gaussian white noise, is the approximate state of charge prediction value of the i-th at the current moment, γ k is the preset state Gaussian white noise, k is the current moment, and k-1 is the previous moment.
[0033] Optionally, the weight coefficient relationship satisfies:
[0034] ;
[0035] in, is the weight coefficient corresponding to the i-th state of charge estimation value at the current moment, R v is the preset measurement noise variance, y k is the predicted value of the state of charge at the current moment, is the ith approximate state of charge prediction value at the current moment, exp is an exponential function, k is the current moment, and k-1 is the previous moment.
[0036] Optionally, the weight satisfies:
[0037] ;
[0038] in, is the weight corresponding to the i-th estimated state of charge value at the current moment, is the temporary weight corresponding to the i-th state of charge estimation value at the current moment, N is the number of all the temporary weights, and k is the current moment.
[0039] Optionally, the method further comprises:
[0040] Generate a state of charge set at the current moment according to all the state of charge estimation values and the corresponding weights;
[0041] Determining the number of effective particles according to all the weights through a preset distribution relationship;
[0042] When the number of effective particles is less than a preset threshold, resampling is performed according to the state of charge set to generate a new state of charge set;
[0043] The distribution relationship satisfies:
[0044] ;
[0045] Among them, N eff is the effective number of particles, is the weight corresponding to the i-th state of charge estimation value at the current moment, and N is the number of all the temporary weights.
[0046] Optionally, the method further comprises:
[0047] Sorting all the weights from largest to smallest and determining the cumulative probability of each weight;
[0048] Determining an upper bound cumulative probability and a lower bound cumulative probability according to a preset confidence level and all of the cumulative probabilities;
[0049] The weight corresponding to the upper bound cumulative probability is determined as the upper bound weight, and the weight corresponding to the lower bound cumulative probability is determined as the lower bound weight;
[0050] Determine the estimated state of charge value corresponding to the upper bound weight as an upper bound value, and determine the estimated state of charge value corresponding to the lower bound weight as a lower bound value;
[0051] A confidence interval for the state of charge estimate is generated based on the upper bound and the lower bound.
[0052] In a second aspect, the present invention provides an electronic device, including a memory and a processor;
[0053] The memory is used to store computer programs;
[0054] The processor is used to implement the battery state of charge evaluation method as described in the first aspect when executing the computer program.
[0055] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the battery state of charge assessment method as described in the first aspect is implemented.
[0056] The beneficial effects of the battery state of charge evaluation method, electronic device and storage medium of the present invention are: based on the acquired data information of the battery at the current moment, based on a pre-constructed time attention deep network, the state of charge at the current moment is predicted by capturing the complex nonlinear relationship in the data information during the battery charging and discharging process, thereby obtaining the predicted value of the state of charge at the current moment. According to the initial state of charge set obtained at the previous moment, the state of charge estimation value and the approximate state of charge prediction value corresponding to each initial state of charge value at the current moment are obtained through the preset state space model. The state of charge value that may appear at the current moment of the battery can be reflected through all the state of charge estimation values, and each approximate state of charge prediction value is used as an approximate value of the state of charge prediction value, so that the approximate state of charge prediction value is compared with the state of charge prediction value output by the temporal self-attention deep network, and the difference between the output value of the temporal self-attention deep network and the state space model is judged, so that according to each approximate state of charge prediction value and the state of charge prediction value at the current moment, the weight coefficient corresponding to the state of charge estimation value at the current moment is calculated, and the difference between the state of charge estimation value obtained at the current moment according to the initial state of charge value and the predicted state of charge prediction value is represented by the weight coefficient. Further, according to the product of the weight coefficient corresponding to the state of charge estimation value and the initial weight, the actual weight corresponding to the state of charge estimation value at the current moment, that is, the temporary weight, is obtained, so that the probability distribution of each state of charge estimation value at the current moment can be accurately represented by the temporary weight. By normalizing all temporary weights, the final weight of each state of charge estimation value is obtained. The normalization process ensures the consistency of the weight of each state of charge estimation value, and makes the sum of all weights equal to 1, further improving the efficiency of data processing and calculation. Finally, the accurate state of charge value of the battery at the current moment is obtained through all the state of charge estimation values and the corresponding weights. Using the preset time self-attention deep network and state space model, the state of charge prediction value and state of charge estimation value of the battery at the current moment are obtained respectively, and the state of charge prediction value and state of charge estimation value are processed by data fusion to obtain the accurate state of charge value of the battery at the current moment, avoiding the limitations of a single model or ampere-hour integration method for evaluating the state of charge value of different types of batteries, improving the generalization and estimation accuracy of the battery state of charge evaluation, making the obtained state of charge value closer to the actual state of charge value of the battery, and further effectively improving the accuracy of the battery state of charge value evaluation through comprehensive processing of historical data and current data information. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a flow chart of a battery state of charge assessment method according to an embodiment of the present invention;
[0058] Figure 2A schematic diagram of the structure of the temporal self-attention mechanism of an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of the structure of the temporal self-attention encoding and decoding according to an embodiment of the present invention;
[0060] Figure 4 A schematic diagram of the structure of a temporal self-attention deep network according to an embodiment of the present invention;
[0061] Figure 5 The figure is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0062] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be interpreted as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.
[0063] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0064] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to"; the term "based on" means "based at least in part on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0065] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0066] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0067] In the related technologies, in the battery management system, the state of charge is one of the core tasks. The state of charge (SOC) represents the ratio between the remaining available capacity and the nominal capacity. Accurate SOC evaluation is the basis for other battery state estimation, balancing and energy management. In the SOC evaluation of NMC and other batteries, the open circuit voltage (OCV) is used as an important parameter in the estimation. There is an obvious monotonic relationship between SOC and OCV, which can be used to evaluate the SOC of the battery, but it is not universal.
[0068] At present, the main battery SOC estimation methods include the ampere-hour integration method, the model-based method and the data-driven method. The ampere-hour integration method is one of the most basic SOC estimation algorithms, which mainly calculates the current SOC by integrating the current over time, but the error is large during the voltage plateau period of the lithium iron phosphate battery; the model-based method has good estimation accuracy on batteries such as ternary lithium, but the accuracy cannot be guaranteed during the voltage plateau period of the lithium iron phosphate battery; the data-driven SOC estimation method has excellent results and is simple to implement, but it ignores the working principle of the battery, and its generalization at different temperatures and different cells in the battery pack also needs further verification.
[0069] In view of the problems existing in the above-mentioned related technologies, this embodiment provides a battery state of charge evaluation method, an electronic device and a storage medium.
[0070] like Figure 1 As shown, a battery state of charge assessment method provided by an embodiment of the present invention includes:
[0071] S100, obtaining battery data information corresponding to the battery at a current moment and an initial state of charge set at a previous moment, wherein the initial state of charge set includes a plurality of initial state of charge values at a previous moment and corresponding initial weights.
[0072] Specifically, in the battery management system or energy management system, the part of the battery or energy system operating status data collected and processed by the input module, through all the current values and voltage values of the preset time period before the current moment, respectively calculates the average current value I of the previous preset time period corresponding to the current moment k And the average voltage value U k , according to the average current value I k , average voltage value U k , the current value I, the current voltage value U and the current ambient temperature T, generate the battery data information of the battery at the current time, the battery data information X bat ={I k , U k, I, U, T}, in the input module, the battery data information at the current moment is used as the input of the preset trained temporal self-attention deep network, and the predicted value of the battery's state of charge at the current moment is output.
[0073] Furthermore, based on the historical data of battery usage and the battery charging and discharging characteristics, the collected data is statistically analyzed to determine the distribution characteristics of the state of charge value, including calculating the mean, variance, skewness, kurtosis and other statistical quantities of the state of charge value. According to the results of the statistical analysis, a suitable probability distribution model is selected to describe the distribution of the state of charge value, and a priori distribution of the state of charge value is generated through the probability distribution model, so that a preset number of multiple state of charge values are randomly selected from the prior distribution of the state of charge value corresponding to the previous moment as an initial state of charge set, and the initial state of charge set includes each initial state of charge and a corresponding initial weight, the initial state of charge is the state of charge value selected at the previous moment, and the initial weight is the weight corresponding to the state of charge value selected at the previous moment. The state of charge value at the current moment can be predicted through the historical state of charge data information at the previous moment, so that the time state of the battery can be accurately reflected through the predicted state of charge value.
[0074] S200, according to the battery data information, a predicted state of charge value corresponding to the battery at the current moment is obtained through a preset time self-attention deep network.
[0075] Specifically, the defects of the traditional self-attention mechanism are improved to obtain the temporal self-attention mechanism (TSA), and the temporal self-attention deep network (TSADN) is constructed with this as the core structure. The mapping relationship between the current battery data information and SOC is found through the pre-constructed temporal attention deep network, so as to obtain the corresponding state of charge prediction value at the current moment.
[0076] Furthermore, the constructed and trained time self-attention deep network is used to input the battery data information X bat Get the predicted value of the battery state of charge corresponding to the current moment, that is, the battery data information X bat Mapped to the state of charge prediction value y k .
[0077] For example, the mapping relationship satisfies:
[0078] ;
[0079] Among them, y k is the predicted value of the state of charge at the current moment, X batis the battery data information corresponding to the current moment, f TSADN Indicates the mapping relationship established by TSADN.
[0080] S300, according to each of the initial state of charge values in the initial state of charge set, obtaining a state of charge estimation value and an approximate state of charge prediction value corresponding to each of the initial state of charge values at a current moment through a preset state space model.
[0081] Specifically, by constructing a good state-space model, according to each initial state-of-charge value in the initial state-of-charge set, the estimated state-of-charge value at the current moment corresponding to the initial state-of-charge value is obtained. The estimated state-of-charge value can reflect the possible remaining power of the battery at the current moment, so that the actual state of the battery at the current moment can be accurately reflected through the estimated state-of-charge value at the current moment. The estimated state-of-charge value is further denoised to obtain a state-of-charge value that is approximate to the predicted state-of-charge value at the current moment output by TSAND, that is, an approximate state-of-charge predicted value. The difference between the evaluation result of the state-space model and the evaluation result of the temporal self-attention deep network can be judged through the approximate state-of-charge predicted value, so that the evaluation results are fused, so that the final evaluation result has better generalization, so that it can adapt to the evaluation of the state of charge of different types of batteries.
[0082] S400, determining a weight coefficient corresponding to the state of charge estimation value through a weight coefficient relationship according to the approximate state of charge prediction value and the state of charge prediction value corresponding to each state of charge estimation value.
[0083] S500 , determining a temporary weight corresponding to the estimated state of charge value according to a product of the weight coefficient and the initial weight corresponding to the estimated state of charge value.
[0084] Specifically, based on the approximate state of charge prediction value corresponding to the state of charge estimation value at the current moment and the state of charge prediction value output by the temporal self-attention deep network, the weight coefficient corresponding to each state of charge estimation value is calculated, and the product of the weight coefficient and the initial weight of the initial state of charge at the previous moment corresponding to the state of charge estimation value is used as the temporary weight corresponding to the state of charge estimation value at the current moment.
[0085] For example, assuming that the i-th initial state of charge value at the previous moment is , corresponding to the initial weight , through the state space model, the estimated state of charge corresponding to the current moment is obtained and approximate state of charge prediction , where K is the current moment and k-1 is the corresponding previous moment. According to the obtained approximate state of charge prediction value and the current state of charge prediction value y k , the corresponding weight coefficient is calculated through the weight coefficient relationship: , according to the weight coefficient The corresponding initial weight The product of the current state of charge is obtained The corresponding temporary weight .
[0086] S600 , obtaining a weight corresponding to each of the state of charge estimation values by normalizing the temporary weights corresponding to all of the state of charge estimation values.
[0087] Specifically, all temporary weights are summed to obtain the total temporary weight corresponding to all state of charge estimation values at the current moment, and then each temporary weight is divided by the total temporary weight to obtain the normalized weight of each temporary weight, that is, the weight of the state of charge estimation value corresponding to the current moment. The weight corresponding to each state of charge estimation value at the current moment can reflect the importance or probability of occurrence of each corresponding state of charge estimation value in the overall distribution. After normalization, it is ensured that the sum of all weights is equal to 1, so that the weights remain consistent under different conditions, which is helpful for cross-condition comparison, thereby providing a more accurate basis for comparison between states of charge, while reducing the complexity of data processing and improving the efficiency of data processing.
[0088] S700, summing up the products of all the state of charge estimation values and the corresponding weights to obtain the state of charge value of the battery at the current moment.
[0089] Specifically, each state of charge estimation value is multiplied by the corresponding weight to obtain the corresponding weighted state of charge estimation value, and all weighted state of charge estimation values are added together to obtain the state of charge value corresponding to the battery at the current moment.
[0090] Exemplarily, the state of charge value satisfies:
[0091] ;
[0092] Among them, SOC k is the current state of charge of the battery, is the weight corresponding to the i-th estimated state of charge value at the current moment, is the i-th state of charge estimation value at the current moment, N is the number of all state of charge estimation values, and k is the current moment.
[0093] In this embodiment, according to the data information of the battery at the current moment, based on the pre-built time attention deep network, the state of charge at the current moment is predicted by capturing the complex nonlinear relationship in the data information during the battery charging and discharging process, so as to obtain the state of charge prediction value at the current moment. According to the initial state of charge set obtained at the previous moment, the state of charge estimation value and the approximate state of charge prediction value corresponding to each initial state of charge value at the current moment are obtained through the preset state space model. The state of charge value that may appear at the current moment of the battery can be reflected by all the state of charge estimation values, and each approximate state of charge prediction value is used as an approximate value of the state of charge prediction value, so as to compare the approximate state of charge prediction value with the state of charge prediction value output by the time self-attention deep network, and judge the difference between the output value of the time self-attention deep network and the state space model, so as to calculate the weight coefficient corresponding to the state of charge estimation value at the current moment according to each approximate state of charge prediction value and the state of charge prediction value at the current moment, and the weight coefficient represents the difference between the state of charge estimation value at the current moment obtained according to the initial state of charge value and the predicted state of charge prediction value. Further, according to the product of the weight coefficient corresponding to the state of charge estimation value and the initial weight, the actual weight corresponding to the state of charge estimation value at the current moment, that is, the temporary weight, can be obtained, so that the probability distribution of each state of charge estimation value at the current moment can be accurately represented by the temporary weight. By normalizing all temporary weights, the final weight of each state of charge estimation value is obtained. The normalization process ensures the consistency of the weight of each state of charge estimation value, and makes the sum of all weights equal to 1, further improving the efficiency of data processing and calculation. Finally, the accurate state of charge value of the battery at the current moment is obtained through all the state of charge estimation values and the corresponding weights. By using the preset temporal self-attention deep network and state-space model, the predicted state of charge and estimated state of charge of the battery at the current moment are obtained respectively, and the predicted state of charge and the estimated state of charge are fused through data processing to obtain the accurate state of charge value of the battery at the current moment, avoiding the limitations of a single model or ampere-hour integration method for evaluating the state of charge values of different types of batteries, improving the generalization and estimation accuracy of the battery state of charge evaluation, making the obtained state of charge value closer to the actual state of charge value of the battery, and through the comprehensive processing of historical data and current data information, further effectively improving the accuracy of the battery state of charge value evaluation.
[0094] It should be noted that the battery state of charge evaluation method of this embodiment uses a temporal self-attention deep network and a state space model to perform comprehensive analysis and processing on current battery data and historical battery data. Therefore, it can be applied to various types of batteries to accurately evaluate the state of charge, that is, the SOC evaluation performed by the method of this embodiment includes but is not limited to the following battery types, such as lithium-ion batteries: lithium-ion batteries are widely used in electric vehicles, mobile devices, energy storage systems and other fields due to their advantages such as high energy density, long life and high stability. SOC evaluation is crucial for the safety management, life prediction and performance optimization of these batteries; lithium iron phosphate batteries (LiFePO4): these batteries are favored in specific applications due to their excellent thermal stability and cycle life. SOC evaluation helps to optimize the use and management of these batteries; nickel manganese cobalt (NMC) batteries: NMC batteries are a type of lithium-ion batteries with different chemical ratios (such as NCM111, NCM523, NCM622, NCM811). SOC evaluation is equally important for the performance and safety management of these batteries; nickel cobalt aluminum (Nickel-Cobalt-Aluminum, NCA) batteries: N CA battery is another type of lithium-ion battery with high energy density and good thermal stability. It is often used in electric vehicles. SOC evaluation helps to improve the efficiency and safety of this type of battery. Lithium manganese oxide battery: This type of battery has the characteristics of low cost and good safety. It is often used in some cost-sensitive applications. SOC evaluation can assist in the charge and discharge management of this type of battery. Lithium cobalt oxide battery: Lithium cobalt oxide battery has a high energy density, but a high cost. It is often used in some high-end applications. SOC evaluation helps to improve the performance of this type of battery and reduce the cost of use. Lead-acid battery: Although lead-acid battery has a low energy density, it is still used in some specific applications due to its low cost and mature technology. SOC evaluation can improve the service life and management efficiency of this type of battery. Fuel cell: As an energy conversion device, the SOC evaluation of fuel cell helps to optimize hydrogen management and battery performance. Supercapacitor: Supercapacitor has advantages in some specific applications with its high power density and long cycle life. SOC evaluation helps to improve its charge and discharge efficiency and service life. The selection and application of SOC evaluation methods need to be comprehensively considered according to battery type, application scenario and performance requirements to ensure the safe, reliable and efficient operation of the battery system.
[0095] Optionally, before obtaining the battery data information corresponding to the battery at the current moment, the method further includes:
[0096] Obtain all current and voltage values within a preset time period before the current moment;
[0097] Determine an average current value according to all the current values, and determine an average voltage value according to all the voltage values;
[0098] The battery data information is generated according to the acquired current value, voltage value and corresponding ambient temperature of the battery at the current moment, as well as the average current value and the average voltage value.
[0099] Specifically, a preset time period is used as a sliding window to obtain multiple current values and voltage values within the preset time period before the current moment. The number of the current values and voltage values is determined according to a preset sampling frequency or a resampling period. The current values and voltage values of the preset time period also include the voltage values and current values at the current moment. The corresponding average current value is calculated based on all current values, and the corresponding average voltage value is calculated based on all voltage values. k , average voltage value U k , the current value I, the current voltage value U and the current ambient temperature T, generate the battery data information of the battery at the current time, the battery data information X bat ={I k , U k , I, U, T}, the battery data information can fully and completely reflect the current state of the battery, as well as the changing trend of the current value and voltage value in a preset time period, so that the current battery charge state can be accurately judged based on the data information.
[0100] Exemplarily, the average current value satisfies:
[0101] ;
[0102] The average voltage value satisfies:
[0103] ;
[0104] Among them, I k is the average current value, I j is the jth current value in the preset time period, U k is the average voltage value, U h is the hth voltage value in the preset time period. Since the collection time points of the current value and the voltage value in the preset time period are the same, that is, the current value and the voltage value are collected at the same time at each collection time point, the number of current values is the same as the number of voltage values, that is, m is the number of voltage values collected, and m is also the number of current values collected.
[0105] In this optional embodiment, by calculating the average current value and the average voltage value within a preset time period, the current data information of the battery can be fully integrated with the historical data of the previous preset time period, and then the change trend of the battery current and voltage can be judged based on the average current and average voltage, so that the current state of charge of the battery can be more accurately judged based on the change trend, effectively improving the accuracy of the battery state of charge assessment.
[0106] Optionally, the temporal self-attention deep network includes a preset first gated recurrent unit, a second gated recurrent unit, a third gated recurrent unit and a decoder; the step of obtaining a predicted state of charge value corresponding to the current moment of the battery through a preset temporal self-attention deep network according to the battery data information includes:
[0107] Based on the battery data information, a query matrix is generated by the first gated cycle unit, a value matrix is generated by the second gated cycle unit, and a key matrix is generated by the third gated cycle unit;
[0108] Obtaining feature information according to the query matrix, the value matrix and the key matrix;
[0109] Obtaining the predicted value of the state of charge at the current moment through the decoder according to the characteristic information;
[0110] The characteristic information satisfies:
[0111] ;
[0112] Among them, output is the feature information, Q is the query matrix, K T is the transpose of the value matrix, V is the key matrix, softmax is the activation function, d k is the second dimension of the query matrix, which is the number of columns of the query matrix, indicating the number of elements in the horizontal direction of the query matrix.
[0113] Specifically, in the temporal self-attention deep network (TSADN), TSADN maps the input data information of the battery at the current moment to the predicted value of the state of charge at the current moment, and uses the constructed and trained temporal self-attention deep network to obtain the estimated value of the battery SOC, that is, the predicted value of the state of charge, according to the input current moment battery data information. Among them, TSA is an improved self-attention mechanism (SAM) with an embedded gated recurrent unit (GRU), such as Figure 2As shown, the TSA in TSADN includes a preset first gated recurrent unit GRU q , the second gated recurrent unit GRU k And the third gated recurrent unit GRU v , input the current data information of the battery into GRU q Output the corresponding query matrix Q and input the current data information of the battery into GRU k Output the corresponding value matrix K and input the current data information of the battery into GRU v Output the corresponding key matrix V, perform matrix multiplication on the query matrix Q and the transpose of the value matrix K to obtain a new matrix, and input the new matrix into the activation function softmax. The result of the activation function output and the key matrix are matrix-penalized to obtain the characteristic information of the battery data information. Based on the characteristic information, the predicted value of the battery's current state of charge is output through the decoder in TSADN.
[0114] Furthermore, if Figure 3 As shown in the figure, TSADN is an encoder-decoder structure. In the encoding stage, the input sequence passes through TSA and the fully connected layer (Fully Connected, FC), and the outputs of the two are added to form a skip connection to accelerate the network convergence speed and obtain the feature information of the sequence. In the decoding stage, the bidirectional gated recurrent unit (BGRU) and FC are used to further enhance the model's perception of the temporal correlation of the feature sequence to improve the model performance and robustness, and are responsible for outputting the current state of charge prediction value. Compared with traditional sequence models such as recurrent neural networks and existing standard SAM, it can better maintain the temporal characteristics of the input sequence, thereby more accurately extracting important feature information of the input sequence. The core structure of the decoder in TSADN is BGRU, which is a recurrent neural network that can access the input sequence forward and backward respectively. Compared with GRU that can only access forward, it is more in line with the temporal dependence of the state of charge on the previous and next data. TSADN can take advantage of the advantages of BGRU and TSA, focus on the useful information in the input data, enhance the model's expression ability and generalization ability for different temperatures and different monomers in the battery pack, and improve the accuracy of the neural network in predicting the state of charge.
[0115] For example, the hyperparameters of TSADN include GRU in TSA network q , GRU k , GRU v and bidirectional gated recurrent unit GRU in the decoder d The number of layers and nodes, as well as the fully connected layer FC in the encoder EF and the fully connected layer FC in the decoder DF1 and FCDF2 Considering the operation time and accuracy, the hyperparameters of TSADN are finally selected as follows: GRU q , GRU k , GRU v and GRU d The number of nodes is 64 and the number of layers is 2; FC EF The number of nodes is 64; FC DF1 The number of nodes is 32; FC DF2 The number of nodes is 1. In order to improve the estimation accuracy and convergence speed of the model, the normalization method is used to preprocess the input data. TSADN uses the Adam optimizer to optimize the parameters. The training batch size is 64, the initial learning rate is 0.001, and the iteration rounds are 300. Thus, through the construction and training of the model, a trained temporal attention deep network is obtained.
[0116] In this optional embodiment, by processing the time series information containing current and voltage at the current moment through the temporal self-attention deep network, the dependency between the battery current value and voltage value at the current moment and in the previous time period can be captured more flexibly, thereby improving the prediction accuracy of the battery state of charge.
[0117] Optionally, the state space model includes a preset state relationship and a measurement relationship; and obtaining, according to each of the initial state of charge values in the initial state of charge set, a current state of charge estimation value and an approximate state of charge prediction value corresponding to each of the initial state of charge values through a preset state space model, includes:
[0118] According to the initial state of charge value, through the state relationship, obtaining the estimated state of charge value at the current moment corresponding to the initial state of charge;
[0119] According to the state of charge estimation value, the approximate state of charge prediction value corresponding to the state of charge estimation value is obtained through the measurement relationship;
[0120] The state relationship satisfies:
[0121] ;
[0122] The measurement relationship satisfies:
[0123] ;
[0124] in, is the i-th initial state of charge value at the previous moment, is the estimated value of the i-th state of charge at the current moment, I k-1 is the current value of the battery at the previous moment, C normis the rated capacity of the battery, △t is the sampling period, ω k The Gaussian white noise of the process preset at the current moment, is the approximate state of charge prediction value of the i-th at the current moment, γ k is the state Gaussian white noise preset at the current moment, k is the current moment, and k-1 is the previous moment.
[0125] Specifically, a preset number N of state-of-charge values are randomly selected from the prior distribution of the state-of-charge at the previous moment as the initial state-of-charge values, and the weight corresponding to each initial state-of-charge value is used as the initial weight, and the initial state-of-charge set of the previous moment is constructed according to all the initial states of charge and the corresponding initial weights, and according to each initial state of charge in the initial state-of-charge set of the previous moment, the estimated value of the state of charge at the current moment corresponding to each initial state of charge is calculated through the pre-constructed state relationship, that is, the estimated state of charge value, according to the estimated state of charge value, denoising is performed through the pre-constructed measurement relationship to obtain a state of charge that is similar to the state-of-charge prediction value output by the temporal self-attention deep network, that is, the approximate state-of-charge prediction value, and by establishing a particle filter to adaptively fuse the estimation results of the TSADN and the state space model, it is possible to effectively reduce the influence of noise or outliers, obtain a more accurate state-of-charge estimation result, provide more reference information for the BMS, prevent the BMS from making overly radical or conservative decisions, and achieve efficient management and control of the battery system.
[0126] In this optional embodiment, the estimated value of the state of charge at the corresponding current moment, that is, the estimated state of charge value, is calculated according to each initial state of charge value through the state relationship, so that the estimated value of the possible state of charge at the current moment corresponding to each initial state of charge at the previous moment can be obtained, which helps to evaluate the uncertainty of the battery state of charge, thereby improving the accuracy of the battery state of charge evaluation. At the same time, through the obtained approximate state of charge prediction value, the difference between each state of charge estimation value and the state of charge prediction value at the current moment can be further judged, so as to find a battery state of charge value that is closer to the actual state of charge according to the difference relationship.
[0127] Optionally, the weight coefficient relationship satisfies:
[0128] ;
[0129] in, is the weight coefficient corresponding to the i-th state of charge estimation value at the current moment, R v is the preset measurement noise variance, y k is the predicted value of the state of charge at the current moment, is the ith approximate state of charge prediction value at the current moment, exp is an exponential function, k is the current moment, and k-1 is the previous moment.
[0130] Optionally, the weight satisfies:
[0131] ;
[0132] in, is the weight corresponding to the i-th estimated state of charge value at the current moment, is the temporary weight corresponding to the i-th state of charge estimation value at the current moment, N is the number of all the temporary weights, and k is the current moment.
[0133] Optionally, the method further comprises:
[0134] Generate a state of charge set at the current moment according to all the state of charge estimation values and the corresponding weights;
[0135] Determining the number of effective particles according to all the weights through a preset distribution relationship;
[0136] When the number of effective particles is less than a preset threshold, resampling is performed according to the state of charge set to generate a new state of charge set;
[0137] The distribution relationship satisfies:
[0138] ;
[0139] Among them, N eff is the effective number of particles, is the weight corresponding to the i-th state of charge estimation value at the current moment, and N is the number of all the temporary weights.
[0140] Exemplarily, the state of charge set at the current moment is constructed according to all the state of charge estimation values and the corresponding weights. In order to prevent the state of charge value in the state of charge set from degrading, that is, most of the state of charge estimation values are concentrated at one point, therefore, according to all the weights in the state of charge set, the effective number of particles in the state of charge set is calculated through the distribution relationship, and the effective particle number N is used. eff Indicates the diversity of the charge state estimation distribution, and a fixed preset threshold N can be set threshoid =0.85N; when N eff ≥N threshoid When N, it means that the estimated state of charge value is evenly distributed and no resampling is required. The current estimated state of charge value is used as the final estimated state of charge value of the battery at the current moment. eff <N threshoidWhen , it means that the current state of charge value distribution is relatively concentrated, and resampling is needed to increase the diversity of the state of charge value distribution. Resampling is performed through importance sampling (Importance Sampling). Importance sampling is a prior art and will not be described in detail here. The state of charge set is resampled a preset number of times according to the weight to generate a new state of charge set, and the state of charge estimation value and the corresponding weight in the newly generated state of charge set are used as the final state of charge estimation value and the corresponding weight of the battery at the current moment, so that the state of charge value of the battery at the current moment is calculated according to the state of charge estimation value and the weight in the newly generated state of charge set, thereby reducing the deviation between the state of charge estimation values and ensuring the accuracy of the battery state of charge evaluation.
[0141] In this optional embodiment, the diversity of all state of charge estimation values obtained by the state space model is judged by comparing the result of the effective particle number with the preset threshold. When the diversity does not meet the requirements, a new state of charge set that meets the diversity requirements is obtained by resampling. That is, the effective particle number calculated based on all weights in the state of charge set is less than the preset threshold. The diversity of all state of charge estimation values in the state of charge set is increased by resampling to avoid the deviation caused by the uneven initial state of charge value selected at the previous moment. The state of charge evaluation can be performed more accurately based on the state of charge estimation value in the state of charge set after resampling, thereby improving the accuracy of the final battery state of charge evaluation.
[0142] Optionally, the method further comprises:
[0143] Sorting all the weights from largest to smallest and determining the cumulative probability of each weight;
[0144] Determining an upper bound cumulative probability and a lower bound cumulative probability according to a preset confidence level and all of the cumulative probabilities;
[0145] The weight corresponding to the upper bound cumulative probability is determined as the upper bound weight, and the weight corresponding to the lower bound cumulative probability is determined as the lower bound weight;
[0146] Determine the estimated state of charge value corresponding to the upper bound weight as an upper bound value, and determine the estimated state of charge value corresponding to the lower bound weight as a lower bound value;
[0147] A confidence interval for the state of charge estimate is generated based on the upper bound and the lower bound.
[0148] Exemplarily, determine the confidence level: pre-set selectable confidence levels of 90%, 95% and 99%; sort the posterior distribution: construct an SOC set based on all the obtained state of charge assessment values and weights, and sort the posterior probability distribution in the SOC set from large to small according to the weight. The weight can represent the probability of the possibility of each state of charge estimate value occurring, which can be understood as sorting according to the probability of each state of charge estimate value occurring; calculate the cumulative probability: calculate the cumulative probability of each probability value after sorting, that is, add all weight values before the current weight according to the order of sorting to obtain the cumulative probability corresponding to the current weight. Since the weight is normalized, the cumulative probability corresponding to the first weight is the first weight, and the cumulative probability corresponding to the second weight is the sum of the first weight and the second weight, and so on. The corresponding cumulative probability is the sum of all weights, that is, 1 or 100%; determine the boundary of the confidence interval: according to a selected preset confidence level, find two critical points corresponding to all cumulative probabilities, namely, the upper bound cumulative probability and the lower bound cumulative probability. For example, if the confidence level is 95%, the corresponding lower bound cumulative probability is 2.5% and the upper bound cumulative probability is 97.5%; determine the parameter value: determine the weight corresponding to the point with the lower bound cumulative probability of 2.5% as the lower bound weight, and determine the state of charge estimation value corresponding to the lower bound weight as the lower bound value of the confidence interval. Similarly, determine the weight corresponding to the point with the upper bound cumulative probability of 97.5% as the upper bound weight, and determine the state of charge estimation value corresponding to the upper bound weight as the upper bound value of the confidence interval. Finally, construct the confidence interval according to the lower bound value and the upper bound value. The confidence interval can be expressed as [lower bound, upperbound], where lower bound is the lower bound value and upper bound is the upper bound value.
[0149] Furthermore, if Figure 4 As shown, all initial states of charge in the output state of charge set are input into the state space model, and the state of charge estimation value and the approximate state of charge prediction value corresponding to each initial state of charge value at the current moment are obtained through the state relationship and measurement relationship therein, and the battery data information at the current moment is input into TSADN, and the state of charge prediction value corresponding to the current moment is output. Then, through the prediction value, the particle filter is used to adaptively fuse the results output by TSADN and the state space model, so as to obtain the total state of charge estimation value of the battery at the current moment, and based on the posterior probability distribution and the weights corresponding to all the state of charge estimation values, the state of charge value of the battery at the current moment and the corresponding confidence interval are obtained, Z -1The final state of charge feedback value is fed back to the state space model, and the closed-loop estimation algorithm formed can not only effectively reduce the impact of noise or outliers, but also characterize the uncertainty of the estimation result through the confidence interval, thereby providing more reference information for the BMS, preventing the BMS from making overly aggressive or conservative decisions, and achieving efficient management and control of the battery system.
[0150] In this optional embodiment, by calculating the confidence interval, the degree of credibility of the uncertainty of the state of charge value evaluated at the current moment can be obtained, and the accuracy of the evaluation result can be judged by determining whether the final state of charge value is within the confidence interval, thereby further improving the reliability and accuracy of the battery state of charge evaluation result.
[0151] Figure 5 As shown, an electronic device provided by an embodiment of the present invention includes a memory and a processor; the memory is used to store a computer program; the processor is used to implement the battery charge state evaluation method as described above when executing the computer program.
[0152] In other words, an electronic device includes a memory and a processor coupled to the memory; the memory is configured to store a computer program; and the processor is configured to perform the following operations when executing the computer program:
[0153] Get request information;
[0154] Determine the number of the request information, and adjust the batch size of the batch processing according to the number of the request information to obtain an adjusted batch size, wherein the adjusted batch size is positively correlated with the number of the request information;
[0155] Based on the adjusted batch size, a corresponding number of the request information is input into the model for parallel processing to obtain inference results corresponding to the request information.
[0156] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the battery state of charge evaluation method as described above is implemented.
[0157] In other words, a non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor performs the following operations:
[0158] Get request information;
[0159] Determine the number of the request information, and adjust the batch size of the batch processing according to the number of the request information to obtain an adjusted batch size, wherein the adjusted batch size is positively correlated with the number of the request information;
[0160] Based on the adjusted batch size, a corresponding number of the request information is input into the model for parallel processing to obtain inference results corresponding to the request information.
[0161] An electronic device that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present invention described and / or required herein.
[0162] The electronic device includes a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM, and RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus.
[0163] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. In the present application, the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the present invention. In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0164] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.
Claims
1. A method for evaluating a battery state of charge, It is characterized in that include: Obtaining battery data information corresponding to the battery at the current moment and an initial state of charge set at a previous moment, wherein the initial state of charge set includes multiple initial state of charge values and corresponding initial weights at the previous moment; According to the battery data information, a predicted state of charge value corresponding to the battery at the current moment is obtained through a preset time self-attention deep network; According to each of the initial state of charge values in the initial state of charge set, obtaining a state of charge estimation value and an approximate state of charge prediction value corresponding to each of the initial state of charge values at a current moment through a preset state space model; Determining a weight coefficient corresponding to each state of charge estimation value through a weight coefficient relationship according to the approximate state of charge prediction value and the state of charge prediction value corresponding to each state of charge estimation value; Determining a temporary weight corresponding to the estimated state of charge value according to a product of the weight coefficient and the initial weight corresponding to the estimated state of charge value; Obtaining a weight corresponding to each of the state of charge estimation values by normalizing the temporary weights corresponding to all of the state of charge estimation values; Sum the products of all the state of charge estimation values and the corresponding weights to obtain the state of charge value of the battery at the current moment; The temporal attention deep network includes a preset first gated recurrent unit, a second gated recurrent unit, a third gated recurrent unit and a decoder; the state of charge prediction value corresponding to the battery at the current moment is obtained according to the battery data information through the preset temporal self-attention deep network, including: based on the battery data information, a query matrix is generated through the first gated recurrent unit, a value matrix is generated through the second gated recurrent unit, and a key matrix is generated through the third gated recurrent unit; feature information is obtained according to the query matrix, the value matrix and the key matrix; the state of charge prediction value at the current moment is obtained through the decoder according to the feature information; The characteristic information satisfies: ; Among them, output is the feature information, Q is the query matrix, K T is the transpose of the value matrix, V is the key matrix, d k is the second dimension of the query matrix, and softmax is the activation function; The state space model includes a preset state relationship and a measurement relationship; the state of charge estimation value and the approximate state of charge prediction value corresponding to each initial state of charge value at the current moment are obtained through the preset state space model according to each initial state of charge value in the initial state of charge set, including: according to the initial state of charge value, through the state relationship, obtaining the state of charge estimation value corresponding to the initial state of charge at the current moment; according to the state of charge estimation value, through the measurement relationship, obtaining the approximate state of charge prediction value corresponding to the state of charge estimation value; The state relationship satisfies: ; The measurement relationship satisfies: ; in, is the i-th initial state of charge value at the previous moment, is the estimated value of the i-th state of charge at the current moment, I k-1 is the current value of the battery at the previous moment, C norm is the rated capacity of the battery, △t is the sampling period, ω k is the preset process Gaussian white noise, is the approximate state of charge prediction value of the i-th at the current moment, γ k is the preset state Gaussian white noise, k is the current moment, and k-1 is the previous moment; The weight coefficient relationship satisfies: ; in, is the weight coefficient corresponding to the i-th state of charge estimation value at the current moment, R v is the preset measurement noise variance, y k is the predicted value of the state of charge at the current moment, is the i-th approximate state of charge prediction value at the current moment, exp is an exponential function, k is the current moment, and k-1 is the previous moment; The weights satisfy: ; in, is the weight corresponding to the i-th estimated state of charge value at the current moment, is the temporary weight corresponding to the i-th state of charge estimation value at the current moment, N is the number of all the temporary weights, and k is the current moment.
2. The battery state of charge evaluation method according to claim 1, It is characterized in that Before obtaining the battery data information corresponding to the battery at the current moment, the method further includes: Obtain all current and voltage values within a preset time period before the current moment; Determine an average current value according to all the current values, and determine an average voltage value according to all the voltage values; The battery data information is generated according to the acquired current value, voltage value and corresponding ambient temperature of the battery at the current moment, as well as the average current value and the average voltage value.
3. The battery state of charge evaluation method according to claim 1, It is characterized in that Also includes: Generate a state of charge set at the current moment according to all the state of charge estimation values and the corresponding weights; Determining the number of effective particles according to all the weights through a preset distribution relationship; When the number of effective particles is less than a preset threshold, resampling is performed according to the state of charge set to generate a new state of charge set; The distribution relationship satisfies: ; Among them, N eff is the effective number of particles, is the weight corresponding to the i-th state of charge estimation value at the current moment, and N is the number of all the temporary weights.
4. The battery state of charge evaluation method according to claim 1, It is characterized in that Also includes: Sorting all the weights from largest to smallest and determining the cumulative probability of each weight; Determining an upper bound cumulative probability and a lower bound cumulative probability according to a preset confidence level and all of the cumulative probabilities; The weight corresponding to the upper bound cumulative probability is determined as the upper bound weight, and the weight corresponding to the lower bound cumulative probability is determined as the lower bound weight; Determine the estimated state of charge value corresponding to the upper bound weight as an upper bound value, and determine the estimated state of charge value corresponding to the lower bound weight as a lower bound value; A confidence interval for the state of charge estimate is generated based on the upper bound and the lower bound.
5. An electronic device, It is characterized in that including memory and processor; The memory is used to store computer programs; The processor is configured to implement the battery state of charge evaluation method according to any one of claims 1 to 4 when executing the computer program.
6. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the battery state of charge evaluation method according to any one of claims 1 to 4 is implemented.
