Power quality data generation method and device and nonvolatile storage medium

Through the generation adversarial network method, the generation network and the discriminant network are adjusted to generate accurate power quality data, which solves the problem of insufficient accurate and authentic data in the prior art and improves the reliability of power quality data.

CN119903302APending Publication Date: 2025-04-29STATE GRID BEIJING ELECTRIC POWER CO +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411996298.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The power quality data generated by the prior art differs from the real data in detail, resulting in the data being inaccurate and true enough, affecting its accuracy and reliability when used for prediction or power quality monitoring.

Method used

The Generative Adversarial Network (GAN) method is adopted, by receiving a random noise vector, determining the initial power quality data based on the generation network, judging the data authenticity based on the target judgment network, and adjusting the generation network parameters based on the judgment results to generate the target power quality data.

Benefits of technology

It improves the accuracy of generated power quality data, making it more reliable in prediction or quality monitoring, and solves the problem of difference between data details and real data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903302A_ABST
    Figure CN119903302A_ABST
Patent Text Reader

Abstract

The invention discloses a power quality data generation method and device and a nonvolatile storage medium. The method comprises the following steps: receiving a random noise vector; based on the generative network, determining initial power quality data according to the random noise vector; judging whether the initial electric energy quality data is real or not based on the target judgment network to obtain a judgment result; adjusting parameters in the generative network based on the judgment result to obtain a target generative network; and based on the target generation network, generating target power quality data according to the random noise vector. The technical problems that the generated data is not accurate and real enough due to the fact that the details of the currently generated power quality data are different from those of the real data, and the accuracy and reliability of the data are affected when the data are used for prediction or power quality monitoring are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power technology, and in particular to a method and device for generating power quality data and a non-volatile storage medium. Background Art

[0002] In recent years, with the application of a large number of power electronic devices, nonlinear loads and solid-state switches in power systems, as well as natural and man-made interference in the transmission of electric energy, various power quality problems have occurred frequently. In addition, the grid connection of distributed renewable power sources such as solar energy and wind energy with random output characteristics has a greater impact on the power quality of the power system. The decline in power quality has affected social production to varying degrees. For example, short-term voltage interruptions or voltage sags will cause the loss of computer storage data, leading to a certain degree of economic losses. The authenticity and accuracy of the power quality data currently generated are low, which affects its accuracy and reliability in predicting and monitoring power quality.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a method, device and non-volatile storage medium for generating power quality data, so as to at least solve the technical problem that the power quality data currently generated differs from the real data in details, resulting in the generated data being inaccurate and untrue, thereby affecting its accuracy and reliability when used for prediction or power quality monitoring.

[0005] According to one aspect of an embodiment of the present invention, a method for generating power quality data is provided, comprising: receiving a random noise vector; determining initial power quality data based on a generating network and the random noise vector; judging whether the initial power quality data is true based on a target discriminating network, and obtaining a judging result; adjusting parameters in the generating network based on the judging result, and obtaining a target generating network; and generating target power quality data based on the target generating network and the random noise vector.

[0006] Optionally, based on the generating network, according to the noise vector, initial power quality data is determined, including: based on the generating network, converting the noise vector into feature data, wherein the feature data characterizes the characteristics of the power quality data; based on a preset time range of the generated power quality data, setting a window size, wherein the window size; generating initial power quality data by controlling the sliding window to move on the feature data.

[0007] Optionally, before determining whether the initial power quality data is true based on the target discrimination network and obtaining the judgment result, the method includes: obtaining sample power quality data; generating training power quality data based on a preset sample noise vector based on the generation network; inputting the sample power quality data and the training power quality data into a preset initial discrimination network to obtain a discrimination result, wherein the discrimination result represents the result of the initial discrimination network in determining whether the sample power quality data and the training power quality data are true data; and adjusting the initial discrimination network based on the discrimination result to obtain the target discrimination network.

[0008] Optionally, based on the discrimination result, the initial discrimination network is adjusted to obtain a target discrimination network, including: determining labels corresponding to the sample power quality data and the training power quality data, wherein the labels are used to distinguish the sample power quality data from the generated training power quality data; based on a preset loss function, determining a loss value according to the discrimination result and the labels corresponding to the sample power quality data and the training power quality data; based on the loss value, adjusting the initial discrimination network to obtain a target discrimination network.

[0009] Optionally, based on the target discrimination network, judging whether the initial power quality data is true or not and obtaining a judgment result includes: extracting feature data in the initial power quality data based on the target discrimination network; calculating a probability value based on the feature data, wherein the probability value represents the probability that the initial power quality data is true; and determining a judgment result based on the probability value.

[0010] Optionally, based on the judgment result, the parameters in the generating network are adjusted to obtain the target generating network, including: based on the judgment result, determining the probability value corresponding to the initial power quality data; based on the probability value, adjusting the parameters in the generating network to obtain the adjusted generating network; based on the adjusted generating network, regenerating the power quality data according to the random noise vector; based on the target discriminant network, regenerating the discrimination result according to the random noise vector; repeating the above steps until the probability value corresponding to the generated power quality data exceeds a preset threshold, determining that the adjusted generating network is the target generating network.

[0011] According to another aspect of an embodiment of the present invention, there is also provided a power quality data generating device, including: a receiving module for receiving a random noise vector; a determining module for determining initial power quality data based on a generating network and according to the random noise vector; a judging module for judging whether the initial power quality data is true based on a target discriminating network and obtaining a judging result; an adjusting module for adjusting parameters in the generating network based on the judging result and obtaining a target generating network; and a generating module for generating target power quality data based on the target generating network and according to the random noise vector.

[0012] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium including a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute any one of the above-mentioned methods for generating power quality data.

[0013] According to yet another aspect of an embodiment of the present invention, a computer device is provided. The computer device includes a processor, and the processor is used to run a program. When the program is run, any one of the above-mentioned methods for generating power quality data is executed.

[0014] According to yet another aspect of the embodiments of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above-mentioned methods for generating power quality data is implemented.

[0015] In an embodiment of the present invention, a method for generating power quality data is adopted, by receiving a random noise vector; determining initial power quality data based on a generating network and the random noise vector; judging whether the initial power quality data is true or not based on a target discrimination network, and obtaining a judgment result; adjusting parameters in the generating network based on the judgment result, and obtaining a target generating network; generating target power quality data based on the target generating network and the random noise vector, so as to achieve the purpose of improving the accuracy of the generated power quality data, thereby achieving the technical effect of improving the reliability of the power quality data when used for prediction or quality monitoring, and further solving the technical problem that the currently generated power quality data is different from the real data in details, resulting in the generated data being not accurate and true enough, so that its accuracy and reliability are affected when used for prediction or power quality monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a computer terminal for implementing a method for generating power quality data is shown;

[0018] Figure 2 is a flow chart of a method for generating power quality data according to an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of a model of a generative adversarial network in a method for generating power quality data according to an optional embodiment of the present invention;

[0020] Figure 4 is a training flow chart of a method for generating power quality data according to an optional embodiment of the present invention;

[0021] Figure 5 It is a structural block diagram of a power quality data generating device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] According to an embodiment of the present invention, a method embodiment of a method for generating power quality data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0025] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for generating power quality data. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0026] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0027] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the power quality data generation method in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the power quality data generation method of the above-mentioned application program is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0028] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .

[0029] Figure 2 is a flow chart of a method for generating power quality data according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0030] Step S202, receiving a random noise vector.

[0031] In this step, the random noise vector can be used to generate new power quality data or any other type of synthetic data. A random noise vector can be generated first. This vector usually contains multiple values, and its distribution can be Gaussian distribution (normal distribution), uniform distribution, or other types of random distribution. The size and dimension of the random noise vector needs to match the input layer of the generator to ensure that it can be correctly input into the network.

[0032] Receiving a random noise vector is the starting point of the generative adversarial network generation process, through which the generator can learn from uninformative random inputs and generate new data with complex structures and features.

[0033] Step S204: determining initial power quality data based on the generating network and the random noise vector.

[0034] In this step, the random noise vector is input into the generator network. The generator network usually contains multiple layers of neural networks, such as deep convolutional neural networks (DCNNs) or fully connected networks (FCNs), which are designed to learn the mapping from the latent space (defined by the random noise vector) to the target data space (power quality data). The generator network forward propagates the random noise vector through a series of neural network layers. This process includes layer-by-layer application of matrix multiplication, activation functions (such as ReLU), upsampling (implemented by deconvolution layers when generating images), weighted summation, etc., gradually transforming the noise vector into the structure and features of power quality data. As the forward propagation continues, the generator network gradually constructs the features of the power quality data, such as the continuity of the time series data, the fluctuation patterns of voltage and current, and the changes in frequency components. The construction of these features depends on the patterns and distributions learned by the generator network from the real power quality data set during training. Finally, the output layer of the generator network provides an output that matches the dimensions and format of the power quality data. This output can be a set of time series data, an image representing the power quality, or a feature vector, depending on the design and training objectives of the generator network.

[0035] The generator (generator network) is a deep learning model, usually using a deep convolutional neural network (DCNN) or a fully connected neural network (FCN), with multi-layer nonlinear transformation capabilities. Deep learning models can learn complex data distribution and feature space representations from a large amount of training data. Even if the input is random noise, these learned transformations can map the noise to meaningful data. In the training process of GAN, the goal of the generator is to learn the distribution of real data and generate data that looks similar to real data from random noise vectors. After the random noise vector is input to the generator, through multiple layers of transformation, the generator gradually learns how to transform the random input into the structure and characteristics of power quality data. Among them, the random noise vector can be regarded as sampled from a latent space, which is a high-dimensional space that contains all possible combinations of features required to generate data. Through learning, the generator can map random points in the latent space to the feature space of power quality data, generating data with specific statistical characteristics and physical meanings. The generator can reconstruct and synthesize power quality data from random noise because it learns how to encode and decode the key features of power quality data during the data generation process. This ability allows the generator to generate new data with similar characteristics through its internal mapping relationship even if the input is random noise.

[0036] Step S206, based on the target discrimination network, determine whether the initial power quality data is true, and obtain a judgment result.

[0037] In this step, the process of judging whether the initial power quality data is true based on the target discriminator network (target Discriminator) is a key link in the training of the generative adversarial network (GAN). The initial power quality data (generated by the generator network based on the random noise vector) is input into the target discriminator network. These data may exist in different forms, such as time series, images, or feature vectors, depending on the output of the generator network and the design of the discriminator. The target discriminator network processes the input data through its internal deep learning architecture (such as convolutional neural network, recurrent neural network, or fully connected network, etc.). The network layer can extract and analyze various features of the data, such as time series features, frequency features, statistical features, etc., which help to determine whether the data is true. After a series of feature extraction and processing, the discriminator will input the extracted features into its decision layer. The decision layer is usually one or more fully connected layers, whose function is to convert features into one or more output values, which represent the discriminator's judgment on the authenticity of the input data. After the target discriminant network processes the input data, it outputs a probability value (usually between 0 and 1) indicating the probability that the data is real power quality data. A probability value close to 1 indicates that the discriminator believes that the data is real, and a probability value close to 0 indicates that the data is identified as generated or unreal. Based on the output probability of the discriminator and the actual label of the data (real data is labeled as 1 and generated data is labeled as 0), the loss function is calculated. The loss function (such as binary cross entropy loss) measures the difference between the discriminator's prediction result and the actual label, which is the basis for optimizing the discriminator's parameters. The value of the loss function is used to calculate the gradient of the internal parameters of the discriminator through the back-propagation algorithm, and then these parameters are updated using an optimization algorithm (such as gradient descent, Adam, etc.) to improve the accuracy of the discriminator. The goal is to enable the discriminator to more accurately distinguish between real data and generated data.

[0038] The judgment results and parameter update process of the discriminator will affect the training of the generated network. The goal of the generated network is to make the generated data deceive the discriminator as much as possible, even if the probability value output by the discriminator is close to 1. Therefore, the parameters of the generated network will also be adjusted according to the feedback of the discriminator to generate more realistic data.

[0039] The whole process is based on the core idea of ​​GAN, that is, through competitive training between the generator network and the discriminator network, the generator network is prompted to learn how to generate the distribution of real data from random noise, while the discriminator learns how to effectively distinguish between real data and generated data, and finally reaches a balance state, where the generated data can simulate the power quality data with high fidelity. This mechanism ensures that the generated data is not only close to the real data in terms of numerical value, but also as consistent as possible with the real power quality data in terms of physical characteristics, statistical characteristics and time series patterns.

[0040] Step S208: Based on the judgment result, adjust the parameters in the generated network to obtain the target generated network.

[0041] In this step, the parameters in the generative network are adjusted based on the judgment result of the discriminator to obtain the target generative network. In each training iteration, the generative network generates a set of data based on the random noise vector, which is sent to the discriminator for evaluation. The discriminator outputs a probability value for each sample, indicating the credibility of the sample as real data. The loss function of the generative network is usually designed to minimize the correct judgment of the discriminator on the generated data, that is, to maximize the probability that the discriminator misjudges the generated data as real data. The gap between the generated data and the ideal output (that is, the probability of completely deceiving the discriminator) can be calculated according to the loss function of the generative network. This gap is represented as the loss gradient. Through the back-propagation algorithm, the loss gradient is passed back to each layer of the generative network to determine the contribution of each layer parameter to the total loss. Once the contribution of the parameter to the loss (that is, the gradient) is obtained, the optimization algorithm (such as stochastic gradient descent SGD, Adam, etc.) is used to update the parameters of the generative network. The goal of parameter update is to minimize the loss of the generative network, thereby improving the quality and authenticity of the generated data and making it more difficult for the discriminator to distinguish between generated data and real data.

[0042] The training of the generator network and the discriminator can be performed alternately. After updating the parameters of the generator network, the parameters of the generator network are usually fixed and the discriminator is trained again to let it learn to distinguish the updated generated data from the real data. This process is a dynamic game in GAN training until an equilibrium state is reached.

[0043] The above process needs to be executed iteratively until the generation network can stably generate high-quality power quality data or the predetermined number of training rounds is reached. In each round of iteration, the generation network learns how to generate data better, while the discriminant network learns how to identify the data more accurately. During the training process, multiple versions of the generation network can be saved based on the evaluation results of the generated data. Finally, based on performance indicators (such as the quality of the generated data, the statistical match with the real data, etc.), an optimal generation network is selected as the target generation network.

[0044] Through the above process, the generative network in GAN can generate synthetic samples that are closer and closer to the real power quality data from random noise vectors through continuous learning and optimization. This mechanism enables the generative network to learn complex data distribution and characteristics, thereby providing high-quality synthetic data for applications such as power quality monitoring, fault prediction, and data enhancement.

[0045] Step S210, generating target power quality data based on a target generation network and a random noise vector.

[0046] In this step, the random noise vector is input into the trained target generation network. The generation network performs a series of nonlinear transformations on the input noise vector through its internal deep learning architecture (such as a deep convolutional neural network or a recurrent neural network), and gradually constructs the structure and characteristics of the power quality data. During the forward propagation of the generation network, the noise vector is converted into the characteristics of the power quality data. These characteristics may include the amplitude and phase information of the voltage and current, the frequency component, the time series fluctuation pattern, and the statistical properties reflecting the power quality, such as the mean, standard deviation, etc. The generation network learns how to map from the latent space (represented by the random noise vector) to the power quality data space, so it can generate time series data or data sets with specific physical meanings and statistical characteristics. The output layer of the generation network generates power quality data related to the input noise vector. These data can be time domain signals, spectrum images or feature vectors, and the specific form depends on the design objectives of the generation network and the structure of the output layer. The output data should have similar characteristics to the real power quality data, including voltage and current fluctuations, frequency changes, transient phenomena, etc.

[0047] After the above process, the target generation network can generate high-quality power quality data from random noise vectors. These data can be used in a variety of scenarios, such as simulation testing of power quality monitoring systems, fault diagnosis and prediction of power systems, training and verification of power quality data analysis algorithms, etc. The generated data is not only similar to the real data in terms of numerical value, but also can highly simulate the characteristics of real power quality data in terms of time series correlation, frequency characteristics and statistical properties, which provides a rich data resource for research and application in the field of power quality. By continuously generating and analyzing these data, we can have a deeper understanding of the changing laws of power quality and improve the operating efficiency and reliability of the power system.

[0048] Figure 3 is a schematic diagram of a model of a generative adversarial network in a method for generating power quality data according to an optional embodiment of the present invention, such as Figure 3 As shown in Figure 1, the Generative Adversarial Network (GAN) consists of two main components: the generator G and the discriminator D. During the training process, the goal of the generator G is to make the generated data as similar as possible to the original data in order to deceive the discriminator D. The discriminator D strives to distinguish the correlation between the generated data and the real data. The generator and the discriminator improve their performance through alternating optimization training, forming a dynamic "game".

[0049] Through the above steps, the purpose of improving the accuracy of the generated power quality data can be achieved, thereby achieving the technical effect of improving the reliability of the power quality data when used for prediction or quality monitoring, and further solving the technical problem that the currently generated power quality data differs from the real data in details, resulting in the generated data being not accurate and real enough, which affects its accuracy and reliability when used for prediction or power quality monitoring.

[0050] As an optional embodiment, based on a generating network, initial power quality data is determined according to a noise vector, including: based on the generating network, converting the noise vector into feature data, wherein the feature data characterizes the features of the power quality data; based on a preset time range of the generated power quality data, setting a window size, wherein the window size; generating initial power quality data by controlling a sliding window to move on the feature data.

[0051] Optionally, a sliding window method can be used to generate power quality data. Based on the generative network, the process of determining the initial power quality data according to the noise vector involves mapping the noise vector to the feature space, and then converting the data in the feature space into power quality data in the form of a time series. The generative network converts the input noise vector into feature data. This step is the mapping process of the generative network learning. Through the forward propagation of the deep learning model (such as the deep convolutional neural network DCNN), the noise vector undergoes multiple layers of nonlinear transformation to generate a set of vectors related to the characteristics of the power quality data. These feature data may include the time series characteristics of voltage and current, frequency components, and statistical properties reflecting power quality, such as mean, standard deviation, etc. The generative network learns how to map from the potential random noise space to the feature space of power quality data through training. The size of the sliding window is determined according to the preset time range for generating power quality data. The selection of the window size depends on the time series characteristics of the generated data. For example, if the goal is to generate power quality data within one minute, the window size may be set to 60 (assuming that the data sampling frequency is 1Hz) to capture the data changes within this time window. The selection of window size needs to take into account the periodicity, dynamic characteristics, computational efficiency and complexity of the data. The sliding window method is used to move on the feature data to generate power quality data in the form of time series. Based on the feature data, continuous feature fragments are extracted through the sliding window, and each fragment represents the power quality information of a time series point. The sliding window moves on the feature data to generate time-series continuous power quality data and realize the conversion from feature space to time series data space. By controlling the size and step size of the sliding window, the time series resolution of the generated data and the coverage of the time window can be adjusted. When the sliding window traverses the entire feature data set, the generation network can synthesize complete power quality data based on the feature fragments extracted in the window. These data include continuous changes in voltage and current, frequency fluctuations, transient events, etc., and have statistical and physical characteristics similar to real power quality data, thus becoming initial power quality data. The generated data can be used for subsequent verification and analysis to ensure that it meets the typical characteristics and requirements of power quality.

[0052] Through the above steps, the generative network can generate feature data based on random noise vectors and finally convert them into initial power quality data. This process not only relies on the deep learning ability of the generative network, but also involves time series data processing techniques, such as the sliding window method. By reasonably setting the window size and sliding strategy, the generated data can maintain the continuity of the time series and the complex dynamic characteristics of power quality data, providing valuable synthetic data for the research and application of power systems.

[0053] As an optional embodiment, before determining whether the initial power quality data is true based on a target discrimination network and obtaining a judgment result, the method includes: obtaining sample power quality data; generating training power quality data based on a preset sample noise vector based on a generation network; inputting the sample power quality data and the training power quality data into a preset initial discrimination network to obtain a discrimination result, wherein the discrimination result represents the result of the initial discrimination network determining whether the sample power quality data and the training power quality data are true data; and adjusting the initial discrimination network based on the discrimination result to obtain a target discrimination network.

[0054] Optionally, before judging whether the initial power quality data is true and obtaining the judgment result based on the target discriminant network, the following detailed steps need to be performed to ensure that the discriminant network can effectively distinguish between real data and generated data: real power quality data can be collected from the actual power quality monitoring system or related database first, and these data will be used as "true" samples in the training process of the discriminant network to teach the discriminant network to recognize the characteristics and patterns of real power quality data. Based on the generating network, a preset sample noise vector is used to generate power quality data. The sample noise vector can be extracted from a Gaussian distribution or a uniform distribution, and its dimension and range must be consistent with the input requirements of the generating network. The generated power quality data will be used as a "false" sample in the training process of the discriminant network to teach the discriminant network to recognize the characteristics of the generated data. The collected sample power quality data ("true" sample) and the generated training power quality data ("false" sample) are input into the initialized discriminant network together. The architecture of the discriminant network can be a convolutional neural network, a fully connected network, or a combination thereof, which is used to identify the statistical properties and physical characteristics of the input data to determine its authenticity. The initial discriminant network analyzes the input data and outputs a probability value for each input sample, indicating the probability that the sample is real data. This is usually a value between 0 and 1, where a value close to 1 indicates that the discriminator believes the data is real, and a value close to 0 indicates that the data is generated or not real. Based on the discriminant results and the real labels of the data (sample data is labeled 1 and generated data is labeled 0), the loss of the discriminant network is calculated. The loss function (such as binary cross entropy loss) measures the gap between the discriminator's prediction results and the actual labels, and is the basis for optimizing the performance of the discriminant network. Based on the calculated loss function, the gradient of the discriminant network parameters is calculated by the back propagation algorithm, and these parameters are updated using an optimization algorithm (such as gradient descent or Adam). The goal is to minimize the loss of the discriminant network in distinguishing between real data and generated data and improve its discrimination ability. The above steps are an iterative process. In each iteration, the generative network generates new power quality data, and the discriminant network improves its ability to distinguish between real and fake data through continuous learning. The training process continues until the discriminant network achieves good performance or the GAN training of the entire system reaches a convergence state.

[0055] When the performance of the discriminant network is stable and can accurately distinguish the real power quality data from the data generated by the generator network, the discriminant network is considered to be a trained target discriminant network. The performance of the target discriminant network indicates the quality of the data generated by the generator network, because only when the generated data is realistic enough, the discriminant network will find it difficult to distinguish the true from the false, which reflects the dynamic balance point in the GAN training process.

[0056] Through the above steps, the target discriminant network can be trained to accurately judge the authenticity of power quality data, providing a key discriminant tool for the subsequent evaluation and use of generated data. This process not only improves the quality of generated data, but also ensures that the generated data is as close as possible to the real power quality data in terms of physical and statistical characteristics, thereby providing a more valuable data source for the research and application of power systems.

[0057] As an optional embodiment, based on the discrimination result, the initial discrimination network is adjusted to obtain the target discrimination network, including: determining the labels corresponding to the sample power quality data and the training power quality data, wherein the labels are used to distinguish the sample power quality data from the generated training power quality data; based on a preset loss function, determining the loss value according to the discrimination result and the labels corresponding to the sample power quality data and the training power quality data; based on the loss value, adjusting the initial discrimination network to obtain the target discrimination network.

[0058] Optionally, labels are assigned to all data input to the discriminant network. The real sample power quality data, i.e., the measured values ​​from the actual power system, will be labeled with a "real" label, usually represented by a value of 1; while the training power quality data generated by the generator network based on the noise vector will be labeled with a "generated" or "fake" label, usually represented by a value of 0. These labels are the basis for training the discriminant network to help it learn to distinguish between real data and generated data. In each training iteration, the sample power quality data and the generated training power quality data are input to the discriminant network to obtain the judgment output. The output is a probability value that represents the probability that the discriminator believes that the input data is real data. A loss function, such as Binary Cross-Entropy Loss, is set to quantify the error between the prediction of the discriminant network and the real label of the data. For real data, the output of the discriminant network should be close to 1 (the real label is 1); for generated data, the output should be close to 0 (the real label is 0). The loss function calculates the loss value based on these predicted values ​​and the real label to reflect the performance of the discriminator. After obtaining the loss value, the backpropagation algorithm can be used to calculate the gradient of the loss value relative to the parameters of the discriminant network. These gradients indicate the direction of parameter adjustment to reduce the loss value and improve the performance of the discriminator. Through optimization algorithms (such as stochastic gradient descent SGD, Adam, RMSprop, etc.), the parameters of the discriminant network are updated according to the calculated gradients. The goal is to minimize the loss function, that is, to improve the discriminator's ability to distinguish between real data and generated data. The above steps are a cyclic iterative process. In each iteration, the parameters of the discriminant network are adjusted based on its discrimination results. Usually, this process is carried out alternately, that is, the parameters of the generating network are fixed first, and the discriminant network is optimized; then the parameters of the discriminant network are fixed and the generating network is optimized. Through this "game" mechanism, the two networks promote each other until a balance is reached, that is, the data generated by the generating network is enough to "cheat" the discriminant network, making it difficult to distinguish between true and false. When the training process of the discriminant network is completed, that is, when the loss value converges and the discriminant network can stably and accurately judge the authenticity of the input data, the discriminant network at this time is the target discriminant network that has completed training. This network can be effectively used for subsequent authenticity verification of power quality data.

[0059] As an optional embodiment, based on the target discrimination network, whether the initial power quality data is true is judged to obtain a judgment result, including: based on the target discrimination network, extracting feature data in the initial power quality data; based on the feature data, calculating a probability value, wherein the probability value represents the probability that the initial power quality data is true; based on the probability value, determining the judgment result.

[0060] Optionally, the process of judging whether the initial power quality data is true or not based on the target discriminant network involves extracting features from the data and estimating the probability of its authenticity, and the specific steps are as follows: First, the initial power quality data is input into the trained target discriminant network. The target discriminant network performs multi-level feature extraction on the input data through its internal neural network architecture. These extracted features may include time series patterns, frequency components, statistical properties of voltage and current (such as mean, variance), etc., which together constitute information that can describe the characteristics of power quality data. After feature extraction, the target discriminant network will evaluate the authenticity of the power quality data and output a probability value. This probability value reflects the probability that the data is true power quality data, which is usually a real number between 0 and 1. The closer the value is to 1, the more true the network believes the data is; conversely, the closer the value is to 0, the more likely the data is generated by the generating network. Based on the calculated probability value, the judgment result of the initial power quality data can be determined. Generally, if the probability value is higher than a preset threshold (such as 0.5), the data can be considered to be real power quality data and marked as "true"; conversely, if the probability value is lower than the threshold, the data is considered to be generated and not real data, and is marked as "false". The choice of this threshold depends on the specific application requirements and the requirements for judgment accuracy. In some cases, this threshold may need to be adjusted to optimize the performance of the discriminant network. For example, if it is more important to avoid misjudging generated data as real data in a specific application, the threshold can be set higher to increase the requirements for authenticity; conversely, if a higher data generation rate is required, the threshold can be appropriately lowered to relax the judgment criteria for authenticity. After obtaining the judgment results, these results can be further analyzed, such as calculating the model's accuracy, recall rate, F1 score and other evaluation indicators, or checking the specific characteristics of the misjudged data to understand the model's discriminant performance and possible deviations.

[0061] Through this process, the target discriminant network can evaluate and judge the authenticity of the initial power quality data based on the power quality data features learned during its training. This mechanism not only provides a basis for the evaluation of the model, but also ensures the quality of the generated data, because only when the generated data can deceive the discriminant network and make it output a high probability value can it be considered that the generated data has reached a similar level to the real power quality data. In the fields of power system analysis, fault diagnosis and prediction, power quality monitoring, etc., this process provides an important verification method for generating high-quality synthetic power quality data, which helps to improve the performance and reliability of related algorithms and systems.

[0062] As an optional embodiment, based on the judgment result, the parameters in the generating network are adjusted to obtain the target generating network, including: based on the judgment result, determining the probability value corresponding to the initial power quality data; based on the probability value, adjusting the parameters in the generating network to obtain the adjusted generating network; based on the adjusted generating network, regenerating the power quality data according to the random noise vector; based on the target discriminant network, regenerating the discrimination result according to the random noise vector; repeating the above steps until the probability value corresponding to the generated power quality data exceeds a preset threshold, determining that the adjusted generating network is the target generating network.

[0063] Optionally, the process of adjusting the parameters in the generating network based on the judgment result to achieve the target generating network is the generator optimization stage in the training of the generative adversarial network (GAN). After the target discriminant network judges the initial power quality data, a probability value is obtained, which reflects the possibility that the data is identified as real power quality data. If the probability value is low, it means that the data generated by the generating network is greatly different from the real data, and the generating network needs to be adjusted. Based on the probability value obtained from the target discriminant network and the corresponding loss function (usually corresponding to the loss function of the discriminator, but with the generated data being identified as real data as the goal), the generating network calculates the gradient of the loss function and back propagates to update its internal parameters. This process uses optimization algorithms such as gradient descent to adjust parameters to increase the authenticity of the generated data, that is, to increase the probability that the discriminant network misjudges the generated data as real data. After the parameter adjustment, the generating network again generates a new set of power quality data based on the random noise vector. This process is the first attempt after the parameters of the generating network are updated, which is used to test the effect of the parameter adjustment. The power quality data newly generated by the generating network is input into the target discriminant network to obtain a new discrimination result, including a new probability value. This is to evaluate whether the realism of the data generated by the generator network has been improved.

[0064] The above steps are a cyclic iterative process. The generator network and the discriminator network constantly compete in training. The generator network tries to generate more realistic power quality data, while the discriminator network strives to improve its ability to distinguish between real data and generated data. Through iterative training, the generator network gradually learns how to generate data that matches the characteristics of real power quality data. During the training process, a probability threshold is set as a judgment criterion. When the probability value corresponding to the generated power quality data exceeds this threshold, it means that the data generated by the generator network is "real" enough to deceive the target discriminator network. At this point, it can be considered that the parameter adjustment of the generator network has reached a satisfactory level, that is, the state of the target generator network has been reached. The entire training process ends when the preset training round is reached or when the probability value of the generated data exceeds the preset threshold and stabilizes. At the end of the training, the generator network has a set of optimized parameters that can generate high-simulation data with power quality data characteristics, which provides a high-quality data source for applications such as fault simulation, performance prediction, and data enhancement of power systems. The key to this process is the dynamic game between the generative network and the discriminative network. Through continuous adjustment and optimization, the ultimate goal is to enable the generative network to generate power quality data that is almost indistinguishable from real data, that is, to achieve the construction of the target generative network. In this process, the reasonable setting of training parameters, loss functions and thresholds is crucial to accelerate model convergence and improve data generation quality.

[0065] Figure 4 is a training flow chart of a method for generating power quality data according to an optional embodiment of the present invention, such as Figure 4 As shown, the present invention constructs a power quality data generation adversarial network model, introduces a deep convolutional neural network in the generator and the discriminator to construct the power quality data generation model, and introduces a loss function to improve the data generation accuracy and the convergence performance of data generation. The training process of power quality data packet generation based on GAN:

[0066] 1. Generate a two-dimensional power quality data set based on the sliding window method (the window value n is determined by the actual scenario), and then perform an inner product operation on the n-dimensional data vector to obtain the Gram matrix.

[0067] 2. Grayscale the generated two-dimensional data set.

[0068] 3. Use the pre-trained deep convolutional neural network to obtain relevant features from the original power quality data set, and define 8 feature indicators including: mean, standard deviation, skewness, kurtosis, root mean square value, Shannon entropy, logarithmic energy entropy and energy.

[0069] 4. First, fix the generator parameters and update the discriminator model so that the discriminator can accurately discriminate between the two types of grayscale images. On this basis, fix the discriminator parameters and optimize the generator model, so that the generated complete power quality grayscale image is closer to the real power quality grayscale image. After repeated iterative updates, the distribution of the generated power quality grayscale image is finally completely fitted to the distribution law of the real power quality grayscale image. Within the specified number of iterations, the entire training process processes all batches of data. The discriminator predicts the real data and calculates the loss, then generates random noise as input, generates false data through the generator, and the discriminator predicts the false data and calculates the loss. After comparing the two losses, update the parameters of the discriminator. The generator generates false data and predicts it through the discriminator, and calculates the loss of the generator.

[0070] 5. By introducing the authenticity loss function, we ensure that the generator gradually generates more realistic data, while the discriminator improves its ability to distinguish between real data and generated data.

[0071] 6. Calculate and compare statistics such as the mean, standard deviation, maximum and minimum values ​​of the generated data and sample test data to quantitatively evaluate the basic characteristics of each data set and perform F-test.

[0072] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that the power quality data generation method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0074] According to an embodiment of the present invention, there is also provided a power quality data generating device for implementing the above power quality data generating method. Figure 5 is a structural block diagram of a power quality data generating device provided according to an embodiment of the present invention, such as Figure 5 As shown, the power quality data generating device includes: a receiving module 502, a determining module 504, a judging module 506, an adjusting module 508 and a generating module 510. The power quality data generating device is described below.

[0075] The receiving module 502 is configured to receive a random noise vector.

[0076] The determination module 504 is connected to the receiving module 502 and is used to determine initial power quality data based on the generation network and the random noise vector.

[0077] The judgment module 506 is connected to the determination module 504 and is used to judge whether the initial power quality data is true based on the target judgment network and obtain a judgment result.

[0078] The adjustment module 508 is connected to the judgment module 506 and is used to adjust the parameters in the generation network based on the judgment result to obtain the target generation network.

[0079] The generating module 510 is connected to the adjusting module 508 and is used to generate target power quality data based on the target generating network and the random noise vector.

[0080] It should be noted that the receiving module 502, the determining module 504, the judging module 506, the adjusting module 508 and the generating module 510 correspond to steps S202 to S210 in the embodiment, and the examples and application scenarios implemented by the multiple modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the above modules as part of the device can be run in the computer terminal 10 provided in the embodiment.

[0081] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the computer device may be located in at least one network device among multiple network devices of a computer network. The computer device includes a memory and a processor.

[0082] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the power quality data generation method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the above-mentioned power quality data generation method is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0083] The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: receive a random noise vector; determine initial power quality data based on the random noise vector based on the generation network; determine whether the initial power quality data is true based on the target discrimination network to obtain a judgment result; adjust the parameters in the generation network based on the judgment result to obtain a target generation network; generate target power quality data based on the target generation network and the random noise vector.

[0084] Optionally, the processor may also execute program code of the following steps: based on a generating network, determining initial power quality data according to a noise vector, including: based on the generating network, converting the noise vector into feature data, wherein the feature data characterizes features of the power quality data; based on a preset time range of the generated power quality data, setting a window size, wherein the window size; generating initial power quality data by controlling a sliding window to move on the feature data.

[0085] Optionally, the processor may also execute the following program code: before determining whether the initial power quality data is true based on the target discrimination network and obtaining the judgment result, the steps include: obtaining sample power quality data; generating training power quality data based on a preset sample noise vector based on a generation network; inputting the sample power quality data and the training power quality data into a preset initial discrimination network to obtain a discrimination result, wherein the discrimination result represents the result of the initial discrimination network determining whether the sample power quality data and the training power quality data are true data; and adjusting the initial discrimination network based on the discrimination result to obtain the target discrimination network.

[0086] Optionally, the processor may also execute the program code of the following steps: based on the discrimination result, adjusting the initial discrimination network to obtain the target discrimination network, including: determining the labels corresponding to the sample power quality data and the training power quality data, wherein the labels are used to distinguish the sample power quality data from the generated training power quality data; based on a preset loss function, determining the loss value according to the discrimination result and the labels corresponding to the sample power quality data and the training power quality data; based on the loss value, adjusting the initial discrimination network to obtain the target discrimination network.

[0087] Optionally, the processor may also execute the following program code: based on the target discrimination network, determine whether the initial power quality data is true, and obtain a judgment result, including: based on the target discrimination network, extract characteristic data from the initial power quality data; based on the characteristic data, calculate a probability value, wherein the probability value represents the probability that the initial power quality data is true; based on the probability value, determine the judgment result.

[0088] Optionally, the processor may also execute the following program code: based on the judgment result, adjusting the parameters in the generating network to obtain the target generating network, including: based on the judgment result, determining the probability value corresponding to the initial power quality data; based on the probability value, adjusting the parameters in the generating network to obtain the adjusted generating network; based on the adjusted generating network, regenerating the power quality data according to the random noise vector; based on the target discriminant network, regenerating the discriminant result according to the random noise vector; repeating the above steps until the probability value corresponding to the generated power quality data exceeds a preset threshold, determining that the adjusted generating network is the target generating network.

[0089] By adopting the embodiment of the present invention, a method for generating power quality data is provided, which receives a random noise vector; determines initial power quality data based on a generating network according to the random noise vector; determines whether the initial power quality data is true or not based on a target discrimination network to obtain a determination result; adjusts the parameters in the generating network based on the determination result to obtain a target generating network; generates target power quality data based on the target generating network according to the random noise vector, thereby achieving the purpose of improving the accuracy of the generated power quality data, thereby achieving the technical effect of improving the reliability of the power quality data when used for prediction or quality monitoring, and further solves the technical problem that the currently generated power quality data differs from the real data in details, resulting in the generated data being not accurate and true enough, so that its accuracy and reliability are affected when used for prediction or power quality monitoring.

[0090] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a non-volatile storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0091] The embodiment of the present invention further provides a non-volatile storage medium. Optionally, in this embodiment, the non-volatile storage medium can be used to store the program code executed by the power quality data generation method provided in the above embodiment.

[0092] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0093] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: receiving a random noise vector; determining initial power quality data based on a generation network and the random noise vector; judging whether the initial power quality data is true based on a target discrimination network and obtaining a judgment result; adjusting parameters in the generation network based on the judgment result to obtain a target generation network; generating target power quality data based on the target generation network and the random noise vector.

[0094] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: based on the generation network, according to the noise vector, determining initial power quality data, including: based on the generation network, converting the noise vector into feature data, wherein the feature data characterizes the characteristics of the power quality data; based on a preset time range of the generated power quality data, setting a window size, wherein the window size; generating initial power quality data by controlling the sliding window to move on the feature data.

[0095] Optionally, in this embodiment, the non-volatile storage medium is configured to store program codes for executing the following steps: before determining whether the initial power quality data is true based on a target discrimination network and obtaining a judgment result, the steps include: obtaining sample power quality data; generating training power quality data based on a preset sample noise vector based on a generation network; inputting the sample power quality data and the training power quality data into a preset initial discrimination network to obtain a discrimination result, wherein the discrimination result represents the result of the initial discrimination network determining whether the sample power quality data and the training power quality data are true data; based on the discrimination result, adjusting the initial discrimination network to obtain a target discrimination network.

[0096] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: based on the discrimination result, adjusting the initial discrimination network to obtain a target discrimination network, including: determining labels corresponding to the sample power quality data and the training power quality data, wherein the labels are used to distinguish the sample power quality data from the generated training power quality data; based on a preset loss function, determining a loss value according to the discrimination result and the labels corresponding to the sample power quality data and the training power quality data; based on the loss value, adjusting the initial discrimination network to obtain the target discrimination network.

[0097] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for executing the following steps: based on the target discrimination network, judging whether the initial power quality data is true, and obtaining a judgment result, including: based on the target discrimination network, extracting feature data in the initial power quality data; based on the feature data, calculating a probability value, wherein the probability value represents the probability that the initial power quality data is true; based on the probability value, determining the judgment result.

[0098] Optionally, in this embodiment, the non-volatile storage medium is configured to store program codes for executing the following steps: based on the judgment result, adjusting the parameters in the generation network to obtain the target generation network, including: based on the judgment result, determining the probability value corresponding to the initial power quality data; based on the probability value, adjusting the parameters in the generation network to obtain the adjusted generation network; based on the adjusted generation network, re-generating the power quality data according to the random noise vector; based on the target discrimination network, re-generating the discrimination result according to the random noise vector; repeating the above steps until the probability value corresponding to the generated power quality data exceeds a preset threshold, determining that the adjusted generation network is the target generation network.

[0099] An embodiment of the present invention also provides a computer program product, including a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it can achieve: receiving a random noise vector; based on a generating network, determining initial power quality data according to the random noise vector; based on a target discrimination network, judging whether the initial power quality data is true, and obtaining a judgment result; based on the judgment result, adjusting parameters in the generating network to obtain a target generating network; based on the target generating network, generating target power quality data according to the random noise vector.

[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0101] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0102] 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 schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, 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.

[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0105] 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 non-volatile 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, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment 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 and other media that can store program codes.

[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for generating power quality data, characterized in that: include: Receive a random noise vector; Based on the generating network, determining initial power quality data according to the random noise vector; Based on the target discrimination network, judging whether the initial power quality data is true, and obtaining a judgment result; Based on the judgment result, adjusting the parameters in the generation network to obtain a target generation network; Based on the target generation network, target power quality data is generated according to the random noise vector.

2. The method according to claim 1, characterized in that: The method of determining initial power quality data based on the generating network and according to the noise vector comprises: Based on the generation network, the noise vector is converted into feature data, wherein the feature data represents the features of the power quality data; Based on a preset time range of the generated power quality data, setting a window size, wherein the window size; The initial power quality data is generated by controlling the sliding window to move on the characteristic data.

3. The method according to claim 1, characterized in that Before determining whether the initial power quality data is true based on the target discrimination network and obtaining a determination result, the method includes: Obtain sample power quality data; Based on the generation network, generating training power quality data according to a preset sample noise vector; Inputting the sample power quality data and the training power quality data into a preset initial discriminant network to obtain a discriminant result, wherein the discriminant result represents a result of the initial discriminant network discriminating whether the sample power quality data and the training power quality data are real data; Based on the discrimination result, the initial discrimination network is adjusted to obtain the target discrimination network.

4. The method according to claim 3, characterized in that The adjusting the initial discriminant network based on the discriminant result to obtain the target discriminant network includes: Determining labels corresponding to the sample power quality data and the training power quality data, respectively, wherein the labels are used to distinguish the sample power quality data from the generated training power quality data; Based on a preset loss function, determining a loss value according to the discrimination result and labels corresponding to the sample power quality data and the training power quality data; Based on the loss value, the initial discriminant network is adjusted to obtain the target discriminant network.

5. The method according to claim 1, characterized in that The step of judging whether the initial power quality data is true based on the target discrimination network and obtaining a judgment result includes: Extracting feature data from the initial power quality data based on the target discrimination network; Based on the characteristic data, a probability value is calculated, wherein the probability value represents the probability that the initial power quality data is true; Based on the probability value, the judgment result is determined.

6. The method according to claim 1, characterized in that The step of adjusting the parameters in the generation network based on the judgment result to obtain a target generation network includes: Based on the judgment result, determining a probability value corresponding to the initial power quality data; Based on the probability value, adjusting parameters in the generating network to obtain an adjusted generating network; Based on the adjusted generation network, and according to the random noise vector, generating power quality data again; Based on the target discrimination network, and according to the random noise vector, a discrimination result is generated again; Repeat the above steps until the probability value corresponding to the generated power quality data exceeds a preset threshold, and determine that the adjusted generation network is the target generation network.

7. A device for generating power quality data, characterized in that: include: A receiving module, used for receiving a random noise vector; A determination module, configured to determine initial power quality data based on a generation network and according to the random noise vector; A judgment module, used to judge whether the initial power quality data is true based on a target discrimination network, and obtain a judgment result; An adjustment module, used for adjusting the parameters in the generation network based on the judgment result to obtain a target generation network; A generating module is used to generate target power quality data based on the target generating network and the random noise vector.

8. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method for generating power quality data according to any one of claims 1 to 6.

9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is running, the processor executes the power quality data generating method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating power quality data according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Intelligent power distribution monitoring method and system for power distribution equipment

    CN120528118A