Battery failure data generation method, device and medium
By generating battery failure data through an improved generative adversarial network, the problem of insufficient power battery failure data samples is solved, and the training effect and accuracy of the fault diagnosis and prediction model are improved.
Patent Information
- Application Number
- CN202411119137.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-08-15
AI Technical Summary
The small number of power battery fault data samples leads to poor training results of fault diagnosis and prediction models, and the random data generated by existing neural networks is ineffective.
An improved generative adversarial network is used to generate battery failure data with time series relationships by position encoding the random noise vector. The improved generator and discriminator are alternately trained to generate battery failure data that is close to the real data.
The training effect of the battery fault diagnosis and prediction model is improved, and the generated fault data has a time series relationship, which enhances the performance and accuracy of the model.
Smart Images

Figure CN119125893B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular relates to a method, device and medium for generating battery fault data. Background Art
[0002] During the actual operation of the vehicle, the fault data of the power battery is relatively small, making it difficult to obtain sufficient fault sample data to train the fault diagnosis and prediction model. Sufficient fault sample data is of great significance to ensure the effect of model training. Therefore, it is necessary to expand the fault data samples of the power battery.
[0003] Related technologies use multi-layer hidden neural networks to describe the strong nonlinear relationship between input and output. Through training or learning, they extract the potential characteristics of power batteries from big data to expand power battery fault data. However, the power battery fault data generated by these neural networks is random data, which is not effective when used to train fault diagnosis and prediction models. Summary of the Invention
[0004] The embodiments of the present application provide a method, device, and medium for generating battery fault data, thereby enabling the generated battery fault data to have a time series relationship, at least to a certain extent, so that when a subsequent battery fault diagnosis and prediction model is trained, the model performance can be improved based on the time series relationship of the battery fault data.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.
[0006] According to a first aspect of an embodiment of the present application, a method for generating battery fault data is provided, comprising:
[0007] Obtain a first random noise vector;
[0008] The first random noise vector is input into the target generator. After the first random noise vector is position-encoded by the target generator, corresponding battery fault data is generated. The target generator is trained on the initially configured improved generative adversarial network through historical battery failure data and a second random noise vector. The historical battery failure data is a first time series. The improved generative adversarial network includes an improved generator and an improved adversary. The improved generator generates battery failure data through the output of the second random noise vector with position coding information. The generated battery failure data is a second time series. The improved discriminator performs data authenticity discrimination through the first time series and the second time series with position coding information.
[0009] In some embodiments of the present application, based on the aforementioned solution, before obtaining the first random noise vector, the method further includes:
[0010] Acquire the historical battery failure data and the second random noise vector, wherein the historical battery failure data is the first time series;
[0011] After position encoding the second random noise vector using the improved generator, the second random noise vector having the position encoding information is converted into generated battery fault data for deceiving the improved discriminator, wherein the generated battery fault data is the second time series;
[0012] After position encoding the first time series and the second time series respectively using the improved discriminator, data authenticity discrimination is performed on the first time series and the second time series having the position encoding information respectively;
[0013] The improved generator and the improved discriminator are alternately trained until they reach a Nash equilibrium, and the training of the improved generative adversarial network is completed. The target generator is obtained from the trained improved generative adversarial network.
[0014] In some embodiments of the present application, based on the aforementioned solution, the second random noise vector, the first time series, and the second time series each include multiple battery fault feature elements, and the position encoding of the second random noise vector using the improved generator, or the position encoding of the first time series and the second time series by the improved discriminator, includes:
[0015] Obtaining multiple coding dimensions and a position index corresponding to each of the battery fault characteristic elements;
[0016] A corresponding position vector is generated for each position index, where the position vector includes a plurality of position sub-vectors, and each position sub-vector corresponds to one of the encoding dimensions.
[0017] In some embodiments of the present application, based on the above solution, generating a corresponding position vector for each position index includes:
[0018] The position index is sine-encoded and cosine-encoded in each encoding dimension to obtain a sine-encoded value and a cosine-encoded value, and the sine-encoded value and the cosine-encoded value are combined to obtain the position sub-vector.
[0019] In some embodiments of the present application, based on the above solution, after generating a corresponding position vector for each position index, the method further includes:
[0020] Splicing the position vector and the original feature vector to obtain a splicing vector, and inputting the splicing vector into the target model;
[0021] Among them, when the original feature vector is the second random noise vector, the target model is the improved generator; when the original feature vector is the first time series or the second time series, the target model is the improved discriminator.
[0022] In some embodiments of the present application, based on the aforementioned solution, the improved generator includes a first position encoding module, a first deconvolution module, a first residual module based on an attention mechanism, and a second deconvolution module connected in sequence. After position encoding the second random noise vector using the improved generator, the second random noise vector with position encoding information is converted into generated battery fault data for deceiving the improved discriminator, including:
[0023] After position encoding the second random noise vector based on the first position encoding module, deconvolution operation is performed on the second random noise vector having the position encoding information using the first deconvolution module to obtain a first state quantity feature;
[0024] After using the first residual module to perform self-attention processing on the first state quantity feature, a second state quantity feature is obtained, and after the second deconvolution module performs a deconvolution operation on the second state quantity feature, generated battery fault data for deceiving the improved discriminator is obtained.
[0025] In some embodiments of the present application, based on the aforementioned solution, the improved discriminator includes a second position encoding module, a first convolution module, a second residual module based on an attention mechanism, a second convolution module, and a data output module connected in sequence. After the improved discriminator performs position encoding on the first time series and the second time series respectively, the improved discriminator performs data authenticity discrimination on the first time series and the second time series having the position encoding information, including:
[0026] After position encoding the first time series and the second time series respectively based on the second position encoding module, convolution operation and self-attention processing are performed respectively by the first convolution module and the second residual module to obtain a third state quantity feature;
[0027] A fourth state quantity feature is obtained by performing a convolution operation on the third state quantity feature using the second convolution module, and a data authenticity judgment result of the fourth state quantity feature is output based on the data output layer.
[0028] In some embodiments of the present application, based on the aforementioned solution, after corresponding battery fault data is generated, the method further includes:
[0029] Based on the generated battery fault data and the historical battery fault data, the network to be trained is trained to obtain a battery fault diagnosis prediction model.
[0030] According to a second aspect of an embodiment of the present application, a battery fault data generating device is provided, comprising:
[0031] an acquiring unit, configured to acquire a first random noise vector;
[0032] A generating unit is configured to input the first random noise vector into a target generator, and after position encoding the first random noise vector through the target generator, corresponding battery fault data is generated. The target generator is trained on an initially configured improved generative adversarial network through historical battery fault data and a second random noise vector. The historical battery fault data is a first time series. The improved generative adversarial network includes an improved generator and an improved adversary. The improved generator generates battery fault data through the output of the second random noise vector with position encoding information. The generated battery fault data is a second time series. The improved discriminator discriminates the authenticity of the data through the first time series and the second time series with position encoding information.
[0033] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one computer program instruction is stored. The at least one computer program instruction is loaded and executed by a processor to implement the operations performed by any method described in the first aspect.
[0034] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by any of the methods described in the first aspect.
[0035] The one or more technical solutions provided by the embodiments of the present invention achieve at least the following technical effects or advantages:
[0036] In the present application, a first random noise vector is obtained, and the first random noise vector is input into a target generator. After the target generator position-encodes the first random noise vector, corresponding battery fault data is generated. The target generator trains the initially configured improved generative adversarial network through historical battery fault data and a second random noise vector. The historical battery fault data is a first time series. The improved generative adversarial network includes an improved generator and an improved adversary. The improved generator generates battery fault data through the output of a second random noise vector with position-encoding information. The generated battery fault data is a second time series. The improved discriminator discriminates the authenticity of the data through the first time series and the second time series with position-encoding information. Therefore, while the present application expands the power battery fault data based on the target generator, it position-encodes the first random noise vector based on the target generator, so that the generated power battery fault data has a time series relationship, and then when the power battery fault data is subsequently used to train the training network, the time series relationship of the power battery fault data can be understood and evaluated, thereby improving the performance of the trained battery fault diagnosis and prediction model.
[0037] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, explaining the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:
[0039] Figure 1 A flow chart of a method for generating battery fault data according to an embodiment of the present application is shown;
[0040] Figure 2 The structure diagram of the improved generative adversarial network of the embodiment of the present application is shown;
[0041] Figure 3 A structural diagram of a battery fault data generating device according to an embodiment of the present application is shown;
[0042] Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0044] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0045] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0046] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.
[0047] It should also be noted that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described.
[0048] It's important to note that in actual vehicle operation, fault information is often relatively scarce, resulting in significant data sparsity and imbalance. This imbalance in data distribution makes it difficult for traditional power battery fault diagnosis and prediction models to obtain sufficient fault samples for training, significantly impacting the accuracy of subsequent fault diagnosis and prediction. Therefore, obtaining a sufficient amount of power battery fault data samples is crucial for ensuring the effectiveness of subsequent power battery fault diagnosis and prediction model training.
[0049] Since power battery fault diagnosis and prediction models are trained based on historical power battery fault data to diagnose and predict future power battery fault states, model training based on power battery fault data samples with a time-series relationship can effectively improve the accuracy of model training. Currently, some related technologies have proposed methods for generating time series data, such as simulation generation methods based on statistical models or rule-based methods. However, these methods often have difficulty capturing the complexity and dynamics of real time series data, and the generated data often differs significantly from the real data. Therefore, if a method can be obtained that can generate high-quality and high-fidelity time series data, it will be important for promoting the training of power battery fault models.
[0050] In recent years, artificial intelligence and deep learning have become familiar terms. Generally speaking, deep learning models can be divided into discriminative models and generative models. Discriminative models have developed rapidly due to the invention of algorithms such as back propagation (BP) and random dropout. However, due to the difficulty of modeling generative models, development has been slow. It was not until the invention of GAN (Generative Adversarial Networks) in recent years that this field has been revitalized. With the rapid development of GAN theory and models, it has found increasingly in-depth applications in fields such as computer vision, natural language processing, and human-computer interaction, and continues to extend into other fields.
[0051] The basic structure of the GAN network includes a generator and a discriminator. Inspired by the zero-sum game in game theory, in GAN technology, the generation problem is regarded as a confrontation and game between two networks, the discriminator and the generator: the generator uses given noise (generally referring to uniform distribution or normal distribution) to generate synthetic data, and the discriminator distinguishes the output of the generator from the real data. The former attempts to produce data that is closer to the real data, and accordingly, the latter attempts to distinguish the real data from the generated data more perfectly. Thus, the two networks progress in the confrontation, and continue to confront after progress. The data obtained by the generator becomes more and more perfect, approaching the real data, so that the desired data (pictures, sequences, videos, etc.) can be generated. Thus, through the adversarial training of the generator and the discriminator, the distribution of real data can be learned to generate high-quality data samples. The generative adversarial network has good generation ability and processing ability for high-dimensional data. Therefore, the embodiment of the present application intends to obtain a target generator by training with an improved generative adversarial network, and use the target generator to generate power battery fault data.
[0052] See also Figure 1 , shows a flow chart of a method for generating battery fault data according to an embodiment of the present application.
[0053] like Figure 1 As shown, according to a first aspect of an embodiment of the present application, a method for generating battery fault data is provided, including but not limited to:
[0054] Step S1. Obtain a first random noise vector;
[0055] In practical applications, the first random noise vector can be a random noise variable obtained from external input or generated internally. Specifically, for example, if historical battery failure data is real historical data collected during actual vehicle operation, including but not limited to data such as battery voltage, battery current, battery temperature, and battery SOC, the generated battery failure data corresponding to the first random noise vector can be data close to the historical real battery data.
[0056] Step S2. Input the first random noise vector into the target generator, and after the target generator performs position encoding on the first random noise vector, generate corresponding battery fault data. The target generator trains the initially configured improved generative adversarial network through historical battery fault data and the second random noise vector. The historical battery fault data is a first time series. The improved generative adversarial network includes an improved generator and an improved adversary. The improved generator generates battery fault data through the output of the second random noise vector with position encoding information. The generated battery fault data is a second time series. The improved discriminator performs data authenticity discrimination through the first time series and the second time series with position encoding information.
[0057] Based on the above-disclosed content, the embodiment of the present application expands the power battery fault data based on the target generator, solves the problem of small number of power battery fault data samples, sample imbalance, and poor training effect of subsequent fault diagnosis model. At the same time, the first random noise vector is position-encoded based on the target generator, so that the generated power battery fault data has a time series relationship, and then when the power battery fault data is subsequently used to train the training network, the time series relationship of the power battery fault data can be understood and evaluated, thereby improving the performance of the trained battery fault diagnosis prediction model.
[0058] In some embodiments, before obtaining the first random noise vector, the method further includes:
[0059] Step S01. Acquire the historical battery failure data and the second random noise vector, wherein the historical battery failure data is the first time series;
[0060] It is understandable that during the operation of the vehicle, whether the power battery has a fault can be determined by the operating parameters of the power battery, such as battery voltage, battery current, battery temperature, battery SOC and other data. By obtaining various operating parameters of the power battery during the operation of the vehicle and the actual operating parameters when the power battery fails, historical battery fault data can be obtained. Since the historical battery fault data is real data obtained during the actual operation of the vehicle, each historical battery fault data is real data. Each historical battery fault data can include sub-data of multiple moments that are continuous in the time domain. Each sub-data can carry a timestamp when it is obtained. Therefore, each historical battery fault data is a time series data. For example: historical battery fault data x = [x1, x2, ... x t …x 100 ], where x t ∈R d is the feature vector at timestamp t.
[0061] Step S02. After position encoding the second random noise vector using the improved generator, the second random noise vector with the position encoding information is converted into generated battery fault data for deceiving the improved discriminator, wherein the generated battery fault data is the second time series;
[0062] Step S03. After position encoding the first time series and the second time series respectively using the improved discriminator, data authenticity discrimination is performed on the first time series and the second time series having the position encoding information respectively;
[0063] Specifically, a first time series or a second time series is randomly selected each time as the input of the improved discriminator. The discriminator is essentially similar to a binary classifier. After receiving the first time series or the second time series, it discriminates the received time series to determine whether the time series comes from historical battery failure data or generated battery failure data generated by the generator, and obtains the probability value of the time series (data authenticity judgment result).
[0064] Step S04. Alternately train the improved generator and the improved discriminator until the two reach Nash equilibrium. The training of the improved generative adversarial network is completed, and the target generator is obtained from the trained improved generative adversarial network.
[0065] Specifically, after each probability value calculated by the discriminator, the GAN calculates the corresponding loss functions for the generator and discriminator based on the probability value. The backpropagation algorithm then performs gradient backpropagation, sequentially updating the parameters of the discriminator and generator based on the loss functions. When updating the discriminator and generator, an alternating iterative update strategy is employed: first, the generator is fixed and the discriminator parameters are updated. The next update cycle, the discriminator is fixed and the generator parameters are updated. After updating the parameters of the discriminator and generator, the generator's forgery detection and the discriminator's forgery detection capabilities are further improved. By repeatedly looping through the "generate-discriminate-update" process, the GAN eventually achieves a highly accurate discriminator ability to determine whether a time series is the first time series. Furthermore, the generator uses a second random noise variable to generate a probability distribution function that approximates the probability distribution function of the first time series. At this point, the discriminator cannot determine whether the second time series transmitted by the discriminator is real or fake, ultimately achieving a Nash equilibrium between the generator and discriminator. When this Nash equilibrium is reached, GAN training is complete. When the training of GAN is completed, the generator in the initially configured GAN now meets the set performance requirements. The discriminator network in GAN can be removed, and the generator of GAN is retained as the battery failure data generation model.
[0066] It should be noted that although generative adversarial networks have achieved good results in applications of generating static data such as pictures, unlike static data such as pictures, power battery fault data is time series data with a temporal sequence. Generating time series data requires that the generative adversarial network be able to capture the temporal dynamics and correlation in the time series data. Traditional generative adversarial networks cannot achieve the above effects. Therefore, the embodiment of the present application adds position coding to the generative adversarial network, so that the improved generative adversarial network can understand and analyze the temporal characteristics of the data based on the position coding of the time series data, thereby improving the training effect of the generative adversarial network.
[0067] In some embodiments, the second random noise vector, the first time series, and the second time series each include a plurality of battery fault characteristic elements, and the performing position encoding on the second random noise vector using the improved generator, or the performing position encoding on the first time series and the second time series using the improved discriminator, respectively, includes:
[0068] Step S05. Obtain multiple coding dimensions and a position index corresponding to each of the battery fault characteristic elements;
[0069] It should be noted that the number of encoding dimensions refers to the number of encoding dimensions of each position vector, which can be pre-set as needed. For example, the number of encoding dimensions of the position vector is set to 16, that is, the position vector has corresponding position sub-vectors in all 16 dimensions.
[0070] For example: for a time series of length n, pos represents the position of the element in the sequence, PE represents the position vector corresponding to pos, d_pos represents the number of dimensions of the vector, i represents the i-th dimension of the vector, and the value range of i is [0,…d_pos / 2]. For example, the first time series x∈R n*d The length of the data is 100, that is, it contains 100 elements, each element corresponds to a time point, and the feature quantity of each element is 9 (such as battery SOC, battery temperature, battery voltage, battery current and other feature quantities), that is, x = [x1, x2, ... x t …x 100 ], where x t ∈R d is the feature vector at timestamp t. Then, for 100 elements, a position index from 0 to 99 can be generated. Of course, it can be understood that the generation method of the position index is only exemplary, and other methods can also be used to set the position index, such as using letters, characters, etc.
[0071] Step S06: Generate a corresponding position vector for each position index, where the position vector includes multiple position sub-vectors, and each position sub-vector corresponds to one of the encoding dimensions.
[0072] In some embodiments, generating a corresponding position vector for each position index includes:
[0073] The position index is sine-encoded and cosine-encoded in each encoding dimension to obtain a sine-encoded value and a cosine-encoded value, and the sine-encoded value and the cosine-encoded value are combined to obtain the position sub-vector.
[0074] For example, the position index is sine-encoded and cosine-encoded in dimensions 2i and 2i+1, respectively, and the corresponding position sub-vectors are obtained as follows:
[0075]
[0076] Among them, PE(pos,2i) and PE(pos,2i+1) represent the position encoding values of the position index pos in dimension 2i and 2i+1 respectively, and the value range of i is 0 to
[0077] Then when pos=0,
[0078]
[0079] When pos=1,
[0080]
[0081]
[0082] Thus, the position vectors corresponding to the position indexes 0-99 can be obtained.
[0083] In some embodiments, after generating a corresponding position vector for each position index, the method further comprises:
[0084] Splicing the position vector and the original feature vector to obtain a splicing vector, and inputting the splicing vector into the target model;
[0085] Among them, when the original feature vector is the second random noise vector, the target model is the improved generator; when the original feature vector is the first time series or the second time series, the target model is the improved discriminator.
[0086] For example: after position encoding of each position index, the position vector and the normalized original feature vector are concatenated, the merged feature dimension is 25, and then the merged feature is passed as input to the generator or discriminator.
[0087] See also Figure 2 , which shows a structural diagram of the improved generative adversarial network of an embodiment of the present application.
[0088] In some embodiments, the improved generator includes a first position encoding module, a first deconvolution module, a first residual module based on an attention mechanism, and a second deconvolution module connected in sequence. After position encoding the second random noise vector using the improved generator, the second random noise vector with position encoding information is converted into generated battery fault data for deceiving the improved discriminator, including:
[0089] Step SA1. After position encoding the second random noise vector based on the first position encoding module, the first deconvolution module is used to perform a deconvolution operation on the second random noise vector having the position encoding information to obtain a first state quantity feature;
[0090] Step SA2. Use the first residual module to perform self-attention processing on the first state quantity feature to obtain a second state quantity feature, and use the second deconvolution module to perform a deconvolution operation on the second state quantity feature to obtain generated battery fault data for deceiving the improved discriminator.
[0091] For example, the second random noise vector input is converted in dimension by the fully connected layer and then positionally encoded. It then passes through a deconvolution module to obtain feature F1, and then passes through the attention mechanism and residual structure to obtain feature F2. It then passes through three deconvolution modules to generate fault data.
[0092] In some embodiments, the improved discriminator includes a second position encoding module, a first convolution module, a second residual module based on an attention mechanism, a second convolution module, and a data output module connected in sequence. After the improved discriminator performs position encoding on the first time series and the second time series respectively, the improved discriminator performs data authenticity discrimination on the first time series and the second time series having the position encoding information, including:
[0093] Step SB1. After position encoding the first time series and the second time series respectively based on the second position encoding module, convolution operation and self-attention processing are performed using the first convolution module and the second residual module respectively to obtain a third state quantity feature;
[0094] Step SB2. Use the second convolution module to perform a convolution operation on the third state quantity feature to obtain a fourth state quantity feature, and output the data authenticity judgment result of the fourth state quantity feature based on the data output layer.
[0095] For example: the real first time series and the second time series generated by the generator are input into the discriminator, and after passing through a convolution module, the result is passed through the self-attention mechanism to obtain feature F3, and then passed through three convolution modules to obtain feature F4, and then converted into degree through a fully connected layer, and then the softmax layer outputs the probability (indicating the probability of data authenticity).
[0096] It should be noted that the various deconvolution modules in the embodiments of the present application include deconvolution (FConv), BatchNorm (a normalization method for solving the internal covariance shift problem in deep networks), and Relu activation function. The deconvolution operation allows the generator network to learn how to best perform upsampling through training. That is, the generator network can adaptively adjust the upsampling method according to the requirements of the task, thereby generating higher quality output. In addition, the convolution module of the embodiment of the present application includes convolution, Relu activation function, Dropout (to prevent overfitting), and BatchNorm.
[0097] It should be noted that the first residual module of the embodiment of the present application is based on the self-attention mechanism, which is used to enhance the model's attention to important information. The output of one-dimensional deconvolution is input into the self-attention mechanism, and a residual connection is used to add the result of self-attention to the original feature value and input it into the next layer to enhance the attention to important information.
[0098] In the self-attention mechanism, the generative adversarial network needs to calculate the correlation or similarity between each element (query) and other elements (keys) to determine which elements should be focused on when generating the target sequence. Position encoding information is added to the representation of these elements (queries and keys) as part of them. In this way, when the generative adversarial network calculates the attention weights, it can not only consider the content information of the elements, but also their position information. This means that even if two elements are similar in content, if their positions are different, then their impact on the attention weights will be different, which can further improve the quality and accuracy of the generated power battery failure data and make it closer to the actual data.
[0099] In this embodiment of the present application, when training the improved generative adversarial network using power battery failure data, cross-validation can also be used to improve the accuracy and robustness of the model. Furthermore, the training parameters are set, and the stochastic optimization algorithm Adam is used for training. The training batch size is Batch = 32, the number of training iterations is Epoch = 200, and the learning rate is set to 0.0002. After multiple iterations and adjustments, a generator and discriminator with excellent performance are finally obtained.
[0100] In some embodiments of the present application, based on the aforementioned solution, after corresponding battery fault data is generated, the method further includes:
[0101] Based on the generated battery fault data and the historical battery fault data, the network to be trained is trained to obtain a battery fault diagnosis prediction model.
[0102] From the above, since the target generator can output fault data close to the actual fault data of the power battery, the sample size of the fault data of the power battery is increased, so that a sufficient sample size of fault data can be used to train the battery fault diagnosis prediction model, thereby improving the model training effect. Moreover, since the fault data has a time series order, the battery fault prediction model can also capture the time series relationship of the power battery fault data, thereby further improving the model training effect.
[0103] See also Figure 3 , shows a structural diagram of a battery fault data generating device according to an embodiment of the present application.
[0104] like Figure 3As shown, according to the second aspect of the embodiment of the present application, a battery fault data generating device 200 is provided, including:
[0105] An acquisition unit 201 is configured to acquire a first random noise vector;
[0106] The generation unit 202 is used to input the first random noise vector into the target generator, and after the first random noise vector is position-encoded by the target generator, the corresponding battery fault data is generated. The target generator is trained by the initially configured improved generative adversarial network through historical battery fault data and the second random noise vector. The historical battery fault data is a first time series. The improved generative adversarial network includes an improved generator and an improved adversary. The improved generator generates battery fault data by outputting the second random noise vector with position coding information. The generated battery fault data is a second time series. The improved discriminator performs data authenticity discrimination through the first time series and the second time series with position coding information.
[0107] According to a third aspect of an embodiment of the present application, a computer-readable storage medium is provided, in which at least one computer program instruction is stored. The at least one computer program instruction is loaded and executed by a processor to implement the operations performed by any method described in the first aspect.
[0108] The computer-readable storage medium may be a portable compact disc read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the computer-readable storage medium of the present application is not limited thereto. In the present application, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0109] The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable 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 thereof.
[0110] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0111] According to a fourth aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement the operations performed by any of the methods described in the first aspect.
[0112] See also Figure 4 , which is a structural diagram of a computer system suitable for implementing an electronic device according to an embodiment of the present application.
[0113] According to the fourth aspect of an embodiment of the present application, an electronic device is provided, comprising one or more processors and one or more memories, wherein at least one program code is stored in the one or more memories, and the at least one program code is loaded and executed by the one or more processors to implement operations performed by any method of the first aspect.
[0114] like Figure 4 As shown, electronic device 400 is implemented as a general-purpose computing device. Components of electronic device 400 may include, but are not limited to, at least one processing unit 410, at least one storage unit 420, and a bus 430 connecting various system components (including storage unit 420 and processing unit 410).
[0115] The storage unit stores program code, which can be executed by the processing unit 410, so that the processing unit 410 executes the steps described in the above "Example Method" section of this specification according to various exemplary embodiments of the present application.
[0116] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 421 and / or a cache memory unit 422 , and may further include a read-only memory unit (ROM) 423 .
[0117] The storage unit 420 may also include a program / utility 424 having a set (at least one) of program modules 425, such program modules 425 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0118] Bus 430 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0119] The electronic device 400 can also communicate with one or more external devices 500 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 400, and / or any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 450. Furthermore, the electronic device 400 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 460. As shown, the network adapter 460 communicates with other modules of the electronic device 400 via a bus 430. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 400, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0120] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present invention and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hardwiring, or a combination of any of these. Furthermore, each functional unit may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.
[0121] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0122] The units described as separate components may or may not be physically separate, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., which can store program code.
[0124] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of the claims of the present application.
Claims
1. A method for generating battery fault data, characterized in that: include: Obtain a first random noise vector; The first random noise vector is input into the target generator. After the first random noise vector is position-encoded by the target generator, corresponding battery fault data is generated. The target generator is trained on the initially configured improved generative adversarial network through historical battery fault data and the second random noise vector. The historical battery fault data is a first time series. The improved generative adversarial network includes an improved generator and an improved discriminator. The improved generator generates battery fault data through the output of the second random noise vector with position coding information. The generated battery fault data is a second time series. The improved discriminator discriminates the authenticity of the data through the first time series and the second time series with position coding information. Before obtaining the first random noise vector, the method further includes: Acquire the historical battery failure data and the second random noise vector, wherein the historical battery failure data is the first time series; After position encoding the second random noise vector using the improved generator, the second random noise vector having the position encoding information is converted into generated battery fault data for deceiving the improved discriminator, wherein the generated battery fault data is the second time series; After position encoding the first time series and the second time series respectively using the improved discriminator, data authenticity discrimination is performed on the first time series and the second time series having the position encoding information respectively; The improved generator and the improved discriminator are alternately trained until they reach a Nash equilibrium, and the training of the improved generative adversarial network is completed. The target generator is obtained from the trained improved generative adversarial network.
2. The method according to claim 1, characterized in that The second random noise vector, the first time series, and the second time series each include a plurality of battery fault characteristic elements, and the position encoding of the second random noise vector using the improved generator, or the position encoding of the first time series and the second time series by the improved discriminator, includes: Obtaining multiple coding dimensions and a position index corresponding to each of the battery fault characteristic elements; A corresponding position vector is generated for each position index, where the position vector includes a plurality of position sub-vectors, and each position sub-vector corresponds to one of the encoding dimensions.
3. The method according to claim 2, characterized in that Generating a corresponding position vector for each of the position indexes, including: The position index is sine-encoded and cosine-encoded in each encoding dimension to obtain a sine-encoded value and a cosine-encoded value, and the sine-encoded value and the cosine-encoded value are combined to obtain the position sub-vector.
4. The method according to claim 2, characterized in that After generating a corresponding position vector for each position index, the method further includes: Splicing the position vector and the original feature vector to obtain a splicing vector, and inputting the splicing vector into the target model; Among them, when the original feature vector is the second random noise vector, the target model is the improved generator; when the original feature vector is the first time series or the second time series, the target model is the improved discriminator.
5. The method according to claim 1, wherein The improved generator includes a first position encoding module, a first deconvolution module, a first residual module based on an attention mechanism, and a second deconvolution module connected in sequence. After position encoding the second random noise vector using the improved generator, the second random noise vector with position encoding information is converted into generated battery fault data for deceiving the improved discriminator, including: After position encoding the second random noise vector based on the first position encoding module, deconvolution operation is performed on the second random noise vector having the position encoding information using the first deconvolution module to obtain a first state quantity feature; After using the first residual module to perform self-attention processing on the first state quantity feature, a second state quantity feature is obtained, and after the second deconvolution module performs a deconvolution operation on the second state quantity feature, generated battery fault data for deceiving the improved discriminator is obtained.
6. The method according to claim 1, characterized in that The improved discriminator includes a second position encoding module, a first convolution module, a second residual module based on an attention mechanism, a second convolution module, and a data output module connected in sequence. After the improved discriminator performs position encoding on the first time series and the second time series respectively, the improved discriminator performs data authenticity discrimination on the first time series and the second time series having position encoding information, including: After position encoding the first time series and the second time series respectively based on the second position encoding module, convolution operation and self-attention processing are performed respectively by the first convolution module and the second residual module to obtain a third state quantity feature; A fourth state quantity feature is obtained by performing a convolution operation on the third state quantity feature using the second convolution module, and a data authenticity judgment result of the fourth state quantity feature is output based on the data output layer.
7. The method according to claim 1, characterized in that After the corresponding battery fault data is generated, the method further includes: Based on the generated battery fault data and the historical battery fault data, the network to be trained is trained to obtain a battery fault diagnosis prediction model.
8. A battery failure data generating device, characterized in that: include: an acquiring unit, configured to acquire a first random noise vector; A generating unit, configured to input the first random noise vector into a target generator, and generate corresponding battery fault data after position encoding the first random noise vector by the target generator, wherein the target generator trains an initially configured improved generative adversarial network using historical battery fault data and a second random noise vector, wherein the historical battery fault data is a first time series, and the improved generative adversarial network includes an improved generator and an improved discriminator, wherein the improved generator generates battery fault data by outputting the second random noise vector having position encoding information, wherein the generated battery fault data is a second time series, and the improved discriminator discriminates the authenticity of the data using the first time series having position encoding information and the second time series; Before acquiring the first random noise vector, the apparatus is further configured to: Acquire the historical battery failure data and the second random noise vector, wherein the historical battery failure data is the first time series; After position encoding the second random noise vector using the improved generator, the second random noise vector having the position encoding information is converted into generated battery fault data for deceiving the improved discriminator, wherein the generated battery fault data is the second time series; After position encoding the first time series and the second time series respectively using the improved discriminator, data authenticity discrimination is performed on the first time series and the second time series having the position encoding information respectively; The improved generator and the improved discriminator are alternately trained until they reach a Nash equilibrium, and the training of the improved generative adversarial network is completed. The target generator is obtained from the trained improved generative adversarial network.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program instruction, and the at least one computer program instruction is loaded and executed by a processor to implement the operations performed by any one of the methods according to claims 1-7.
Citation Information
Patent Citations
Information processing method, device and equipment
CN115705463A
Two-stage fault sample enhancement method and device, electronic equipment and storage medium
CN116662797A