Lithium battery protection board charging and discharging out-of-limit anomaly detection method based on data analysis

By constructing a variational autoencoder model with a time window sample matrix and an attention mechanism, and combining supervised learning and the local outlier factor method, the problem of detecting charging and discharging over-limit anomalies in lithium battery protection boards when faced with asynchronous sampling channels and changes in operating conditions is solved, achieving stable anomaly detection and event-level alarms.

CN122017594APending Publication Date: 2026-05-12SHENZHEN YUEZHICAI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN YUEZHICAI TECHNOLOGY CO LTD
Filing Date
2026-02-13
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing lithium battery protection boards struggle to reliably identify over-limit charging and discharging anomalies when faced with issues such as asynchronous sampling channels, communication delays, noise spikes, temperature gradients, and aging drift, leading to false alarms or missed alarms. Furthermore, the output scale and meaning of different algorithms drift when operating conditions change, and non-fault switching can be amplified during rapid plugging and unplugging.

Method used

By constructing a time window sample matrix and reconstructing the window using a variational autoencoder model with an attention mechanism, combined with supervised learning and the local outlier factor method, a comprehensive anomaly score is calculated to achieve the detection of charging and discharging over-limit anomalies of lithium battery protection boards.

Benefits of technology

Data is aligned and interpolated on a unified time axis to suppress spikes, ensure the availability of joint features of voltage, current and temperature characteristics, adaptively correct score instability caused by operating condition switching, suppress false alarms and missed alarms, and output event-level results for easy alarm linkage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122017594A_ABST
    Figure CN122017594A_ABST
Patent Text Reader

Abstract

The invention discloses a lithium battery protection board charging and discharging out-of-limit anomaly detection method based on data analysis, and relates to the technical field of operation data analysis and anomaly diagnosis of a lithium battery protection board management system. The method is used for solving the problem that under the conditions of working condition switching, distribution drifting and mark scarcity, charging and discharging out-of-limit anomalies are difficult to stably recognize and perform event-level positioning. Collecting the voltage of a single cell, the current of a battery pack and the temperature, aligning at unified time, cleaning and normalizing, and constructing a time sequence sample by a sliding window; solving a reconstruction abnormal score by using a variational auto-encoder model based on an attention mechanism, and combining a supervised learning fusion score and a local outlier factor method outlier score; and correcting and dynamically weighting according to the concentration ratio, migration and marking proximity to form a comprehensive score, confirming an out-of-limit event and an output type according to a threshold value and a continuity rule, and associating a battery cell with a record.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of operational data analysis and anomaly diagnosis technology for lithium battery protection board management systems. More specifically, this invention relates to a data analysis-based method for detecting over-limit charging and discharging anomalies in lithium battery protection boards. Background Technology

[0002] Lithium-ion battery energy storage and power systems typically rely on protection boards to monitor individual cell voltages, battery pack currents, and temperatures in real time, triggering protection when risks such as overcharging or over-discharging occur. However, in actual operating conditions, issues such as asynchronous sampling channels, communication delays, noise spikes, missing data points, and temperature gradients and aging drift exist, making it easy to generate false alarms or missed alarms when relying on a single threshold or statistical indicator. Furthermore, protection action logs are lagging, and precursors to exceeding limits may manifest as short-term morphological jumps or slow accumulation across windows, making stable identification with fixed rules difficult. On the other hand, the output scale and meaning of different algorithms for the same window drift with changing operating conditions. Directly fixing weighted fusion can easily amplify non-fault switching during rapid insertion and removal of multiple distributed clusters.

[0003] To address the above problems, this invention proposes a solution. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a method for detecting abnormal charging and discharging limits of lithium battery protection boards based on data analysis, so as to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: In a preferred embodiment, it includes: During charging and discharging, the protection board collects the voltage of individual cells, the current of the battery pack, and the temperature at sampling intervals, and constructs a time window sample matrix under a unified set of discrete sampling times; Using the time window sample matrix as input, the attention score and attention weight are calculated and the attention convergence vector is generated. The latent variables are obtained and the window is reconstructed. The anomaly score and attention weight sequence are output. For each time window sample, supervised learning anomaly scores and local outlier anomaly scores are obtained. The concentration within the window is calculated using the attention weight sequence, the migration amplitude between windows is calculated using the mean vector of adjacent latent variables, and the proximity of the window labels is calculated using the nearest neighbor label statistics. Standardization is performed based on the normal window sample set during the stable operating period to generate three correction scores and calculate the evidence consistency. After the three correction scores are bounded and mapped, exponentially normalized weights are generated based on the concentration within the window, the migration amplitude between windows, the proximity of the window labels, and the evidence consistency, and then aggregated to obtain the comprehensive anomaly score. Threshold and persistence determination is performed on the comprehensive anomaly score to confirm the over-limit anomaly event, determine the over-limit charging or over-limit discharging anomaly and the set of cells associated with the over-limit, and output the recorded results.

[0006] In a preferred embodiment, the protection board collects individual cell voltage, battery pack current and temperature during charging and discharging at a sampling period constrained by both hardware sampling capability and over-limit observation resolution. It also establishes a unified discrete sampling time set with timestamps to achieve time alignment of the three types of channels: for each unified time, the original samples of each channel are mapped to the closest sampling time; when missing points occur, linear interpolation is used for cell voltage and temperature, and forward hold is used for current that may have a step to complete the multidimensional observation vector at the same time.

[0007] In a preferred embodiment, impossible values ​​are eliminated based on the range of the protection board and the reasonable range of the sensor. Within the neighborhood window, the neighborhood median or neighborhood mean and the median absolute deviation threshold are used to determine and replace local spikes with neighborhood statistics to obtain purified multidimensional time series data. Then, the mean and standard deviation of each feature are calculated on a clearly selected stable operating statistical interval and standardized to obtain normalized multidimensional time series features. Finally, the normalized multidimensional time series features are slid segmented according to the window length and window step size, and within each window, the feature vectors corresponding to multiple consecutive unified moments are stacked in chronological order to construct a time window sample matrix.

[0008] In a preferred embodiment, the constructed time window sample matrix is ​​used as input. Each time window sample is represented as a normalized multidimensional feature vector sequence arranged in chronological order. Attention scores are calculated for each sampling time within the window, and attention weights are obtained by exponential normalization. After the sum of the attention weights is equal to one, the feature vectors at each time within the window are weighted and converged to generate an attention convergence vector. Then, the mean vector and variance vector of the latent variables are generated by encoding and mapping using this attention convergence vector. Latent variable samples are obtained by reparameterized sampling, and a reconstructed window with the same shape as the input window is generated by decoding and mapping. Subsequently, the reconstruction error is obtained by calculating the squared error of the input window and the reconstruction window time by time and dimension by dimension and accumulating them within the window. At the same time, the Kuhlberg-Klebler divergence of the approximate posterior distribution of the latent variable relative to the standard normal prior distribution is calculated. The reconstruction error and the divergence are then weighted and summed according to preset weight coefficients to obtain the variational autoencoder total loss of the window. This total loss is then defined as the outlier score of the sample in the time window. Meanwhile, the attention weight sequence corresponding to the window is retained to trace the key sampling time positions that contribute significantly to the convergence vector within the window.

[0009] In a preferred embodiment, for each constructed time window sample, on the one hand, the timestamp of the protection action triggered by the protection plate is used as the anchor point of the out-of-limit abnormal event, and a window category label is established according to the time coverage relationship with the sliding window to form a labeled training sample pair; then, the window feature vector is extracted from the normalized sequence within each time window according to fixed statistical operations, and the time series window is converted into a fixed-dimensional representation that can be input into the supervised model by calculating the window mean, standard deviation, maximum value, minimum value, first and last difference and slope index; and on the basis of the feature vector and category label, at least two supervised learning models with different principles are trained and their outputs are unified as the out-of-limit abnormal probability; then, the probabilities of each model are weighted and summed according to the fusion weight determined in the verification process to generate a supervised learning abnormal score. On the other hand, using the same window feature vector as the feature space sample points, after verifying and determining the number of neighborhood points based on normal operation data, the distance between sample points is calculated and a nearest neighbor set is selected. The reachability distance is introduced to construct the local reachability density. Then, the ratio of the local reachability density of the nearest neighbor to its own local reachability density is averaged to obtain the local outlier factor as the local outlier score. Thus, the corresponding scores are output on the two links of supervision evidence that depends on protection action labels and density outlier evidence that does not depend on labels, respectively, and input is provided for subsequent normalization and comprehensive outlier score generation.

[0010] In a preferred embodiment, the protection board collects individual cell voltage, battery pack current, and temperature at sampling periods to form time window samples. Within each time window, it obtains the attention weight sequence, latent variable distribution parameters, and corresponding anomaly scores from the variational autoencoder link output, while simultaneously obtaining supervised learning fusion anomaly scores and local outlier anomaly scores. Subsequently, for each time window, the concentration within the window is calculated using the attention weight sequence. This concentration is determined by the ratio of the maximum attention weight to the average attention weight within the window, characterizing whether anomaly contributions are concentrated in a few sampling moments. The L2 norm difference of the latent variable mean vectors of adjacent time windows is used to calculate the inter-window migration amplitude, characterizing the overall morphological migration degree between windows. Finally, the window label proximity is calculated using the window feature vector to select a nearest neighbor set in the feature space and to statistically analyze the proportion of out-of-limit anomaly labels in the nearest neighbor training samples, characterizing the label support degree near the window.

[0011] In a preferred embodiment, after obtaining the intra-window concentration, inter-window migration amplitude, and window label proximity, the mean and standard deviation of relevant quantities are statistically obtained from the normal window sample set during a stable operating period. The variational autoencoder anomaly score, intra-window concentration, inter-window migration amplitude, and local outlier anomaly score are then standardized. Subsequently, a logistic function is applied to the variational autoencoder anomaly score based on the standardized intra-window concentration, the supervised learning anomaly score based on the window label proximity, and the local outlier anomaly score based on the standardized inter-window migration amplitude, resulting in three corrected scores. Evidence consistency is then calculated from these three corrected scores, obtained by inverse mapping of the standard deviations of the three corrected scores. Finally, the three corrected scores are boundedly mapped to obtain aggregable quantities. An exponentially normalized weight is generated by combining the intra-window concentration, window label proximity, inter-window migration amplitude, and evidence consistency. These weights are then used to aggregate the three aggregable quantities to generate a comprehensive anomaly score for the given time window.

[0012] In a preferred embodiment, for the comprehensive anomaly score of each time window sample, firstly, a normal window sample set is selected within a determined stable operating period, and the mean and standard deviation of the comprehensive anomaly scores of the set are calculated to generate a comprehensive anomaly score threshold; then, the comprehensive anomaly score of each time window is compared with the threshold, and windows that meet the threshold condition are recorded as candidate anomaly windows, and the minimum number of consecutive candidate anomaly windows is calculated based on the sampling period, window step size, and minimum effective duration of exceeding the limit, and the sequence of candidate anomaly windows that continuously meet the threshold is confirmed as an out-of-limit anomaly event; Subsequently, the start and end sampling times of the event are calculated from the start and end window numbers of the sequence to determine the event time interval. Within this time interval, charging over-limit anomalies or discharging over-limit anomalies are determined based on the sign statistics of the battery pack current. At the same time, the maximum or minimum value of the interval is calculated for the voltage sequence of each cell and compared with the charging cut-off voltage threshold or discharging cut-off voltage threshold configured on the protection board to determine the set of cells associated with the over-limit. Finally, the over-limit anomaly results are output and recorded, including the event start time, end time, over-limit anomaly type, set of cells associated with the over-limit, peak value of the comprehensive anomaly score within the event coverage window, and peak window number.

[0013] The technical effects and advantages of the data analysis-based lithium battery protection board charge / discharge over-limit anomaly detection method of this invention are as follows: This invention ensures the availability and traceability of joint features between voltage, current, and temperature by performing alignment, interpolation, and peak suppression on a unified time axis. It then uses an attention-based variational autoencoder model to highlight reconstruction deviations at key moments within a window, while introducing supervised fusion and local outlier factor methods to form complementary evidence sources. To address the instability in scoring caused by operating condition switching and distribution migration, the solution utilizes concentration, inter-window migration amplitude, label proximity, and consistency for adaptive correction and dynamic weight allocation, fundamentally suppressing false alarms during switching and mitigating missed alarms caused by missing labels. Finally, it outputs event-level results for easy alarm linkage and maintenance verification. Attached Figure Description

[0014] Figure 1 This is a general framework diagram of the lithium battery protection board charging and discharging over-limit anomaly detection method based on data analysis according to the present invention.

[0015] Figure 2 This is a flowchart showing the closed-loop process and judgment output of the lithium battery protection board charge / discharge over-limit anomaly detection method based on data analysis according to the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] Example This invention discloses a data analysis-based method for detecting over-limit charging and discharging anomalies in lithium battery protection boards, comprising: Step 1: Run data acquisition and time window sample construction; In this step, the lithium battery protection board operates according to a preset sampling period during charging or discharging. Acquire runtime data and generate time-series records.

[0018] Wherein, the sampling period It's not set arbitrarily, but determined by the actual sampling conditions of the protection board: on the one hand, the voltage, current, or temperature sampling of the protection board is usually provided by an analog-to-digital converter or digital sensor, and its effective sampling rate has an upper limit; on the other hand, the protection board's response to over-limit risks needs to observe the changing trend within a certain time resolution, therefore... This is set as the minimum available sampling interval within the hardware-allowed sampling rate range, capable of covering out-of-limit variations. In specific implementations, The sampling period can be obtained by reading the firmware or registers configured on the protection board, or by statistically analyzing the difference between two consecutive recorded timestamps, thus ensuring... The source is clear and consistent with the actual sampling.

[0019] The operational data includes at least three categories, and each category of data is obtained directly from the corresponding measurement link of the protection board: The first category is the voltage of a single battery cell. Where i represents the cell number and t represents the sampling time, the The terminal voltage of the i-th cell is sampled by the voltage sampling channel of the protection board; this data is used as direct evidence to characterize whether overcharging or over-discharging has occurred, because exceeding the limit essentially corresponds to the deviation of the cell voltage from the threshold.

[0020] The second category is the battery pack current I(t), which is obtained by sampling the current sampling circuit of the protection board. The direction and magnitude of the current are used to characterize whether the battery is currently charging or discharging and the load intensity changes. This data is used to distinguish between charging over-limit and discharging over-limit, and to characterize whether the voltage change is consistent with the current change (e.g., voltage drop caused by large current).

[0021] The third category is temperature. Where k represents the temperature measuring point number, the The data is obtained from the temperature sampling channel of the protection board; this data is used to characterize the influence of thermal factors on voltage and internal resistance changes, and serves as a correlation variable when judging abnormal segments.

[0022] Furthermore, I(t), Organized as multidimensional time series data under the same time base.

[0023] Here, "same time reference" means that the three types of data must correspond to the same set of discrete sampling times. Otherwise, misalignment will occur between different channels, causing voltage, current, and temperature at the same time to not constitute the same observation record, thus rendering any calculation based on multidimensional correlation meaningless. Therefore, this step explicitly establishes a multidimensional observation at the same time using timestamps as indexes.

[0024] When different sampling channels have inconsistent timestamps or different sampling frequencies, time alignment processing is performed on the data of each channel.

[0025] Inconsistent timestamps commonly originate from two sources: first, different sensors or sampling channels trigger sampling at different times; second, data may be queued or delayed when reported to the recording terminal via communication. To eliminate this impact, this step constructs a unified set of sampling times. and order .in Taken from the timestamp of the start time of the record. The method described above is used to ensure that the unified time set is consistent with the actual sampling rhythm.

[0026] Next, the original sampled values ​​of each channel are mapped to the unified sampling time set.

[0027] Mapping refers to: for each uniform moment Search for matching data in the raw channel data. The closest sampling time point is selected and its value is taken; if the original data is high-frequency but the unified set is low-frequency, then sampling is performed according to the unified set; if the original data is low-frequency but the unified set is high-frequency, then missing points will appear and need to be imputed. The purpose of this processing is to ensure that within the same... The above can be obtained simultaneously , , This results in a multidimensional observation vector at the same moment.

[0028] If missing points occur during the mapping process, they are filled using an interpolation method consistent with the characteristics of the physical quantity change. For voltage... With temperature Typically, these parameters exhibit continuous, gradual changes or piecewise, smooth changes within a normal sampling period; therefore, linear interpolation is used: that is, interpolation is applied at missing time points. Located at two adjacent known times In between, The corresponding values ​​of the two points are calculated according to the time ratio. The estimated value; the source of this estimated value is clearly the actual sampled values ​​of two adjacent points.

[0029] For the current I(t), there may be a step, and linear interpolation might introduce non-existent intermediate current values. Therefore, forward hold is used: the most recent sampled current value before the missing point is used as the current value of the missing point; the source of this estimate is clearly the actual sampled value of the previous known point. The interpolated value is only used to complete the time series to form a complete observation, without changing the original sampling points, and the interpolation position can be marked in the data for audit traceability.

[0030] Subsequently, the time-aligned multidimensional time-series data is cleaned. The sources and uses of the cleansing rules are as follows.

[0031] The first step in cleaning is range elimination: impossible values ​​are eliminated based on the measurement range of the protection board and the reasonable range of the sensor. The measurement range here comes from the sensor specifications, sampling circuit design, or firmware configuration, such as the maximum measurable value of voltage sampling, current sampling range, and temperature sensor range; these can all be obtained from hardware parameter tables, calibration files, or firmware configurations.

[0032] The second step in cleaning is local peak correction, which involves peak determination thresholds and replacement values. Local spikes refer to the phenomenon of sudden increases or decreases at a single point or a few points, but rapid recovery at adjacent points. They are often caused by sampling noise or transient interference. For each dimension of the sequence, the neighborhood median is calculated using a neighborhood window of length W. or neighborhood mean As a reference value; where W is an odd number and must cover at least a certain number of sampling periods, for example, W = 2r + 1, where r is the neighborhood radius. The peak determination threshold can be a multiple of the absolute deviation of the neighborhood: for example, calculating the median of the absolute deviation within the neighborhood. ,when The peak is identified as a sharp point, where λ is an empirical multiple parameter. Here... , All values ​​are calculated from real sampled data in the neighborhood of the point, with a clear source. The purpose of λ is to control the sensitivity to spikes; the value of λ can be selected based on the principle of minimizing the false correction rate on historical normal data. Once a spike is identified, the point is replaced with... or The replacement value is derived from the neighborhood statistics, and the replacement action only changes the peak point and does not change other points in the neighborhood.

[0033] After cleaning and peak correction, purified multidimensional time-series data is obtained and presented as a vector sequence. It indicates. Among them. At each time t, there is a multidimensional observation vector, whose components correspond to the raw quantities after standardization, such as individual cell voltage, battery pack current, and temperature measurement points; the purpose of this representation is to unify multi-source data into the same mathematical object. Normalization was performed on the purified multidimensional time-series data, and the data segments and uses for calculating the statistics were clearly defined. Normalization was performed using a standardized formula: for the j-th feature... ,calculate: ; in and It must be calculated from a clearly defined data segment: In implementation, a preset statistical interval is selected from the operational data collected by the protection board. This is a statistical data segment, and it is required that this statistical data segment be a stable operating segment. This is the arithmetic mean of the j-th dimension feature samples in this statistical data segment. is the standard deviation of the j-th dimension feature sample in this statistical data segment; both are derived from the actual sampled data of this statistical data segment.

[0034] The purpose of standardization is to convert features with different dimensions into a comparable scale, ensuring that when performing joint operations on multidimensional features within the same window, the different dimensions do not cause a single dimension to dominate the operation results. The results obtained in this step... is the normalized eigenvalue and serves as the input element for windowing.

[0035] After normalization, a sliding window is used to segment the normalized multi-dimensional time series data. The determination methods and uses of the window parameters L and S are as follows: The window length L represents the number of sampling points contained in each time window, and its corresponding physical time span is . The basis for determining L is that within this time span, it should be able to cover the local patterns of voltage, current, and temperature changes during one charge-discharge process, so that the window contains sufficient dynamic information rather than just instantaneous points. Therefore, L can be statistically obtained from the shortest duration of the out-of-limit segments in historical data. For example, take the minimum duration when the out-of-limit related changes can be stably manifested and divide it by and round up.

[0036] The window step size S represents the number of sampling points at the start time interval between adjacent windows, and its corresponding physical time interval is . The use of S is to control the window overlap degree: when S < L, the windows overlap, which is beneficial for more fine-grained positioning of the abnormal starting point; when S = L, the windows do not overlap, and the computational amount is smaller. In implementation, S can be determined according to the allowed computing resources and positioning accuracy requirements. For example, when overlap is allowed, take S as a part of L to balance accuracy and load.

[0037] In the nth window, take the sampling time set , and stack the normalized feature vectors of each sampling time within this window in chronological order to obtain the time window sample matrix : ; where each component of comes from the actual sampling data at the same moment t after cleaning and normalization; is used to encapsulate the time series changes of multi-dimensional variables into a directly computable sample object within a fixed time span. By repeating the above construction process for all n, the time window sample set is obtained.

[0038] Step 2: Variational auto-encoding reconstruction modeling and anomaly score calculation based on the attention mechanism; In this step, select the time window sample set obtained in Step 1 as the calculation object, and for each time window sample A variational autoencoder reconstruction model based on an attention mechanism is constructed, and anomaly scores for the samples within the time window are calculated accordingly. The anomaly score here refers to a scalar quantifying the degree of deviation of the samples within the time window from the common operating patterns fitted by the model. This scalar is calculated jointly by the reconstruction error and distribution deviation metric within this step; a larger value indicates that the samples within the time window are more difficult for the model to interpret in the common pattern.

[0039] First, sample any time window. Following the construction method in step one, the normalized multidimensional feature vector sequence is written in chronological order, i.e.: ; in, Indicates the nth time window. The normalized multidimensional feature vector at each sampling time point, where L is the window length. Each dimension component corresponds to the voltage of a single battery cell in step one. Battery pack current I(t) and temperature Data obtained after time alignment, cleaning, and normalization; After obtaining the above sequence representation, attention weights are calculated for sequence elements at different sampling times within the same time window to characterize the contribution of each sampling time to the overall representation of that time window. The attention mechanism here refers to a weight allocation calculation: for the feature vector at each time step in the sequence... A comparable scalar score is calculated and normalized into weights, which are then used to weight and aggregate the information at each time step. Specifically, an attention score is first calculated for each sequence element. Its calculation form is: ; in, This is the weight matrix. For bias vectors, For the weight vector, This is a hyperbolic tangent nonlinear function. (The above...) , , These are all model parameters, and their specific values ​​are not arbitrarily assigned, but rather obtained through training data-driven optimization during the loss function minimization process described later in this step; Its function is to introduce non-linear mapping, enabling combinations of features from different dimensions to have stronger expressive power on the same scalar score. Attention score Its purpose is to map multidimensional information from each sampling time to the same scalar space so that relative importance can be compared within the same window.

[0040] Then convert the attention score into attention weights. And ensure that the sum of all weights within the same time window is 1, so as to guarantee that the weights have a clear proportional meaning. The calculation formula is as follows: ; in, It is an exponential function, and the denominator is the exponential sum of the attention scores at all sampling times within the time window, therefore The source of attention weights is entirely determined by the input sequence of the window and the model parameters. The purpose of this is to weight each sampling moment within the window, so that the sampling moment that contributes more to the overall representation of the window has a higher weight.

[0041] The sequence information of this time window is weighted and converged based on attention weights to obtain an attention convergence vector. The calculation formula is as follows: ; in, and The dimensions are consistent, originating from normalized multidimensional feature vectors and their attention weights within the same window. Attention convergence vector. Its purpose is to integrate information from multiple time points within a window into a single vector representation, while preserving the differences in contributions at different sampling times, thereby providing a compact and weighted input for probabilistic modeling.

[0042] After obtaining the attention convergence vector Then, variational autoencoding is performed to calculate the probability distribution parameters of the latent variables. Here, variational autoencoding refers to a generative model that uses latent variables to represent the input hidden states and describes the uncertainty of these latent variables in the form of probability distributions; where latent variables refer to implicit vectors that cannot be directly measured but are used to explain the overall shape of the input window, denoted as... This step sets the approximate posterior distribution of the latent variables as a multivariate normal distribution and uses diagonal covariance: ; in, Indicates a normal distribution. It is the mean vector. It is the variance vector. This indicates that the variance vector is placed diagonally to form a diagonal matrix. The advantage of using diagonal covariance is that it characterizes the uncertainty of each dimension of the latent variable with fewer parameters, avoiding the instability of estimation caused by introducing too many covariance parameters when the sample size is limited. The purpose of this distribution is to provide a probabilistic description of the latent state for samples within the same time window, so that reconstruction and anomaly measurement not only rely on a single point estimate, but also include a characterization of the fluctuations in the latent state.

[0043] Mean vector With variance vector The encoding mapping is calculated and takes the form of a linear transformation, which is expressed in this embodiment as follows: ; ; in, , The model parameters are for mean mapping. , These are the model parameters for the log-variance mapping; log-variance is used. The purpose is to ensure that the variance obtained through exponential transformation is positive, thus numerically avoiding meaningless negative variance. The four sets of parameters mentioned above are all derived from training optimization, and their purpose is to focus the attention vector. The two sets of parameters are transformed into the distribution of the latent variables, thus completing the probabilistic encoding from the input space to the latent space.

[0044] In order to obtain from the approximate posterior distribution latent variable samples were obtained. To enable gradient optimization during training, this step employs a reparameterization technique for sampling. The reparameterization technique involves treating randomness as an independent standard distribution of noise, then using deterministic transformations to generate latent variable samples, thus allowing the model parameters to still be optimized for differentiability using the chain rule. Specifically, a random noise vector is first generated. To satisfy: ; in, It is a zero vector. The identity matrix is ​​represented by the noise vector, which originates from a random number generation process and serves to provide controlled random perturbations. The latent variable samples are then obtained using the following formula: ; in, Let be the standard deviation vector, satisfying , This indicates element-wise multiplication. The purpose of this sampling method is to ensure that the latent variable sample reflects both the mean and the... The central position also reflects the standard deviation. The uncertainty it describes, and its value is entirely determined by... , and The decision has a clear source.

[0045] Obtain latent variable samples Then, a decoding and reconstruction computation is performed to generate samples of the input time window. The reconstruction result. Here, decoding refers to the mapping from the latent space to the input space, used to generate data estimates with the same shape as the input. In this step, the decoding mapping is assumed to be... ,in Given the model parameters for decoding and mapping, the reconstructed time window samples are: ; in, and They have the same time length L and the same feature dimension; θ comes from the parameter values ​​obtained through training optimization; the purpose of this reconstruction result is to compare it with the real input time-by-time and dimension-by-dimensional, so as to calculate the reconstruction error that can measure whether the window conforms to the form learned by the model.

[0046] After obtaining the reconstructed sample Then, the reconstruction error is calculated. The reconstruction error is calculated using the squared error, which is accumulated over all moments within the time window. Its definition is: ; in, To reconstruct time window samples The Middle Reconstructed normalized multidimensional feature vectors at each sampling time. The L2 norm is calculated by summing the square roots of the sums of the squared differences in each dimension of the vector and then taking the square root. The purpose of using accumulated squared errors is to simultaneously consider both the magnitude and duration of the deviation, preventing small deviations in a single dimension or short-term deviations from being excessively amplified, while significantly reflecting persistent deviations in multiple dimensions. The reconstruction error originates from the calculated difference between the input and the reconstructed sample, and its purpose is to serve as a direct measure of the degree of anomaly: when the operational pattern of a sample within a certain time window deviates from the common pattern, the model struggles to reconstruct the sample, and the reconstruction error increases accordingly.

[0047] In addition to reconstruction error, this step also calculates a distribution deviation measure between the approximate posterior distribution and the prior distribution of the latent variables. This is to prevent the model from losing its discriminative ability by simply increasing the uncertainty of the latent distribution to reduce reconstruction error. Here, the prior distribution refers to the distribution of the latent variables. The reference distribution is predefined; this step uses the standard normal distribution. ; The purpose of this prior distribution is to provide a uniform scale benchmark for the latent space, making the latent representations of samples from different time windows comparable at the same distribution scale. The distribution deviation is measured using the Kohlbek-Leibler divergence, denoted as: ; in, This represents the Kolbec-Leibler divergence, used to quantify the difference between two probability distributions. Since in this step... It is a diagonal normal distribution and For a standard normal distribution, the above Kolbec-Leibler divergence can be written as a closed-form formula: ; Where D represents the dimension of the latent variable. Mean vector The d-th dimension component, Variance vector The d-th dimension component, This is the natural logarithm of the variance component. Each term in this formula is directly output from the encoded mapping. and The calculation yields a clear source; the purpose of this divergence is to serve as a second component of the outlier score, while simultaneously constraining the latent distribution to a reference scale during training, thus making the latent representations comparable.

[0048] After obtaining the reconstruction error and the Kolbec-Leibler divergence, the total loss for the samples in that time window is defined. The weighted sum of the two: ; Here, β is the weighting coefficient, which is derived from pre-defined parameters and can be determined through the validation process using historical running data. Specifically, it is determined by training and validating the model on a set of candidate β values, comparing the degree to which the abnormal scores distinguish between known out-of-limit samples and normal samples under different β values, and selecting the β value with the best discrimination and stable training convergence. The purpose of β is to adjust the relative contribution of reconstruction error and Kolb-Leibler divergence to the total loss, so that the model both emphasizes reconstruction ability and maintains the scale constraint of the potential distribution.

[0049] Finally, the anomaly scores for the samples within this time window are calculated. Defined as the total loss for the samples within that time window: ; Among them, abnormal scores The source is entirely from the input time window samples. The calculation results of attention mechanism, encoding mapping, reparameterized sampling, and decoding reconstruction in this step are determined; anomaly score. The purpose is to output a directly comparable anomaly quantification result for each time window sample, allowing samples from different time windows to be sorted according to the degree of anomaly or proceed to the next step of judgment. Simultaneously, to maintain the traceability of contributions at critical moments, this step also preserves the attention weight sequence. As a companion calculation result corresponding to this abnormal score, each of them The sources are all attention score normalization calculation results within the same time window samples, and their purpose is to locate the attention convergence vector within that time window. The sampling time locations that contribute significantly are identified, thus providing a basis for interpreting the temporal distribution of abnormal scores in samples within that time window.

[0050] Step 3: Supervised learning multi-model fusion calculation and local outlier density calculation, and generation of comprehensive anomaly score; like Figure 1 As shown, in this step, the time window sample set obtained in step one is... Each time window sample On the one hand, multiple prediction models are constructed based on supervised learning and fused to obtain supervised learning anomaly scores; on the other hand, density outlier calculations are performed on time window samples based on the local outlier factor method to obtain local outlier anomaly scores. After obtaining the two types of scores, the scores are normalized with the same caliber and a comprehensive anomaly score is calculated. Here, supervised learning refers to training a model using data samples with known category labels, enabling the model to output the probability or score of normal or out-of-limit anomalies for unknown samples; the local outlier factor refers to an unsupervised outlier calculation method based on neighborhood density comparison, used to identify anomalous samples with significantly reduced local density without relying on category labels.

[0051] To ensure that supervised learning has a clear source of labels, this step first generates a set of labels for supervised learning training from the protection board's operation records. Specifically, the protection board typically has records of protection actions that exceed thresholds during operation, such as records of charging overvoltage protection triggering discharge undervoltage protection triggering, along with the corresponding trigger timestamps and the cell numbers involved. These records originate from the protection board's own protection logic execution logs or reporting messages, and are traceable original records. This step uses the protection action trigger timestamp as a reliable event anchor point for the threshold-exceeding anomaly, and maps the time range covered before and after the event anchor point to the sliding window number in step one: when a certain time window sample... If the time coverage interval of a protection action falls within the same window coverage interval as the trigger timestamp of a certain protection action, or if there is a preset time proximity relationship between them, then the window sample is marked as an out-of-limit abnormal window, and its category is denoted as [category 1]. When a certain time window sample If the time coverage interval does not intersect with the trigger timestamps of all protection actions and does not satisfy the time proximity relationship, and the window is within a stable operating data segment, then the window sample is marked as a normal window, and its category is denoted as . This leads to the set of supervised learning training samples. ,in The source is clearly the protection action trigger record of the protection board and the result of the stable operation period screening, and each mark can be traced back to the corresponding timestamp and its mapping rules.

[0052] After obtaining labeled time window samples, this step determines the input format for the supervised learning model. To enable different supervised learning models to handle fixed-length numerical inputs, this step uses samples from each time window... Extract the window feature vector for supervised learning. The window feature vector The source is entirely from Internal data, calculated using repeatable statistical operations, is used to transform a time series of length L into a fixed-dimensional feature vector, allowing it to be directly input into a supervised learning model. In practice, for... For each normalized feature component, the statistics and changes within the window are calculated and then concatenated to form a... The statistics include at least the window mean, window standard deviation, window maximum, and window minimum, used to characterize the level and fluctuation of the window in the dimensions of voltage, current, and temperature. The changes include at least the difference between the beginning and end of the window and the estimated window slope, used to characterize the upward or downward trend within the window. All the above statistics and changes are calculated by definition from the sampling points within the window, without introducing data from outside the window. Each item corresponds to a quantitative expression of the extreme trend of horizontal fluctuations, thus enabling the supervised learning model to learn the difference between out-of-limit anomalies and normal values ​​in the numerical feature space.

[0053] Based on window feature vectors With category tags This step trains at least two supervised learning models based on different principles to obtain complementary discriminative abilities. The first supervised learning model is the Support Vector Machine (SVM) model. Here, the SVM model refers to a model that constructs the classification boundary by maximizing the class margin; its core is based on the training samples... Learn a decision function such that the decision function is and The samples exhibit maximum discriminative power. Key parameters of the Support Vector Machine (SVM) model include the kernel type and penalty coefficient. The kernel type determines the nonlinear mapping in the feature space, while the penalty coefficient balances the classification margin and training error. These parameters are derived from a pre-set candidate set and determined through validation data. Their purpose is to ensure stable discriminative performance on both training and unseen data. The second supervised learning model uses a random forest model. Here, a random forest model refers to an ensemble classification model composed of multiple decision trees. It autonomously samples training samples and randomly selects feature subsets to train each decision tree. The outputs of each decision tree are then aggregated to obtain the final classification result. Key parameters of the random forest model include the number of decision trees and the maximum depth of a single tree. The number of decision trees controls the stability of the ensemble, while the maximum depth controls the complexity of a single tree to avoid overfitting. These parameters are also determined from the candidate set and the validation process, aiming to obtain more robust discriminative outputs against noise and nonlinear relationships. If it is necessary to further improve the fitting ability to complex boundaries, this step can also add a gradient boosting tree model as a third supervised learning model. The gradient boosting tree model builds a strong classifier by gradually fitting the residuals. Its key parameters include the learning rate and the number of iterations. The learning rate is used to control the update magnitude of each step, and the number of iterations is used to control the model capacity. The above parameters are determined by the validation process and are used to balance underfitting and overfitting.

[0054] To ensure that the outputs of supervised learning models have a consistent meaning, this step unifies the outputs of all supervised learning models to the probability of exceeding the limit. Specifically, for any window feature vector... After the Support Vector Machine (SVM) model outputs decision values, these are converted into probability values ​​using a probability calibration method. This calibration method can employ logistic function fitting or ordinal-preserving regression fitting. Its inputs are the decision values ​​and the true labels of the training samples, and its output is the probability that the value lies in the interval [0,1]. This probability originates from the model output and the calibration fitting result, and its purpose is to allow the SVM model output to be integrated with other model outputs on the same scale. The Random Forest model itself can output the percentage of trees classified as out-of-bounds anomalies. This percentage naturally lies in the interval [0,1] and can be used as the out-of-bounds anomaly probability. Its source is the voting result of each decision tree in the forest, and its purpose is to characterize the model's confidence in out-of-bounds anomalies. If a gradient boosting tree model is used, it also outputs an out-of-bounds anomaly probability, which originates from the optimization result of the model's loss function and its final probability mapping form. Therefore, out-of-bounds anomaly probabilities for the same window of samples are obtained from various supervised learning models, denoted as […]. , where M is the number of supervised learning models used.

[0055] After obtaining the out-of-limit anomaly probabilities from multiple supervised learning models, this step fuses them to generate a supervised learning anomaly score. The fusion computation uses a weighted summation method: ; in, Let m be the fusion weights of the m-th supervised learning model, satisfying Fusion weights The source is not arbitrarily designated, but determined through validation data: in a set of labeled samples. The model is divided into a training subset and a validation subset. The training subset is used to train each supervised learning model, and the discriminative performance index of each model is calculated on the validation subset. Weights are then assigned to each model based on the discriminative performance index, giving higher weights to models with better discriminative performance. The purpose of these weights is to integrate the outputs of multiple models on the same probability scale, making the fusion result more stable than that of a single model. (Supervised learning anomaly score) The value range of is [0,1]. The larger the value, the more likely the supervised learning model group is to determine that the sample in this time window is consistent with the out-of-bounds anomaly category.

[0056] After the supervised learning fusion computation is completed, this step calculates the local outlier factor for samples within the same time window to obtain a local outlier score independent of category labeling. Here, the local outlier factor refers to a method that measures the degree of outlier status by comparing the local reachability density of a sample point with the local reachability density of its neighboring sample points. The basic idea is that if a sample within a window is located in a locally low-density region while its neighboring samples are located in relatively high-density regions, then that sample within the window is considered an outlier in the local space, and the degree of outlier status can be quantified by the local outlier factor. To ensure that the local outlier factor calculation targets points of fixed dimensions, this step uses the same window feature vector as the supervised learning. As a representation of sample points used in the calculation of local outlier factors, where The source of has been given above, and its use in the calculation of local outlier factors is reflected in providing a feature space representation of computable distances.

[0057] Calculating local outlier factors requires a preset neighborhood point number parameter K, where K represents the set of the K nearest neighbors in the feature space for each sample point. The neighborhood point number parameter K is derived from a preset candidate set and determined through validation with normal operating data: the local outlier factor distribution is calculated on samples within the normal operating window, and a K value is selected that ensures the local outlier factor distribution of normal samples is stable and the false alarm rate is below a preset upper limit. The purpose of K is to balance locality and stability; if K is too small, it will be sensitive to noise, while if K is too large, it will dilute local anomalies into the global structure and reduce sensitivity.

[0058] After determining K, for any window sample point First, calculate its comparison with other sample points. distance The distance metric can be Euclidean distance, and its calculation formula is as follows: ; in It is a norm 2. and All distance calculations are window feature vectors obtained through statistical operations within the time window samples, thus the source of the distance calculations is clear and repeatable. The purpose of the distance metric is to provide a ranking basis for neighbor selection. Based on the distance ranking, we obtain... K-nearest neighbor set The elements in the set are all related to The K sample points with the smallest distance.

[0059] After obtaining the nearest neighbor set, reachability distance is introduced to avoid instability in density calculation caused by excessively small nearest neighbor distances. First, sample points are defined. The K distance is ,in express The distance to its Kth nearest neighbor, the source of which is the pair The distance sorting results. Redefined. Compared to neighbors The reachable distance is: ; in Take the maximum of the two. The purpose of reachability distance is: when... and The distance is too small More representative When using the surrounding density scale, This serves as a lower bound, thus preventing local density from being abnormally amplified.

[0060] Define sample points based on reachability distance. Locally achievable density The local reachability density refers to the inverse average of the reachability distances of a sample point within its neighborhood, and its calculation formula is: ; The source of the summation term is... The reciprocal of the reachability distance calculation result is used to convert the distance scale into a density scale. The larger the average reachability distance, the sparser the neighborhood and the smaller the local reachability density.

[0061] After obtaining the local reachability density, define the sample points. Local outlier The local outlier factor here refers to the average of the ratios of the local reachability densities of each nearest neighbor point within the neighborhood to the local reachability density of the local outlier point itself. Its calculation formula is as follows: ; in, The source is the nearest neighbor. The local reachability density is calculated in the same way. This local outlier factor is used to quantify the difference in relative density within a neighborhood: when... When the local reachability density of a point is significantly lower than that of its neighboring points, the ratio in the above equation is generally greater than 1, thus the local outlier factor is significantly greater than 1, indicating that... It exhibits a disconnect in local space; when When the density is similar to that of the neighborhood, the local outlier factor is close to 1, indicating that the person is not an outlier.

[0062] It should be noted that the energy storage station uses the same model of lithium battery protection board to manage multiple battery clusters. The battery clusters are composed of cells from different batches, and there is a temperature gradient inside the battery clusters. Temperature measurement points The changes exhibit a combination of rapid and slow variations depending on the operating conditions. The protection board uses a sampling period... Collect individual cell voltages Battery pack current I(t), temperature Time window samples are constructed according to window length L and step size S. In each Following step two, the attention weight sequence can be obtained. Latent variable distribution parameters with abnormal scores The supervised learning anomaly score can be obtained by following the existing computational chain in step three. Local outlier scores .

[0063] However, near the pulse edge of the charging / discharging current I(t), the voltage of a few cells... A short-term abnormal condition occurred but did not trigger a protection action; within the same time period, a temperature gradient caused voltage sampling to occur. The overall offset drifts slowly; simultaneously, cell aging causes voltage drop to accumulate slowly and evolve across multiple windows. It should be noted that, in this scenario, samples within the same time window... Multiple factors may overlap and mask each other: It may be sensitive to the pulse edge morphology and thus increase, but The score is low due to missing protective action markers; It may treat operating condition changes or distribution drift as outliers and increase them, but it does not highlight the true precursors to exceeding limits. Furthermore, because operating conditions change over time and density distribution drifts over time, the scale meaning of the three types of scores is not constant under different operating conditions, which makes it impossible for fixed comparison rules to reliably distinguish between precursors to exceeding limits, sampling drift, and slow aging.

[0064] Therefore, in this embodiment, when obtaining supervised learning anomaly scores... Local outlier scores Subsequently, to ensure that the three types of evidence can still form a consistent basis for judgment under conditions of rapid insertion and removal leading to the migration of multiple distribution clusters, loss of protective action markers, and rapid changes in density structure, this step does not directly address... and Instead of using fixed-scale comparisons and fixed-weighted summation, it performs comparisons for samples within each time window. Construct several quantities corresponding to the running state of the window, and base the values ​​on the window. , , After performing calibration on each sample, a comprehensive anomaly score is generated. First, to characterize whether anomalies within the time window are concentrated in a few sampling moments, the attention weight sequence output from step two is used. Concentration within the construction window Its definition is: ; Where the numerator is the maximum value of the attention weights within the window, and the denominator is the average value of the attention weights within the window. Since the attention weights satisfy... Therefore, the denominator is 1 or L, thus This can be understood as the amplification factor of the case where the maximum attention weights are distributed relatively evenly. The data source is entirely the attention weights calculated in step two, without introducing external data; its purpose is to reflect whether the significant contribution moments of the window exhibit a peak-like concentration, which corresponds to short-time jumps near the edge of the current pulse in the scene. When short-time jumps cause a significant increase in contribution at a few moments, It will increase.

[0065] Secondly, to characterize the overall shape migration phenomenon between windows caused by quick insertion and removal, the mean vector of latent variables output in step two is used. Construction window migration amplitude Its definition is: ; in, It is a norm 2. This is the vector of latent variable means corresponding to the samples from the previous time window. The source is entirely from the output of the encoding mapping in step two. and Its purpose is to transform the multi-cluster distribution and rapid migration into a computable inter-window difference; when a quick plug-in / plug-out switch or abrupt changes occur in the running sub-distribution, It usually increases significantly.

[0066] Furthermore, to characterize the applicability of supervised learning evidence in cases where protective action labels are missing or locally sparse, this step utilizes the window feature vector constructed in step three. With labeled training sample set Calculate window tag proximity Specifically, within the same feature space, for Select its K nearest neighbor sets Where K and the nearest neighbor selection method use the same parameters and distance definitions as the local outlier factor calculation to ensure consistency in the neighborhood scope. Redefined: ; in, Label the window categories of the training samples. Indicates an out-of-limits exception window flag. Indicates a normal window marker; Therefore, it represents the proportion of out-of-bounds anomaly markers among neighborhood samples similar to the current window. The data source is the labeling of training samples. And the feature space nearest neighbor relationship; its purpose is to quantify whether the supervised learning model has sufficient labeled support in the vicinity of the current window. For windows that jump briefly in the scene but do not trigger protection action recording, the neighborhood often lacks nearest neighbor relationships; its purpose is to quantify whether there are sufficient labeled support in the vicinity of the current window for supervised learning models. For windows that jump briefly in the scene but do not trigger protection action recording, there is often a lack of labeled support in the neighborhood. The sample with =1, therefore It may be too small, used to characterize the scarcity of marker evidence.

[0067] In obtaining , , Next, this step performs in-window caliber correction on the scores of the three types of outliers to maintain comparability under conditions of distribution migration and sparse labeling. To avoid introducing untraceable constants, the scaling benchmark used in this step is the set of normal window samples within the stable operating period determined in step one. According to statistics, the aforementioned The source and selection rules have been clarified in steps one and three. Specifically, first in the set Calculate separately , , , The mean and standard deviation are obtained. , , , The source of each group's mean and standard deviation is a set. The sample statistics are then used to standardize the current window value, yielding the following results: ; ; ; ; in, This indicates the deviation scale of the variational autoencoder outlier score relative to the normal baseline. This indicates the deviation of the concentration within the window from the normal baseline. This indicates the deviation of the inter-window migration magnitude from the normal baseline. This represents the deviation scale of local outlier scores relative to the normal baseline. The purpose of this standardization is to transform quantities with different dimensions and numerical ranges to the same scale of relative deviation from the normal baseline, and this scale is entirely determined by statistics from stable operating periods. in, This indicates the deviation scale of the variational autoencoder outlier score relative to the normal baseline. This indicates the deviation of the concentration within the window from the normal baseline. This indicates the deviation of the inter-window migration magnitude from the normal baseline. This represents the deviation scale of local outlier scores relative to the normal baseline. The purpose of this standardization is to transform quantities with different dimensions and numerical ranges to the same scale of relative deviation from the normal baseline, and this scale is entirely determined by statistics from stable operating periods. ; in, It is an exponential function. To The logical function mapping takes values ​​in the range (0,1). The purpose of this logical mapping is to convert the concentration deviation into a smoothing adjustment coefficient: when... When the value is large, the adjustment coefficient approaches 1, making near ;when When the value is small, the adjustment coefficient decreases, making... The contribution is relatively reduced. All quantities in this formula are derived from the output of step two and the statistical results of the set Ω; Regarding the abnormal supervised learning scores, considering the issue of missing protective action labels in the scene leading to low supervised learning probabilities, and the reduced output reliability of the supervised learning model when neighborhood labels are sparse, the corrected supervised learning score is defined as follows: ; in, This is the lower bound coefficient, with a value range of (0,1), used to prevent the adjustment coefficient from reaching 0 and causing the term to become completely ineffective; The slope coefficient is used to control the logic function. Sensitivity to change; The center point parameter indicates the level at which the neighboring label proximity can be considered to have sufficient label support for the supervised learning output. , , The sources are all determined during the verification process: adjustments are made on labeled verification window samples. , , This enables supervised learning evidence to be used in To prevent accidental magnification on lower windows, A higher window size allows for a more comprehensive demonstration of its discriminative ability. The purpose of the above formula is to bind the supervised learning anomaly score to its local label support level: when... At higher values, the logic function value approaches 1. near ;when At lower levels, the logic function value approaches 0, and the adjustment coefficient approaches... This limits the impact of supervised learning scores on sparsely labeled regions to a manageable level.

[0068] Wherein, in this formula The source is the training label neighborhood statistics, which meets the traceability requirement.

[0069] For local outlier scores, considering that rapid insertion and removal in the scene can cause the distribution of multiple clusters to shift, leading to a rearrangement of local density structures in a short period of time, which may increase the local outlier score even during normal switching windows, the inter-window migration amplitude is adjusted. As the basis for correction, the corrected local outlier score is defined as: ; Where λ>0 is the slope coefficient, which is determined during the verification process and is used to control the slope when... The strength of suppression of local outlier scores when increased; The value range of is (0,1), when When the value is large, the coefficient approaches 0, making The contribution is significantly reduced, thereby reducing the impact of distribution migration causing density rearrangements to be mistakenly identified as anomalies; when When the coefficient is small, it is close to 1 or 2 or close to 1, which makes the local outlier scores effective when the distribution is relatively stable.

[0070] Score after three corrections , , Next, this step further constructs the consistency of evidence within the same window. This reflects whether the three corrected scores show a consistent direction within the window. The consistency of evidence is defined as the inverse vector of the dispersion of the three corrected scores, specifically: ; in, This indicates that the standard deviation is calculated for the three scalars; a larger standard deviation indicates a greater difference among the three pieces of evidence. The smaller the standard deviation, the more consistent the three pieces of evidence are. The larger. The source of the score is entirely the three corrected scores calculated in this step, without introducing external information; its purpose is to explicitly quantify whether the evidence within the same window is conflicting, so as to avoid the overall score being dominated by abnormal fluctuations of a single piece of evidence when there is a significant conflict of evidence.

[0071] Finally, a comprehensive anomaly score is defined for the samples within this time window. This is the aggregated result of the combined effects of the three correction scores and the consistency of evidence. In this implementation, the bounded mapping value of the correction score is calculated first: ; ; in, , , All three are located in the (0,1) interval, and their purpose is to convert the corrected scores into aggregateable quantities within a unified interval. Then, the three are aggregated in the following form: ; in, , , The index weights corresponding to this window satisfy the following conditions: , , And defined as: ; ; ; in, , , In the above definition, The coefficients are determined during the validation process: each coefficient is adjusted on labeled validation window samples to ensure that the overall anomaly score's discrimination between out-of-limit anomaly windows and normal windows reaches a preset target and remains stable. Its purpose is to map the window state quantity related to the evidence into driving quantities of the exponential weights, so that the exponential weights change with the window state. The aforementioned exponential weights are in an exponentially normalized form, making... This ensures that the three contributions are comparable on the same scale and that there are no cases where the source of the weights is unclear.

[0072] The aggregation form Its purpose is: when a piece of evidence... Higher and its corresponding weight When the value is large, the overall anomaly score will increase significantly; when conflicting evidence leads to a higher degree of consistency... At lower levels, each Zhongyu Related items will have their weights reduced accordingly, making it less likely for the overall abnormal score to be amplified by occasional fluctuations from a single piece of evidence; when rapid insertion and removal occur, leading to a shift in the amplitude... When it increases, In This will suppress the weight of local outlier evidence, thereby reducing the false positive impact of density rearrangement; when edge concentration occurs within the window, In The term enhances the weight of variational autoencoding evidence, thereby increasing sensitivity to short-term jump patterns; when the neighborhood label proximity... At higher levels, In This will increase the weight of supervised learning evidence, enabling it to play a stable discriminative role in regions where the labeling is sufficiently supportive.

[0073] Step 4: Trigger the out-of-limit anomaly judgment based on the comprehensive anomaly score, and output the out-of-limit anomaly result and record; like Figure 2 As shown, in this step, for each time window sample obtained in step three... Comprehensive abnormal score The system performs an out-of-limit anomaly detection and outputs the detection result. Here, out-of-limit anomaly detection means: under the constraints of clear threshold rules and persistence rules, converting the numerical result of the anomaly score into a conclusion on whether the sample in the time window corresponds to an out-of-limit charge / discharge anomaly, and when the conclusion is true, giving the out-of-limit anomaly type, the range of cells involved, and the time interval of occurrence.

[0074] First, determine the overall anomaly score threshold. The comprehensive anomaly score threshold The data source is obtained using a statistical threshold method based on a normal window sample set. Specifically, within the stable operating period determined in step one, a time window sample set Ω consisting only of normal operations is selected, and a comprehensive anomaly score is calculated for all window samples within set Ω. Calculate the mean on this score set. with standard deviation ,in The arithmetic mean of the score set. Let be the standard deviation of the score set, and both are derived from the calculation results of the set Ω. Then, determine the comprehensive anomaly score threshold using the following formula: ; Here, γ is the threshold coefficient, derived from a preset candidate set and determined by the false positive rate constraint of the validation window samples. Specifically, γ is adjusted on the labeled validation samples to ensure that the proportion of normal window samples being falsely classified as abnormal is below a preset upper limit, while minimizing the false negative rate of samples exceeding the limit. The purpose of γ is to control the stringency of the comprehensive anomaly score threshold; a larger γ results in a higher threshold, fewer false positives, but a higher risk of false negatives; a smaller γ results in a lower threshold, fewer false negatives, but a higher risk of false positives. Through this method, the threshold is... It has a clear source and adjustable control parameters.

[0075] After obtaining the comprehensive anomaly score threshold Then, single-window anomaly detection is performed on each time window sample. The technical action of single-window anomaly detection is to compare the comprehensive anomaly scores of that window. With threshold When satisfied When, the sample in that time window is recorded as a candidate anomaly window; when When this time window sample is selected, it is designated as a non-abnormal window. The purpose of this comparison is to map continuous numerical scores to a preliminary candidate set. However, this step does not directly output the final conclusion based on the candidate results of a single window. Instead, it further introduces persistence rules to exclude short-term noise triggers.

[0076] Subsequently, persistent anomaly confirmation is performed to convert the candidate anomaly window sequence into out-of-limit anomaly events. Persistent anomaly confirmation here means that candidate anomaly windows must appear consecutively for a preset duration before an out-of-limit anomaly event is confirmed. Let the persistence threshold be M, where M represents the minimum number of consecutive candidate anomaly windows. M is not arbitrarily assigned but is determined by the sampling period. Window step size S and minimum effective duration of out-of-limit anomalies It is derived that, where This information is derived from the protection strategy or safety requirements of the protection board regarding the duration of over-limit events, or from statistical results of the shortest confirmed over-limit anomalies in historical over-limit events. Since the interval between the starting points of adjacent windows is... The minimum sustained span covered by M consecutive windows can be approximated as: Therefore, it can be determined by the following formula: ; in This indicates rounding up, and its purpose is to ensure that the time span of continuous candidate anomaly coverage is not less than [a certain value]. This persistent rule ensures that when a candidate anomaly window appears only briefly but does not reach the persistent threshold, the out-of-limit anomaly event is not confirmed, thereby reducing misjudgments caused by transient interference.

[0077] Once a sequence of candidate anomaly windows satisfying the persistence condition is confirmed, this step determines the time interval corresponding to the out-of-limit anomaly event. Specifically, let the starting window number of the continuous candidate anomaly window sequence be... The termination window number is The start time of the out-of-limit exception event is then taken as the window. The start sampling time The termination time is taken as the window The last sampling time The above timestamps originate from step one, which unifies the timeline. Because of the sliding window segmentation rule, the time interval can be directly calculated from the window number and can be traced back to the original sampling time.

[0078] After determining the time interval of the over-limit anomaly event, this step determines the type of over-limit anomaly, which is at least distinguished as charging over-limit anomaly and discharging over-limit anomaly. The data used for type determination are all derived from the original sampling sequence in step one and maintain the same caliber: charging over-limit anomaly refers to an anomaly in which the direction of the battery pack current I(t) is consistent with the charging direction and there is a risk of voltage exceeding the upper limit within the event time interval; discharging over-limit anomaly refers to an anomaly in which the direction of the battery pack current I(t) is consistent with the discharging direction and there is a risk of voltage exceeding the lower limit within the event time interval. To ensure that the consistent charging and discharging directions have an implementable criterion, this step determines the direction by current sign convention, that is, in the protection board calibration, I(t)>0 is defined as charging current and I(t)<0 is defined as discharging current, or the definition of current direction in the protection board communication protocol is used as the basis; the source of this convention is the calibration and protocol definition of the protection board current sampling channel, and its purpose is to replace fuzzy descriptions with calculable sign criteria. The specific action of type determination is: within the time interval of the over-limit anomaly event... The sign ratio or sign median of the current is calculated within the interval; for example, the median of I(t) within that interval is taken. ,when The event is determined to be a charging over-limit anomaly. The event is determined to be an out-of-limit discharge anomaly. The purpose of using the median is to reduce the impact of symbol jitter at individual sampling points on the direction determination. The median is derived from the statistical calculation results of the sampling current sequence within the interval.

[0079] After determining the direction, this step further identifies the range of cells associated with the over-limit anomaly, in order to correlate the over-limit anomaly with the specific cell voltage behavior. Specifically, within the time interval of the over-limit anomaly event, the voltage sequence of each cell numbered i is determined. Calculate the maximum value within the interval and minimum value ,in , Both originate from the actual sampled voltage sequence within that time interval. Subsequently, the charging cutoff voltage threshold set by the protection board is read. With discharge cutoff voltage threshold The aforementioned and The source is the protection board parameter configuration or firmware setting value, which belongs to the predetermined threshold of the protection board's operation strategy, and can be obtained by reading the configuration file or communication message. If this event is determined to be a charging over-limit anomaly, then it will satisfy... The set of cell numbers is determined as the set of cells associated with exceeding the discharge limit; if the event is determined to be a discharge exceeding the limit anomaly, then the following conditions will be met. The set of cell numbers is determined as the set of cells associated with exceeding the voltage threshold. The purpose of the above comparison action is to establish a verifiable correspondence between the event triggered by the abnormal score and the specific cell that exceeds the voltage threshold, where the source of the threshold is clear and the comparison rules are reproducible.

[0080] Once the type of out-of-limit anomaly and the set of cells associated with it are determined, this step outputs the out-of-limit anomaly results and generates a record. The output must include at least: the start time of the out-of-limit anomaly event. End time Type of out-of-limit anomaly, set of cells associated with the out-of-limit anomaly, and peak value of the comprehensive anomaly score corresponding to the event. The window number where the peak occurred. Here, the peak value of the overall anomaly score. Derived from the set of window numbers covered by this event The maximum value of the comprehensive anomaly score is used to provide a quantitative indicator of the anomaly intensity of the event; the peak window number is used to locate the time window where the anomaly is most significant, thus allowing backtracking to the corresponding original sampling segment. The recording method can be to write the above output to the protection board's operation log or to report communication messages. The recording medium belongs to the protection board's existing recording mechanism, and its purpose is to preserve a traceable chain of evidence for out-of-limit anomalies.

[0081] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0082] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0083] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and inventive constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0084] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0085] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0086] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting over-limit charging and discharging anomalies in lithium battery protection boards based on data analysis, characterized in that, include: During charging and discharging, the protection board collects the voltage of individual cells, the current of the battery pack and the temperature at sampling periods, and constructs a time window sample matrix under a unified set of discrete sampling times; Using the time window sample matrix as input, the attention score and attention weight are calculated and the attention convergence vector is generated. The latent variables are obtained and the window is reconstructed. The anomaly score and attention weight sequence are output. For each time window sample, supervised learning anomaly score and local outlier anomaly score are obtained, and the concentration within the window is calculated by the attention weight sequence, the migration amplitude between windows is calculated by the mean vector of adjacent latent variables, and the proximity of window labels is calculated by the nearest neighbor label statistics. Standardization is performed on the normal window sample set based on the stable operating period, three correction scores are generated and the evidence consistency is calculated; after the three correction scores are bounded and mapped, exponential normalized weights are generated based on the concentration within the window, the migration amplitude between windows, the proximity of the window label and the evidence consistency, and the comprehensive anomaly score is obtained by aggregation. Threshold and persistence determination is performed on the comprehensive anomaly score to confirm the over-limit anomaly event, determine the over-limit charging or over-limit discharging anomaly and the set of cells associated with the over-limit, and output the recorded results.

2. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 1, characterized in that: During charging and discharging, the protection board collects individual cell voltage, battery pack current, and temperature at a sampling period constrained by both hardware sampling capability and over-limit observation resolution. It also establishes a unified discrete sampling time set using timestamps to achieve time alignment of the three types of channels: for each unified time, the original samples of each channel are mapped to the closest sampling time; when missing points occur, linear interpolation is used for cell voltage and temperature, and forward hold is used for currents that may experience step jumps to complete the multidimensional observation vector at the same time.

3. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 2, characterized in that: Impossible values ​​are eliminated based on the range of the protection board and the reasonable range of the sensor. Within the neighborhood window, the median or mean of the neighborhood and the median of the absolute deviation are used to determine and replace local spikes with neighborhood statistics to obtain purified multidimensional time series data. Then, the mean and standard deviation of each feature are calculated on the clearly selected stable operation statistical interval and standardized to obtain normalized multidimensional time series features. Finally, the normalized multidimensional time series features are slid segmented according to the window length and window step size. Within each window, the feature vectors corresponding to multiple consecutive unified moments are stacked in time order to construct a time window sample matrix.

4. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 3, characterized in that: Using the constructed time window sample matrix as input, each time window sample is represented as a normalized multidimensional feature vector sequence arranged in chronological order. Attention scores are calculated for each sampling time within the window, and attention weights are obtained through exponential normalization. After the sum of the attention weights is equal to one, the feature vectors at each time within the window are weighted and converged to generate an attention convergence vector. Then, the mean vector and variance vector of the latent variables are generated by encoding and mapping using this attention convergence vector. Latent variable samples are obtained by reparameterized sampling, and a reconstructed window with the same shape as the input window is generated by decoding and mapping. Subsequently, the reconstruction error is obtained by calculating the squared error of the input window and the reconstruction window time by time and dimension by dimension and accumulating them within the window. At the same time, the Kuhlberg-Klebler divergence of the approximate posterior distribution of the latent variable relative to the standard normal prior distribution is calculated. The reconstruction error and the divergence are then weighted and summed according to preset weight coefficients to obtain the variational autoencoder total loss of the window. This total loss is then defined as the outlier score of the sample in the time window. Meanwhile, the attention weight sequence corresponding to the window is retained to trace the key sampling time positions that contribute significantly to the convergence vector within the window.

5. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 4, characterized in that: For each constructed time window sample, on the one hand, the timestamp of the protection action of the protection plate is used as the anchor point of the out-of-limit abnormal event, and the window category label is established according to the time coverage relationship with the sliding window to form a labeled training sample pair; on the other hand, the normalized sequence within each time window is used to extract the window feature vector by fixed statistical operation, and the time series window is converted into a fixed dimension representation that can be input into the supervised model by calculating the window mean, standard deviation, maximum value, minimum value, first and last difference and slope index. Based on the feature vector and category label, at least two supervised learning models with different principles are trained and their output is unified as the out-of-limit abnormal probability. Then, the probabilities of each model are weighted and summed according to the fusion weight determined in the verification process to generate the supervised learning abnormal score. On the other hand, using the same window feature vector as the feature space sample points, after verifying and determining the number of neighborhood points based on normal operation data, the distance between sample points is calculated and a nearest neighbor set is selected. The reachability distance is introduced to construct the local reachability density. Then, the ratio of the local reachability density of the nearest neighbor to its own local reachability density is averaged to obtain the local outlier factor as the local outlier score. Thus, the corresponding scores are output on the two links of supervision evidence that depends on protection action labels and density outlier evidence that does not depend on labels, respectively, and input is provided for subsequent normalization and comprehensive outlier score generation.

6. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 5, characterized in that: The protection board collects individual cell voltage, battery pack current and temperature at sampling period to form time window samples, and obtains the attention weight sequence, latent variable distribution parameters and corresponding anomaly scores of the variational autoencoder link output in each time window. At the same time, it obtains supervised learning fusion anomaly scores and local outlier anomaly scores. Subsequently, for each time window, the concentration within the window is calculated using the attention weight sequence. The concentration within the window is determined by the ratio of the maximum value of the attention weight within the window to the average value of the attention weight within the window, in order to characterize whether the abnormal contribution is concentrated in a few sampling times. The migration amplitude between windows is calculated using the L2 difference of the mean vectors of latent variables in adjacent time windows, in order to characterize the overall degree of morphological migration between windows. The window label proximity is calculated by using the window feature vector to select a nearest neighbor set in the feature space and statistically analyzing the proportion of out-of-limit abnormal labels in the nearest neighbor training samples, in order to characterize the degree of label support near the window.

7. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 6, characterized in that: After obtaining the concentration within the window, the migration amplitude between windows, and the proximity of the window label, the mean and standard deviation of the relevant quantities are statistically obtained from the normal window sample set during the stable operation period. The variational autoencoder anomaly score, the concentration within the window, the migration amplitude between windows, and the local outlier anomaly score are standardized. Then, based on the standardized concentration within the window, the variational autoencoder anomaly score is adjusted by a logistic function; based on the window label proximity, the supervised learning anomaly score is adjusted by a logistic function; and based on the standardized migration amplitude between windows, the local outlier anomaly score is adjusted by a logistic function, resulting in three correction scores. The consistency of evidence is then calculated from the three corrected scores, which are obtained by inverse mapping of the standard deviations of the three corrected scores. Finally, the three corrected scores are boundedly mapped to obtain aggregateable quantities, and the concentration within the window, the proximity of the window label, the migration amplitude between windows, and the consistency of evidence are used to generate an exponentially normalized weight. The three aggregateable quantities are then aggregated according to the weights to generate the comprehensive anomaly score for the time window.

8. The method for detecting over-limit charging and discharging anomalies of lithium battery protection boards based on data analysis according to claim 7, characterized in that: For the comprehensive anomaly score of each time window sample, firstly, select a normal window sample set within a determined stable operating period and calculate the mean and standard deviation of the comprehensive anomaly score of the set, thereby generating a comprehensive anomaly score threshold; then, compare the comprehensive anomaly score of each time window with the threshold, and record the windows that meet the threshold conditions as candidate anomaly windows, and calculate the minimum number of consecutive candidate anomaly windows based on the sampling period, window step size and minimum effective duration of exceeding the limit, and confirm the sequence of candidate anomaly windows that continuously meet the threshold as an out-of-limit anomaly event; Subsequently, the start and end sampling times of the event are calculated from the start and end window numbers of the sequence to determine the event time interval. Within this time interval, charging over-limit anomalies or discharging over-limit anomalies are determined based on the sign statistics of the battery pack current. At the same time, the maximum or minimum value of the interval is calculated for the voltage sequence of each cell and compared with the charging cut-off voltage threshold or discharging cut-off voltage threshold configured on the protection board to determine the set of cells associated with the over-limit. Finally, the over-limit anomaly results are output and recorded, including the event start time, end time, over-limit anomaly type, set of cells associated with the over-limit, peak value of the comprehensive anomaly score within the event coverage window, and peak window number.