A two-stage broadband oscillation data generation method, device, computer equipment, readable storage medium and program product

Through the two-stage wide-frequency oscillation data generation method, feature information is extracted in a hierarchical manner and combined with noise and generation models, the problem of low quality of wide-frequency oscillation data generation in the existing technology is solved, the quality and diversity of data generation are improved, and strong support is provided for data-driven technology.

CN119782804APending Publication Date: 2025-04-08STATE GRID ECONOMIC TECH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411752171.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing wide-frequency oscillation data generation method has the problem that the data generation quality is low and it is difficult to meet the actual needs of data-driven technology.

Method used

The two-stage wide-frequency oscillation data generation method is used to obtain low-dimensional and high-dimensional conditional information through hierarchical feature extraction, and the broad-frequency oscillation data backbone information is generated by combining random noise and backbone generation model. Then, the details component is added to the backbone quantity through the detail generation model, and the target broad-frequency oscillation data is output.

Benefits of technology

The generation quality of wide-frequency oscillation data is improved, and the problem of limited data volume caused by the low frequency of wide-frequency oscillation data generation and difficulty of collection is solved, providing a data basis for the large-scale application of data-driven methods in the field of wide-frequency oscillation problem analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782804A_ABST
    Figure CN119782804A_ABST
Patent Text Reader

Abstract

The present application relates to the field of electric power technology, and discloses a two-stage broadband oscillation data generation method, device, computer equipment, readable storage medium and program product, wherein the method comprises performing hierarchical feature extraction on the acquired target data sample to obtain first-stage condition information and second-stage condition information; inputting the first-stage condition information and random noise conforming to the normal distribution into a preset broadband oscillation data trunk generation model, and outputting the trunk quantity representing the broadband oscillation data trunk information; inputting the second-stage condition information and the trunk quantity into a preset broadband oscillation data detail generation model, adding detail components to the trunk quantity, and outputting target broadband oscillation data, wherein the detail components represent the detail information of the broadband oscillation data. The present application has the effect of improving the generation quality of broadband oscillation data and effectively expanding the data volume of broadband oscillation data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electric power technology, and in particular to a two-stage broadband oscillation data generation method, device, computer equipment, readable storage medium and program product. Background Art

[0002] In recent years, new transmission technologies represented by flexible direct current transmission have provided new ideas and directions for solving the grid connection and transmission problems of large-scale new energy bases in the Shagohuang area. However, the existing large-scale new energy bases in the Shagohuang area have weak AC system support capabilities or even no AC system support at all, and the weak-end flexible direct current transmission system has the risk of broadband oscillation. Due to factors such as low frequency of occurrence and measurement difficulties, it is difficult to collect broadband oscillation data, which makes it difficult to effectively apply data-driven technology in the field of broadband oscillation problem analysis.

[0003] In the existing technology, deep learning technology constructs nonlinear mapping between features and targets through deep neural networks, which has higher fitting accuracy and is an effective way to generate broadband oscillation data. However, current research on broadband oscillation data generation based on deep learning focuses on direct generation methods, which not only requires a large amount of training data, but also has low quality of generated data, making it difficult to meet the actual needs of data-driven technology.

[0004] With respect to the above-mentioned related technologies, the inventors have found that the existing broadband oscillation data generation method has the problem of low data generation quality and difficulty in effective analysis. Summary of the invention

[0005] In order to improve the quality of broadband oscillation data generation and assist in the effective analysis of broadband oscillation problems, the present application provides a two-stage broadband oscillation data generation method, apparatus, computer equipment, readable storage medium and program product.

[0006] In a first aspect, the present application provides a two-stage broadband oscillation data generation method.

[0007] This application is achieved through the following technical solutions: A two-stage broadband oscillation data generation method comprises the following steps: Obtain target data samples; Performing hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; Obtaining random noise that conforms to normal distribution, inputting the first-stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and outputting a trunk quantity representing broadband oscillation data trunk information; The second-stage condition information and the trunk quantity are input into a preset broadband oscillation data detail generation model, detail components are added to the trunk quantity, and target broadband oscillation data is output, wherein the detail components represent detail information of the broadband oscillation data.

[0008] In a preferred example, the present application can be further configured as follows: the training step of the broadband oscillation data trunk generation model includes: Determine, based on the first-stage condition information and the random noise, a query vector for evaluating the corresponding relationship of information related to the entire input sequence, a key vector for evaluating the correlation between the current element position and other element positions, and a value vector for characterizing the actual position of each element in the input sequence; Convolution modules are used to construct local associations, and causal convolution attention mechanisms are used to replace multi-head attention mechanisms for multi-association modeling. Causal convolution calculations are performed on the query vector and the key vector, respectively, to map query matrices for characterizing attribute features that match the broadband oscillation data and key matrices for characterizing attribute features of the broadband oscillation data itself; Packing the value vector to obtain a numerical matrix for characterizing the information contained in the broadband oscillation data itself; Obtaining attention values ​​according to the query matrix, the key matrix and the value matrix, and performing forward training and back propagation on a first-stage generator to output a trunk quantity representing trunk information of broadband oscillation data; When the classification accuracy of the one-stage discriminator on the generated data of the one-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data trunk generation model is obtained, wherein the one-stage discriminator is a symmetrical structure of the one-stage generator.

[0009] In a preferred example, the present application may be further configured as follows: the training step of the broadband oscillation data trunk generation model further includes: Designing a loss function of the one-stage generator and a loss function of the one-stage discriminator includes: Where, L G-1 is the loss function of the one-stage generator, e g-I Generate data for the first stage, e g-I ~P g-I represents the sampling distribution of the data generated in the first stage, e p-I The corresponding sampling of the data generated in the first stage and the real data hm, It means that the first stage sampling data e is interpolated with the interpolation coefficient χ p-I The first stage generates data e g-I Random interpolation sampling, L D-1is the loss function of the one-stage discriminator, e p-I ~P p-I represents the sampling distribution of the real data in the first stage, represents the sampling distribution of the interpolation data in the first stage, λ is the penalty coefficient, Refers to the norm of the gradient of the first-stage penalty output relative to the interpolation, D I (e g-I ) is the first stage discriminator for the first stage generated data e g-I 's rating.

[0010] In a preferred example, the present application may be further configured as follows: the step of obtaining the attention value according to the query matrix, the key matrix and the value matrix includes: Based on the query matrix, the key matrix and the numerical matrix, in combination with a causal convolutional attention mechanism, a correlation value of a transposed matrix of the query matrix and the key matrix is ​​calculated; Scaling the correlation value and then normalizing it to obtain an attention score; Multiply the attention score by the numerical matrix to obtain an attention value.

[0011] In a preferred example, the present application can be further configured as follows: the training step of the broadband oscillation data detail generation model includes: Based on the fully connected-ConvLSTM structure as a two-stage generator, the second-stage condition information is input into the fully connected layer for learning to obtain high-dimensional features; and The backbone quantity is input, and a small-step domain deconvolution operation is performed in combination with the high-dimensional feature. The ConvLSTM layer is used to encode the detail features of the high-dimensional feature, and the convolution operation is used to replace the multiplication operation of each gate to capture the potential spatial features, so as to supplement the detail features for the first-stage generation result. When the classification accuracy of the two-stage discriminator on the generated data of the two-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data detail generation model is obtained, wherein the two-stage discriminator is a symmetrical structure of the two-stage generator.

[0012] In a preferred example, the present application may be further configured as follows: the training step of the broadband oscillation data detail generation model further includes: Designing the loss function of the two-stage generator and the loss function of the two-stage discriminator includes: Where, L G-II is the loss function of the two-stage generator, e g-II Generate data for the second stage, e g-II ~Pg-II represents the sampling distribution of the generated data in the second stage, e p-II Generate data and real data h for the second stage m The corresponding sampling of Expressed as interpolation coefficient χ and interpolation coefficient χ II For the second stage sampling data e p-II The second stage generates data e g-II Random interpolation sampling, L D-II is the loss function of the two-stage discriminator, e p-II ~P p-II represents the sampling distribution of the real data in the second stage, represents the sampling distribution of the interpolation data in the second stage, λ is the penalty coefficient, Refers to the norm of the gradient of the second-stage penalty output relative to the interpolation, D II (e g-II ) is the second stage discriminator for generating data e for the second stage g-I 's rating.

[0013] In a second aspect, the present application provides a two-stage broadband oscillation data generating device.

[0014] This application is achieved through the following technical solutions: A two-stage broadband oscillation data generating device, comprising: Data module, used to obtain target data samples; A hierarchical feature extraction module, used to perform hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; A trunk feature generation module is used to obtain random noise that conforms to the normal distribution, input the first-stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and output a trunk quantity that characterizes the broadband oscillation data trunk information; a detail feature generation module is used to input the second-stage condition information and the trunk quantity into a preset broadband oscillation data detail generation model, add a detail component to the trunk quantity, and output target broadband oscillation data, wherein the detail component characterizes the detail information of the broadband oscillation data.

[0015] In a third aspect, the present application provides a computer device.

[0016] This application is achieved through the following technical solutions: A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the above two-stage broadband oscillation data generating methods when executing the computer program.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium.

[0018] This application is achieved through the following technical solutions: A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of any one of the above two-stage broadband oscillation data generation methods.

[0019] In a fifth aspect, the present application provides a computer program product.

[0020] This application is achieved through the following technical solutions: A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above two-stage broadband oscillation data generating methods are implemented.

[0021] In summary, compared with the prior art, the technical solution provided by the present application has at least the following beneficial effects: by collecting voltage data of generator sets in large-scale new energy bases as target data samples, the overall features and detail features of the target data samples are extracted in stages to obtain high-dimensional broadband oscillation data features and low-dimensional broadband oscillation data features, which are used to guide the generation of broadband oscillation data in subsequent different stages, so as to pay full attention to the influence of sub-synchronous components and super-synchronous components of broadband oscillation data of the voltage of generator sets in large-scale new energy bases; in the first stage, a broadband oscillation data trunk generation model is designed to generate broadband oscillation data from a large number of low-dimensional broadband oscillation data in the first stage. A small amount of important information is screened out and focused on from the first-stage conditional information to generate the backbone of broadband oscillation data. In the second stage, a broadband oscillation data detail generation model is designed to capture potential spatial features from a large amount of second-stage conditional information representing high-dimensional broadband oscillation data, supplement small-scale local details for the first-stage generation results, add detail components to the backbone, and output target broadband oscillation data, which improves the generation quality of broadband oscillation data and solves the problem of limited data volume caused by the low frequency of occurrence and difficulty in collecting broadband oscillation data, providing a data basis for the large-scale application of data-driven methods in the field of broadband oscillation problem analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A schematic diagram of the structure of a stacked autoencoder model SAE used in a two-stage broadband oscillation data generation method provided as an exemplary embodiment of the present application.

[0023] Figure 2 A schematic flow chart of a two-stage broadband oscillation data generating method provided for yet another exemplary embodiment of the present application.

[0024] Figure 3 A schematic diagram of a ConvLSTM structure of a two-stage broadband oscillation data generation method provided for another exemplary embodiment of the present application.

[0025] Figure 4 A comparison chart of t-SNE two-dimensional visualization distribution results of target broadband oscillation data generated by a two-stage broadband oscillation data generation method provided in an exemplary embodiment of the present application and real data.

[0026] Figure 5 A two-stage broadband oscillation data generation method provided as an exemplary embodiment of the present application, and a schematic diagram of the Wasserstein distance comparison of the generated data of GAN, CGAN, DCGAN and WGAN.

[0027] Figure 6 A two-stage broadband oscillation data generation method provided as an exemplary embodiment of the present application, and a schematic diagram of the cosine similarity comparison between the generated data of GAN, CGAN, DCGAN and WGAN and the original data. DETAILED DESCRIPTION

[0028] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0031] In order to improve the generation quality of broadband oscillation data, the present application provides a two-stage adversarial generative broadband oscillation data generation method, which includes: by collecting voltage data of generator sets in large-scale new energy bases as target data samples, a hierarchical feature extraction part composed of SAE; a broadband oscillation data trunk generation part composed of an improved convolution-Transformer; and a broadband oscillation data detail supplement part composed of an improved fully connected-ConvLSTM. By changing the number of neurons in the hidden layer of SAE and setting the dimension of compressed data, conditional information of different dimensions is obtained to guide the generation of data in subsequent different stages; then, taking the random quantity and the global conditional information extracted by SAE as input, local associations are constructed through the convolution module, and global associations are constructed through the improved Transformer, mainly learning the characteristics of subsynchronous oscillation components in broadband oscillation data, and generating the trunk information of broadband oscillation data; finally, taking the trunk information of broadband oscillation data and the local conditional information extracted by SAE as input, nonlinear associations are constructed through full connection, and ConvLSTM is used to learn the local and sequence associations in the small step domain of data, mainly learning the characteristics of supersynchronous oscillation components in broadband oscillation data, and adding detail components to the trunk quantity of broadband oscillation data; in addition, based on the Wasserstein distance, the overall loss function constructed by the two-stage generation process is combined to optimize the model, which greatly reduces the risk of model overfitting; the quality and diversity of data generation are improved, and the effective expansion of broadband oscillation data can be achieved, which provides a research basis for data-driven technology in the field of broadband oscillation problem analysis.

[0032] An embodiment of the present application provides a two-stage broadband oscillation data generation method, and the main steps of the method are described as follows.

[0033] Obtain target data samples; Performing hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; Obtaining random noise that conforms to normal distribution, inputting the first-stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and outputting a trunk quantity representing broadband oscillation data trunk information; The second-stage condition information and the trunk quantity are input into a preset broadband oscillation data detail generation model, detail components are added to the trunk quantity, and target broadband oscillation data is output, wherein the detail components represent detail information of the broadband oscillation data.

[0034] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.

[0035] Reference Figure 1Specifically, the target data sample can be the voltage data of the generator set of a large-scale new energy base. The stacked autoencoder model SAE is used to extract the overall characteristics and detailed characteristics of the target data sample, and the first-stage condition information representing the low-dimensional broadband oscillation data and the second-stage condition information representing the high-dimensional broadband oscillation data are obtained to guide the subsequent generation of broadband oscillation data in different stages.

[0036] SAE is a variant of autoencoder (AE), which is composed of several stacked AEs. Each AE includes an input layer, a hidden layer, and an output layer. The features extracted from the hidden layer of the current AE are used as the input of the next AE. Each layer is based on the representation of the previous layer. The weight values ​​of AE layers of different colors in the figure are different, and neurons in hidden layers of different dimensions realize information transmission through full connection.

[0037] When extracting target data samples, the number of neurons in the hidden layer of SAE is changed and the compression dimension of the data is set to obtain compression features, so as to obtain information on conditions of different dimensions and guide the subsequent data generation in different stages.

[0038] Assume that the input of the i-th AE of SAE is x i , the feature information extracted by the hidden layer is hi, and the input of the hidden layer is The encoding and decoding process can be expressed by equations (1) and (2).

[0039] h i =f i-enc (w i-enc x i +b i-enc ) (1) In the formula, w i-enc , b i-enc With w i-dec , b i-dec They represent the weight and bias of the encoding layer and the weight and bias of the decoding layer of the AE respectively.

[0040] The AE is trained in an unsupervised manner and the reconstruction error is reduced to a set value, as shown in formula (3): Where minL MSE is the loss function value based on mean square error, N is the total number of training samples, x is the input of the AE, is the input of the hidden layer.

[0041] After completing the feature extraction of this layer, the hidden layer information h iAs the input of the lower layer, a new feature expression is obtained, and the above operation is repeated to achieve layer-by-layer feature extraction, and finally complete SAE training. The SAE hyperparameters are shown in Table 1.

[0042] Table 1 When SAE is used for feature extraction, the features of different hidden layers of SAE are extracted as the first-stage conditional information and the second-stage conditional information to guide the two-stage broadband oscillation data generation process. The representation content is more abstract and more suitable for complex tasks.

[0043] Next, random noise conforming to normal distribution is obtained, the first stage condition information and random noise are input into a preset broadband oscillation data trunk generation model, and a trunk quantity representing the broadband oscillation data trunk information is output. The broadband oscillation data trunk generation model can use a Gaussian SVM classifier or the like.

[0044] Then, the second stage condition information and the main trunk quantity are input into the preset broadband oscillation data detail generation model, and the detail component representing the broadband oscillation data detail information is added to the main trunk quantity, and the target broadband oscillation data is output. The broadband oscillation data detail generation model can use a Gaussian SVM classifier, etc.

[0045] In one embodiment, the training step of the broadband oscillation data trunk generation model includes: Determine, based on the first-stage condition information and the random noise, a query vector for evaluating the corresponding relationship of information related to the entire input sequence, a key vector for evaluating the correlation between the current element position and other element positions, and a value vector for characterizing the actual position of each element in the input sequence; Convolution modules are used to construct local associations, and causal convolution attention mechanisms are used to replace multi-head attention mechanisms for multi-association modeling. Causal convolution calculations are performed on the query vector and the key vector, respectively, to map query matrices for characterizing attribute features that match the broadband oscillation data and key matrices for characterizing attribute features of the broadband oscillation data itself; Packing the value vector to obtain a numerical matrix for characterizing the information contained in the broadband oscillation data itself; Obtaining attention values ​​according to the query matrix, the key matrix and the value matrix, and performing forward training and back propagation on a first-stage generator to output a trunk quantity representing trunk information of broadband oscillation data; When the classification accuracy of the one-stage discriminator on the generated data of the one-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data trunk generation model is obtained, wherein the one-stage discriminator is a symmetrical structure of the one-stage generator.

[0046] In one embodiment, the step of obtaining the attention value according to the query matrix, the key matrix and the value matrix includes: Based on the query matrix, the key matrix and the numerical matrix, in combination with a causal convolutional attention mechanism, a correlation value of a transposed matrix of the query matrix and the key matrix is ​​calculated; Scaling the correlation value and then normalizing it to obtain an attention score; Multiply the attention score by the numerical matrix to obtain an attention value.

[0047] Reference Figure 2 Specifically, the broadband oscillation data trunk generation model adopts a convolution-Transformer structure. The broadband oscillation data trunk generation model includes a first-stage generator and a first-stage discriminator.

[0048] The first-stage conditional information guides the adversarial generation process based on the improved convolution-Transformer model, inputs the broadband oscillation data representing low dimensions and the random noise conforming to the normal distribution into the preset broadband oscillation data trunk generation model, learns the subsynchronous oscillation characteristics, and generates broadband oscillation data trunk information. The first-stage conditional information describes the changing trend of broadband oscillation data more accurately, and the random noise can better restore the randomness of the sample data, thereby controlling the broadband oscillation data generated by the model to be more random and have more accurate changing trend characteristics.

[0049] In this embodiment, the high-dimensional broadband oscillation data is composed of the contents extracted from the first few hidden layers of SAE, and the representation content is richer. The information extracted from the lowest-dimensional hidden layer in SAE is low-dimensional broadband oscillation data.

[0050] The structure of the first-stage generator consists of two fully connected layers connected in series, two deconvolution upsampling layers of different dimensions, and an improved Transformer layer.

[0051] The first-stage generator encoding of the broadband oscillator data backbone generation model includes a spatial encoding part and a sequence encoding part.

[0052] The spatial encoding part includes a fully connected structure and a large kernel deconvolution structure. The fully connected structure is used to perform nonlinear transformation on the input. The large kernel deconvolution structure is used to construct the local correlation f of the target area. CNN , and reduce redundant interference and enhance convergence.

[0053] The sequence encoding part is composed of an improved Transformer, which uses a causal convolutional attention mechanism instead of a multi-head attention mechanism to achieve multi-association modeling. Compared with the traditional Transformer encoder, the improved Transformer based on the causal convolutional attention mechanism not only has a stronger ability to learn sequence associations, but can also learn the spatial association characteristics of data, and has fine-grained similarity calculation capabilities, and has stronger encoding diversity.

[0054] When training the improved Transformer, the query vector q used to evaluate the corresponding relationship of the information related to the entire input sequence and the key vector k used to evaluate the correlation or similarity between the position of any input element and the position of other elements are mapped into the query matrix Q and the key matrix K through causal convolution calculation. The query matrix Q and the key matrix K are based on the traditional Transformer and the result f constructed according to the local association above. CNN The query matrix Q represents the attribute information that matches the broadband oscillation data. The key matrix K represents the attribute information of the broadband oscillation data itself.

[0055] Afterwards, the value vector v representing the actual position information of each element in the input sequence is packaged in parallel order into a numerical matrix V. The numerical matrix V represents all the information contained in the broadband oscillation data itself.

[0056] The query matrix Q, key matrix K and value matrix V are the mappings of query vector q, key vector k and value vector v. The three together constitute the basis of the attention mechanism. The specific attention value is calculated according to the query matrix Q, key matrix K and value matrix V, which is used to learn and focus on the key areas of broadband oscillation data. The parameters of the query matrix Q, key matrix K and value matrix V are calculated through back propagation to represent the expression of different attributes of the data itself.

[0057] After linear transformation of the query matrix Q, key matrix K, and value matrix V, they are input into the causal convolutional attention mechanism to complete the transposed matrix K of the query matrix Q and the key matrix T Calculate the correlation.

[0058] Finally, the correlation calculation results are scaled to where d k is the dimension of the key vector k, and the softmax function is used to obtain the attention score, and the attention score is multiplied by the numerical matrix V to obtain the attention value.

[0059] The first-stage conditional information and random noise are input, combined with the attention value, and the improved convolution-Transformer model (first-stage generator encoding model) is forward trained and back-propagated to achieve focused learning on the regional changes of broadband oscillation data.

[0060] In the process of generating data for the first stage of broadband oscillation, the attention value obtained through the causal convolutional attention mechanism can selectively filter out a small amount of important information from a large amount of information and focus on this important information. The focusing process is mainly reflected in the calculation of the weight coefficient. The larger the weight, the more focused it is on the corresponding numerical matrix, and the higher the importance of the corresponding information. It can better learn the characteristics of subsynchronous oscillations in broadband oscillation data and improve the generation quality of broadband oscillation data.

[0061] Furthermore, the one-stage discriminator is a symmetric structure of the one-stage generator. The generator is a fully connected deconvolution-improved Transformer, and the discriminator is a convlstm-convolution-improved Transformer. Deconvolution and convolution can be regarded as symmetric in terms of calculation form. The fully connected and improved Transformer of the generator and discriminator can be regarded as structurally symmetric, so the two can be regarded as symmetric structures.

[0062] The structure of the first-stage discriminator includes an improved Transformer layer, two convolutional layers of different dimensions, a fully connected layer, and a classifier connected in series. The first-stage conditional information and random noise are input into the first fully connected layer. The first-stage conditional information and the generated results of the first-stage generator are respectively input into the improved Transformer layer of the first-stage discriminator.

[0063] The first stage discriminator is based on the concept of discriminative modeling, and m The first stage generates data e g-I Classification is essentially a supervised classifier.

[0064] During training, the loss functions of the first-stage generator and the first-stage discriminator are shown in equations (4), (5), and (6).

[0065] Where, L G-I is the loss function of the one-stage generator, e g-I Generate data for the first stage, e g-I ~P g-I represents the sampling distribution of the data generated in the first stage, e p-I The corresponding sampling of the data generated in the first stage and the real data hm, It means that the first stage sampling data e is interpolated with the interpolation coefficient χ p-I The first stage generates data e g-I Random interpolation sampling, L D-1 is the loss function of the one-stage discriminator, e p-I ~P p-I represents the sampling distribution of the real data in the first stage, is the gradient penalty term, represents the sampling distribution of the interpolation data in the first stage, λ is the penalty coefficient, Refers to the norm of the gradient of the first-stage penalty output relative to the interpolation, Dx(e g-I ) is the first stage discriminator for the first stage generated data e g-I 's rating.

[0066] The interpolation coefficient χ is used to adjust the spatial distribution distance between the data generated in the first stage and the real data to prevent the diversity and quality problems of the data generated in the first stage caused by the long distance.

[0067] The interactive training of the first-stage generator and the first-stage discriminator continuously optimizes the broadband oscillation data trunk generation model until the first-stage discriminator cannot distinguish between the generated data and the real data samples, that is, the classification accuracy of the first-stage discriminator on the generated data of the first-stage generator and the classification accuracy on the real data meet the preset conditions. At this time, the broadband oscillation data trunk generation model of this scheme is obtained, and the classifier output of the first-stage discriminator represents the trunk quantity of the broadband oscillation data trunk information.

[0068] In one embodiment, the step of training the broadband oscillation data trunk generation model further includes: During convergence training, the one-stage generator and the one-stage discriminator construct a two-stage joint loss function based on the Wasserstein distance.

[0069] Specifically, during the convergence training, the one-stage discriminator and the one-stage generator are trained based on the minimum Wasserstein distance, and the Wasserstein distance is used instead of the Jensen-Shannon divergence to more accurately measure the distribution gap between the one-stage generated data samples and the original samples. The Wasserstein distance W(e p , e g )The specific definition is as follows.

[0070] In the formula, γ~Π(e p , e g ) is the real data e p With generated data gThe joint distribution set of x is the real sample, y is the generated sample, (x, y): γ represents the element γ taken from (x, y), E (x,y)~γ When (x, y):γ, the expectation of ||xy|| of element γ, W(e p , e g ) means to convert e g Fit to e p The distance to be moved, W(e p , e g ) is smaller, the more similar the distribution of real data is to that of generated data.

[0071] In one embodiment, the step of training the broadband oscillation data detail generation model includes: Based on the fully connected-ConvLSTM structure as a two-stage generator, the second-stage condition information is input into the fully connected layer for learning to obtain high-dimensional features; and The backbone quantity is input, and a small-step domain deconvolution operation is performed in combination with the high-dimensional feature. The ConvLSTM layer is used to encode the detail features of the high-dimensional feature, and the convolution operation is used to replace the multiplication operation of each gate to capture the potential spatial features, so as to supplement the detail features for the first-stage generation result. When the classification accuracy of the two-stage discriminator on the generated data of the two-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data detail generation model is obtained, wherein the two-stage discriminator is a symmetrical structure of the two-stage generator.

[0072] Specifically, the adversarial generation process based on the improved fully connected-ConvLSTM model is guided by the second-stage conditional information, and the broadband oscillation data representing high dimensions is input into the preset broadband oscillation data detail generation model to learn the characteristics of the super-synchronous oscillation component of the broadband oscillation data, and supplement the detailed features of the first-stage generation results. The broadband oscillation features represented by the high-dimensional broadband oscillation data are richer and can more accurately depict the detailed features of the broadband oscillation data.

[0073] Reference Figure 2 ,The broadband oscillation data detail generation model adopts an improved fully connected -ConvLSTM structure, and the broadband oscillation data detail generation model includes a second stage generator and a second stage discriminator.

[0074] The structure of the second-stage generator includes two fully connected layers connected in series, two deconvolution upsampling layers of different dimensions, and an improved ConvLSTM layer. The second-stage conditional information is input into the first fully connected layer of the second-stage generator.

[0075] The second-stage conditional information content is learned through two fully connected layers in the second-stage generator, and the small-step domain deconvolution upsampling layer is used to supplement the small-scale local details of the first-stage generation results.

[0076] Afterwards, the ConvLSTM layer is used to perform feature encoding in view of the coexistence of sequence and spatial correlation in the small step domain of broadband oscillation data to improve the generation quality of broadband oscillation data.

[0077] Reference Figure 3 ConvLSTM is a variant of Long Short-Term Memory (LSTM). The structure of ConvLSTM is shown in the figure. It replaces the multiplication operation of each gate with convolution operation to capture the potential spatial features. It takes into account the advantages of Convolutional Neural Network (CNN) and LSTM in building spatiotemporal associations, and can better capture the detailed features in broadband oscillation data.

[0078] Similar to the first-stage oscillation data discrimination process, the second-stage discriminator is also a symmetric structure of the second-stage generator. The generator is fully connected-deconvolution-convlstm, and the discriminator is convlstm-convolution-fully connected. Deconvolution and convolution can be regarded as symmetric in terms of calculation form. The full connection of the generator and the discriminator and the convlstm can be seen as structural symmetry, so the two can be regarded as symmetric structures.

[0079] The structure of the second-stage discriminator includes an improved ConvLSTM layer, two deconvolution upsampling layers of different dimensions, a fully connected layer and a classifier connected in series. The generated results of the two-stage generator are input into the improved ConvLSTM layer of the second-stage discriminator.

[0080] The loss function of the two-stage generator and the loss function of the two-stage discriminator are shown in equations (8), (9), and (10).

[0081] Where, L G-II is the loss function of the two-stage generator, e g-II Generate data for the second stage, e g-II ~P g-II represents the sampling distribution of the generated data in the second stage, e p-II Generate data and real data h for the second stage m The corresponding sampling of Expressed as interpolation coefficient χ and interpolation coefficient χ II For the second stage sampling data e p-IIThe second stage generates data e g-II Random interpolation sampling, L D-II is the loss function of the two-stage discriminator, e p-II ~P p-II represents the sampling distribution of the real data in the second stage, represents the sampling distribution of the interpolation data in the second stage, λ is the penalty coefficient, Refers to the norm of the gradient of the second-stage penalty output relative to the interpolation, D II (e g-II ) is the second stage discriminator for generating data e for the second stage g-I 's rating.

[0082] In one embodiment, the step of training the broadband oscillation data detail generation model further includes: During convergence training, the two-stage generator and the two-stage discriminator construct a two-stage joint loss function based on the Wasserstein distance. The Wasserstein distance is defined as in the above formula (7) and will not be repeated here.

[0083] In different generation stages, Wasserstein distance is used instead of Jensen-Shannon divergence to measure the distribution gap between the generated and original samples, so as to more accurately measure the distribution gap between the generated data samples and the original samples, thereby improving the accuracy of the model.

[0084] Furthermore, in order to further improve the accuracy of the model, the losses of the generator and discriminator at different stages are used to construct the overall loss function, as shown in equations (11) and (12).

[0085] L G =L G-I +μL G-II (11) L D =L D-I +ηL D-II (12) Where, L G With L D They are the overall loss function of the generator and the overall loss function of the discriminator, respectively. μ and η are the convergence dynamic weight coefficients of the two, which are used to adjust the balance between the two-stage losses.

[0086] In this embodiment, the hyperparameter results of the two-stage adversarial generative data enhancement model are shown in Table 2 below.

[0087] Table 2 The distribution difference between the target broadband oscillation data generated by the method proposed in this application and the real data is verified.

[0088] First, the t-SNE algorithm is used to visualize the target broadband oscillation data and the real data. The core idea of ​​the t-SNE algorithm is to reduce the dimension by retaining the local relationship between data samples. The t-SNE algorithm uses the horizontal and vertical coordinates to represent the position of the sample in the low-dimensional space, and based on the similarity probability model distribution in the high-dimensional space and the similarity probability model distribution in the low-dimensional space, finds a mapping in the low-dimensional space so that samples that are similar in the high-dimensional space remain similar in the low-dimensional space.

[0089] The t-SNE two-dimensional visualization distribution results of the target broadband oscillation data and the real data are as follows Figure 4 As shown in the figure, it can be seen that the generated target broadband oscillation data has similar distribution characteristics to the real data, and the distribution gaps of the real data are further filled, the distribution law of the real broadband oscillation data is better learned, and it has a higher generation accuracy.

[0090] Next, in order to verify the innovation and advantages of the two-stage broadband oscillation data generation method proposed in this application, a comparative experiment was designed, and the experimental comparison included deep learning generation methods such as GAN, CGAN, DCGAN, and WGAN. The Wasserstein distance comparison results of each method are shown in the figure below: Figure 5 As shown in the figure, the distribution difference between the target broadband oscillation data generated by the present application and the original data is the smallest. The median and mean of the Wasserstein distance between the data generated by each method and the original data are 0.12 and 0.13 respectively. Compared with the existing methods, the distribution difference between the generated data and the original data of the present application is at least reduced by 21.80% and 22.28%. In addition, the maximum difference in the Wasserstein distance between the data generated by the method proposed in the present application and the original data is only 0.038, so it has a more stable generation effect.

[0091] Finally, the cosine similarity difference between the data generated by different methods and the real data is compared to measure the similarity between the data using cosine similarity. The specific definition is shown in formula (13).

[0092] In the formula, S is the cosine similarity, the closer it is to 1, the higher the data similarity; A ij With B ij They represent the generated data sample content and the original data sample content respectively, and m and n represent the data quantity and feature dimension respectively.

[0093] m is set to 100, 200, 500, and 1000 respectively. The cosine similarity experimental results between the data generated by each method and the real data are shown in Figure 6As shown in the figure, it can be seen that the cosine similarity between the data generated by the method proposed in this patent and the original data is the highest. Taking m=100 as an example, the similarity between the generated data and the real data by the method proposed in this application reaches 0.86, which is 32.31% higher than that of other schemes. As the amount of data increases, the cosine similarity does not change significantly. It can be seen that in the context of large-scale data generation, the method proposed in this application can still maintain a high data generation quality.

[0094] In summary, a two-stage broadband oscillation data generation method collects the voltage data of the generator set of a large-scale new energy base as the target data sample, hierarchically extracts the overall characteristics and detail characteristics of the target data sample, and obtains high-dimensional broadband oscillation data characteristics and low-dimensional broadband oscillation data characteristics, which are used to guide the subsequent broadband oscillation data generation in different stages, and pays full attention to the influence of the sub-synchronous component and super-synchronous component of the broadband oscillation data of the voltage of the generator set of the large-scale new energy base; in the first stage, a broadband oscillation data trunk generation model is designed to screen out a small amount of important information from a large amount of first-stage conditional information representing low-dimensional broadband oscillation data and focus on it, so as to generate the trunk volume of broadband oscillation data; in the second stage, a broadband oscillation data detail generation model is designed to capture the potential spatial characteristics from a large amount of second-stage conditional information representing high-dimensional broadband oscillation data, supplement small-scale local details for the first-stage generation results, add detail components to the trunk volume, and output the target broadband oscillation data, thereby improving the generation quality of broadband oscillation data, and solving the problem of limited data volume caused by the low occurrence frequency and high collection difficulty of broadband oscillation data, which provides a data basis for the large-scale application of data-driven methods in the field of broadband oscillation problem analysis.

[0095] Compared with the prior art, the present invention has the following beneficial effects: 1. The two-stage data generation strategy adopts a trunk-detail generation method, which effectively reduces the difficulty of data generation at different stages and improves the quality of data generation; 2. SAE realizes the compression of broadband oscillation data in different dimensions, effectively guides the subsequent data generation process in different stages, and enhances the diversity of generated data; 3. The joint loss function takes into account the needs of the data generation process at different stages, improves the convergence of the model, and reduces the risk of the model falling into overfitting.

[0096] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0097] The present application also provides a two-stage broadband oscillation data generating device, which corresponds one-to-one to a two-stage broadband oscillation data generating method in the above embodiment. The two-stage broadband oscillation data generating device includes: Data module, used to obtain target data samples; A hierarchical feature extraction module, used to perform hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; A trunk feature generation module is used to obtain random noise that conforms to the normal distribution, input the first-stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and output a trunk quantity that characterizes the broadband oscillation data trunk information; a detail feature generation module is used to input the second-stage condition information and the trunk quantity into a preset broadband oscillation data detail generation model, add a detail component to the trunk quantity, and output target broadband oscillation data, wherein the detail component characterizes the detail information of the broadband oscillation data.

[0098] The specific definition of a two-stage broadband oscillation data generating device can be found in the above definition of a two-stage broadband oscillation data generating method, which will not be repeated here.

[0099] Each module in the above two-stage broadband oscillation data generating device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0100] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, any one of the above-mentioned two-stage broadband oscillation data generation methods is implemented.

[0101] In one embodiment, a computer-readable storage medium is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the above two-stage broadband oscillation data generation methods is implemented.

[0102] In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, any one of the above two-stage broadband oscillation data generation methods is implemented.

[0103] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. When the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0104] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.

Claims

1. A two-stage broadband oscillation data generation method, characterized in that: The following steps are included: Obtain target data samples; Performing hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; Obtaining random noise that conforms to normal distribution, inputting the first-stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and outputting a trunk quantity representing broadband oscillation data trunk information; The second-stage condition information and the trunk quantity are input into a preset broadband oscillation data detail generation model, detail components are added to the trunk quantity, and target broadband oscillation data is output, wherein the detail components represent detail information of the broadband oscillation data.

2. The two-stage broadband oscillation data generation method according to claim 1, characterized in that: The training steps of the broadband oscillation data trunk generation model include: Determine, based on the first-stage condition information and the random noise, a query vector for evaluating the corresponding relationship of information related to the entire input sequence, a key vector for evaluating the correlation between the current element position and other element positions, and a value vector for characterizing the actual position of each element in the input sequence; Convolution modules are used to construct local associations, and causal convolution attention mechanisms are used to replace multi-head attention mechanisms for multi-association modeling. Causal convolution calculations are performed on the query vector and the key vector, respectively, to map query matrices for characterizing attribute features that match the broadband oscillation data and key matrices for characterizing attribute features of the broadband oscillation data itself; Packing the value vector to obtain a numerical matrix for characterizing the information contained in the broadband oscillation data itself; Obtaining attention values ​​according to the query matrix, the key matrix and the value matrix, and performing forward training and back propagation on a first-stage generator to output a trunk quantity representing trunk information of broadband oscillation data; When the classification accuracy of the one-stage discriminator on the generated data of the one-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data trunk generation model is obtained, wherein the one-stage discriminator is a symmetrical structure of the one-stage generator.

3. The two-stage broadband oscillation data generation method according to claim 2, characterized in that: The training step of the broadband oscillation data trunk generation model also includes: Designing a loss function of the one-stage generator and a loss function of the one-stage discriminator includes: In the formula, I G-1 is the loss function of the one-stage generator, e g-I Generate data for the first stage, e g-I ~P g-I represents the sampling distribution of the data generated in the first stage, e p-I The corresponding sampling of the data generated in the first stage and the real data hm, It means that the first stage sampling data e is interpolated with the interpolation coefficient χ p-I The first stage generates data e g-I Random interpolation sampling, L D-1 is the loss function of the one-stage discriminator, e p-I ~P p-I represents the sampling distribution of the real data in the first stage, represents the sampling distribution of the interpolation data in the first stage, λ is the penalty coefficient, Refers to the norm of the gradient of the first-stage penalty output relative to the interpolation, D I (e g-I ) is the first stage discriminator for the first stage generated data e g-I 's rating.

4. The two-stage broadband oscillation data generation method according to claim 2, characterized in that: The step of obtaining the attention value according to the query matrix, the key matrix and the value matrix comprises: Based on the query matrix, the key matrix and the numerical matrix, in combination with a causal convolutional attention mechanism, a correlation value of a transposed matrix of the query matrix and the key matrix is ​​calculated; Scaling the correlation value and then normalizing it to obtain an attention score; Multiply the attention score by the numerical matrix to obtain an attention value.

5. The two-stage broadband oscillation data generation method according to any one of claims 1 to 4, characterized in that: The training step of the broadband oscillation data detail generation model includes: Based on the fully connected-ConvLSTM structure as a two-stage generator, the second-stage condition information is input into the fully connected layer for learning to obtain high-dimensional features; and The backbone quantity is input, and a small-step domain deconvolution operation is performed in combination with the high-dimensional feature. The ConvLSTM layer is used to encode the detail features of the high-dimensional feature, and the convolution operation is used to replace the multiplication operation of each gate to capture the potential spatial features, so as to supplement the detail features for the first-stage generation result. When the classification accuracy of the two-stage discriminator on the generated data of the two-stage generator and the classification accuracy on the real data meet the preset conditions, the broadband oscillation data detail generation model is obtained, wherein the two-stage discriminator is a symmetrical structure of the two-stage generator.

6. The two-stage broadband oscillation data generation method according to claim 5, characterized in that: The training step of the broadband oscillation data detail generation model also includes: Designing the loss function of the two-stage generator and the loss function of the two-stage discriminator includes: Where, L G-II is the loss function of the two-stage generator, e g-II Generate data for the second stage, e g-II ~P g-II represents the sampling distribution of the data generated in the second stage, e p-II Generate data and real data h for the second stage m The corresponding sampling of Expressed as interpolation coefficient χ and interpolation coefficient χ II For the second stage sampling data e p-II The second stage generates data e g-II Random interpolation sampling, L D-II is the loss function of the two-stage discriminator, e p-II ~P p-II represents the sampling distribution of the real data in the second stage, represents the sampling distribution of the interpolation data in the second stage, λ is the penalty coefficient, Refers to the norm of the gradient of the second-stage penalty output relative to the interpolation, D II (e g-II ) is the second stage discriminator for generating data e for the second stage g-I 's rating.

7. A two-stage broadband oscillation data generating device, characterized in that: include, Data module, used to obtain target data samples; A hierarchical feature extraction module, used to perform hierarchical feature extraction on the target data sample to obtain first-stage condition information representing low-dimensional broadband oscillation data and second-stage condition information representing high-dimensional broadband oscillation data; A trunk feature generation module, used to obtain random noise that conforms to normal distribution, input the first stage condition information and the random noise into a preset broadband oscillation data trunk generation model, and output a trunk quantity that characterizes the broadband oscillation data trunk information; The detail feature generation module is used to input the second stage condition information and the main trunk quantity into a preset broadband oscillation data detail generation model, add detail components to the main trunk quantity, and output target broadband oscillation data, wherein the detail components represent the detail information of the broadband oscillation data.

8. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 6 when being executed by a processor.