Battery fault diagnosis method and device, computer equipment and storage medium

Through deep learning models and feature fusion technology, the problem of inaccurate battery fault diagnosis is solved, and earlier and more accurate fault identification is achieved, improving the accuracy and interpretability of battery fault warning.

CN120507663APending Publication Date: 2025-08-19SHENZHEN POWER SUPPLY BUREAU
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202510824832.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The prior art is difficult to accurately capture the faint signs before battery failure occurs, and the limited ability to model timing changes, resulting in inaccurate diagnosis of battery failures.

Method used

By obtaining battery operation data, the deep learning model Transformer is used to extract spatiotemporal features and feature fusion, combining multi-head attention mechanism and statistical features, training the fault classification model, and using a mixed loss function of the focus loss function and the dice loss function for model optimization, improving fault recognition capabilities.

Benefits of technology

Improves the accuracy, robustness and interpretability of battery fault warnings, and can identify battery faults earlier and more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120507663A_ABST
    Figure CN120507663A_ABST
Patent Text Reader

Abstract

The invention relates to a battery fault diagnosis method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring operation data of a target battery in an operation process; determining a target operation characteristic of the target battery in at least one dimension according to the operation data; and based on a pre-trained fault classification model, according to the target operation characteristics of the target battery in at least one dimension, determining a target fault type of the target battery. By adopting the method, the accuracy, robustness and interpretability of battery fault early warning can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of fault diagnosis, and in particular to a battery fault diagnosis method, apparatus, computer equipment, and storage medium. Background Art

[0002] With the rapid development of the new energy vehicle industry, the operational safety of batteries, as its core power source, has become increasingly important. During actual operation, batteries may experience performance degradation or even safety accidents due to factors such as aging, manufacturing defects, and environmental stress. Therefore, establishing an accurate, efficient, and real-time battery fault identification and early warning mechanism is crucial.

[0003] At present, traditional battery fault identification methods mostly rely on a single physical quantity (such as voltage) or static characteristics (such as maximum and minimum values) for anomaly detection. They find it difficult to capture subtle signs before a fault occurs, and their ability to model timing changes is limited. Therefore, there is a problem of inaccurate battery fault diagnosis. Summary of the Invention

[0004] Based on this, it is necessary to provide a battery fault diagnosis method, device, computer equipment and storage medium that can accurately detect battery faults in order to solve the above technical problems.

[0005] In a first aspect, the present application provides a battery fault diagnosis method, comprising:

[0006] Obtaining the operating data of the target battery during operation;

[0007] determining target operating characteristics of the target battery in at least one dimension based on the operating data;

[0008] Based on a pre-trained fault classification model, a target fault type of a target battery is determined according to the target operating characteristics of the target battery in at least one dimension.

[0009] In one embodiment, determining target operating characteristics of a target battery in at least one dimension based on the operating data includes:

[0010] Divide the operation data into time series based on the preset time length to obtain time period operation data for at least one time period;

[0011] For each time period, determining the time period operation characteristics of the target battery in at least one dimension of the time period based on the time period operation data of the time period;

[0012] For each dimension, the time period operation characteristics in different time periods on the dimension are fused to obtain the target operation characteristics of the target battery in the dimension.

[0013] In one embodiment, the period operation characteristics in at least one dimension include spatiotemporal operation characteristics and operation distribution characteristics; determining the period operation characteristics of the target battery in at least one dimension in the period based on the period operation data in the period includes:

[0014] Based on the feature extraction model, the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension of the time period are determined according to the time period operation data of the time period; the feature extraction model is obtained by training the deep learning model Transformer; and

[0015] Determine at least one operation distribution value of the target battery in the time period according to the time period operation data in the time period; the operation distribution value includes at least one of the mean, variance, skewness, kurtosis and extreme value of the time period operation data;

[0016] According to each operation distribution value, the operation distribution characteristics of the target battery in the data distribution dimension under the time period are determined.

[0017] In one embodiment, the spatiotemporal operation characteristics include time sequence operation characteristics and spatial operation characteristics. Based on the feature extraction model, the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension of the time period are determined according to the time period operation data of the time period, including:

[0018] Based on the time series extraction network in the feature extraction model, time series feature extraction is performed on the time period operation data under the time period to obtain the time series operation features of the target battery in the time series dimension under the time period; and

[0019] Based on the spatial extraction network in the feature extraction model, the price control features are extracted from the period operation data under the period, and the spatial operation characteristics of the target battery in the spatial dimension under the period are obtained.

[0020] In one embodiment, based on the time series extraction network in the feature extraction model, time series feature extraction is performed on the time period operation data in the time period to obtain the time series operation features of the target battery in the time period in the time series dimension, including:

[0021] Obtaining a preset time sequence code for a time period; the preset time sequence code is used to represent the time period position of the time period operation data in the operation data;

[0022] The sum of the first vector corresponding to the period operation data and the preset time series code is used as the second vector of the period operation data; the first vector is a vector obtained by performing dimensionality reduction processing on the period operation data based on the preset projection weight and bias;

[0023] Based on the multi-head attention mechanism, a third vector of the time period operation data is determined according to the second vector and the preset attention weights; the preset attention weights are determined based on the query weight, key weight, and value weight; the query weight is the product of the second vector and the preset query matrix; the key weight is the product of the second vector and the preset key matrix; and the value weight is the product of the second vector and the preset value matrix.

[0024] According to the third vector and the preset duration, the timing operation characteristics of the target battery in the timing dimension within the time period are determined; the timing operation characteristics represent the operation characteristics of the target battery per unit time within the time period.

[0025] In one embodiment, the fault classification model is trained in the following manner:

[0026] For each training iteration, based on the fault classification model to be trained, the predicted fault type of the sample battery is determined according to the sample operation characteristics of the sample battery in at least one dimension;

[0027] Based on a preset loss function, the loss value of the sample battery is determined according to the predicted fault type of the sample battery and the corresponding actual fault type. The loss function includes a focus loss function and a dice loss function. The focus loss function is used to measure the balance between different fault types in the fault classification model; the dice loss function is used to measure the similarity between the predicted fault type and the actual fault type.

[0028] For each dimension of sample operation characteristics, determine the contribution of the sample operation characteristics in the fault type prediction process;

[0029] Determine the model score of the untrained fault classification model in this training iteration based on the loss value of the sample battery, the corresponding contribution of the sample operation characteristics in each dimension, and the preset regularization value corresponding to this training iteration;

[0030] If the model score does not reach the preset score threshold, the model parameters of the fault classification model are adjusted based on the model score until the model score reaches the preset score threshold.

[0031] In a second aspect, the present application further provides a battery fault diagnosis device, comprising:

[0032] An acquisition module is used to obtain the operating data of the target battery during operation;

[0033] a determination module, configured to determine target operating characteristics of a target battery in at least one dimension based on the operating data;

[0034] The classification module is used to determine the target fault type of the target battery based on the target operating characteristics of the target battery in at least one dimension based on a pre-trained fault classification model.

[0035] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Obtaining the operating data of the target battery during operation;

[0037] determining target operating characteristics of the target battery in at least one dimension based on the operating data;

[0038] Based on a pre-trained fault classification model, a target fault type of a target battery is determined according to the target operating characteristics of the target battery in at least one dimension.

[0039] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0040] Obtaining the operating data of the target battery during operation;

[0041] determining target operating characteristics of the target battery in at least one dimension based on the operating data;

[0042] Based on a pre-trained fault classification model, a target fault type of a target battery is determined according to the target operating characteristics of the target battery in at least one dimension.

[0043] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:

[0044] Obtaining the operating data of the target battery during operation;

[0045] determining target operating characteristics of the target battery in at least one dimension based on the operating data;

[0046] Based on a pre-trained fault classification model, a target fault type of a target battery is determined according to the target operating characteristics of the target battery in at least one dimension.

[0047] The above-mentioned battery fault diagnosis method, device, computer equipment and storage medium obtain the operating data of the target battery during operation; determine the target operating characteristics of the target battery in at least one dimension based on the operating data; and determine the target fault type of the target battery based on the target operating characteristics of the target battery in at least one dimension based on a pre-trained fault classification model, which can improve the accuracy, robustness and interpretability of battery fault warning. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 A diagram illustrating an application environment of a battery fault diagnosis method provided in this embodiment;

[0050] Figure 2 A schematic flow chart of a first battery fault diagnosis method provided in this embodiment;

[0051] Figure 3 A schematic diagram of a flow chart of steps for determining operation characteristics of a time period provided in this embodiment;

[0052] Figure 4 A schematic diagram of a flow chart of steps for determining a characteristic of a timing operation provided in this embodiment;

[0053] Figure 5 A schematic diagram of a flow chart of steps for determining spatial operation characteristics provided in this embodiment;

[0054] Figure 6 A schematic diagram of a process for training a fault classification model provided in this embodiment;

[0055] Figure 7 A structural block diagram of a battery fault diagnosis device provided in this embodiment;

[0056] Figure 8 This is a diagram of the internal structure of a computer device provided in this embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0058] The battery fault diagnosis method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. The terminal 102 communicates with the server 104 through the network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The computer device obtains the operating data of the target battery during operation; based on the operating data, the target operating characteristics of the target battery in at least one dimension are determined; based on the pre-trained fault classification model, the target fault type of the target battery is determined according to the target operating characteristics of the target battery in at least one dimension. The computer device can be either a terminal or a server. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.

[0059] In an exemplary embodiment, Figure 2 As shown, a battery fault diagnosis method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps S201 to S203.

[0060] S201 obtains operating data of the target battery during operation.

[0061] The operating data includes voltage, current, temperature and pressure channels. The target battery can be a lithium-ion battery.

[0062] S202 determines target operating characteristics of the target battery in at least one dimension based on the operating data.

[0063] In some embodiments, the operating data is preprocessed based on the operating data to obtain preprocessed operation; and target operating characteristics of the target battery in at least one dimension are determined based on the preprocessed operating data.

[0064] In some embodiments, the pre-processing method may include: the sampling frequency and timestamp of the running data of different channels are inconsistent. In order to complete the data alignment of the corresponding time points of each channel, it is necessary to define a unified time axis. Usually, the highest frequency channel is selected as the reference channel, and its time list is set as: {t1, t2, ..., tT}. For the non-reference channel x i , linear interpolation is performed using the following formula (1) to obtain the estimated value at time t. For missing values in the data, a forward filling strategy is used, that is, when xi When (t) is missing, fill it with the data of the previous moment: x i (t)=x i (t-Δt). Finally, the multi-channel data over the entire time series are combined into a matrix representation (2).

[0065] (1)

[0066] in, is the value at the time to be interpolated, x i (t k+1 ), x i (t k ) is the data of two adjacent time points, and t is the interpolation time. It should be noted that in this embodiment, t k <t<t k+1 .

[0067] (2)

[0068] in, is the value at the time to be interpolated, T is the number of time steps, and C is the number of channels.

[0069] It should be noted that because the units and ranges of the data in each channel are different, directly inputting the model can easily lead to unstable training results. Therefore, the data in each channel needs to be standardized using the following formula (3).

[0070] (3)

[0071] in, is the original value, μi is the mean of the channel, and σi is the standard deviation of the channel.

[0072] In some embodiments, the operating data is divided into time series based on a preset time length to obtain period operating data for at least one period; for each period, the period operating characteristics of the target battery in at least one dimension of the period are determined based on the period operating data; for each dimension, the period operating characteristics of different period in the dimension are feature fused to obtain the target operating characteristics of the target battery in the dimension.

[0073] Specifically, battery failure is not common, and its characteristics are usually manifested in a very short time window. Dividing the full-length sequence into multiple sliding window samples can enhance the ability to cope with local sequence characteristics. Define the window length as w and the sliding step as s, then the data corresponding to the nth sample is: X (n) =[ (tn), (tn+1),…, (tn+w-1)]. Where, This splitting method can increase the sample size and maintain the learning dimension at the same time. Regarding the label given, if the original data has a fault label y(t) at each moment, the window label output can be constructed by the majority voting method: y (n) =mode(y(tn),…,y(tn+w-1)). Where y(t) is the label of the nth sliding window, and mode is the most frequently occurring label value.

[0074] S203 determines a target fault type of the target battery based on a pre-trained fault classification model and target operating characteristics of the target battery in at least one dimension.

[0075] In some embodiments, the target operating characteristics of the target battery in at least one dimension are input into a pre-trained fault classification model, and the fault classification model analyzes the target operating characteristics of the target battery in at least one dimension to obtain the target fault type of the target battery.

[0076] The above-mentioned battery fault diagnosis method, device, computer equipment and storage medium obtain the operating data of the target battery during operation; determine the target operating characteristics of the target battery in at least one dimension based on the operating data; and determine the target fault type of the target battery based on the target operating characteristics of the target battery in at least one dimension based on a pre-trained fault classification model, which can improve the accuracy, robustness and interpretability of battery fault warning.

[0077] Figure 3 This is a flow chart illustrating the steps for determining period operation characteristics in one embodiment. In this embodiment, period operation characteristics in at least one dimension include spatiotemporal operation characteristics and operation distribution characteristics; spatiotemporal operation characteristics include time series operation characteristics and spatial operation characteristics. Therefore, this embodiment provides an optional method for determining period operation characteristics, including the following steps:

[0078] S301 determines the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension within the time period based on the time period operation data within the time period based on the feature extraction model.

[0079] Among them, the feature extraction model is trained based on the deep learning model Transformer.

[0080] In some embodiments, based on the timing extraction network in the feature extraction model, timing feature extraction is performed on the period operation data under the period to obtain the timing operation characteristics of the target battery in the timing dimension under the period; and based on the spatial extraction network in the feature extraction model, price control feature extraction is performed on the period operation data under the period to obtain the spatial operation characteristics of the target battery in the spatial dimension under the period.

[0081] Specifically, the period operation data under the period is input into the feature extraction model; the timing extraction network in the feature extraction model performs timing feature extraction on the period operation data under the period, and obtains the timing operation characteristics of the target battery in the timing dimension under the period; the space extraction network in the feature extraction model performs price control feature extraction on the period operation data under the period, and obtains the spatial operation characteristics of the target battery in the spatial dimension under the period.

[0082] S302 determines at least one operation distribution value of the target battery in the time period according to the time period operation data in the time period.

[0083] The operation distribution value includes at least one of the mean, variance, skewness, kurtosis and extreme value of the operation data of the time period.

[0084] In some embodiments, considering that the distribution form and instantaneous changes of the battery signal can be intuitively reflected from statistics, the mean, variance, skewness, kurtosis and extreme value are calculated for each channel within a sliding window.

[0085] For example, the mean and variance are determined according to the following formula (4). The mean μc reflects the signal level, and the variance This reveals the fluctuation strength of the channel value.

[0086] (4)

[0087] Among them, x t,c represents the sensor reading of the cth channel at the tth time step, where T is the window length.

[0088] For example, the skewness and kurtosis are determined according to the following formula (5). c Skewness describes the asymmetry of a distribution, Kurt c Kurtosis measures the density of the tail, and both can reveal unusual signal patterns.

[0089] (5)

[0090] Among them, x t,c represents the sensor reading of the cth channel at the tth time step, where T is the window length.

[0091] For example, the maximum value, minimum value, and extreme value are determined according to the following formula (6). The maximum value (max), minimum value (min), and extreme value (Range) can directly reflect the sudden peak or drop amplitude.

[0092] (6)

[0093] in, is the maximum value of the channel c value in the sliding window, The minimum value of the channel c value in the sliding window, Range c The range is the difference between the maximum and minimum values, which is used to measure the local fluctuation amplitude and identify mutations and anomalies.

[0094] S303 determines the operation distribution characteristics of the target battery in the data distribution dimension in the time period according to each operation distribution value.

[0095] In some embodiments, according to the following formula (7), the running distribution values are sequentially concatenated to obtain a statistical feature vector.

[0096] (7)

[0097] Wherein, C is the number of channels, and the total length is 7C. It should be noted that, in this embodiment, splicing and fusion processing can also be performed on the temporal operation features, spatial operation features, and operation distribution features.

[0098] This embodiment can more accurately determine the time period operation characteristics.

[0099] Figure 4 Schematic diagram of a flow chart of the steps for determining the characteristics of a timing operation in one embodiment. This embodiment provides an optional method for determining the characteristics of a timing operation, including the following steps:

[0100] S401 obtains a preset timing code in a time period.

[0101] The preset time series code is used to represent the time period position of the time period operation data in the operation data.

[0102] In some embodiments, the input projection and position encoding are set to the original sliding window data matrix Among them, x t,c represents the sensor reading of the cth channel at the tth time step, T is the window length, and C is the number of channels. According to the following formula (8), The d-dimensional channel data is projected into the d-dimensional feature space. Since the self-attention in the subsequent operations of this embodiment does not have the ability to perceive the order, the sine / cosine temporal code is injected into each time step according to the following formula (9).

[0103] (8)

[0104] in, and are projection weights and biases respectively. This step helps to represent the original signal in a higher dimension.

[0105] (9)

[0106] Among them, P Et,2iCharacterize the sinusoidal temporal code, P Et,2i+1 Represents the cosine time series code, t represents the time period, and i represents the code position.

[0107] S402 uses the sum of the first vector corresponding to the period operation data and the preset time series code as the second vector of the period operation data.

[0108] The first vector is a vector obtained by performing dimensionality reduction processing on the time period operation data based on preset projection weights and biases.

[0109] S403 determines the third vector of the time period operation data based on the multi-head attention mechanism and the second vector and the preset attention weight.

[0110] Among them, the preset attention weight is determined based on the query weight, key weight and value weight; the query weight is the product value between the second vector and the preset query matrix; the key weight is the product value between the second vector and the preset key matrix; the value weight is the product value between the second vector and the preset value matrix.

[0111] In some embodiments, the multi-head self-attention mechanism: Linearly map to query (Q), key (K) and value (V) spaces respectively: Q= W Q , K= W K ,V= W V .in, , d k =d / h (h is the number of heads). According to the following formula (10), the scaled dot product attention weight is calculated. The output of each head is concatenated according to the feature dimension and mapped through the matrix Restoration Dimension: MHA (T) =[head1;…;headh],W O ∈R (T×d) .

[0112] (10)

[0113] in, Measure the similarity of each time step, divided by Prevent the gradient from being too small after the dimension is too large, and then normalize it.

[0114] S404 determines the timing operation characteristics of the target battery in the timing dimension within the time period according to the third vector and the preset time length.

[0115] The timing operation characteristics represent the operation characteristics of the target battery per unit time within a time period.

[0116] In some embodiments, according to the following formula (11), the third vector is subjected to residual connection and layer normalization; then, according to the following formula (12), the residual connection and layer normalization results are input into the feedforward network, and finally, according to the third vector and the preset duration, the timing operation characteristics of the target battery in the timing dimension under the time period are determined by the following formula (13), which integrates the global timing information of the entire window and facilitates subsequent feature fusion and classification.

[0117] (11)

[0118] Among them, "+" is the ResNet-style residual connection, which ensures the gradient flow, and then the layer normalization stabilizes the training.

[0119] (12)

[0120] in, 、 , bias b1, b2 and ReLU together form a two-layer fully connected network to enhance nonlinear expression.

[0121] (13)

[0122] Among them, z (T) It is the timing operation feature.

[0123] This embodiment can more accurately determine the timing operation characteristics.

[0124] Figure 5 This is a flow chart of the steps for determining spatial operation characteristics in one embodiment. This embodiment provides an optional method for determining spatial operation characteristics, including the following steps:

[0125] S501 obtains a preset spatial code in a time period.

[0126] The preset spatial code is used to represent the channel position of the period operation data in the operation data.

[0127] In some embodiments, the input projection is encoded with the channel position, and the channel vector is extracted for each time step t: xt=[x t,1 ,…,x t,C ]∈R C . Doing linear projection gives: H t (S) =x t W proj +b proj ∈R 1×d Where W proj 、b proj Shares W with Chrono Tower proj 、b projIn order to distinguish different channels, channel position coding is introduced according to the following formula (14).

[0128] (14)

[0129] S502 uses the sum of the first vector corresponding to the time period operation data and the preset spatial code as the fourth vector of the time period operation data; the first vector is a vector obtained by performing dimensionality reduction processing on the time period operation data based on the preset projection weight and bias.

[0130] S503 is based on the multi-head attention mechanism and determines the fifth vector of the time period operation data according to the fourth vector and the preset attention weight; the preset attention weight is determined based on the query weight, key weight and value weight; the query weight is the product value between the four vectors and the preset query matrix; the key weight is the product value between the fourth vector and the preset key matrix; the value weight is the product value between the fourth vector and the preset value matrix.

[0131] It should be noted that the process of determining the fifth vector of the time period operation data based on the fourth vector and the preset attention weight is similar to the process of determining the timing operation characteristics of the target battery in the timing dimension under the time period based on the third vector and the preset duration in S403 in the above embodiment. This implementation will not be repeated here.

[0132] S504 determines the spatial operation characteristics of the target battery in the spatial dimension during the time period according to the fifth vector and the preset time length.

[0133] Among them, the spatial operation characteristics represent the operation characteristics of the target battery per unit time within a time period.

[0134] In some embodiments, residual connection and layer normalization are performed on the fifth vector; the residual connection and layer normalization results are input into the feedforward network, and finally, based on the fifth vector and the preset duration, the spatial operation characteristics of the target battery in the spatial dimension under the time period are determined by the following formula (15). This vector comprehensively reflects the spatial coupling relationship between the channels at the same time.

[0135] (15)

[0136] Among them, z (T) Run features for the space.

[0137] This embodiment can more accurately determine the spatial operation characteristics.

[0138] Figure 6 Schematic diagram of a process for training a fault classification model in one embodiment. This embodiment provides an optional method for training a fault classification model, including the following steps:

[0139] S601 determines the predicted fault type of the sample battery according to the sample operation characteristics of the sample battery in at least one dimension based on the fault classification model to be trained for each training iteration process.

[0140] S602 determines the loss value of the sample battery based on a preset loss function and the predicted fault type and the corresponding actual fault type of the sample battery.

[0141] Among them, the loss function includes the focus loss function and the dice loss function; the focus loss function is used to measure the balance between different fault types in the fault classification model; the dice loss function is used to measure the similarity between the predicted fault type and the actual fault type.

[0142] In some embodiments, in order to minimize classification error, improve the ability to identify a few fault types, and take into account the unbalanced sample distribution, the present invention introduces a hybrid form of weighted focal loss function (FocalLoss) and dice loss function (Dice Loss) on top of the traditional cross entropy loss: .

[0143] The focal loss function is Where γ>0 is the modulation coefficient, which is used to reduce the weight of "easy to classify" samples and increase the sensitivity to minority classes. The dice loss function is defined as: . Among them, ϵ is a small constant that prevents the denominator from being zero. The optimization objective function is: .

[0144] in, is a composite regularization term for leaf node weights to prevent overfitting.

[0145] S603 determines the contribution of the sample operation feature in the fault type prediction process for the sample operation feature of each dimension.

[0146] In some embodiments, to enhance interpretability and to directly guide the model to focus on key features during training, a SHAP regularization term is added. This constraint forces the feature importance distribution of each tree to be consistent with the global one, suppressing the over-reliance of a few decision trees on abnormal features, and improving model stability and interpretability. This is shown in Formula (16).

[0147] (16)

[0148] in, is the average SHAP value of the t-th tree on feature j, is the global SHAP mean of the entire model on feature j, and μ is the regularization coefficient.

[0149] S604 determines the model score of the untrained fault classification model in this training iteration process based on the loss value of the sample battery, the corresponding contribution of the sample operation characteristics of each dimension, and the preset regularization value corresponding to this training iteration process.

[0150] In some embodiments, after introducing the SHAP-driven regularization term, the final optimization objective function of the improved XGBoost can be expressed as the following formula (17):

[0151] (17)

[0152] in, It is a hybrid loss function that combines weighted Focal Loss and Dice Loss to deal with the problem of class imbalance. t ) is the regularization term of the t-th tree, usually including L1 and L2 regularization, which is used to prevent the model from overfitting. represents the average SHAP value of the j-th feature in the t-th tree, Among all trees The global average SHAP value of each feature, μ is the weight coefficient of the SHAP regularization term, which is used to control the influence of this term in the total loss.

[0153] In step S605 , if the model score does not reach the preset score threshold, the model parameters of the fault classification model are adjusted based on the model score until the model score reaches the preset score threshold.

[0154] It should be noted that this embodiment fully utilizes multi-channel information to enhance fault perception capabilities: This invention fully integrates multi-channel sensor data such as voltage, current, temperature, and pressure. Through standardization and time alignment, it preserves the dynamic evolution characteristics of multi-source signals, significantly enhancing the ability to perceive battery operating conditions under complex operating conditions. It introduces a dual-tower Transformer architecture to enhance spatiotemporal feature modeling capabilities: By splitting the Transformer encoder into a temporal tower and a spatial tower, this invention can capture local temporal dependencies and multi-channel spatial coupling relationships, respectively, overcoming the limitations of traditional single-tower models in modeling sequences and inter-channel interactions. It integrates statistical features with deep representations to improve expressiveness and model robustness: Based on deep learning features, this invention introduces multiple statistical indicators within a sliding window (such as mean, variance, skewness, kurtosis, etc.), effectively compensating for the deep model's insensitivity to numerical distributions and enabling the coordinated expression of prior features and deep features. Introducing a customizable loss function and SHAP regularization mechanism to balance performance and interpretability: By improving XGBoost by fusing a hybrid loss function that combines weighted FocalLoss and Dice Loss, and introducing a SHAP value-driven feature regularization term, this invention significantly improves the ability to identify small sample / difficult-to-classify faults, while enhancing the model's interpretability and robustness.

[0155] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0156] Based on the same inventive concept, embodiments of the present application also provide a battery fault diagnosis device for implementing the aforementioned battery fault diagnosis method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more battery fault diagnosis device embodiments provided below can be found in the above-described limitations of the battery fault diagnosis method and will not be further elaborated here.

[0157] In an exemplary embodiment, Figure 7 As shown, a battery fault diagnosis device is provided, comprising: an acquisition module 10, a determination module 11 and a classification module 12, wherein:

[0158] An acquisition module 10 is used to acquire operating data of a target battery during operation;

[0159] A determination module 11 is configured to determine target operating characteristics of a target battery in at least one dimension based on the operating data;

[0160] The classification module 12 is configured to determine a target fault type of the target battery based on a pre-trained fault classification model and according to target operating characteristics of the target battery in at least one dimension.

[0161] In some embodiments, the determination module 11 is also used to divide the operation data into time series based on a preset time length to obtain time period operation data for at least one time period; for each time period, based on the time period operation data for the time period, determine the time period operation characteristics of the target battery in at least one dimension of the time period; for each dimension, perform feature fusion on the time period operation characteristics of different time periods in the dimension to obtain the target operation characteristics of the target battery in the dimension.

[0162] In some embodiments, the determination module 11 is also used to determine the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension of the time period based on the time period operation data in the time period based on the feature extraction model; the feature extraction model is obtained based on the deep learning model Transformer training; and, based on the time period operation data in the time period, determine at least one operation distribution value of the target battery in the time period; the operation distribution value includes at least one of the mean, variance, skewness, kurtosis and extreme value of the time period operation data; based on each operation distribution value, determine the operation distribution characteristics of the target battery in the data distribution dimension in the time period.

[0163] In some embodiments, the determination module 11 is also used to perform time series feature extraction on the time period operation data under the time period based on the time series extraction network in the feature extraction model, and obtain the time series operation characteristics of the target battery in the time period in the time series dimension; and to perform price control feature extraction on the time period operation data under the time period based on the space extraction network in the feature extraction model, and obtain the spatial operation characteristics of the target battery in the space dimension under the time period.

[0164] In some embodiments, the determination module 11 is also used to obtain a preset timing code under a time period; the preset timing code is used to characterize the time period position of the time period operation data in the operation data; the sum of the first vector corresponding to the time period operation data and the preset timing code is used as the second vector of the time period operation data; the first vector is a vector obtained by dimensionality reduction processing of the time period operation data based on the preset projection weight and bias; based on the multi-head attention mechanism, the third vector of the time period operation data is determined according to the second vector and the preset attention weight; the preset attention weight is determined based on the query weight, key weight and value weight; the query weight is the product value between the second vector and the preset query matrix; the key weight is the product value between the second vector and the preset key matrix; the value weight is the product value between the second vector and the preset value matrix; according to the third vector and the preset time length, the timing operation characteristics of the target battery in the timing dimension under the time period are determined; the timing operation characteristics characterize the operation characteristics of the target battery per unit time in the time period.

[0165] In some embodiments, the battery fault diagnosis device further includes: a model training module, which is used to determine, for each training iteration process, based on the fault classification model to be trained and the sample operation characteristics of the sample battery in at least one dimension, the predicted fault type of the sample battery; based on a preset loss function, determine the loss value of the sample battery according to the predicted fault type of the sample battery and the corresponding true fault type; the loss function includes a focus loss function and a dice loss function; the focus loss function is used to measure the balance between different fault types in the fault classification model; the dice loss function is used to measure the similarity between the predicted fault type and the true fault type; for the sample operation characteristics of each dimension, determine the contribution of the sample operation characteristics in the fault type prediction process; determine the model score of the untrained fault classification model in this training iteration process according to the loss value of the sample battery, the corresponding contribution of the sample operation characteristics of each dimension, and the preset regularization value corresponding to this training iteration process; if the model score does not reach the preset score threshold, adjust the model parameters of the fault classification model based on the model score until the model score reaches the preset score threshold.

[0166] Each module in the battery fault diagnosis device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0167] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a battery fault diagnosis method is implemented.

[0168] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0169] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0170] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0171] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0172] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0173] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0174] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.

[0175] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0176] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A battery fault diagnosis method, characterized in that: The method comprises: Obtaining the operating data of the target battery during operation; determining, based on the operating data, target operating characteristics of the target battery in at least one dimension; Based on a pre-trained fault classification model, a target fault type of the target battery is determined according to target operating characteristics of the target battery in at least one dimension.

2. The method according to claim 1, characterized in that Determining, based on the operating data, target operating characteristics of the target battery in at least one dimension includes: Dividing the operation data into time series based on a preset time period to obtain time period operation data for at least one time period; For each time period, determining a time period operation characteristic of the target battery in at least one dimension in the time period according to the time period operation data in the time period; For each dimension, feature fusion is performed on the time period operation features in different time periods on the dimension to obtain the target operation features of the target battery on the dimension.

3. The method according to claim 2, characterized in that The period operation characteristics in the at least one dimension include spatiotemporal operation characteristics and operation distribution characteristics; The determining, based on the period operation data of the period, the period operation characteristics of the target battery in at least one dimension of the period, includes: Based on a feature extraction model, according to the period operation data in the period, determining the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension in the period; the feature extraction model is obtained by training based on a deep learning model Transformer; and Determining at least one operation distribution value of the target battery in the period according to the period operation data in the period; the operation distribution value includes at least one of the mean, variance, skewness, kurtosis and extreme value of the period operation data; An operation distribution feature of the target battery in the data distribution dimension during the time period is determined according to each of the operation distribution values.

4. The method according to claim 3, characterized in that The spatiotemporal operation characteristics include time sequence operation characteristics and spatial operation characteristics; the feature extraction model is based on the period operation data of the period to determine the spatiotemporal operation characteristics of the target battery in the spatiotemporal dimension of the period, including: Based on the time series extraction network in the feature extraction model, time series feature extraction is performed on the time period operation data in the time period to obtain the time series operation feature of the target battery in the time period in the time series dimension; and Based on the space extraction network in the feature extraction model, price control features are extracted from the period operation data in the period to obtain the spatial operation features of the target battery in the spatial dimension in the period.

5. The method according to claim 4, characterized in that The step of extracting time series features from the time period operation data in the time period based on the time series extraction network in the feature extraction model to obtain the time series operation features of the target battery in the time series dimension in the time period includes: Obtaining a preset time sequence code for the time period; the preset time sequence code is used to represent the time period position of the time period operation data in the operation data; The sum of the first vector corresponding to the period operation data and the preset time series code is used as the second vector of the period operation data; the first vector is a vector obtained by performing dimensionality reduction processing on the period operation data based on preset projection weights and biases; Based on the multi-head attention mechanism, a third vector of the time period operation data is determined according to the second vector and a preset attention weight; the preset attention weight is determined based on the query weight, key weight, and value weight; the query weight is the product value of the second vector and a preset query matrix; the key weight is the product value of the second vector and a preset key matrix; and the value weight is the product value of the second vector and a preset value matrix; According to the third vector and the preset duration, a timing operation characteristic of the target battery in a timing dimension in the time period is determined; the timing operation characteristic represents an operation characteristic of the target battery per unit time in the time period.

6. The method according to any one of claims 1 to 5, characterized in that The fault classification model is trained in the following way: For each training iteration, based on the fault classification model to be trained, the predicted fault type of the sample battery is determined according to the sample operation characteristics of the sample battery in at least one dimension; Based on a preset loss function, the loss value of the sample battery is determined according to the predicted fault type and the corresponding actual fault type of the sample battery; the loss function includes a focus loss function and a dice loss function; the focus loss function is used to measure the balance between different fault types in the fault classification model; the dice loss function is used to measure the similarity between the predicted fault type and the actual fault type; Determine the contribution of the sample operation feature in the fault type prediction process for each dimension of the sample operation feature; Determine the model score of the untrained fault classification model in this training iteration process based on the loss value of the sample battery, the corresponding contribution of the sample operation characteristics of each dimension, and the preset regularization value corresponding to this training iteration process; In a case where the model score does not reach a preset score threshold, model parameters of the fault classification model are adjusted based on the model score until the model score reaches the preset score threshold.

7. A battery fault diagnosis device, characterized in that: The device comprises: An acquisition module is used to obtain the operating data of the target battery during operation; a determination module, configured to determine a target operating characteristic of the target battery in at least one dimension based on the operating data; A classification module is used to determine a target fault type of the target battery based on a pre-trained fault classification model and according to target operating characteristics of the target battery in at least one dimension.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Vehicle battery temperature fault diagnosis method and device, electronic equipment, medium and product

    CN121299479A

  • Vehicle battery temperature fault diagnosis method and device, electronic equipment, medium and product

    CN121299479B

  • Battery fault diagnosis method and device, electronic equipment and storage medium

    CN121578130A

  • Large model-lightweight model collaborative battery fault diagnosis method and system

    CN121633859A

  • Battery fault diagnosis method and system based on large model-lightweight model cooperation

    CN121633859B