Sample data generation method and device and storage medium

By converting the battery state feature data sequence into feature vectors and mapping them in the latent space of the generator, diversified sample data is generated, which solves the problem of battery failure data sample imbalance and improves the training effect and generalization of the fault diagnosis model ability.

CN118940029APending Publication Date: 2024-11-12ZHONGKE HAINENG (BEIJING) TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410960513.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The unbalanced battery failure data sample results in limited accuracy of battery failure diagnosis, insufficient learning of the fault diagnosis model and limited generalization capabilities.

Method used

By obtaining the battery state feature data sequence, converting it into feature vectors, and mapping and inverse mapping in the latent space of the generator, diverse sample data is generated that is closer to the real battery state.

Benefits of technology

It significantly improves the training effect and generalization ability of the fault diagnosis model, and solves the problem of limited battery fault diagnosis accuracy caused by imbalance of battery fault data samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940029A_ABST
    Figure CN118940029A_ABST
Patent Text Reader

Abstract

The invention discloses a sample data generation method and device and a storage medium, and the method comprises the steps: obtaining a battery state feature data sequence which is a time-based sorting result of battery state feature data; converting the battery state characteristic data sequence into a characteristic vector; mapping the feature vector to a potential space of a generator to generate a corresponding potential vector, and performing reverse mapping on the potential vector to form a new feature vector; and recombining the new feature vectors into sample data and outputting the sample data. According to the method, the battery state feature data sequence is converted into the feature vector, and the feature vector is mapped and reversely mapped through the generator, so that diversified sample data closer to the real battery state is generated, the training effect and generalization ability of a fault diagnosis model are improved, and the fault diagnosis efficiency is improved. The problem that the accuracy of battery fault diagnosis is limited due to unbalanced battery fault data samples is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device and storage medium for generating sample data. Background Art

[0002] As a key energy storage and supply device, batteries play an important role in electric vehicles, smart grids, portable electronic devices and other fields. Among the related technologies, battery diagnostic technology includes electrochemical analysis, voltage and current monitoring, internal resistance testing, temperature monitoring, etc., which mainly rely on data collected during operation to identify potential faults. In addition, battery diagnostic technology also includes pattern recognition based on machine learning, deep learning models, and signal processing technology, etc., which mainly perform battery fault diagnosis by extracting features from battery monitoring data. However, in actual use, the normal state data of the battery is far more than the fault state data, and the fault data is difficult to collect in large quantities, especially for specific types of battery faults, where the fault data is even more scarce. Therefore, the fault samples available for training the diagnostic model are extremely limited, resulting in insufficient model learning and limited generalization ability, which affects the accuracy of fault diagnosis. Summary of the invention

[0003] The main purpose of the present application is to provide a method, device and storage medium for generating sample data, aiming to solve the technical problem of limited accuracy of battery fault diagnosis caused by unbalanced battery fault data samples.

[0004] To achieve the above purpose, an embodiment of the present application provides a method for generating sample data, the method comprising:

[0005] Acquire a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a result of sorting the battery status characteristic data based on time;

[0006] Converting the battery status characteristic data sequence into a characteristic vector;

[0007] Mapping the feature vector to a latent space of a generator to generate a corresponding latent vector, wherein the latent vector is inversely mapped to form a new feature vector;

[0008] The new feature vector is reorganized into sample data for output.

[0009] In the embodiment of the present application, before the step of obtaining the battery status characteristic data sequence, the step further includes:

[0010] Aggregate the measured values ​​of the battery state parameters at different time points to form a single data point;

[0011] sorting the data points according to timestamps attached to the data points;

[0012] The sorted data points are connected in sequence to obtain a battery status characteristic data sequence.

[0013] In the embodiment of the present application, the step of converting the battery status characteristic data sequence into a characteristic vector includes:

[0014] Mapping data points in the battery status characteristic data sequence to pixels of an image using a visual point pattern to generate corresponding image data;

[0015] The features of the image data are extracted to generate the feature vector.

[0016] In the embodiment of the present application, the step of mapping the data points in the battery status characteristic data sequence to the pixels of the image using the visual point mode to generate the corresponding image data includes:

[0017] Mapping the data points of the battery status characteristic data sequence to rows or columns of an image based on a time sequence to form a row or a column of the image;

[0018] The value of each data point is converted into a pixel brightness value through linear mapping, wherein the maximum value and the minimum value of the data point correspond to the maximum brightness and the minimum brightness of the pixel respectively;

[0019] A corresponding pixel is generated for each data point, wherein the position of the pixel is determined by the position of the corresponding data point in the time series, and the pixel brightness value is determined by the numerical value of the corresponding data point.

[0020] In the embodiment of the present application, the step of extracting the features of the image data and generating the feature vector includes:

[0021] Dividing the image data into a plurality of units, and obtaining a pixel brightness value of each unit;

[0022] Calculate the average pixel brightness of each unit as the characteristic value of the corresponding unit;

[0023] Based on the position of each unit in the image data, the feature values ​​of all units are arranged in order to obtain a feature vector corresponding to the image data.

[0024] In the embodiment of the present application, after the step of mapping the feature vector to the potential space of the generator to generate a corresponding potential vector, and the potential vector forming a new feature vector by inverse mapping, the method further includes:

[0025] Inputting the new feature vector into a discriminant model to determine the probability that the new feature vector is a feature vector of a true battery state;

[0026] If the probability that the new feature vector is the feature vector of the real battery state is greater than or equal to a preset threshold, executing the step of reorganizing the new feature vector into sample data for output;

[0027] If the probability that the new feature vector is the feature vector of the true battery state is less than a preset threshold, the step of jumping to map the feature vector to the latent space of the generator to generate a corresponding latent vector, and the latent vector is formed into a new feature vector by inverse mapping.

[0028] In the embodiment of the present application, the step of reorganizing the new feature vector into sample data for output includes:

[0029] Mapping the new feature vectors back to the corresponding positions of the original time series through indices according to their order in the latent space;

[0030] The characteristic values ​​at each time series position are accumulated or averaged to form sample data at each time point;

[0031] Arrange the processed time series sample data in chronological order to form a complete sample data sequence for output.

[0032] In the embodiment of the present application, after the step of reorganizing the new feature vector into sample data for output, the following steps are included:

[0033] Performing quality assessment on the sample data to obtain an assessment result of the sample data;

[0034] Based on the evaluation results and the preset quality evaluation criteria, sample data that meets the preset quality evaluation criteria are selected as valid samples;

[0035] The battery status characteristic data sequence and the valid samples are divided into a training set and a test set respectively, the training set is used for training the fault diagnosis model, and the test set is used for verifying the fault diagnosis model.

[0036] An embodiment of the present application also provides a device for generating sample data, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for generating sample data as described above.

[0037] An embodiment of the present application further provides a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for generating sample data as described above are implemented.

[0038] The present application discloses a method, device and storage medium for generating sample data, by acquiring a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a result of time-based sorting of the battery status characteristic data; converting the battery status characteristic data sequence into a feature vector; mapping the feature vector to a latent space of a generator to generate a corresponding latent vector, wherein the latent vector forms a new feature vector through inverse mapping; and reorganizing the new feature vector into sample data for output. The present application generates diversified sample data that is closer to the actual battery status by converting the battery status characteristic data sequence into a feature vector, and mapping and inverse mapping the feature vector in the latent space of the generator, thereby significantly improving the training effect and generalization ability of the fault diagnosis model, and solving the problem of limited accuracy of battery fault diagnosis due to unbalanced battery fault data samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flowchart of an embodiment of a method for generating sample data involved in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of a sample data generation process according to an embodiment of a method for generating sample data according to an embodiment of the present application;

[0041] Figure 3 A flowchart of another embodiment of a method for generating sample data according to an embodiment of the present application;

[0042] Figure 4 This is a schematic diagram of the structure of the device for generating sample data of this application.

[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0044] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0045] With the rapid development of technology fields such as electric vehicles, smart grids, and portable electronic devices, batteries, as key energy storage and supply devices for these systems, have become extremely important in terms of performance stability and safety. However, during long-term use, batteries may fail due to various reasons (such as overcharging, over-discharging, high temperature, etc.), resulting in system performance degradation and even safety accidents.

[0046] Among the related technologies, battery diagnostic technologies include electrochemical analysis, voltage and current monitoring, internal resistance testing, temperature monitoring and other technical means. These technical means mainly rely on data collected during operation to identify potential battery failures. However, due to the difficulty of data collection and the scarcity of failure data, it is often difficult to accurately judge the failure status of the battery. In addition, these technical means can usually only diagnose specific types of batteries and failure modes, and lack sufficient generalization capabilities to adapt to multiple types of batteries and unknown types of failures.

[0047] With the development of artificial intelligence and machine learning technologies, data-driven methods for generating sample data have gradually been proposed, such as pattern recognition based on machine learning, deep learning models, and signal processing technologies. These technologies mainly collect multi-source data of the battery during operation (such as time series feature data such as voltage, current, and temperature), and use machine learning algorithms to mine and analyze the data, thereby realizing battery fault detection, location, and classification. However, in actual use, the normal state data of the battery is far more than the fault state data. The data-driven generation method of sample data is also limited by the sparsity of battery fault data and sample imbalance. The available fault samples are extremely limited when training the fault diagnosis model, resulting in insufficient learning of the fault diagnosis model and limited generalization ability, which affects the accuracy of fault diagnosis.

[0048] In order to solve the above-mentioned defects existing in the related art, an embodiment of the present application proposes a method for generating sample data, by obtaining a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a time-based sorting result of the battery status characteristic data; converting the battery status characteristic data sequence into a feature vector; mapping the feature vector to the latent space of the generator to generate a corresponding latent vector, wherein the latent vector forms a new feature vector through inverse mapping; and reorganizing the new feature vector into sample data for output. The present application generates diversified sample data that is closer to the actual battery status by converting the battery status characteristic data sequence into a feature vector, and mapping and inverse mapping the feature vector in the latent space of the generator, thereby significantly improving the training effect and generalization ability of the fault diagnosis model, and solving the problem of limited accuracy of battery fault diagnosis due to unbalanced battery fault data samples.

[0049] For ease of understanding, the technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0050] Please refer to Figure 1 In an optional implementation scheme, the method for generating sample data includes the following steps S10 to S30:

[0051] S10: Acquire a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a result of sorting the battery status characteristic data based on time.

[0052] It should be noted that the battery status characteristic data includes characteristic data such as battery voltage, current, temperature, and SOC / SOH, and the battery status should cover data of the battery in various usage environments, workloads, battery aging stages, and in normal and various fault modes, including but not limited to high temperature, low temperature, high load, low load, rapid charging and discharging, battery aging, and various possible fault types, such as overcharging, over-discharging, short circuit, open circuit, etc.

[0053] In an optional implementation, before the step of obtaining the battery state characteristic data sequence, it is necessary to summarize the measured values ​​of the collected battery state parameters at different time points and merge them into a single data point. Then, the data points are sorted according to the timestamps attached to the data points. Finally, the sorted data points are connected in sequence to obtain the battery state characteristic data sequence.

[0054] Optionally, during the battery status data collection phase, the real-time status parameters of the battery are first collected from multiple sensors, including the battery voltage, current, temperature, and SOC / SOH, etc. These battery status parameters are recorded independently at each time point. Then the parameter values ​​corresponding to the collected battery status parameters are integrated into a data structure to form a single data point, and a timestamp is marked for the single data point. Among them, the data structure can be a custom class or structure that contains the attributes of the battery status parameters. Each attribute corresponds to a battery status parameter, and the data type of the attribute can be selected according to the numerical characteristics of the battery status parameter. Finally, these single data points are sorted in timestamp order and connected into a battery status characteristic data sequence, which reflects the state changes of the battery over a period of time.

[0055] For example, first create a data structure, such as a dictionary or class instance, to store battery status parameters. At each time point, the sensor automatically collects the values ​​of the battery status parameters. For example, at a certain moment, the recorded battery voltage is 12.8V, the current is 3A, the temperature is 30°C, the SOC is 70%, and the SOH is 85%. These parameter values ​​are then filled into the defined data structure, a data point object is created, and a timestamp is generated for the data point object to record the generation time of the data point. Then each data point object is stored in a list one by one. As time goes by, parameter collection and data point creation at new time points continue, and new data point objects are continuously added to the list. When the list accumulates a certain number of data points, it is sorted according to the timestamp of each data point object, and the sorted list forms a complete battery status characteristic data sequence.

[0056] In an optional embodiment, in the process of generating the battery status characteristic data sequence, the collected battery status parameters can be preprocessed to ensure the accuracy of the data points. First, the collected battery status parameters are cleaned. Before the battery status parameters are aggregated into a single data point, possible erroneous data is checked and removed, such as abnormal values ​​caused by sensor measurement errors or recording errors. At the same time, abnormal data points caused by sensor failures or extreme conditions are identified and eliminated, and duplicate recorded data are deleted.

[0057] Optionally, after data cleaning is completed, the data is further denoised. Due to factors such as sensor noise and data transmission interference, the collected battery status parameter data may contain certain random fluctuations. Smoothing can effectively reduce the random fluctuations and noise components in the data, thereby more clearly showing the changing trend of the battery status characteristic data.

[0058] Optionally, on the basis of data cleaning and denoising, in order to make the characteristic parameters of different dimensions and magnitudes have the same weight, normalization processing is required to scale the time series characteristic data to a uniform numerical range.

[0059] It can be understood that at each time point, the cleaned, denoised and normalized data is integrated into a single data point and recorded with a timestamp. These data points are accumulated in a list and updated over time. When a certain number of data points are accumulated in the list, they are sorted according to the timestamp of each data point and connected into a continuous battery status characteristic data sequence.

[0060] S20: Convert the battery status characteristic data sequence into a characteristic vector.

[0061] In an optional embodiment, the conversion process of the battery status characteristic data sequence can be achieved by utilizing a visual point pattern to convert the data points in the battery status characteristic data sequence into pixel representations on an image, generating corresponding image data, and then converting the image data into a set of feature vectors through feature extraction.

[0062] Optionally, the specific process of mapping the battery status characteristic data sequence to image data through the visual point mode is as follows: first, according to the time sequence of the data points of the battery status characteristic data sequence, the data points are mapped to the rows or columns of the image in sequence. As time progresses, a row or column of the image represents a snapshot of the battery status at different time points. Then the value of each data point is converted into a pixel brightness value through linear mapping, wherein the maximum and minimum values ​​of the data point correspond to the maximum brightness and minimum brightness of the pixel, respectively. Thereby, a continuous tone from dark to light is created in the image, which effectively converts the numerical changes of the battery status parameters into a visual form. In addition, when each data point generates a corresponding pixel, the position of the pixel is determined by the position of the corresponding data point in the time series, and the pixel brightness value is determined by the numerical value of the corresponding data point.

[0063] For example, if a data point in the battery status characteristic data sequence represents the battery voltage and current at a specific time point, then the position of this data point on the image is determined by the two parameters of the battery voltage and current, and its brightness can be determined by the battery temperature.

[0064] For example, if the key parameters of the battery status are voltage and current, then in the converted image, the x-axis can represent the numerical range of time or current, the y-axis can represent the numerical range of voltage, and the brightness of the pixel can represent the temperature of the battery or other related parameters. In this way, each pixel not only represents a specific time point and the corresponding battery status in space, but also provides additional parameter information in terms of brightness.

[0065] Optionally, the process of converting the battery status feature data sequence into a feature vector can be performed by using the battery status parameter as the channel or color dimension of the image data. Then, using the numerical value of the battery status parameter, each data point is mapped to the corresponding pixel of the image in the order of the timestamp, where the color depth or brightness of each pixel is determined by the numerical value of the battery status parameter. Through feature conversion, the battery status feature data sequence is converted into a two-dimensional representation of the image, and then the key features in the image data can be extracted using image processing technology.

[0066] For example, converting a battery status feature data sequence into image data can be achieved by mapping the numerical values ​​of battery status parameters such as voltage, current, and temperature to the RGB color channels of the image. For example, the voltage data is mapped to the red channel, the current data is mapped to the green channel, and the temperature data is mapped to the blue channel. In the created color image, the intensity of each color directly corresponds to the numerical value of the corresponding parameter. In the order of timestamps, the battery status snapshots of each data point are connected in series to form a complete image data. The image data uses different colors or shapes to represent different battery status features, thereby giving clear contextual information to the image data.

[0067] Optionally, after the battery status characteristic data sequence is converted into image data, the image data is divided into multiple units, which can be regular grid shapes, such as squares or rectangles, and each unit covers a portion of the image. Then the pixel brightness values ​​in each unit are summarized to obtain the brightness value of each pixel. Then the average value of the pixel brightness in each unit is calculated, where the average value of the pixel brightness of each unit represents the characteristic value of the corresponding unit, and the average value reflects the average level of the battery status parameter represented by the partial image corresponding to the unit. Finally, according to the position of the unit in the image, the characteristic values ​​of all units (i.e., the average value of the pixel brightness of each unit) are arranged in order to form a feature vector.

[0068] It should be explained that the eigenvalues ​​of all units can be arranged in order according to the physical position of the units, or in a specific logical order, such as from left to right, from top to bottom. The final eigenvector is a one-dimensional numerical array, in which each element corresponds to the eigenvalue of a unit, and the entire array reflects the data characteristics of the entire image in a certain order.

[0069] S30: Mapping the feature vector to a latent space of a generator to generate a corresponding latent vector, wherein the latent vector is inversely mapped to form a new feature vector.

[0070] It should be noted that the latent space is a low-dimensional space used to represent the compressed form of data. In the latent space, each instance of data is mapped to a point, called a latent vector.

[0071] It is important to explain that the latent space mapping of feature vectors is a transformation process implemented by the generator part of the deep learning model. The generator receives the original feature vector as input and transforms the feature vector through the parameterized structure of the generator network in order to find a corresponding point in the latent space, namely the latent vector.

[0072] In an alternative embodiment, if Figure 2 As shown, after the step of mapping the feature vector to the latent space of the generator to generate a corresponding latent vector, and the latent vector forming a new feature vector through reverse mapping, the new feature vector needs to be input into the discriminant model to determine the probability that the new feature vector is the feature vector of the true battery state; if the probability that the new feature vector is the feature vector of the true battery state is greater than or equal to a preset threshold, the step of reorganizing the new feature vector into sample data for output is executed; if the probability that the new feature vector is the feature vector of the true battery state is less than the preset threshold, the step of jumping to map the feature vector to the latent space of the generator to generate a corresponding latent vector, and the step of forming a new feature vector through reverse mapping of the latent vector is executed.

[0073] It can be understood that the discriminator is used to evaluate the possibility that the new feature vector represents the characteristic data of the true battery status, that is, to calculate the probability that the new feature vector is the feature vector of the true battery status. If the discriminant model determines that the probability that the new feature vector represents the true battery status is greater than or equal to a preset threshold, it means that the new feature vector has passed the verification and can be considered to be a true and valid data representation. On the contrary, if the discriminator calculates that the probability that the new feature vector represents the true battery status is less than the preset threshold, it means that the new feature vector may contain inaccurate information or noise and is insufficient to represent the true battery status. Therefore, the processing flow will return to the previous step, that is, to map the original feature vector to the latent space of the generator again, regenerate the latent vector, and form an updated new feature vector through inverse mapping.

[0074] S40: Reorganize the new feature vector into sample data for output.

[0075] It can be understood that the feature vectors obtained after the latent space transformation are reorganized to obtain a sample data set that can be used for analysis and application.

[0076] In an optional embodiment, the new feature vector is mapped back to the corresponding position of the original time series through the index according to its order in the latent space. Once the new feature vector is mapped to the correct time point, the data at each time point needs to be aggregated, and the feature values ​​at each time series position are accumulated or averaged to form sample data at each time point. Among them, accumulation can provide the total change in a specific time period, while the average provides the central trend of the data in the time period. Finally, the processed time series sample data is arranged in chronological order to form a complete sample data sequence for output.

[0077] Please refer to Figure 3 In another optional implementation scheme, after the new feature vector is reorganized into sample data for output, the following steps S50 to S70 are also included:

[0078] S50: Perform quality assessment on the sample data to obtain assessment results of the sample data.

[0079] S60: Based on the evaluation result and the preset quality evaluation standard, sample data that meets the preset quality evaluation standard is selected as a valid sample.

[0080] S70: Divide the battery status characteristic data sequence and the valid samples into a training set and a test set respectively, wherein the training set is used for training the fault diagnosis model, and the test set is used for verifying the fault diagnosis model.

[0081] In an optional implementation, when the new feature vector data generated by the generator is valid data, the valid data is reorganized to obtain new sample data. In order to ensure the quality of the new sample data, the new sample data needs to be quality evaluated to obtain the evaluation results of the new sample data. Then, based on the evaluation results and the preset quality evaluation standards, the sample data that meets the preset quality evaluation standards are screened as valid samples.

[0082] Optionally, the Structural Similarity Index (SSIM) and Peak Signal to Noise Ratio (PSNR) can be used as the main indicators for quality assessment. SSIM is an indicator for measuring the structural similarity of two images, which can reflect the degree of structural information loss in the image; while PSNR is an objective standard for evaluating the quality of image reconstruction, which measures the image quality by calculating the mean square error between the original image and the reconstructed image.

[0083] Exemplarily, the sample data is first preprocessed, including converting the sample data into image data through the above-mentioned conversion process, and then ensuring the consistency of format and features of all sample data by standardizing the image size, adjusting the brightness and contrast, etc. Next, the image corresponding to each sample data is evaluated using SSIM and PSNR. The SSIM and PSNR values ​​between the image of each sample data and the image corresponding to the original battery state characteristic data sequence are calculated, and these values ​​are compared with the thresholds preset in the evaluation results. For example, for image data with an SSIM value higher than 0.9 and a PSNR value higher than 30dB, it can be considered that they are structurally and visually similar enough to the images corresponding to the original battery state characteristic data sequence, and therefore can be used as training samples for the fault diagnosis model.

[0084] Optionally, when performing quality assessment on sample data, dynamic time warping (DTW) and Fréchet Inception Distance (FID) can also be introduced as quality assessment indicators. DTW is an algorithm used to measure the similarity between two time series. It nonlinearly distorts the time series to achieve the best match between the two time series, thereby calculating the distance between the two time series. In quality assessment, the DTW distance between each sample data and the true battery status feature data sequence can be calculated to evaluate the similarity between the two images and thus determine the quality of the sample data.

[0085] FID is an indicator for evaluating sample data generated by a generative model. It evaluates the quality of generated sample data by calculating the distance between the generated sample data and the true battery status feature data in the feature space.

[0086] Specifically, FID first extracts the characteristics of the real battery state, then calculates the mean and covariance matrix between the sample data and the real battery state characteristics, and finally calculates the Fritsche distance between the two matrices. The smaller the FID value, the higher the quality of the generated sample data and the more similar it is to the real battery characteristics.

[0087] When performing quality assessment on sample data, the quality assessment standard may be set according to actual conditions, and this embodiment does not impose any restrictions on the preset threshold of the assessment result.

[0088] In an optional implementation, the battery status characteristic data sequence and the valid samples may be divided into a training set and a test set, respectively. The training set is used for training the fault diagnosis model, and the test set is used for verifying the fault diagnosis model.

[0089] It is understandable that the battery status feature data sequence and valid samples are divided into training sets and test sets respectively in order to be able to train and test the fault detection model on different data subsets. The training set is used for the learning process of the fault diagnosis model, while the test set is used to evaluate the performance of the fault diagnosis model. By training the fault diagnosis model on the training set, it learns the difference between the fault characteristics and the normal state, and then evaluates the fault diagnosis model on the unseen test set, ensuring that the fault diagnosis model has good generalization ability and avoids overfitting.

[0090] In an optional implementation, a convolutional neural network (CNN) is first used to extract features from the data in the training set. As a deep learning model, the convolutional neural network has an internal structure including convolutional layers and pooling layers, which can automatically learn and extract local and global features in the image. During the training process, the convolutional neural network enhances the representation ability of features by optimizing weights and biases.

[0091] Subsequently, the features extracted by the convolutional neural network are subjected to dimensionality reduction by applying the principal components analysis (PCA) method. As a statistical method, PCA maps the original feature space to a low-dimensional space by identifying the main variation directions (i.e., principal components) in the sample data, generating feature vectors, thereby reducing the computational complexity while retaining the most important information in the data.

[0092] Finally, the fault diagnosis model is established using the Support Vector Machine (SVM) algorithm. As an efficient classification algorithm, the support vector machine separates data of different categories by finding the optimal hyperplane. During the training phase of the fault diagnosis model, the support vector machine makes classification decisions based on the input low-dimensional feature vector and the learned hyperplane to achieve accurate fault diagnosis.

[0093] Exemplarily, the training set is first input into the pre-trained convolutional neural network model, and the feature representation of the training set is extracted through the forward propagation process of the model. These feature representations are then collected and organized into a feature matrix. Then, principal component analysis is applied to reduce the dimension of the feature matrix, and the principal component that best represents the data variation is selected to form a new feature vector. The feature vector is then input into the support vector machine model, which classifies the feature vector by adjusting the position and direction of the hyperplane until the model can accurately identify the fault type.

[0094] In an optional implementation, the fault diagnosis model is trained using a training set to learn characteristic data of the battery in a normal state and a fault state.

[0095] It can be explained that the training of the fault diagnosis model is to enable the model to learn the characteristic data of the battery in normal and faulty states from the training data. These characteristic data are the key information used by the fault diagnosis model to distinguish between normal and faulty states. During the training phase, the fault diagnosis model will continuously match the prediction results with the corresponding sample data, optimize its own parameters based on the matching results, and learn how to identify and distinguish the characteristics of normal and faulty states.

[0096] In an optional implementation scheme, after the training of the fault diagnosis model is completed, the test set can be input into the fault diagnosis model, and then the fault diagnosis model starts to perform fault detection on each sample data in the test set to generate a fault detection result.

[0097] Subsequently, the fault detection results output by the fault diagnosis model are compared with the fault states corresponding to the test set, and the performance indicators such as the accuracy, recall, and F1 score of the fault diagnosis model are calculated. Among them, the accuracy reflects the proportion of samples (true positives and true negatives) correctly predicted by the fault diagnosis model to the total samples, and the calculation formula is: Accuracy = (TP + TN) / total number of samples. Recall represents the proportion of fault samples (true positives) correctly predicted by the fault diagnosis model to all actual fault samples, and the calculation formula is: Recall = TP / (TP + FN). The F1 score is the harmonic average of the accuracy and recall, providing a comprehensive evaluation of the accuracy and comprehensiveness of the fault diagnosis model, and the calculation formula is: F1 score = 2 * (accuracy * recall) / (accuracy + recall).

[0098] For example, the fault diagnosis model predicts 100 battery samples, 80 of which are normal samples and 20 are faulty samples. The generated fault detection results are:

[0099] TP (True Positives): The number of fault samples correctly predicted by the model is 18.

[0100] FP (False Positive): The number of normal samples that the model incorrectly predicts as faults is 5.

[0101] TN (True Negative): The number of normal samples correctly predicted by the model as normal is 75.

[0102] FN (False Negative): The number of fault samples that the model incorrectly predicts as normal is 2.

[0103] Based on the above results, the accuracy, recall and F1 score of the fault diagnosis model can be calculated:

[0104] Accuracy = (18 + 75) / 100 = 0.93

[0105] Recall = 18 / 20 = 0.9

[0106] F1 score = 2*(0.93*0.9) / (0.93+0.9) = 2*0.837 / 1.83≈0.922

[0107] Therefore, in the specific implementation example, the fault diagnosis model has an accuracy of 0.93, a recall rate of 0.9, and an F1 score of 0.922. These performance indicators show that the fault diagnosis model has good generalization ability on the test set, can accurately identify faulty samples, and can also effectively exclude normal samples.

[0108] In an optional implementation, human feedback reinforcement learning (RLHF) can also be introduced to modify the fault diagnosis model. The specific implementation is as follows:

[0109] First, after the initial training, the fault diagnosis model needs to be evaluated on the test set. During the evaluation process, the model's diagnosis results will be compared with the pre-set standard answers and a feedback signal will be generated.

[0110] Then, under the reinforcement learning framework, a reward function is defined. This reward function gives rewards or penalties based on the consistency between the diagnosis results of the fault diagnosis model and the optimal strategy. By learning to maximize this reward function, the performance of the fault diagnosis model is optimized.

[0111] In addition, the optimization process of the fault diagnosis model is carried out in an iterative manner. In each iteration, the fault diagnosis model is adjusted according to the latest feedback signal, and then evaluated again on the test set to verify the effect of these adjustments. This process is repeated until the performance of the fault diagnosis model reaches the expected goal, or further improvement becomes insignificant.

[0112] The present application provides a sample data generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the sample data generation method in the above-mentioned embodiment.

[0113] Reference below Figure 4 , which shows a schematic diagram of the structure of a sample data generation device suitable for implementing an embodiment of the present application. , Figure 4 The sample data generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0114] like Figure 4As shown, the sample data generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the sample data generation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: a storage device 1003 including, for example, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the sample data generation device to communicate with other devices wirelessly or by wire to exchange data. Although the sample data generation device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0115] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0116] The sample data generation device provided by the present application adopts the sample data generation method in the above embodiment, which can solve the technical problem of limited accuracy of battery fault diagnosis caused by imbalance of battery fault data samples. Compared with the prior art, the beneficial effects of the sample data generation device provided by the present application are the same as the beneficial effects of the sample data generation method provided by the above embodiment, and the other technical features in the sample data generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0117] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0118] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0119] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for generating sample data in the above-mentioned embodiment.

[0120] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0121] The computer-readable storage medium may be included in the sample data generation device; or may exist independently without being assembled into the sample data generation device.

[0122] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by a sample data generating device, the sample data generating device can: obtain a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a time-based sorting result of the battery status characteristic data; convert the battery status characteristic data sequence into a feature vector; map the feature vector to a latent space of a generator to generate a corresponding latent vector, wherein the latent vector forms a new feature vector through inverse mapping; and reorganize the new feature vector into sample data for output.

[0123] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0125] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0126] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for generating sample data, and can solve the technical problem of limited accuracy of battery fault diagnosis caused by unbalanced battery fault data samples. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for generating sample data provided by the above-mentioned embodiment, and will not be elaborated here.

[0127] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method for generating sample data when executed by a processor.

[0128] The computer program product provided by the present application can solve the technical problem of limited accuracy of battery fault diagnosis caused by unbalanced battery fault data samples. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the sample data generation method provided by the above embodiment, which will not be repeated here.

[0129] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

[0130] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.

[0132] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for generating sample data, characterized in that: The method includes: Acquire a battery status characteristic data sequence, wherein the battery status characteristic data sequence is a result of sorting the battery status characteristic data based on time; Converting the battery status characteristic data sequence into a characteristic vector; Mapping the feature vector to a latent space of a generator to generate a corresponding latent vector, wherein the latent vector is inversely mapped to form a new feature vector; The new feature vector is reorganized into sample data for output.

2. The method according to claim 1, characterized in that Before the step of acquiring the battery status characteristic data sequence, the method further includes: Aggregate the measured values ​​of the battery state parameters at different time points to form a single data point; sorting the data points according to timestamps attached to the data points; The sorted data points are connected in sequence to obtain a battery status characteristic data sequence.

3. The method according to claim 1, characterized in that The step of converting the battery status characteristic data sequence into a characteristic vector comprises: Mapping data points in the battery status characteristic data sequence to pixels of an image using a visual point pattern to generate corresponding image data; The features of the image data are extracted to generate the feature vector.

4. The method according to claim 3, characterized in that The step of mapping the data points in the battery status characteristic data sequence to the pixels of the image by using the visual point mode to generate the corresponding image data comprises: Mapping the data points of the battery status characteristic data sequence to rows or columns of an image based on a time sequence to form a row or a column of the image; The value of each data point is converted into a pixel brightness value through linear mapping, wherein the maximum value and the minimum value of the data point correspond to the maximum brightness and the minimum brightness of the pixel respectively; A corresponding pixel is generated for each data point, wherein the position of the pixel is determined by the position of the corresponding data point in the time series, and the pixel brightness value is determined by the numerical value of the corresponding data point.

5. The method according to claim 3, characterized in that The step of extracting the features of the image data and generating the feature vector comprises: Dividing the image data into a plurality of units, and obtaining a pixel brightness value of each unit; Calculate the average pixel brightness of each unit as the characteristic value of the corresponding unit; Based on the position of each unit in the image data, the feature values ​​of all units are arranged in order to obtain a feature vector corresponding to the image data.

6. The method according to claim 1, characterized in that After the step of mapping the feature vector to the potential space of the generator to generate a corresponding potential vector, and the potential vector is inversely mapped to form a new feature vector, the method further includes: Inputting the new feature vector into a discrimination model to determine the probability that the new feature vector is a feature vector of a true battery state; If the probability that the new feature vector is the feature vector of the real battery state is greater than or equal to a preset threshold, executing the step of reorganizing the new feature vector into sample data for output; If the probability that the new feature vector is the feature vector of the true battery state is less than a preset threshold, the step of jumping to map the feature vector to the latent space of the generator to generate a corresponding latent vector, and the latent vector is formed into a new feature vector by inverse mapping.

7. The method according to claim 1, characterized in that The step of reorganizing the new feature vector into sample data for output comprises: Mapping the new feature vectors back to the corresponding positions of the original time series through indices according to their order in the latent space; The characteristic values ​​at each time series position are accumulated or averaged to form sample data at each time point; Arrange the processed time series sample data in chronological order to form a complete sample data sequence for output.

8. The method according to claim 1, characterized in that After the step of reorganizing the new feature vector into sample data for output, the method further comprises: Performing quality assessment on the sample data to obtain an assessment result of the sample data; Based on the evaluation results and the preset quality evaluation criteria, sample data that meets the preset quality evaluation criteria are selected as valid samples; The battery status characteristic data sequence and the valid samples are divided into a training set and a test set respectively, the training set is used for training the fault diagnosis model, and the test set is used for verifying the fault diagnosis model.

9. A device for generating sample data, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for generating sample data according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for generating sample data according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Small sample fault diagnosis method based on improved TimeGAN model

    CN114692506A

  • Fault classification method based on TimeGAN model

    CN115345222A

  • Non-equilibrium sample bearing fault diagnosis method based on multi-scale feature fusion

    CN116541771A

  • Transformer fault image sample generation method and system based on StyleGAN

    CN117853847A

  • Machine learning model development

    US20210117774A1