Power battery health state anomaly detection method based on machine learning

Through the MtsNet abnormality detection model, the dynamic mode and coupling problems of power batteries are handled using the squirt response time modeling and variable relationship learning modules, and the problem of insufficient detection capabilities of power batteries in the existing technology is solved, and the accuracy of abnormality detection results is achieved.

CN120142955AActive Publication Date: 2025-06-13WEIFANG UNIVERSITY

Patent Information

Application Number
CN202510605883.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-06-13
Estimated Expiration
2045-05-12

AI Technical Summary

Technical Problem

The prior art is difficult to effectively detect abnormalities in early degradation of power batteries and complex and changeable working conditions. Traditional methods have poor generalization capabilities, are sensitive to environmental changes and rely on artificially set thresholds or rules.

Method used

The MtsNet anomaly detection model is proposed, including the slurred response time modeling module, the variable relationship learning module and the abnormality detection module. The dynamic mode is processed through slurred response modeling, the variable relationship learning module handles dynamic coupling problems, and the abnormality detection module integrates the deviation score to calculate the final anomaly score.

Benefits of technology

Accurate abnormality detection of the health status of the power battery is realized, and abnormalities in early degradation and complex operating conditions can be identified, improving the modeling ability of nonlinear and strongly coupled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120142955A_ABST
    Figure CN120142955A_ABST
Patent Text Reader

Abstract

The invention provides a power battery health state anomaly detection method based on machine learning, and relates to the field of data anomaly detection. The invention provides an MtsNet anomaly detection model which comprises a perturbation response time modeling module, a variable relation learning module and an anomaly detection module, specifically, the perturbation response time modeling module is used for processing a dynamic mode in data, the variable relation learning module is used for processing a dynamic coupling problem of the data, and the anomaly detection module is used for detecting the anomaly of the data. The anomaly detection module is used for integrating the two deviation scores to obtain a final power battery health state anomaly score, and all the modules are matched with one another to achieve anomaly detection of the power battery health state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of anomaly detection, and particularly relates to a method for detecting anomalies in the state of health of power batteries based on machine learning. Background Art

[0002] With the development of new energy vehicles, as the core component, the performance and lifespan of power batteries directly affect the safety, reliability, and user experience of the entire vehicle. However, during actual operation, the battery system is affected by various complex factors, such as temperature fluctuations, charge and discharge frequencies, etc., resulting in a gradual decline in performance and even safety accidents. Conducting research on real-time monitoring and anomaly detection of the battery state of health has important practical significance. On the one hand, potential failure risks can be identified in advance to achieve early warning and optimized operation and maintenance; on the other hand, it also provides technical support for extending battery life and improving energy utilization efficiency. Traditional methods based on physical modeling have gradually shown deficiencies because it is difficult to adapt to the diverse, non-linear, and strongly coupled characteristics of batteries.

[0003] Currently, common battery anomaly detection methods mainly include model-driven methods and signal processing methods. Model-driven methods estimate the state of health by establishing an electrochemical or equivalent circuit model of the battery and combining actual operation data; signal processing methods focus on extracting characteristic indicators from sensor data such as voltage and judging anomalies. Such methods generally have problems such as poor generalization ability, sensitivity to environmental changes, and the need for a large amount of domain knowledge to participate in modeling, and it is difficult to adapt to complex and changing working conditions. In addition, traditional methods usually rely on artificially setting thresholds or rules, and cannot effectively capture the weak characteristics of early battery degradation, and have limited detection capabilities for sudden or hidden anomalies.

[0004] Machine learning technology has powerful data modeling and feature learning capabilities and has received extensive attention in the state monitoring and anomaly identification of power batteries in recent years. By mining historical operation data, machine learning algorithms can automatically extract potential patterns to achieve anomaly detection without the need for artificially set rules. For example, support vector machines and random forests can perform classification predictions based on labeled fault data; in scenarios where anomaly labels are actually lacking, semi-supervised or unsupervised methods such as autoencoders, isolation forests, and clustering algorithms can also effectively capture abnormal behaviors. At the same time, combining deep learning frameworks enhances the modeling ability for time series data. Currently, battery anomaly detection methods based on machine learning show advantages in terms of accuracy, generalization, etc. Summary of the Invention

[0005] The present invention provides a method for detecting anomalies in the state of health of power batteries based on machine learning. For the diverse, non-linear, and strongly coupled battery state-of-health data, an MtsNet anomaly detection model is proposed, which consists of a perturbation response time modeling module, a variable relationship learning module, and an anomaly detection module.

[0006] The technical solution adopted by the present invention to achieve the above object specifically includes the following steps: S1. Collect the health state data of the power battery and preprocess the collected data; S2. Normalize the preprocessed data and divide the data set; S3. Construct a perturbation response time modeling module for processing dynamic patterns in the data. The specific steps are as follows: S31. Input the normalized health state data sequence of the power battery to construct a perturbation window; S32. Perform linear response modeling, design a dynamic dissipation-driven weight strategy to calculate the linear response term ; S33. Perform second-order non-linear perturbation modeling, propose a multi-order trajectory non-linear weight strategy to calculate the second-order non-linear perturbation term , fuse and to obtain a response estimate value, and calculate the non-linear interaction residual score ; S4. Construct a variable relationship learning module for processing the dynamic coupling problem of the data. The specific steps are as follows: S41. Input a subsequence of the normalized health state data sequence of the power battery to perform 1D dilated convolution operation, calculate the non-uniform frequency projection transformation, and propose a set of non-integer modulation frequencies , and obtain the complex frequency representation through self-attention ; S42. Split the complex frequency representation into real and imaginary parts for processing, and calculate the finally interaction-enhanced time-domain features through residual connection and normalization methods; S43. Construct a sine prototype matrix, calculate the minimum distance between its finally interaction-enhanced time-domain features and the sine prototype vector, and obtain the relationship deviation score ; S5. Construct an anomaly detection module for integrating the two deviation scores to obtain the final anomaly score .

[0007] Preferably, in S1, when collecting the health state data of the power battery, it includes cell-level monitoring parameters, system-level operation parameters, and environmental parameters. Among them, the cell-level monitoring parameters include voltage data, current data, and internal resistance change data, the system-level operation parameters include cycle data, energy efficiency data, and fault code data, and the environmental parameters include environmental temperature data and environmental humidity data. Calculate the mean value of the health state data of the power battery to fill in the missing values. The specific formula is: ; Wherein, is the mean value to be filled, is the number of missing values, are non-missing values.

[0008] Preferably, in the step S2, the preprocessed power battery health state data is normalized using a single vector, and the training set and the test set are divided according to a ratio. The specific formula is: ; Wherein, is the preprocessed power battery health state data, is the number of the preprocessed power battery health state data, is the th data of the preprocessed power battery health state data, is the normalized power battery health state data.

[0009] Preferably, in the step S3, in S31, the normalized power battery health state data sequence is input, where is the power battery health state data at the current time point, is the number of variables of the power battery health state data. A perturbation window corresponding to the current time point is constructed, and the length of the past time window is defined as . For each current time point , the corresponding historical perturbation window is .

[0010] Preferably, the concept of "perturbation window" is introduced to construct a historical observation window centered on the current time point, and cooperate with the normalized data to form a high-dimensional time series matrix, providing clear time series semantics for subsequent dynamic modeling, ensuring the integrity and consistency of the historical dependence of the modeling, accurately focusing on key historical segments through the time window mechanism, and improving the model's ability to depict the perturbation of non-stationary signals.

[0011] Preferably, in the step S3, in S32, linear response modeling is performed. The state difference from the time point to is defined as , representing the historical perturbation intensity, where is the power battery health state data at the current time point, is the number of variables of the power battery health state data. A dynamic dissipation-driven weight strategy is designed. The specific formula is: ; Wherein, For traversing the variable dimensions of all power battery health state data, there are a total of ones, is the square of the perturbation intensity from the historical point to the current point of the power battery health state data on the th variable, representing the magnitude of potential energy. is the component of the state difference on the th variable dimension of the power battery health state data. is the sine wave fluctuation frequency. is the phase shift. Then, according to the historical points of the power battery health state data and the corresponding periodic drive enhanced dissipative potential energy difference linear response weight , a weighted sum is constructed. The specific formula is: ; In the formula, is the length of the past time window, is the power battery health state data at the historical moment , is the corresponding historical perturbation window for each current time point , is the linear response term.

[0012] Preferably, a periodic drive enhanced dissipative potential energy difference linear response strategy is designed, embedding the historical perturbation intensity with a sine frequency modulation mechanism, simulating the physical dissipation process, introducing the "potential energy" concept into the battery state sequence modeling, enhancing the recognition and weighting ability of periodic change patterns, so that the linear response term not only reflects the numerical change but also includes the "phase - amplitude" dynamic weight modulation, improving the physical rationality and prediction accuracy of the modeling.

[0013] Preferably, in S3 and S33, second - order nonlinear perturbation modeling is performed, and a multi - order trajectory nonlinear weight strategy is proposed to measure the coupling strength of the historical point of any power battery health state data to the power battery health state data at the current time point . The specific formula is: ; In the formula, is the length of the past time window, , , are the power battery health state data at the historical moments , , , is the order, is the exponential function, is the square of the two - norm, is the one - norm, To prevent a constant from being divided by zero, all products between the following are retained , are as follows. The specific formula is: ; In the formula, is the multi-order trajectory normalized non-linear interaction weight, is the dot product operation, is the historical perturbation window corresponding to each current time point , is the second-order non-linear perturbation term, which is used for time response estimation and fuses the linear response term and the second-order non-linear perturbation term to obtain the response estimated value of the power battery health state data and calculate the non-linear interaction residual score. The specific formula is: ; ; In the formula, is the response estimated value, is the non-linear interaction deviation score.

[0014] Preferably, a multi-order trajectory non-linear weight strategy is proposed. A coupling strength matrix is constructed through the dot product operation, a nested structure of the second norm and the first norm is introduced to construct the non-linear interaction term, and the linear and non-linear responses are fused for residual modeling, effectively capturing non-linear and sudden state transition behaviors, such as deterioration mutations or complex fault co-evolutions, so that the model not only depends on the average behavior but can also sensitively respond to "outliers" or "hidden risks".

[0015] Preferably, in S4 and S41, a subsequence of the normalized power battery health state data sequence is input , where is the batch size, is the time step length, is the number of variables of the power battery health state data. A 1D dilated convolution operation is performed on the channels of each variable dimension. The specific formula is: ; In the formula, is the dilated convolution operation, is the dilation rate. Then, a non-uniform frequency projection transformation is performed, and a set of non-integer modulation frequencies is proposed. The specific formula for the non-uniform frequency projection transformation is defined as: ; ; In the formula, , They are the scaling coefficients for controlling the logarithmic frequency components and the scaling coefficients for controlling the square root frequency components, respectively. , is an integer index representing the position of the th frequency component, is the total number of frequency components used, is the result of dilated convolution, is the non-resonant rotation basis function for projecting the signal onto non-integer modulation frequencies , is the imaginary unit. Self-attention is performed on the variable dimension in the non-uniform frequency projection transformation. The specific formula is: ; In the formula, is the activation function, is the transpose of the non-uniform frequency projection transformation, is the complex frequency representation.

[0016] Preferably, by combining 1D dilated convolution with the frequency domain projection strategy of non-integer modulation frequencies, a non-resonant rotation basis function is proposed to map the time series signal to the non-uniform frequency spectrum space, and a complex frequency representation is constructed, endowing the model with the ability of frequency representation across variable dimensions, enabling it to still identify fine-grained modulation features in the high-dimensional state, enhancing the modeling ability of asynchronous coupling between variables, and laying a foundation for subsequent frequency domain interaction enhancement.

[0017] Preferably, in S4, S42, the complex frequency representation is split into the real part and the imaginary part. The specific formula is: ; In the formula, is the real part of is the imaginary part of is the imaginary unit. Then a real vector is constructed. is the complex frequency representation. The specific formula is: ; In the formula, is the th sample, the is the spectrum vector of the power battery health state data variable, is the th sample, the real part response of the th sample, the th power battery health state data variable on all complex frequency representation channels, The imaginary response of the power battery health status data variable on all complex frequency channels is used to map the spectrum vector to the time domain through a shared linear mapping. The specific formula is: ; In the formula, is the shared linear mapping matrix, The power battery health state sequence is reconstructed from the complex frequency representation, and the reconstruction result is restored to the dimension to obtain the power battery health state sequence of the merged dimension ,in, is the batch size, is the time step length, and finally the time domain features after interaction enhancement are obtained through residual connection and normalization method. The specific formula is: ; In the formula, is the layer normalization operation, is a subsequence of the normalized power battery health status data sequence, It is the time domain feature after the final interaction enhancement.

[0018] Preferably, the complex frequency signal is split into real and imaginary parts, and a shared linear mapping matrix is ​​introduced to realize the restoration from frequency domain to time domain. The residual connection and layer normalization are combined to perform interactive feature enhancement, improve the availability and characterization ability of frequency features, and achieve low-dimensional time domain alignment while maintaining the spectral information structure, effectively solving the "irreversible and uncontrollable" problems of traditional frequency domain mapping and improving the model's adaptability to small frequency changes.

[0019] Preferably, the sinusoidal prototype matrix is ​​constructed in S4 and S43, and the specific formula is: ; In the formula, is the first Line The sine basis vectors of the columns, is the time step length, is the number of variables of the power battery health status data. For each time step, the minimum distance between the final interactively enhanced time domain feature and the sinusoidal prototype vector is calculated. The specific formula is: ; In the formula, For the The sine basis vectors of the columns, is the time step The corresponding final interactively enhanced time domain features, To return the minimum distance operation, Score the relationship deviance, is the second norm.

[0020] Preferably, a sine prototype matrix is constructed as a template for the ideal variable response. The degree of deviation of the actual feature from the prototype is evaluated through minimum distance calculation to form a "relationship deviation score" for measuring the relative abnormality between variable behaviors. The pattern comparison of abnormal features is realized with the help of prototype vectors, which can not only capture absolute changes but also analyze whether the behavior trajectory "derails", enhancing the detection and judgment ability of weak systematic abnormalities.

[0021] Preferably, an anomaly detection module is constructed in S5 to integrate the two deviation scores and calculate the final abnormal score of the power battery health state at each time step through a weighted fusion method. The specific formula is: ; In the formula, is the relationship deviation score, is the non - linear interaction deviation score, is the activation function, is the final abnormal score of the power battery health state.

[0022] Preferably, a deviation score fusion strategy is designed. By combining the non - linear interaction score in S3 and the relationship deviation score in S4, and regulating the weighted mechanism through the activation function, an abnormal score of adaptive non - linear fusion is formed to realize the integrated decision - making of multi - source abnormal scores, taking into account the stability of frequency - domain modeling and the sensitivity of time - domain response. This mechanism improves the coverage and response ability of the model to different types of abnormalities.

[0023] In summary, due to the adoption of this technical solution, the beneficial effects of the present invention are as follows: The present invention proposes an MtsNet anomaly detection model applied to the scenario of power battery health state anomaly detection, including a perturbation response time modeling module, a variable relationship learning module, and an anomaly detection module. The perturbation response time modeling module is used to process the dynamic patterns in the data, the variable relationship learning module is used to process the dynamic coupling problem of the data, and the anomaly detection module is used to integrate the two deviation scores to obtain the final abnormal score of the power battery health state. The modules cooperate with each other to realize the anomaly detection of the power battery health state. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a flowchart of a method for detecting anomalies in the health state of a power battery based on machine learning.

[0025] Figure 2 is a diagram of the perturbation response time modeling module.

[0026] Figure 3 is a diagram of the variable relationship learning module.

[0027] Figure 4 It is the structure diagram of the MtsNet anomaly detection model.

[0028] Figure 5 It is the effect diagram of the anomaly detection of the power battery health state. Specific implementation manners

[0029] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0030] Please refer to Figures 1 - 5 , the present invention provides a technical solution: a method for anomaly detection of the power battery health state based on machine learning, by constructing a perturbation response time modeling module for processing dynamic patterns in data, a variable relationship learning module for processing the dynamic coupling problem of data, and an anomaly detection module for integrating two deviation scores to obtain the final anomaly score of the power battery health state. The specific steps are as Figure 1 shown.

[0031] Construct an MtsNet anomaly detection model, and its structure diagram is as Figure 4 shown. The specific steps are as follows: S1. Collect the power battery health state data and preprocess the collected data.

[0032] Further, collect the power battery health state data, including cell-level monitoring parameters, system-level operation parameters, and environmental parameters. Among them, the cell-level monitoring parameters include voltage data, current data, and internal resistance change data. The system-level operation parameters include cycle data, energy efficiency data, and fault code data. The environmental parameters include environmental temperature data and environmental humidity data. Calculate the mean value of the power battery health state data to fill in the missing values. The specific formula is: ; In the formula, is the filled mean value, is the number of missing values, is the non-missing value.

[0033] S2. Normalize the preprocessed data and divide the data set.

[0034] Further, use a single vector to normalize the preprocessed power battery health state data and divide the training set and the test set according to a ratio of 7:3. The specific formula is: ; In the formula, is the data of the health state of the power battery after preprocessing, is the number of the data of the health state of the power battery after preprocessing, is the th data of the health state of the power battery after preprocessing, is the data of the health state of the power battery after normalization.

[0035] S31. Input the normalized data sequence of the health state of the power battery to construct a perturbation window.

[0036] Furthermore, construct a perturbation response time modeling module. As Figure 2 shown, input the normalized data sequence of the health state of the power battery , where is the data of the health state of the power battery at the current time point, is the number of variables of the data of the health state of the power battery, initially set to 8. Construct the perturbation window corresponding to the current time point, and define the length of the past time window as , initially set to 16. The historical perturbation window corresponding to each current time point is . The implementation code for step S31 is as follows: # Construct a perturbation window def construct_perturbation_windows(data, window_length=10): if isinstance(data, np.ndarray): data = torch.tensor(data, dtype=torch.float32) T, C = data.shape L = window_length # Initialize the perturbation window tensor perturb_windows = torch.zeros((T, L, C), dtype=torch.float32) for t in range(T): if t<L: # Boundary processing: Use the first t+1 data for reflection padding pad = data[0].repeat(L - t - 1, 1) window = torch.cat([pad, data[0:t+1]], dim=0) else: window = data[t-L+1:t+1] perturb_windows[t] = window return perturb_windows。

[0037] S32. Perform linear response modeling and design a dynamic dissipation-driven weight strategy , calculate the linear response term .

[0038] Furthermore, perform linear response modeling and define the state difference from time point to as , representing the historical perturbation intensity, where is the battery health state data at the current time point, is the number of variables of the battery health state data, initially set to 8, and design a dynamic dissipation-driven weight strategy , and the specific formula is: ; In the formula, is the variable dimension for traversing all battery health state data, with a total of ones, initially set to 8, is the square of the perturbation intensity from the historical point to the current point of the battery health state data on the th variable, representing the potential energy magnitude, is the component of the state difference on the th variable dimension of the battery health state data, is the sine wave frequency, is the phase shift. Then, based on the historical points of the battery health state data and the corresponding periodic drive-enhanced dissipative potential difference linear response weights , construct a weighted sum, and the specific formula is: ; In the formula, is the length of the past time window, initially set to 16, is the battery health state data at the historical time , is the historical perturbation window corresponding to each current time point , is the linear response term, and the implementation code for step S32 is: # Initialize the Linear Response Model class LinearResponseModel(torch.nn.Module): def __init__(self, input_dim, window_length): super(LinearResponseModel, self).__init__() self.C = input_dim self.L = window_length # Learnable sine frequency and phase parameters self.omega = torch.nn.Parameter(torch.rand(self.C)) # shape:[C] self.theta = torch.nn.Parameter(torch.rand(self.C)) # shape:[C] def forward(self, x, perturb_windows): T, L, C = perturb_windows.shape assert C == self.C # Expand the current state for broadcasting [T, 1, C] x_current = x.unsqueeze(1).expand(-1, L, -1) # State difference Δx_{t,l,c} delta_x = x_current - perturb_windows phi = delta_x ** 2 # Build sin(ω_c * l + θ_c) l_indices = torch.arange(1, L + 1, dtype=torch.float32).unsqueeze(1) omega_theta = self.omega * l_indices.T + self.theta sin_component = torch.sin(omega_theta) # Expand the shape for multiplication with phi sin_component = sin_component.unsqueeze(0) weights = phi * sin_component # Weighted sum: Multiply each weight by x_{t-l,c} response = weights * perturb_windows response_sum = response.sum(dim=[1, 2]) return response_sum

[0039] S33. Perform second-order non-linear perturbation modeling and propose a multi-order trajectory non-linear weight strategy , calculate the second-order non-linear perturbation term , fuse with to obtain the response estimate value and calculate the non-linear interaction residual score .

[0040] Furthermore, perform second-order non-linear perturbation modeling, propose a multi-order trajectory non-linear weight strategy, and measure the coupling strength of historical points of any power battery health state data to the power battery health state data at the current time point . The specific formula is: ; In the formula, is the length of the past time window, initially set to 16, , , are the power battery health state data at historical moments , , , is the order, initially set to 3, is the exponential function, is the square of the two-norm, is the one-norm, is a constant to prevent division by zero, initially set to 0.1, and then retain all , The product between is as follows. The specific formula is: ; In the formula, is the multi-order trajectory normalized non-linear interaction weight, is the dot product operation, For each current time point The corresponding historical perturbation window For the second-order nonlinear perturbation term, perform time response estimation and fuse the linear response term And the second-order nonlinear perturbation term , obtain the response estimated value of the power battery health state data, and calculate the nonlinear interaction residual score. The specific formula is: ; ; In the formula, Is the response estimated value, Is the nonlinear interaction deviation score. The implementation code for step S33 is: # Initialize the nonlinear perturbation modeling module class NonlinearResponseModel(nn.Module): def __init__(self, input_dim, window_length, max_order=3, epsilon=1e - 6): super(NonlinearResponseModel, self).__init__() self.C = input_dim self.L = window_length self.K = max_order self.epsilon = epsilon # Learnable nonlinear exponential control parameter alpha self.alpha = nn.Parameter(torch.tensor(0.1)) # Adjustable intensity control term def forward(self, x, perturb_windows, R_linear): T, L, C = perturb_windows.shape x_t = x.unsqueeze(1).expand(-1, L, -1) # Cumulative multiplication of the nonlinear trajectory intensity Ψ_{t,l}^{(k)} product_weights = torch.ones((T, L), dtype = torch.float32) for k in range(1, self.K + 1): # Squared L2 norm term + L1 norm term l2 = torch.norm(x_t - perturb_windows, dim=2, p=2) ** 2 l1 = torch.norm(x_t - perturb_windows, dim=2, p=1) numerator = l2 + l1 denominator = torch.exp(-self.alpha * k) + self.epsilon psi_k = numerator / denominator product_weights *= psi_k # Cumulative multiplication of multi - order trajectory weights # Multiply multi - order weights by the perturbed window to generate a non - linear perturbation term W_expand = product_weights.unsqueeze(-1) N_t = torch.sum(W_expand * perturb_windows, dim=1) # Incorporate the linear response term R_linear_expand = R_linear.unsqueeze(-1) response_estimate = N_t + R_linear_expand # Non - linear interaction residual scoring s_t = torch.norm(response_estimate - x, dim=1, p=2) return s_t, response_estimate。

[0041] S41. Sub - sequence of the normalized power battery health state data sequence Perform 1D dilated convolution operation, calculate the non - uniform frequency projection transformation, and propose a set of non - integer modulation frequencies , and obtain the complex frequency representation through self - attention .

[0042] Furthermore, construct a variable relationship learning module, such as Figure 3As shown, a subsequence of the normalized input power battery health state data sequence , where is the batch size, initially set to 64, is the time step length, initially set to 24, is the number of variables of the power battery health state data, initially set to 8. A 1D dilated convolution operation is performed on the channels of each variable dimension. The specific formula is: ; In the formula, is the dilated convolution operation, is the dilation rate, initially set to 3. Then, a non-uniform frequency projection transformation is performed to obtain a set of non-integer modulation frequencies . The specific formula for defining the non-uniform frequency projection transformation is: ; ; In the formula, , are the scaling coefficients for controlling the logarithmic frequency components and the scaling coefficients for controlling the square root frequency components, respectively, initially set to 0.7 and 0.3, , are integer indices representing the position of the th frequency component, is the total number of frequency components used, is the result of the dilated convolution, is the non-resonant rotation basis function for projecting the signal to the non-integer modulation frequency , is the imaginary unit, initially set to 5. Self-attention is performed on the variable dimension in the non-uniform frequency projection transformation. The specific formula is: ; In the formula, is the activation function, is the transpose of the non-uniform frequency projection transformation, is the complex frequency representation. The implementation code for step S41 is: # Non-uniform frequency dilated convolution + self-attention to calculate complex frequency representation class NonUniformFrequencyAttention(nn.Module): def __init__(self, input_dim, seq_len, freq_channels, dilation=2): super(NonUniformFrequencyAttention, self).__init__() self.C = input_dim self.T = seq_len self.F = freq_channels self.dilation = dilation self.embedding_dim = 64 # Dilated convolutional layer self.conv = nn.Conv1d(in_channels=input_dim, out_channels=input_dim, kernel_size=3, dilation=dilation, padding=dilation) # Learnable non-uniform frequency control parameters λ and η self.lambda_param = nn.Parameter(torch.tensor(0.7)) self.eta_param = nn.Parameter(torch.tensor(0.3)) # QKV linear layers (complex real and imaginary parts share linear mapping) self.q_linear = nn.Linear(self.T, self.embedding_dim) self.k_linear = nn.Linear(self.T, self.embedding_dim) self.v_linear = nn.Linear(self.T, self.embedding_dim) def build_complex_basis(self, t, f_idx): log_term = self.lambda_param * torch.log1p(f_idx) sqrt_term = self.eta_param * torch.sqrt(f_idx + 1e-5) omega = log_term + sqrt_term # Construct e^{-jω t} t = t.unsqueeze(0) omega = omega.unsqueeze(1) phase = omega * t real = torch.cos(phase) imag = -torch.sin(phase) return torch.complex(real, imag) def forward(self, x): B, T, C = x.shape assert C == self.C and T == self.T # 1D dilated convolution: First reshape to [B, C, T] x_conv = self.conv(x.permute(0, 2, 1)) x_conv = x_conv.permute(0, 2, 1) # Project to the frequency domain: Construct φ_f(t) t = torch.arange(0, T).float().to(x.device) f_idx = torch.arange(0, self.F).float().to(x.device) basis = self.build_complex_basis(t, f_idx) # Map the input to the complex frequency domain x_freq_real = torch.einsum('btc,ft->bfc', x_conv.real,basis.real) - \ torch.einsum('btc,ft->bfc', x_conv.imag,basis.imag) x_freq_imag = torch.einsum('btc,ft->bfc', x_conv.real,basis.imag) + \ torch.einsum('btc,ft->bfc', x_conv.imag,basis.real) x_complex = torch.complex(x_freq_real, x_freq_imag) # Flatten the complex number x_complex for QKV attention real_part = x_complex.real q = self.q_linear(real_part) k = self.k_linear(real_part) v = self.v_linear(real_part) # Attention scores and output attention_scores = torch.matmul(q, k.transpose(-1, -2)) / math.sqrt(self.embedding_dim) attention_weights = F.softmax(attention_scores, dim=-1) output = torch.matmul(attention_weights, v) return output, x_complex # Attention-enhanced output + original complex frequency domain representation.

[0043] S42. Split the complex frequency representation into real and imaginary parts for processing, and calculate the final interaction-enhanced time-domain features through residual connection and normalization methods.

[0044] Furthermore, split the complex frequency representation into real and imaginary parts. The specific formula is as follows: ; In the formula, is the real part of is the imaginary part of is the imaginary unit. Then construct a real vector is the complex frequency representation. The specific formula is as follows: ; In the formula, is the th sample, the is the spectrum vector of the state-of-health data variable of the power battery, is the th sample, the real part response of the th state-of-health data variable of the power battery on all complex frequency representation channels, is the th sample, the imaginary part response of the th state-of-health data variable of the power battery on all complex frequency representation channels. Through a shared linear mapping, the spectrum vector is mapped to the time-domain representation. The specific formula is: ; In the formula, is the shared linear mapping matrix, is the state-of-health sequence of the power battery reconstructed from the complex frequency representation. After restoring the dimension of the reconstruction result, the state-of-health sequence with merged dimensions is obtained , where is the batch size, initially set to 64, is the time step length, initially set to 24. Finally, through the residual connection and normalization method, the final interaction-enhanced time-domain features are obtained. The specific formula is: ; In the formula, is the layer normalization operation, is the subsequence of the normalized state-of-health data sequence of the power battery, is the final interaction-enhanced time-domain feature. The implementation code for step S42 is: # Frequency domain to time domain representation + Residual normalization class FrequencyToTimeDecoder(nn.Module): def __init__(self, freq_channels, input_dim, time_steps): super(FrequencyToTimeDecoder, self).__init__() self.F = freq_channels self.C = input_dim self.T = time_steps self.hidden_dim = 2 * self.C # Shared linear mapping matrix W_r that maps the spectrum vector to the time domain self.projection = nn.Linear(self.hidden_dim, self.T) # Residual and normalization module self.layernorm = nn.LayerNorm(self.T) def forward(self, x_complex, x_input): B, F, C = x_complex.shape T = self.T assert C == self.C # Split real and imaginary parts real = x_complex.real imag = x_complex.imag # Concatenate spectrum vectors: real || imag → [B, F, 2C] freq_vector = torch.cat([real, imag], dim=-1) # Shared mapping back to the time domain [B, F, T] time_reconstruction = self.projection(freq_vector) # Aggregate frequency channel information time_merged = torch.mean(time_reconstruction, dim=1) # Restore time dimension and channel structure x_input_flat = torch.mean(x_input, dim=2) fused = x_input_flat + time_merged # Residual connection normalized = self.layernorm(fused) # Reconstruct for subsequent processing as [B, T, C] enhanced = normalized.unsqueeze(-1).expand(-1, -1, C) return enhanced

[0045] S43. Construct a sine prototype matrix, calculate the minimum distance between its finally interaction-enhanced time-domain features and the sine prototype vector, and obtain a relationship deviation score .

[0046] Further, construct a sine prototype matrix. The specific formula is as follows: ; In the formula, is the sine basis vector in the th row and the th column of the sine prototype matrix. is the time step length, initially set to 24. is the number of variables of the power battery health state data, initially set to 8. For each time step, calculate the minimum distance between its finally interaction-enhanced time-domain features and the sine prototype vector. The specific formula is as follows: ; In the formula, is the sine basis vector of the th column. is the finally interaction-enhanced time-domain feature corresponding to the time step . is the operation to return the minimum distance. is the relationship deviation score. is the two-norm. The implementation code for step S43 is as follows: # Construct a sine prototype and calculate the relationship deviation score class SinusoidPrototypeDistance(nn.Module): def __init__(self, time_steps, input_dim, num_basis=None): super(SinusoidPrototypeDistance, self).__init__() self.T = time_steps self.C = input_dim self.P = num_basis if num_basis is not None else input_dim # Learnable sine frequency and phase parameters self.omega = nn.Parameter(torch.linspace(0.1, 1.0, self.P)) self.phi = nn.Parameter(torch.zeros(self.P)) # Optional linear transformation for feature matching self.feature_mapper = nn.Linear(self.C, self.P) def forward(self, enhanced_time_features): B, T, C = enhanced_time_features.shape assert C == self.C and T == self.T # Step 1: Construct the sine prototype matrix [T, P] t_idx = torch.arange(0, T, dtype=torch.float32).unsqueeze(1).to(enhanced_time_features.device) omega = self.omega.unsqueeze(0) phi = self.phi.unsqueeze(0) S = torch.sin(omega * t_idx + phi) # Step 2: Map the input to the same dimension as the prototype [B, T, P] projected = self.feature_mapper(enhanced_time_features) # Step 3: Calculate the distance between each sample time step and all P prototypes [B, T, P] S_expanded = S.unsqueeze(0).expand(B, -1, -1) diff = projected - S_expanded distance = torch.norm(diff, p=2, dim=2) # Step 4: Take the minimum distance of each time step to all prototypes as the relationship deviation score min_distance = torch.min(distance, dim=1).values # Restore the scoring tensor to [B, T] return min_distance, distance, projected, S。

[0047] S5. Build an anomaly detection module to integrate two deviation scores to obtain the final anomaly score 。

[0048] Furthermore, build an anomaly detection module to integrate two deviation scores and calculate the final anomaly score of the power battery health state at each time step through a weighted fusion method. The specific formula is: ; In the formula, is the relational deviation score, is the non - linear interaction deviation score, is the activation function, is the final anomaly score of the power battery health state. The implementation code for step S5 is: # Anomaly score fusion module class AnomalyScoringFusion(nn.Module): def __init__(self, normalize=True, multi_scale=False): super(AnomalyScoringFusion, self).__init__() self.normalize = normalize self.multi_scale = multi_scale # Learnable fusion weights α, β and bias b self.alpha = nn.Parameter(torch.tensor(1.0)) self.beta = nn.Parameter(torch.tensor(1.0)) self.bias = nn.Parameter(torch.tensor(0.0)) # Fusion mapping layer self.fusion_mlp = nn.Sequential( nn.Linear(1, 16), nn.ReLU(), nn.Linear(16, 1) ) def forward(self, nonlinear_score, relation_score): B, T = nonlinear_score.shape # Optional normalization if self.normalize: nonlinear_score = (nonlinear_score - nonlinear_score.mean(dim=1, keepdim=True)) / \ (nonlinear_score.std(dim=1, keepdim=True) + 1e-6) relation_score = (relation_score - relation_score.mean(dim=1, keepdim=True)) / \ (relation_score.std(dim=1, keepdim=True)+ 1e-6) # Weighted fusion fused = self.alpha * nonlinear_score + self.beta * relation_score + self.bias # Sigmoid activation + MLP non-linear mapping enhancement fused_activated = torch.sigmoid(fused).unsqueeze(-1) anomaly_score = self.fusion_mlp(fused_activated).squeeze(-1) if self.multi_scale: global_score = torch.mean(anomaly_score, dim=1) return anomaly_score, global_score else: return anomaly_score。

[0049] Furthermore, the MtsNet anomaly detection model is written in Python. The experiment runs on the Windows operating system. Pytorch is selected as the framework in the CUDA 11.27 environment. It is trained on a GeForce RTX 3090. The optimizer is selected, the initial learning rate is set to 0.001, the training batch is set to 64, the training cycle is set to 100, and the dataset is the data related to the health state of power batteries for 60 days. After preprocessing, it is input into the MtsNet anomaly detection model.

[0050] Furthermore, the effect diagram of the MtsNet anomaly detection model for realizing the anomaly detection of the health state of power batteries is as Figure 5 shown. The figure shows the performance of the MtsNet anomaly detection model under three key index dimensions, namely voltage, current, and temperature. Each sub-figure uses time (h) as the horizontal axis to show the historical change trend of this dimension and marks the anomaly points determined by the model. The first figure is the voltage change diagram of the power battery. The curve is generally stable between 3.6V and 3.8V, but there is a significant sudden drop to below 2.5V at about the 20th hour, which is a severe anomaly point. The model successfully marks this point as an anomaly, indicating that under its linear response and non-linear interaction scoring mechanism, it can effectively identify instantaneous mutation behaviors, especially sudden drop phenomena caused by similar open circuits or short circuits. The second figure is the long-term current diagram of the power battery. Near the 50th hour, the current suddenly rises from the normal state of about 1.5A to 3.5A, forming a peak anomaly point. Such anomalies often accompany problems such as load mutation, short-term overcharging, or control strategy imbalance. The detection model accurately marks this point, indicating that it also has good detection ability for local mutations in slow evolution, verifying the effectiveness of the multi-order trajectory non-linear perturbation model. The third figure is the temperature change diagram of the power battery. The overall temperature remains in the range of 25–30°C, except for a sharp peak in the temperature suddenly increasing to about 45°C at the 80th hour. Such anomalies may be related to sudden changes in the external environment, overheating inside the battery cell, or failure of the thermal management system, etc. This point is also judged as an anomaly by the model, indicating that the model can identify high-amplitude sparse sudden events from the frequency-domain to time-domain mapping enhanced features. The experimental results show that the MtsNet anomaly detection model performs excellently in the anomaly detection of the health state of power batteries.

Claims

1. A method for detecting abnormal health status of a power battery based on machine learning, characterized in that: The following steps are involved: S1. Collect power battery health status data and pre-process the collected data; S2, normalize the preprocessed data and divide the data set; S3. Construct a perturbation response time modeling module to process dynamic patterns in the data. The specific steps are as follows: S31. Input the normalized power battery health status data sequence , construct the disturbance window; S32. Perform linear response modeling and design dynamic dissipative drive weight strategy , calculate the linear response term ; S33, conduct second-order nonlinear perturbation modeling and propose a multi-order trajectory nonlinear weight strategy , calculate the second-order nonlinear disturbance term , fusion and Get response estimates and calculate nonlinear interaction residual scores ; S4. Construct a variable relationship learning module to handle the dynamic coupling problem of data. The specific steps are as follows: S41. Input a subsequence of the normalized power battery health status data sequence Perform 1D dilated convolution operation, calculate non-uniform frequency projection transformation, and propose a set of non-integer modulation frequencies , complex frequency representation is obtained through self-attention ; S42, splitting the complex frequency representation into real and imaginary parts, and calculating the final interactively enhanced time domain features through residual connection and normalization methods; S43, construct the sine prototype matrix, calculate the minimum distance between the final interactively enhanced time domain feature and the sine prototype vector, and obtain the relationship deviation score ; S5. Build an anomaly detection module to integrate the two deviation scores to obtain the final anomaly score .

2. The method for detecting abnormal health status of a power battery based on machine learning according to claim 1, characterized in that: In the S1, the power battery health status data is collected, including cell-level monitoring parameters, system-level operating parameters and environmental parameters, wherein the cell-level monitoring parameters include voltage data, current data, and internal resistance change data; the system-level operating parameters include cycle data, energy efficiency data, and fault code data; the environmental parameters include ambient temperature data and ambient humidity data; the mean of the power battery health status data is calculated to fill in missing values ​​and construct a power battery health status data set.

3. The method for detecting abnormal health status of a power battery based on machine learning according to claim 2, characterized in that: The normalized power battery health status data sequence is input in S3 and S31. ,in is the power battery health status data at the current time point, is the number of variables of the power battery health status data, constructs the disturbance window corresponding to the current time point, and defines the length of the past time window as , each current time point The corresponding historical disturbance window is .

4. The method for detecting abnormal health status of a power battery based on machine learning according to claim 3, characterized in that: In S3 and S32, linear response modeling is performed to define the time points to The state difference is , represents the historical disturbance intensity, where is the power battery health status data at the current time point, Design a dynamic dissipative drive weight strategy for the number of variables in the power battery health status data , the specific formula is: ; In the formula, To traverse the variable dimensions of all power battery health status data, indivual, For the The square of the disturbance intensity from the historical point to the current point of the power battery health status data on each variable represents the potential energy. The state difference is The variable dimension of the power battery health status data, is the frequency of the sinusoidal oscillation, is the phase shift, and then the enhanced dissipated potential energy differential linear response weight is driven according to the historical points of the power battery health status data and the corresponding cycle , construct the weighted sum, the specific formula is: ; In the formula, is the length of the past time window, For historical moments Power battery health status data, For each current time point The corresponding historical disturbance window, is a linear response term.

5. The method for detecting abnormal health status of a power battery based on machine learning according to claim 4, characterized in that: In S3 and S33, second-order nonlinear disturbance modeling is performed, and a multi-order trajectory nonlinear weight strategy is proposed to measure the historical point pair of any power battery health status data. The health status data of the power battery at the current time point The coupling strength is: ; In the formula, is the length of the past time window, , , For historical moments , , Power battery health status data, is the order, is an exponential function, is the square of the two norm, is a norm, To prevent division by zero, keep all , The specific formula is: ; In the formula, is the normalized nonlinear interaction weight of multi-order trajectories, is the dot product operation, For each current time point The corresponding historical disturbance window, is a second-order nonlinear disturbance term, performs time response estimation, and integrates linear response terms and the second-order nonlinear disturbance term , get the estimated value of the response of the power battery health status data, and calculate the nonlinear interaction residual score. The specific formula is: ; ; In the formula, is the estimated value of the response, Scoring nonlinear interaction deviance.

6. The method for detecting abnormal health status of a power battery based on machine learning according to claim 5, characterized in that: The subsequence of the normalized power battery health status data sequence is input in S4 and S41 ,in, is the batch size, is the time step length, is the number of variables of the power battery health status data, and a 1D hole convolution operation is performed on the channel of each variable dimension. The specific formula is: ; In the formula, is the dilated convolution operation, is the hole rate, and then a non-uniform frequency projection transformation is performed to propose a set of non-integer modulation frequencies , the specific formula for defining the non-uniform frequency projection transform is: ; ; In the formula, , are the scaling factors for controlling the logarithmic frequency component and the scaling factors for controlling the square root frequency component, respectively. , is an integer index, indicating the The position of the frequency components, is the total number of frequency components used, is the result of the dilated convolution. is a non-resonant rotation basis function used to project the signal to a non-integer modulation frequency , is an imaginary unit, and self-attention is performed on the variable dimension on the non-uniform frequency projection transformation. The specific formula is: ; In the formula, is the activation function, is the transpose of the non-uniform frequency projection transform, is a complex frequency representation.

7. The method for detecting abnormal health status of a power battery based on machine learning according to claim 6, characterized in that: In S4 and S42, the complex frequency representation is split into a real part and an imaginary part. The specific formula is: ; In the formula, for The real part of for The imaginary part of is the imaginary unit, and then constructs the real vector, It is a complex frequency representation, and the specific formula is: ; In the formula, For the Samples, is the frequency spectrum vector of the power battery health status data variable, For the Samples, The power battery health status data variable represents the real part response of the channel at all complex frequencies. For the Samples, The imaginary response of the power battery health status data variable on all complex frequency channels is used to map the spectrum vector to the time domain through a shared linear mapping. The specific formula is: ; In the formula, is the shared linear mapping matrix, The power battery health state sequence is reconstructed from the complex frequency representation, and the reconstruction result is restored to the dimension to obtain the power battery health state sequence of the merged dimension ,in, is the batch size, is the time step length, and finally the time domain features after interaction enhancement are obtained through residual connection and normalization method. The specific formula is: ; In the formula, is the layer normalization operation, is a subsequence of the normalized power battery health status data sequence, It is the time domain feature after the final interaction enhancement.

8. The method for detecting abnormal health status of a power battery based on machine learning according to claim 7, characterized in that: In S4 and S43, a sinusoidal prototype matrix is ​​constructed, and the specific formula is: ; In the formula, is the first Line The sine basis vectors of the columns, is the time step length, is the number of variables of the power battery health status data. For each time step, the minimum distance between the final interactively enhanced time domain feature and the sinusoidal prototype vector is calculated. The specific formula is: ; In the formula, For the The sine basis vectors of the columns, is the time step The corresponding final interactively enhanced time domain features, To return the minimum distance operation, Score the relationship bias, is the two-norm.

9. The method for detecting abnormal health status of a power battery based on machine learning according to claim 8, characterized in that: In S5, an anomaly detection module is constructed to integrate the two deviation scores and calculate the final anomaly score of each time step by a weighted fusion method. The specific formula is: ; In the formula, Score the relationship bias, Score the nonlinear interaction deviation, is the activation function, is the final anomaly score.

Citation Information

Patent Citations

  • Multivariable time sequence anomaly detection method and system based on graph neural network

    CN117786374A

  • Lithium battery electric quantity monitoring and low electric quantity early warning system

    CN118938019A

  • Gastric cancer recurrence risk prediction method based on metabonomics characteristic analysis

    CN119446523A

  • Power system component dynamic modeling method based on MMOE-DAE model

    CN119494276A

  • Artificial intelligence driven battery energy storage health state and residual life prediction method

    CN119716587A

Cited By

  • Battery anomaly detection method for new energy automobile

    CN120524209A

  • A battery anomaly detection method for new energy vehicles

    CN120524209B

  • Tower crane tower body damage abnormity detection method

    CN120805081A

  • Method and system for testing electric energy quality monitoring device

    CN120832634A