Battery anomaly diagnosis method and device, storage medium and electronic equipment

CN122901689APending Publication Date: 2026-10-13HUNAN CSR TIMES ELECTRIC VEHICLE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611398501.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-10
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

相关电池异常诊断技术多依赖人工经验设定的固定阈值,或采用传统自编码器进行点对点确定性映射学习,面临多源异构数据适配性差、跨车型泛化能力弱、异常判定边界不清晰、误报漏报率高、模型可解释性不足、单批次评估结果方差大等问题,难以支撑规模化、高可靠的动力电池运维与故障预警需求

Benefits of technology

[0015]本发明涉及新能源汽车电池故障诊断技术领域,特别涉及一种电池异常诊断方法、装置、存储介质及电子设备,其中,方法包括:获取不同车载终端上传的车辆时序充电数据;对车辆时序充电数据进行预处理得到归一化充电片段数据集;将归一化充电片段数据集输入预训练的变分自编码器模型进行重构计算得到重构误差集;基于重构误差集进行异常判定得到电池异常诊断结果;能够有效提升电池异常诊断准确率与跨车型泛化能力,降低误报漏报率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122901689A_ABST
    Figure CN122901689A_ABST
Patent Text Reader

Abstract

The present application relates to the new energy automobile battery fault diagnosis technical field, especially in kind of battery abnormal diagnosis method, device, storage medium and electronic equipment, wherein, the method includes: obtaining the vehicle time sequence charging data uploaded by different vehicle terminals;The vehicle time sequence charging data is preprocessed to obtain the normalized charging segment data set;The normalized charging segment data set is input into the pre-trained variational autoencoder model to obtain the reconstruction error set by reconstruction calculation;Based on the reconstruction error set, the abnormality is determined to obtain the battery abnormal diagnosis result;Can effectively improve the battery abnormal diagnosis accuracy and the cross-model generalization ability, reduce the false alarm and the missing report rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy vehicle battery fault diagnosis technology, and in particular to a battery anomaly diagnosis method, device, storage medium and electronic equipment. Background Technology

[0002] With the surge in electric vehicle ownership, the safe operation and status monitoring of power batteries have become a key concern in the new energy industry, leading to an exponential increase in the volume of high-frequency time-series charging data generated by on-board battery systems. Current battery anomaly diagnosis technologies largely rely on fixed thresholds set manually based on experience, or employ traditional autoencoders for point-to-point deterministic mapping learning. These technologies face challenges such as poor adaptability to multi-source heterogeneous data, weak cross-vehicle generalization ability, unclear anomaly judgment boundaries, high false positive and false negative rates, insufficient model interpretability, and large variance in single-batch evaluation results. Consequently, they struggle to support the demands of large-scale, highly reliable power battery operation and maintenance and fault early warning. This field suffers from low accuracy and poor generalization in battery anomaly diagnosis. Summary of the Invention

[0003] In a first aspect, the present invention provides a battery anomaly diagnosis method, comprising: acquiring vehicle time-series charging data uploaded by different vehicle terminals; preprocessing the vehicle time-series charging data to obtain a normalized charging segment dataset; inputting the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation to obtain a reconstruction error set corresponding to each charging segment; and performing data-driven anomaly determination based on the reconstruction error set to obtain a battery anomaly diagnosis result including the vehicle's health status.

[0004] In some embodiments, the vehicle time-series charging data is preprocessed to obtain a normalized charging segment dataset, including: using multi-encoding backoff parsing on the vehicle time-series charging data to obtain structured charging time-series data; performing sliding window segmentation on the structured charging time-series data based on current polarity and state of charge monotonicity to obtain a set of independent charging segments; and performing extreme value normalization on the continuous features in the set of independent charging segments to obtain a normalized charging segment dataset.

[0005] In some embodiments, the vehicle time-series charging data is parsed using multi-encoding backoff to obtain structured charging time-series data, including: attempting to decode the vehicle time-series charging data in sequence according to the priority of GB2312, UTF-8, and LATIN1; if the current encoding fails to decode, it automatically switches to the next priority encoding until decoding is completed; and performing missing value interpolation and physical extreme value filtering on the decoded data to obtain structured charging time-series data.

[0006] In some embodiments, the structured charging time series data is segmented by a sliding window based on the current polarity and the monotonicity of the state of charge to obtain a set of independent charging segments. This includes: detecting current polarity jump points and state of charge monotonicity reversal points in the structured charging time series data through a sliding window; dividing the continuous time series data into independent charging segments based on the jump points and reversal points; and removing the discharging segments to obtain a set of independent charging segments.

[0007] In some embodiments, the pre-trained variational autoencoder model is obtained through the following steps: acquiring a historical normalized charging segment dataset under normal operating conditions, and dividing the historical normalized charging segment dataset into a training set and a test set; inputting the training set into the encoder of the variational autoencoder for feature mapping to obtain latent variable distribution parameters; sampling the latent variable distribution parameters through reparameterization to obtain latent vectors, and inputting the latent vectors into the decoder for reconstruction calculation to obtain reconstructed samples; constructing a joint loss function based on the mean square error of the reconstructed samples and the original samples of the training set, and the KL divergence between the latent variable distribution and the standard normal distribution, and iteratively updating the network weights until convergence to obtain the pre-trained variational autoencoder model.

[0008] In some embodiments, data-driven anomaly determination based on the reconstruction error set is used to obtain battery anomaly diagnostic results including vehicle health status. This includes: grouping the reconstruction error set according to the vehicle's unique identifier and calculating the average reconstruction error of each vehicle; comparing the average reconstruction error of each vehicle with a dynamic threshold, and marking the vehicle as an abnormal vehicle if the average reconstruction error is greater than the dynamic threshold, otherwise marking it as a normal vehicle; and generating battery anomaly diagnostic results based on the marking results of all vehicles, wherein the dynamic threshold is pre-calibrated based on the 95% confidence interval of the reconstruction error distribution of historical normal samples.

[0009] In some embodiments, after generating battery anomaly diagnosis results based on the labeling results of all vehicles, the method further includes: performing dimensionality reduction visualization on the latent vectors output by the variational autoencoder and the original features respectively, generating a visualization map including the separation effect of normal clusters and abnormal clusters; generating a three-level structured output file, including a time step-level detail file, a vehicle-level score file, and an abnormal vehicle list file.

[0010] In some embodiments, before generating a visualization map showing the separation effect between normal and abnormal clusters, the method further includes: performing a 5-fold cross-partition on the historical normalized charging segment dataset to obtain 5 sets of alternating training and test sets; training a variational autoencoder model on each training set in turn and evaluating it on the corresponding test set; collecting the abnormality ratio, score distribution, and latent vector coordinates of each evaluation set; calculating the global statistics and performance standard deviation; and generating a cross-fold comparison report.

[0011] In some embodiments, the latent vectors and original features output by the variational autoencoder are subjected to dimensionality reduction and visualization to generate a visualization map that includes the separation effect of normal clusters and abnormal clusters. This includes: performing principal component analysis and t-distribution neighborhood embedding nonlinear dimensionality reduction on the latent vectors and original features respectively; marking normal vehicles as first-class identifiers and abnormal vehicles as second-class identifiers to draw scatter plots; and calculating the explained variance of each principal component to generate a dimensionality reduction map as a visualization map.

[0012] Secondly, the present invention provides a battery anomaly diagnosis device, comprising: a data acquisition module configured to acquire vehicle time-series charging data uploaded by different vehicle terminals; a preprocessing module configured to preprocess the vehicle time-series charging data to obtain a normalized charging segment dataset; a reconstruction calculation module configured to input the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation to obtain a reconstruction error set corresponding to each charging segment; and an anomaly determination module configured to perform data-driven anomaly determination based on the reconstruction error set to obtain a battery anomaly diagnosis result including the vehicle's health status.

[0013] Thirdly, the present invention provides a storage medium on which program code is stored, and when the program code is executed by a processor, the above-mentioned battery abnormality diagnosis method is implemented.

[0014] Fourthly, the present invention provides an electronic device, which includes a memory and a processor. The memory stores program code that can run on the processor. When the program code is executed by the processor, it implements the above-mentioned battery abnormality diagnosis method.

[0015] This invention relates to the field of new energy vehicle battery fault diagnosis technology, and particularly to a battery anomaly diagnosis method, device, storage medium, and electronic device. The method includes: acquiring vehicle time-series charging data uploaded from different vehicle terminals; preprocessing the vehicle time-series charging data to obtain a normalized charging segment dataset; inputting the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation to obtain a reconstruction error set; and performing anomaly determination based on the reconstruction error set to obtain a battery anomaly diagnosis result. This method can effectively improve the accuracy of battery anomaly diagnosis and its cross-vehicle generalization ability, while reducing false alarm and false negative rates. Attached Figure Description

[0016] The invention will now be described in more detail with reference to embodiments and the accompanying drawings: Figure 1 This is a flowchart illustrating a battery anomaly diagnosis method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a battery malfunction diagnosis device provided in an embodiment of the present invention; Figure 3A schematic diagram of the overall architecture of a VAE anomaly detection model provided as an application example of the present invention; Figure 4 A schematic diagram of a data preprocessing and five-fold partitioning process is provided as an application example of the present invention; Figure 5 A schematic diagram illustrating the multi-dimensional visualization effect of the latent variable space, provided as an application example of the present invention; Figure 6 This is a schematic diagram illustrating the execution and result output process of an anomaly diagnosis module, provided as an application example of the present invention.

[0017] In the accompanying drawings, the same parts are referred to by the same reference numerals, and the drawings are not drawn to scale. Detailed Implementation

[0018] To enable those skilled in the art to better understand the present invention and to fully understand and implement the process of how the present invention uses technical means to solve technical problems and achieve corresponding technical effects, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. The embodiments of the present invention and the various features therein can be combined with each other without conflict, and the resulting technical solutions are all within the protection scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0021] With the surge in electric vehicle ownership, the safe operation and status monitoring of power batteries have become a key concern in the new energy industry, leading to an exponential increase in the volume of high-frequency time-series charging data generated by on-board battery systems. Current battery anomaly diagnosis technologies largely rely on fixed thresholds set manually based on experience, or employ traditional autoencoders for point-to-point deterministic mapping learning. These technologies face challenges such as poor adaptability to multi-source heterogeneous data, weak cross-vehicle generalization ability, unclear anomaly judgment boundaries, high false positive and false negative rates, insufficient model interpretability, and large variance in single-batch evaluation results. Consequently, they struggle to support the demands of large-scale, highly reliable power battery operation and maintenance and fault early warning. This field suffers from low accuracy and poor generalization in battery anomaly diagnosis.

[0022] To address the aforementioned technical problems, this invention proposes a battery anomaly diagnosis method and apparatus. The implementation details of this invention are described below. The following content is for illustrative purposes only and is not essential for implementing this solution.

[0023] Example 1 Figure 1 This is a flowchart illustrating a battery anomaly diagnosis method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, in this embodiment, a battery anomaly diagnosis method is provided, including: acquiring vehicle time-series charging data uploaded by different vehicle terminals; preprocessing the vehicle time-series charging data to obtain a normalized charging segment dataset; inputting the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation to obtain a reconstruction error set corresponding to each charging segment; and performing data-driven anomaly determination based on the reconstruction error set to obtain a battery anomaly diagnosis result including the vehicle's health status.

[0024] In this embodiment, the technical solution first acquires vehicle time-series charging data uploaded by different vehicle terminals. This data refers to high-frequency time-series data collected by various brands of vehicle BMS, containing parameters such as total voltage, total current, cell voltage, state of charge, and temperature. Next, the vehicle time-series charging data is preprocessed. Preprocessing involves encoding and parsing the raw data, segmenting it according to operating conditions, and unifying its scale to obtain a normalized charging segment dataset with consistent physical boundaries and feature scales. Then, the normalized charging segment dataset is input into a pre-trained variational autoencoder model for reconstruction calculation. The variational autoencoder is a generative model containing an encoder and decoder structure that can learn the distribution of normal charging data. Reconstruction calculation refers to the process of mapping the input to latent variables through the encoder and then restoring the input through the decoder, obtaining the reconstruction error set for each charging segment. Finally, based on the reconstruction error set, data-driven anomaly detection is performed. This data-driven anomaly detection refers to a judgment logic that sets a threshold based on the error distribution of normal samples, obtaining a battery anomaly diagnosis result that includes the vehicle's health status.

[0025] The technical solution of this embodiment eliminates the interference of data heterogeneity and operating condition differences by uniformly preprocessing multi-source charging data. It adopts a pre-trained variational autoencoder to learn the distribution characteristics of normal charging data and uses reconstruction error as the basis for anomaly judgment, replacing the deterministic mapping of manual experience thresholds and traditional autoencoders. This improves the accuracy of battery anomaly diagnosis, enhances the model's adaptability to charging data of different brands and models, reduces the migration cost of cross-model deployment, and effectively reduces the false alarm and false negative rates based on the anomaly judgment logic based on data distribution.

[0026] Example 2 Based on the above embodiments, the vehicle time-series charging data is preprocessed to obtain a normalized charging segment dataset, including: using multi-encoding backoff parsing on the vehicle time-series charging data to obtain structured charging time-series data; performing sliding window segmentation on the structured charging time-series data based on current polarity and state of charge monotonicity to obtain a set of independent charging segments; and performing extreme value normalization on the continuous features in the set of independent charging segments to obtain a normalized charging segment dataset.

[0027] In this embodiment, the process of preprocessing vehicle time-series charging data to obtain a normalized charging segment dataset consists of three steps: First, the vehicle time-series charging data is parsed using multi-encoding backtracking, which refers to the operation of trying different encoding formats to decode files according to a preset priority, to obtain structured charging time-series data containing complete fields; then, the structured charging time-series data is segmented by sliding window based on current polarity and state of charge monotonicity, which refers to the operation of traversing the time-series data through a fixed-length window to detect the switching points of the operating conditions, to obtain a set of independent charging segments containing only the charging process; finally, the continuous features in the set of independent charging segments are normalized by extreme values, including total voltage, total current, individual cell voltage, temperature, etc., which refers to the operation of linearly mapping the feature values ​​to the [0,1] interval according to their historical physical extreme value interval, to obtain a normalized charging segment dataset with all feature scales uniform.

[0028] The technical solution of this embodiment ensures that charging data of different formats can be read completely through multi-encoding backoff parsing, avoiding data loss caused by encoding incompatibility. It decouples the charging and discharging process through sliding window segmentation, ensuring that each input segment has a single thermodynamic boundary, eliminating feature distribution drift caused by mixed operating conditions, and unifies the scale of all features through extreme value normalization, avoiding the problem of high-dimensional features dominating model calculation.

[0029] Based on the above embodiments, the vehicle time-series charging data is parsed using multi-encoding backoff to obtain structured charging time-series data, including: attempting to decode the vehicle time-series charging data in sequence according to the priority of GB2312, UTF-8, and LATIN1; if the current encoding fails to decode, it automatically switches to the next priority encoding until decoding is completed; and performing missing value interpolation and physical extreme value filtering on the decoded data to obtain structured charging time-series data.

[0030] In this embodiment, the process of obtaining structured charging time-series data by multi-encoding backtracking parsing of vehicle time-series charging data is as follows: Vehicle time-series charging data is decoded sequentially according to the priority of GB2312, UTF-8, and LATIN1. GB2312 is a commonly used Chinese encoding in early domestic vehicle systems, UTF-8 is a universal encoding used by current mainstream vehicle systems, and LATIN1 is a fallback encoding compatible with all single-byte encodings. If the current encoding fails to decode, it automatically switches to the next priority encoding until decoding is complete. Missing value interpolation and physical extreme value filtering are then performed on the decoded data. Missing value interpolation refers to using linear interpolation to fill in missing points in the time-series data, while physical extreme value filtering refers to removing abnormal values ​​that exceed the normal operating range of the battery, such as total voltage exceeding the rated voltage range of the vehicle battery. Finally, structured charging time-series data with complete fields and valid values ​​is obtained.

[0031] The technical solution of this embodiment, through a three-level encoding automatic rollback parsing mechanism, is compatible with charging CSV files exported from vehicle terminals of different eras and brands, avoiding data loss problems caused by poor adaptability of a single encoding. Through missing value imputation and physical extreme value filtering, invalid outliers are eliminated, and missing segments of time-series data are completed.

[0032] Based on the above embodiments, the structured charging time-series data is segmented by a sliding window based on the monotonicity of current polarity and state of charge to obtain a set of independent charging segments, including: The current polarity jump point and the state of charge monotonicity reversal point in the structured charging time series data are detected by a sliding window. Based on the jump point and reversal point, the continuous time series data is divided into independent charging segments, and the set of independent charging segments is obtained after removing the discharging segments.

[0033] In this embodiment, the process of obtaining an independent charging segment set by sliding window segmentation of structured charging time series data based on current polarity and state of charge monotonicity is as follows: the current polarity jump point and the state of charge monotonicity reversal point in the structured charging time series data are detected by sliding window. Positive current polarity represents charging and negative current polarity represents discharging. Monotonically increasing state of charge represents the charging process and monotonically decreasing state of charge represents the discharging process. The step size of the sliding window can be adjusted according to the data sampling frequency. For example, a window with a step size of 5 is used for data sampled at 1Hz. Based on the jump point and reversal point, the continuous time series data is segmented into independent operating condition segments. After removing non-charging segments such as discharging and resting, an independent charging segment set containing only the charging process is obtained. The current polarity of each charging segment is positive and the state of charge remains monotonically increasing.

[0034] The technical solution in this embodiment accurately identifies the switching point of the operating conditions by detecting both current polarity and state of charge, effectively decoupling the charging operating conditions from other operating conditions, ensuring that each segment of the input model has a single charging thermodynamic boundary, and eliminating the feature distribution drift problem caused by the mixing of operating conditions.

[0035] Example 3 Based on the above embodiments, the pre-trained variational autoencoder model is obtained through the following steps: acquiring a historical normalized charging segment dataset under normal operating conditions, and dividing the historical normalized charging segment dataset into a training set and a test set; inputting the training set into the encoder of the variational autoencoder for feature mapping to obtain latent variable distribution parameters; sampling the latent variable distribution parameters through reparameterization to obtain latent vectors, and inputting the latent vectors into the decoder for reconstruction calculation to obtain reconstructed samples; constructing a joint loss function based on the mean square error of the reconstructed samples and the original samples of the training set, and the KL divergence between the latent variable distribution and the standard normal distribution, and iteratively updating the network weights until convergence to obtain the pre-trained variational autoencoder model.

[0036] In the technical solution of this embodiment, the pre-trained variational autoencoder model is obtained through the following steps: First, a normalized historical charging segment dataset under normal operating conditions is obtained. Normal operating conditions refer to charging data from vehicles that have been manually verified to have no battery faults. The normalized historical charging segment dataset is divided into a training set and a test set. Then, the training set is input into the encoder of the variational autoencoder for feature mapping. Feature mapping refers to the operation of converting high-dimensional charging features into latent variable distribution parameters, including the mean and variance of the latent variables. The latent variable distribution parameters are sampled through reparameterization to obtain latent vectors. Reparameterization refers to the technique of converting the random sampling process into differentiable operations. The latent vectors are input into the decoder for reconstruction calculation to obtain reconstructed samples. Based on the mean squared error of the reconstructed samples and the original samples of the training set, and the KL divergence of the latent variable distribution and the standard normal distribution, a joint loss function is constructed. The network weights are iteratively updated until the loss converges, resulting in a pre-trained variational autoencoder model.

[0037] The technical solution of this embodiment constrains both reconstruction accuracy and latent variable distribution through a joint loss function, forcing the model to learn the common features of normal charging conditions, avoiding overfitting and training noise. The trained model can be adapted without extensive retraining for new vehicle models.

[0038] Example 4 Based on the above embodiments, data-driven anomaly determination is performed based on the reconstruction error set to obtain battery anomaly diagnosis results including vehicle health status. This includes: grouping the reconstruction error set according to the unique vehicle identifier and calculating the average reconstruction error of each vehicle; comparing the average reconstruction error of each vehicle with a dynamic threshold; if the average reconstruction error is greater than the dynamic threshold, the vehicle is marked as an abnormal vehicle; otherwise, it is marked as a normal vehicle; and generating battery anomaly diagnosis results based on the marking results of all vehicles, wherein the dynamic threshold is pre-calibrated based on the 95% confidence interval of the reconstruction error distribution of historical normal samples.

[0039] In the technical solution of this embodiment, the process of obtaining battery anomaly diagnosis results including vehicle health status by data-driven anomaly determination based on the reconstruction error set is as follows: First, the reconstruction error set is grouped according to the vehicle's unique identifier, which refers to the vehicle's VIN code, and the average reconstruction error of all charging segments of each vehicle is calculated; then, the average reconstruction error of each vehicle is compared with a dynamic threshold. If the average reconstruction error is greater than the dynamic threshold, it is marked as an abnormal vehicle; otherwise, it is marked as a normal vehicle; finally, the battery anomaly diagnosis result is generated based on the marking results of all vehicles. The dynamic threshold is pre-calibrated based on the 95% confidence interval of the reconstruction error distribution of historical normal samples. Historical normal samples refer to the reconstruction error set of historical charging data of vehicles that have been manually verified to have no battery faults, and the 95% confidence interval refers to the value range covering the reconstruction error of 95% of normal samples.

[0040] The technical solution of this embodiment replaces the manually fixed threshold with a dynamic threshold calibrated based on the error distribution of normal samples. This adapts to the differences in charging data distribution under different batches and working conditions, thereby improving the accuracy of anomaly detection. It eliminates the need for manual adjustment of the detection threshold for different vehicle models and batches, significantly reducing the labor cost of threshold maintenance.

[0041] Based on the above embodiments, after generating battery anomaly diagnosis results based on the labeling results of all vehicles, the method further includes: performing dimensionality reduction visualization on the latent vectors output by the variational autoencoder and the original features respectively, generating a visualization map including the separation effect of normal clusters and abnormal clusters; generating a three-level structured output file, including a time step level detail file, a vehicle level score file, and an abnormal vehicle list file.

[0042] In the technical solution of this embodiment, after generating the battery anomaly diagnosis result based on the marking results of all vehicles, two types of operations are performed: The first type is to perform dimensionality reduction visualization on the latent vectors output by the variational autoencoder and the original features respectively. Dimensionality reduction visualization refers to the operation of mapping high-dimensional features to 2D or 3D space and drawing scatter plots to generate a visualization map including the separation effect of normal clusters and abnormal clusters. The normal clusters and abnormal clusters correspond to the feature projections of normal vehicles and abnormal vehicles, respectively. The second type is to generate a three-level structured output file, including a time step-level detailed file, a vehicle-level score file, and an abnormal vehicle list file. The time step-level detailed file contains the feature values ​​and reconstruction errors at each sampling time, the vehicle-level score file contains the average reconstruction error and health level of each vehicle, and the abnormal vehicle list file contains the unique identifiers and abnormal time periods of all abnormal vehicles.

[0043] The technical solution of this embodiment intuitively displays the feature separation effect between normal and abnormal samples through dimensionality reduction visualization maps, which greatly improves the interpretability of diagnostic results.

[0044] Based on the above embodiments, before generating a visualization map that includes the separation effect of normal clusters and abnormal clusters, the method further includes: performing a 5-fold cross-partition on the historical normalized charging segment dataset to obtain 5 sets of alternating training and test sets; training a variational autoencoder model on each training set in turn and evaluating it on the corresponding test set; collecting the abnormality ratio, score distribution and latent vector coordinates of each evaluation set; calculating the global statistics and performance standard deviation; and generating a cross-fold comparison report.

[0045] In the technical solution of this embodiment, before generating a visual map including the separation effect of normal clusters and abnormal clusters, the following operations are performed: First, the historical normalized charging segment dataset is subjected to a 5-fold cross-split, which means randomly dividing the dataset into 5 equal subsets. Each time, 4 subsets are used as the training set and 1 subset is used as the test set, resulting in 5 alternating training and test sets. A variational autoencoder model is trained on each training set and evaluated on the corresponding test set. The anomaly ratio, score distribution, and latent vector coordinates of each evaluation are collected. Global statistics and performance standard deviation are calculated. Global statistics include the total number of vehicles, the total number of anomalies, and the overall anomaly ratio. The performance standard deviation refers to the standard deviation of the 5 evaluation results. Finally, a cross-fold comparison report is generated, which includes a distribution comparison chart of the evaluation results of each group and a summary of performance indicators.

[0046] The technical solution of this embodiment eliminates the distribution bias caused by a single random partition by using a 5-fold cross-partitioning evaluation method, which can accurately reflect the true performance of the model. The performance fluctuation of the model is quantified by the performance standard deviation. When the standard deviation is lower than, for example, 5%, the model can be confirmed to have strong robustness.

[0047] Based on the above embodiments, the latent vectors and original features output by the variational autoencoder are subjected to dimensionality reduction and visualization to generate a visualization map that includes the separation effect of normal clusters and abnormal clusters. This includes: performing principal component analysis and t-distribution neighborhood embedding nonlinear dimensionality reduction on the latent vectors and original features respectively; marking normal vehicles as the first type of identifier and abnormal vehicles as the second type of identifier to draw a scatter plot; and calculating the explained variance of each principal component to generate a dimensionality reduction map as a visualization map.

[0048] In this embodiment, the process of generating a visualization map including the separation effect of normal and abnormal clusters by performing dimensionality reduction and visualization on the latent vectors and original features output by the variational autoencoder is as follows: Principal component analysis and t-distributed neighborhood embedding nonlinear dimensionality reduction are performed on the latent vectors and original features respectively. Principal component analysis is a linear dimensionality reduction method that extracts the direction of maximum variance of data through orthogonal transformation, while t-distributed neighborhood embedding is a nonlinear dimensionality reduction method that preserves the local neighborhood relationship in the high-dimensional space. Normal vehicles are marked as the first type of identifier and abnormal vehicles are marked as the second type of identifier, and a scatter plot is drawn. The first type of identifier can be a hollow circle and the second type of identifier can be a solid cross. At the same time, the explained variance of each principal component is calculated. The explained variance refers to the proportion of original information retained by each principal component. Finally, a dimensionality reduction map containing the dimensionality reduction results of principal component analysis, the dimensionality reduction results of t-distributed neighborhood embedding, and the explained variance is generated as a visualization map.

[0049] The technical solution of this embodiment combines two dimensionality reduction methods: principal component analysis and t-distributed neighborhood embedding. It can both quantify the information retention ratio of the low-dimensional projection through the explained variance of principal component analysis and verify the latent vector's ability to represent the original features, and demonstrate the separation effect of local clusters through t-distributed neighborhood embedding, intuitively verifying the feature decoupling ability of the variational autoencoder, and greatly improving the reference value of the visualization results.

[0050] Example 5 Figure 2 This is a schematic diagram of a battery malfunction diagnosis device provided in an embodiment of the present invention.

[0051] like Figure 2 As shown, based on the above embodiments, the battery malfunction diagnosis device includes: The data acquisition module is configured to acquire vehicle time-series charging data uploaded by different in-vehicle terminals; The preprocessing module is configured to preprocess vehicle time-series charging data to obtain a normalized charging segment dataset. The reconstruction calculation module is configured to input the normalized charging segment dataset into the pre-trained variational autoencoder model for reconstruction calculation, and obtain the reconstruction error set for each charging segment. The anomaly detection module is configured to perform data-driven anomaly detection based on the reconstruction error set, and obtain battery anomaly diagnosis results including the vehicle's health status.

[0052] In the technical solution of this embodiment, the battery abnormality diagnosis device includes four modules.

[0053] The first is a data acquisition module, configured to acquire vehicle time-series charging data uploaded by different in-vehicle terminals, supporting integration with in-vehicle data platforms of different brands and import of local CSV files. The second is a preprocessing module, configured to preprocess the vehicle time-series charging data, integrating functions such as multi-encoding backtracking parsing, sliding window condition segmentation, and extreme value normalization to obtain a normalized charging segment dataset. The third is a reconstruction calculation module, configured to input the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation. The pre-trained variational autoencoder model can be flexibly replaced according to the application scenario to obtain the reconstruction error set for each charging segment. The fourth is an anomaly detection module, configured to perform data-driven anomaly detection based on the reconstruction error set. The dynamic threshold can be adjusted according to requirements to obtain battery anomaly diagnostic results, including vehicle health status.

[0054] The technical solution of this embodiment achieves decoupling of various functions through modular architecture design, which can flexibly adapt to charging data of different brands and models, greatly improves scalability, and can add preprocessing logic or replace diagnostic models as needed. It supports docking with different types of vehicle data platforms, can meet the batch diagnostic needs of more than 100,000 vehicles, and can complete the entire process of automatic diagnosis without manual intervention, which greatly reduces the manpower cost of operation and maintenance.

[0055] Example 6 Based on the above embodiments, when the program code is executed by the processor, the above-described battery abnormality diagnosis method is implemented.

[0056] In the technical solution of this embodiment, program code is stored on the storage medium. When the program code is executed by the processor, it implements any of the aforementioned battery anomaly diagnosis methods. The storage medium includes various media that can store program code, such as USB flash drive, mobile hard drive, read-only memory, random access memory, magnetic disk or optical disk. The stored program code includes the entire process logic of data parsing, preprocessing, model inference, anomaly judgment, visualization and report generation. It can be adapted to processors with different architectures and does not require customized development for hardware. The entire process of battery anomaly diagnosis can be automatically completed when the program is called.

[0057] Based on the above embodiments, the electronic device includes a memory and a processor. The memory stores program code that can run on the processor. When the program code is executed by the processor, the above-mentioned battery abnormality diagnosis method is implemented.

[0058] In the technical solution of this embodiment, the electronic device includes a memory and a processor. The memory stores program code that can run on the processor. When the program code is executed by the processor, it implements any of the aforementioned battery anomaly diagnosis methods. The electronic device includes devices with computing capabilities such as servers, edge computing devices, and vehicle terminals. The memory is used to store program code and files such as original charging data and diagnostic results. The processor is used to execute the program code to complete the entire process of data parsing, preprocessing, model reasoning, anomaly judgment, visualization, and report generation. It supports two operating modes: timed triggering and event triggering, and can automatically complete battery anomaly diagnosis without manual intervention.

[0059] The processor may include, but is not limited to, one or more processors or microprocessors. Each processor may be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic component, for performing the methods in the above embodiments. The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or a combination thereof, and may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, EPROM memory, EEPROM memory, registers, computer storage media (e.g., hard disk, floppy disk, solid-state drive, removable disk, CD-ROM, DVD-ROM, Blu-ray disc, etc.).

[0060] Computer-readable storage media may also store at least one computer-executable program / instruction, such as computer-readable instructions. Computer-readable storage media include, but are not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Computer-readable storage media may include, for example, read-only memory (ROM), hard disk, flash memory, etc. For example, a non-transitory computer-readable storage medium may be connected to a computing device such as a computer, and then, when the computing device executes the computer-readable instructions stored on the computer-readable storage medium, the various methods described above can be performed.

[0061] In addition, the computer device may also include (but is not limited to) a data bus, an input / output (I / O) bus, a display, and input / output devices (e.g., a keyboard, mouse, speakers, etc.). The processor can communicate with external devices via the I / O bus through a wired or wireless network. In one embodiment, the at least one computer-executable instruction may also be compiled into or comprise a software product / computer program product, wherein one or more computer-executable instructions, when executed by the processor, perform the steps of the various functions and / or methods in the embodiments described herein.

[0062] Example 7 Based on the above embodiments, this embodiment provides an application example. This application example provides a battery anomaly diagnosis method and apparatus.

[0063] This invention relates to the fields of big data analysis, fault diagnosis and artificial intelligence algorithm technology for new energy vehicle batteries. Specifically, it relates to an electric vehicle battery anomaly judgment model, data processing method and storage medium based on variational autoencoder (VAE).

[0064] In recent years, with the surge in the number of electric vehicles, the safe operation and condition monitoring of power batteries have become a focus of the industry. The high-frequency timing charging data generated by on-board battery systems is growing exponentially, but existing anomaly diagnosis technologies face the following seven technical bottlenecks in practical engineering applications: (1) Heterogeneous data sources and mixed operating conditions: The CSV files for charging of vehicles from multiple brands have chaotic encoding formats (GB2312 / UTF-8 / LATIN1 are mixed), and the continuous time series data does not distinguish between charging / discharging physical processes, resulting in serious drift of the model input feature distribution and easy divergence during training.

[0065] (2) Imbalance of feature scale and fragmentation of protocol: There are huge differences in feature dimensions and units among different models (such as the coexistence of 100 ampere-level current and millivolt-level single-cell voltage difference). The hard-coded model has poor cross-brand generalization ability. High-dimensional features dominate distance calculation, resulting in distortion of the latent space geometry.

[0066] (3) Limitations of deterministic mapping: Traditional autoencoders only learn point-to-point deterministic reconstruction, which is prone to overfitting to high-dimensional nonlinear coupled data, cannot quantify the uncertainty of data distribution, and lack explicit definition of the probability boundary of "normal working conditions".

[0067] (4) Static threshold misjudgment: Anomaly judgment mostly relies on fixed thresholds based on human experience, lacking dynamic decision boundaries based on data manifold distribution, resulting in a high false alarm / false negative rate when facing operating condition drift.

[0068] (5) Algorithm black box: Deep learning models lack a visualization mapping mechanism, engineers cannot intuitively verify the separation effect between the latent space and the original features, the diagnostic results have weak interpretability and are difficult to pass industrial safety audits.

[0069] (6) Single output granularity: Each evaluation only outputs binary labels, lacking a three-level traceability chain of "macro statistics - meso scores - micro time series", which is not conducive to rapid after-sales positioning and R&D model iteration.

[0070] (7) Uncontrollable evaluation variance: Single Fold random partitioning is greatly affected by data distribution bias, resulting in significant performance fluctuations. It lacks cross-batch cross-validation and automated aggregation mechanisms, making it difficult to support large-scale high-reliability deployment.

[0071] In view of the engineering bottlenecks pointed out in the background art, this invention aims to solve the following seven technical problems, and clarifies the corresponding solutions and mechanisms of action: (1) Inconsistent encoding of multi-source heterogeneous data and the mixing of charging and discharging physical conditions lead to model input breakage. A multi-encoding adaptive backoff parsing pipeline + a sliding window physical segmentation algorithm based on current polarity / SOC monotonicity.

[0072] The character set fault tolerance mechanism ensures complete data reading; based on the physical law of electrochemical reaction direction reversal, polarity jump detection is used to achieve decoupling of operating conditions, ensuring that the input segment has a single thermodynamic boundary and eliminating feature distribution drift.

[0073] (2) Differences in the dimensions and inconsistencies in the units of measurement of multi-brand features lead to geometric distortion in the latent space and poor model generalization. Abstract Task multi-task interface architecture + Min-Max extreme value normalization preprocessing.

[0074] Object-oriented abstraction decouples the algorithm from the data schema; normalization eliminates interference from dimensional magnitudes, prevents high-amplitude features from dominating gradient updates, makes the latent variable manifold smooth and isotropic, and improves cross-protocol generalization ability.

[0075] (3) Traditional deterministic mapping cannot quantify uncertainty and high-dimensional nonlinear data are prone to overfitting. A joint optimization framework for variational autoencoders (VAEs) combined with reparameterization sampling techniques.

[0076] KL divergence regularization forces the latent space to approximate the standard normal prior, constructing a continuous probability manifold; reparameterization enables backpropagation through random sampling, maximizing ELBO so that the model learns only common features, mathematically defining the probability boundary of normal operating conditions.

[0077] (4) Relying on fixed thresholds based on human experience leads to a high false alarm / false alarm rate in anomaly detection and a lack of dynamic decision boundaries. A dynamic threshold determination mechanism for statistical quantiles based on the reconstructed error distribution.

[0078] The reconstruction error reflects the projection residual of the sample onto the learned manifold; the threshold is calibrated based on the 95% confidence interval of the normal sample error, forming the rejection region for statistical hypothesis testing, thus realizing data-driven adaptive anomaly interception.

[0079] (5) The black-box nature of AI models makes engineering tracing difficult and lacks intuitive evidence of feature separation. Multi-dimensional dimensionality reduction visualization module (2D / 3DPCA+t-SNE) and latent / original space comparison mapping.

[0080] PCA extracts the direction of maximum variance and quantifies the information retention rate, while t-SNE preserves the local topological structure. Dual-space comparison intuitively verifies the feature decoupling capability of VAE, transforming black-box decision-making into visible geometric separation evidence.

[0081] (6) The output of a single assessment is non-standardized and lacks a macro-micro data traceability chain. Three-level structured data output architecture (time step level details / vehicle level scores / anomaly list).

[0082] Layered decoupling enables granular data management, macro-statistics provide batch baselines, and micro-time series support fine-grained backtracking.

[0083] (7) The single-Fold evaluation has large variance and lacks cross-batch stability verification and automated aggregation mechanism. (8) Technical means: 5-Fold cross-validation cyclic aggregation and global comparison report generation module.

[0084] K-fold rotation partitioning eliminates single-cycle random bias, making the estimator unbiased; standard deviation quantifies performance fluctuations, and cross-Fold comparison plots expose algorithm boundaries, enabling highly robust and automated large-scale deployment evaluation.

[0085] This embodiment provides an anomaly detection model based on VAE. The overall architecture includes a data preprocessing module (pre_dataprocess), a data processing module (data_process), a five-fold splitting module (five_fold_train_test_split), a threshold determination module (dyad_eval_fivefold-threshold_no), a latent space visualization module (latent_z_visual, optional), and an anomaly diagnosis module (evaluate). The model runs on Python 3.10 and uses PyTorch to build the VAE network. The encoder maps charging segments to the distribution parameters of the latent variable Latent_Z. The decoder reconstructs the input data and calculates the mean squared error (MSE) loss. The anomaly diagnosis module initializes the BatteryAnomalyEvaluator class, configuring the base save path (base_save_path) and the reconstruction error threshold (rec_error_threshold, default 0.05). It calculates the average reconstruction error by traversing the test set; if the error exceeds the threshold, it is marked as an outlier (abnormal vehicle). The model supports dynamic configuration of command-line parameters, outputs a structured file containing latent variable vectors, vehicle IDs, and outlier detection results, and generates time-step, vehicle-level, and summary-level statistical reports.

[0086] Figure 3 This is a schematic diagram of the overall architecture of the VAE anomaly detection model of the present invention.

[0087] Figure 4 This is a schematic diagram of the data preprocessing and five-fold partitioning process of the present invention.

[0088] Figure 5 This is a visualization of the multi-dimensional latent variable space of the present invention.

[0089] Figure 6 This is a flowchart of the execution and result output of the abnormal diagnosis module (evaluate) of this invention.

[0090] The solutions provided in this application example include: Step 1: Multi-source heterogeneous charging data analysis and physical condition segmentation The system scans the specified data directory and reads the vehicle charging CSV file. It employs a GB2312→UTF-8→LATIN1 priority back-off decoding strategy to automatically match the file character set. After performing linear interpolation for missing values ​​and filtering for physical extrema, based on the current direction and the monotonicity of SOC changes, a sliding window and polarity jump detection algorithm are set to segment the continuous time-series data into independent charging / discharging segments. A set of structured segments is output.

[0091] Ensuring that each input segment has a single boundary condition fundamentally eliminates feature distribution confusion caused by the mixing of multiple operating conditions, providing a physical consistency foundation for subsequent models.

[0092] 2. Step Two: Construction of Multi-Task Abstraction Interface and Unification of Feature Scale Instantiate the abstract Task base class to dynamically filter redundant feature columns. Map continuous variables such as mileage, voltage, and temperature to the [0,1] interval using extreme value normalization. Construct a regression label class and configure the mean squared error (MSE) loss calculation interface. Output the normalized feature matrix. Dictionary of task configuration parameters .

[0093] Principle: Normalization eliminates dimensional interference, ensuring that the update step size of each feature weight is consistent during gradient descent.

[0094] Normalization transformation:

[0095] This transformation projects each feature onto a unified probability hypercube. In VAEs, the KL divergence regularization of the latent variable distribution is extremely sensitive to the input scale. Scale uniformity can prevent high-amplitude features (such as total voltage) from masking low-amplitude sensitive features (such as individual voltage difference), ensuring that the latent manifold learned by the encoder is smooth and isotropic, and avoiding the latent space from being stretched and deformed by single-dimensional features, thereby solving the problems of poor generalization and geometric distortion.

[0096] The formula explanation is shown in Table 1 below: Table 1

[0097] 3. Step Three: Variational Autoencoder (VAE) Training and Latent Variable Probability Distribution Learning Will Input VAE encoder, output latent variable distribution parameters and The latent vector Z is obtained by sampling using reparameterization techniques. The decoder then reconstructs the latent vector using Z as input. Jointly optimize the reconstruction loss (MSE) and KL divergence, iteratively updating the network weights until convergence. Output the converged VAE model parameters. Test set latent variable sequence and sample-by-sample reconstruction error vector .

[0098] Principle: VAE forces the encoder output to approximate the standard normal prior through KL divergence regularization. This maps discrete data points to a continuous probability manifold. Reparameterization techniques: This makes the random sampling process differentiable, thus enabling the backpropagation path. The model optimization objective is the lower bound of evidence (ELBO). The essence of training is to maximize the lower bound of the data likelihood, enabling the model to learn only the common features of the data. Normal samples appear frequently in the training set, and the decoder can accurately reconstruct them; abnormal samples deviate from the training distribution manifold, causing a sharp drop in reconstruction ability and naturally amplifying the reconstruction error. This mechanism mathematically constructs the decision basis for anomaly detection, solving the limitations of deterministic mapping and the overfitting problem. The formula explanation is shown in Table 2 below: Table 2

[0099] 4. Step Four: Anomaly Diagnosis and Outlier Marking Based on Dynamic Threshold of Reconstruction Error take over Calculate the average reconfiguration error per vehicle by grouping by VIN. .Will With preset threshold (Default 0.05) is used for comparison. If > If an outlier is identified, it is marked as an outlier (outlier flag = 1); otherwise, it is considered normal. A judgment result set containing outlier flags, vehicle scores, and time-series details is generated. .

[0100] Principle: Reconstruction error is essentially the orthogonal projection residual of the test samples onto the learned manifold. According to information theory, normal operating condition data are densely distributed in high-probability regions, and the residuals follow a low-mean distribution; abnormal operating conditions are located at the edge or outside of the manifold, and the residuals exhibit a long-tailed distribution. Threshold Based on the 95% confidence interval of the historical normal sample error distribution, a statistical hypothesis rejection region is constructed. Judgment logic: This mechanism transforms unsupervised representation learning into interpretable binary classification decisions, utilizing the geometric distance of a probabilistic manifold to replace manual rules, achieving adaptive anomaly interception and completely resolving the false positive / false negative problem associated with fixed thresholds. See Table 3 for formula explanations. Table 3

[0101] 5. Step Five: Dimensionality Reduction and Visualization Mapping between Multi-Dimensional Latent Space and Original Feature Space take over and The abnormal flag label in the text. Perform 2D / 3D principal component analysis (PCA) and t-SNE nonlinear dimensionality reduction; for the original features Perform 2D / 3DPCA synchronously. Plot a scatter plot, marking normal vehicles as hollow circles and outliers as solid crosses. Calculate and output the explained variance of each principal component. Generate 5 dimensionality reduction map files. .

[0102] Principle: PCA extracts the direction of maximum variance in data through orthogonal transformation, and its explained variance The proportion of original information retained by the low-dimensional projection is quantified. t-SNE minimizes the KL divergence of the conditional probabilities of points in the high / low-dimensional space: It preserves the local neighborhood topology and is more sensitive to nonlinear cluster separation. Comparison of the projections of the "latent space" and the "original space" verifies that VAE successfully decouples high-dimensional coupled features into low-dimensional discriminative manifolds, significantly isolating outliers in the projected space. Visualization provides decision transparency; the geometric separation degree is used to verify the convergence quality of manifold learning in step three, solving the black-box attribution problem. The formula explanations are shown in Table 4 below: Table 4

[0103] Step Six: Single Fold Evaluation Execution and Three-Level Structured Data Output Call the evaluation function to load the current Fold. and Generate three types of standardized files: time-step level details (test_segment_data.csv), vehicle-level statistical scores (test_car_scores.csv), and anomaly vehicle list (test_anomalies.csv). Calculate and print the statistical summary (total time steps, total number of vehicles, number of anomalies, anomaly ratio, and error range). Output this Fold evaluation package. .

[0104] Principle: A layered output architecture ensures data traceability. Time-step level preserves transient fluctuation characteristics, supporting fine-grained fault backtracking; vehicle-level aggregation eliminates high-frequency noise and provides a health baseline; anomaly lists enable rapid interception. Anomaly ratio calculation: The error range in the statistical summary reflects the model confidence interval, and the anomaly ratio provides a quantitative indicator of batch health.

[0105] The formula explanation is shown in Table 5 below: Table 5

[0106] Step 7: 5-Fold Cross-Validation Cyclic Aggregation and Global Comparison Report Generation Initialize 5 Fold datasets. Repeat steps one through six, collecting the anomaly proportion for each Fold. Score distribution And latent space coordinates. After the loop ends, calculate global statistics (total number of vehicles, total number of anomalies, overall anomaly rate). Standard deviation Call the comparison plotting function to generate cross-Fold boxplots / distribution overlay plots. Output the final evaluation report .

[0107] Principle: K-fold cross-validation alternates between training and test set partitioning, ensuring each sample is evaluated once, eliminating distribution bias caused by a single random partition, and making the outlier ratio estimate an unbiased estimator. Global metric calculation: Standard deviation The performance fluctuation of the quantification model on different subsets of data, if If the threshold is less than 5%, it proves that the algorithm has strong robustness. Cross-Fold comparison charts visually expose the algorithm's boundary conditions, providing statistical basis for adaptive threshold adjustment, achieving closed-loop automation of the diagnostic process, and solving the problem of uncontrollable evaluation variance. See Table 6 for formula explanations: Table 6

[0108] The technical solution of this embodiment can achieve the following beneficial technical effects: 1) Multi-encoding adaptive parsing and physical segmentation technology: Built-in GB2312 / utf-8 / latin1 automatic back-down parsing mechanism, combined with current / SOC trend intelligent segmentation of charging and discharging segments, solves the problems of multi-source heterogeneous data reading failure and physical meaning breakage, and improves the robustness of data pipeline.

[0109] 2) Abstract Task Interface and Multi-Brand Generalized Architecture: A unified codec interface is defined through the Task base class, which supports the rapid expansion of general tasks and multi-battery brand sub-tasks. Feature filtering and normalization strategies are configurable, which greatly reduces the cost of migrating algorithms across vehicle models.

[0110] 3) Accurate anomaly detection driven by latent space reconstruction error: Based on VAE learning of the latent distribution of high-dimensional charging data, with a default reconstruction error threshold of 0.05 as the benchmark, and combined with the evolution of historical latent variable Z, the current anomaly diagnosis and future risk prediction are realized, breaking through the bottleneck of high false alarm rate of fixed threshold.

[0111] 4) Five-dimensional visualization and enhanced interpretability: The unique five-in-one visualization scheme of 2D / 3DPCA latent space, 2D / 3DPCA original feature space and t-SNE dimensionality reduction, with principal component interpretation variance output, intuitively separates normal clusters and outliers, and significantly improves engineering interpretability and fault tracing efficiency.

[0112] 5) Automated 5-Fold Batch Evaluation and Comparison Report Generation: Integrates the evaluate_all_folds and generate_comparison_plot modules, automatically completing cross-Fold data collection, anomaly statistics, visualization aggregation, and standardized report output in a single run. It supports flexible configuration of command-line parameters, significantly improving the diagnostic efficiency and operational convenience of the big data platform.

[0113] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0114] It should be noted that, in this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element limited by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0115] While the embodiments disclosed in this invention are as described above, the above content is merely for the purpose of facilitating understanding of this invention and is not intended to limit the invention. Any person skilled in the art to which this invention pertains may make any modifications and changes in form and detail of the implementation without departing from the spirit and scope disclosed in this invention; however, the scope of patent protection of this invention shall still be determined by the scope defined in the appended claims.

Claims

1. A method for diagnosing battery malfunctions, characterized in that, include: Acquire vehicle timing charging data uploaded by different in-vehicle terminals; The vehicle time-series charging data is preprocessed to obtain a normalized charging segment dataset; The normalized charging segment dataset is input into a pre-trained variational autoencoder model for reconstruction calculation to obtain the reconstruction error set for each charging segment. Based on the reconstructed error set, data-driven anomaly determination is performed to obtain battery anomaly diagnosis results, including the vehicle's health status. The preprocessing of the vehicle time-series charging data to obtain a normalized charging segment dataset includes: Multi-encoding back-off parsing is used to obtain structured charging time-series data from vehicle time-series charging data; The structured charging time series data is segmented by a sliding window based on the monotonicity of current polarity and state of charge to obtain a set of independent charging segments. The extreme values ​​of continuous features in the set of independent charging segments are normalized to obtain a normalized charging segment dataset.

2. The battery anomaly diagnosis method according to claim 1, characterized in that, The process of parsing the vehicle time-series charging data using multi-encoding backoff yields structured charging time-series data, including: The vehicle timing charging data was decoded in the order of priority: GB2312, UTF-8, and LATIN1. If the current encoding or decoding fails, it will automatically switch to the next priority encoding until decoding is complete; Missing value interpolation and physical extreme value filtering are performed on the decoded data to obtain structured charging time series data.

3. The battery anomaly diagnosis method according to claim 1, characterized in that, The structured charging time-series data is segmented using a sliding window based on current polarity and the monotonicity of the state of charge to obtain a set of independent charging segments, including: The current polarity jump point and the monotonic reversal point of the state of charge in the structured charging timing data are detected by sliding window. Based on the jump point and reversal point, the continuous time-series data is divided into independent charging segments, and the set of independent charging segments is obtained after removing the discharging segments.

4. The battery anomaly diagnosis method according to claim 1, characterized in that, The pre-trained variational autoencoder model is obtained through the following steps: Obtain a historical normalized charging segment dataset under normal operating conditions, and divide the historical normalized charging segment dataset into a training set and a test set; The training set is input into the encoder of the variational autoencoder for feature mapping to obtain the latent variable distribution parameters. Latent vectors are obtained by sampling the distribution parameters of latent variables through reparameterized sampling, and then the latent vectors are input into the decoder for reconstruction calculation to obtain reconstructed samples. A joint loss function is constructed based on the mean squared error of the reconstructed samples and the original training samples, the KL divergence of the latent variable distribution and the standard normal distribution. The network weights are iteratively updated until convergence, resulting in a pre-trained variational autoencoder model.

5. The battery anomaly diagnosis method according to claim 1, characterized in that, The data-driven anomaly determination based on the reconstructed error set yields battery anomaly diagnostic results including the vehicle's health status, including: The reconstruction error set is grouped according to the unique vehicle identifier, and the average reconstruction error of each vehicle is calculated. The average reconstruction error of each vehicle is compared with the dynamic threshold. If the average reconstruction error is greater than the dynamic threshold, the vehicle is marked as abnormal; otherwise, it is marked as normal. Battery anomaly diagnostic results are generated based on the labeling results of all vehicles, wherein the dynamic threshold is pre-calibrated based on the 95% confidence interval of the error distribution reconstructed from historical normal samples.

6. The battery anomaly diagnosis method according to claim 5, characterized in that, After generating the battery anomaly diagnostic results based on the marking results of all vehicles, the process also includes: The historical normalized charging segment dataset is divided into 5-fold cross-partitions to obtain 5 sets of alternating training and test sets; The variational autoencoder model is trained sequentially based on each training set and evaluated based on the corresponding test set. The anomaly ratio, score distribution and latent vector coordinates of each evaluation are collected. The global statistics and performance standard deviation are calculated, and a cross-fold comparison report is generated. The latent vectors and original features output by the variational autoencoder are dimensionality reduced and visualized to generate a visualization map that includes the separation effect of normal clusters and abnormal clusters. This includes: performing principal component analysis and t-distribution neighborhood embedding nonlinear dimensionality reduction on the latent vectors and original features respectively; marking normal vehicles as the first type of identifier and abnormal vehicles as the second type of identifier to draw a scatter plot; and calculating the explained variance of each principal component to generate a dimensionality reduction map as a visualization map. Generate a three-level structured output file, including a time step level detail file, a vehicle level score file, and an abnormal vehicle list file.

7. A battery anomaly diagnosis device based on the battery anomaly diagnosis method according to any one of claims 1 to 6, characterized in that, include: The data acquisition module is configured to acquire vehicle time-series charging data uploaded by different in-vehicle terminals; The preprocessing module is configured to preprocess the vehicle time-series charging data to obtain a normalized charging segment dataset. The reconstruction calculation module is configured to input the normalized charging segment dataset into a pre-trained variational autoencoder model for reconstruction calculation, and obtain the reconstruction error set corresponding to each charging segment. The anomaly determination module is configured to perform data-driven anomaly determination based on the reconstruction error set, and obtain battery anomaly diagnosis results including the vehicle health status.

8. A storage medium storing program code, characterized in that, When the program code is executed by the processor, it implements the battery anomaly diagnosis method as described in any one of claims 1 to 6.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor. The memory stores program code that can run on the processor. When the program code is executed by the processor, it implements the battery abnormality diagnosis method as described in any one of claims 1 to 6.