A method and system for generating voltage sag data based on a probability diffusion model
By generating voltage sag data through a probability diffusion model, the problem of insufficient data diversity in existing technologies is solved, enabling richer training data for power quality analysis and power system risk assessment, and improving the diversity and coverage of the dataset.
Patent Information
- Application Number
- CN202311172238.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-09-12
AI Technical Summary
The voltage sag data generated by existing technologies lacks diversity and cannot fully reflect the characteristics and patterns of voltage sags, resulting in poor power quality analysis and mitigation effects.
A probability diffusion model is used to preprocess, train, and sample voltage sag data to generate data with similar distribution characteristics and diversity. Through data preprocessing, model training, and sampling steps, the probability diffusion model is used to generate voltage sag data.
This improved the diversity and coverage of voltage sag datasets, providing rich training data for tracing power quality disturbances and assessing power system risks, and enhancing the quality and stability of the generated data.
Smart Images

Figure CN117216562B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of power and artificial intelligence, specifically to a method and system for generating voltage sag data based on a probability diffusion model. Background Technology
[0002] A voltage sag refers to a transient phenomenon where the effective voltage value begins to decrease at a certain moment and then recovers to the nominal voltage after a certain period of time. The main causes of voltage sags include short-circuit faults, transformer excitation, and the starting of large motors, which can lead to the shutdown of sensitive equipment in industrial users, causing production interruptions and economic losses. Therefore, monitoring, analyzing, and mitigating voltage sags is an important task for improving power quality and ensuring power supply reliability.
[0003] To effectively analyze and manage voltage sags using artificial intelligence, sufficiently diverse and representative voltage sag data is needed. However, the actual monitored voltage sag data is often limited in quantity and type, failing to comprehensively reflect the characteristics and patterns of voltage sags. Therefore, how to utilize existing voltage sag data to generate data with a similar distribution but greater diversity, thus expanding the voltage sag dataset, is a significant and challenging problem.
[0004] Currently, research on expanding voltage sag datasets mainly includes the following methods: First, simulation-based methods utilize mathematical models or simulation software to generate voltage sag waveforms with different types, amplitudes, durations, phase transitions, and other characteristics. This method can generate any amount and form of data as needed, but may differ from actual conditions. Second, transform-based methods use signal processing techniques such as wavelet transform, discrete cosine transform, and Fourier transform to transform existing voltage sag data, extract features or components, and then reconstruct or synthesize to generate new data. This method can retain some characteristics of the original data, but may introduce noise or distortion, and requires high precision in the selection of transform methods and parameters. Third, generative adversarial networks (GANs) are used to learn and fit existing voltage sag data using deep learning GAN models to generate new data. This method can automate and intelligently generate sag data, but the training process may be unstable or have difficulty converging. Summary of the Invention
[0005] (a) Technical problems to be solved
[0006] To address the shortcomings of existing technologies, this invention provides a method and system for generating voltage sag data based on a probability diffusion model, which improves the diversity and coverage of the dataset and provides richer training data for tasks such as power quality disturbance tracing, power system risk assessment and prediction based on artificial intelligence.
[0007] (II) Technical Solution
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] Firstly, a method for generating voltage sag data based on a probability diffusion model is provided, the method comprising the following steps:
[0010] The data preprocessing step involves preprocessing the voltage sag data samples to construct the original dataset;
[0011] The model training steps involve using the original dataset to train a probability diffusion model and learn the distribution characteristics of voltage sag data.
[0012] The model sampling step uses the trained probability diffusion model sampling algorithm to generate voltage sag data.
[0013] The generation and evaluation steps involve merging the generated voltage sag data with the original dataset and evaluating the merged dataset.
[0014] Preferably, the data preprocessing step specifically includes:
[0015] The effective value conversion step converts the instantaneous value of the recorded voltage into an effective value;
[0016] The sample denoising step uses a one-dimensional median filter to denoise the voltage sag samples;
[0017] The construction steps involve constructing a three-channel representation of a one-dimensional sequence from the three-phase voltage sag samples.
[0018] Preferably, the model training step specifically includes:
[0019] The data noise addition step involves spreading and adding noise to the processed voltage sag data based on the noise level vector to obtain noisy data.
[0020] The noise prediction step involves inputting the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result.
[0021] The parameter update step involves calculating the loss and updating the parameters of the conditional noise prediction model using gradient descent.
[0022] The first loop step involves repeating the above steps until the model converges.
[0023] Preferably, the noise level vector is obtained using the continuous noise level method, and the steps for obtaining the noise level vector are as follows:
[0024] Time step t is uniformly and randomly selected from {1,2,…,T};
[0025] Obtain adjacent discrete noise values based on the defined diffusion schedule.
[0026] Randomly select a noise level vector between two discrete noise values.
[0027] Preferably, the deep learning model includes an input embedding layer, a residual block recurrent layer, and an output projection layer;
[0028] The input embedding layer includes:
[0029] The noisy sample of length L is processed by a one-dimensional convolutional layer. The number of channels is converted from 3 to the number of residual channels C, and SiLu activation is used:
[0030] SiLu(x) = x * Sigmoid(x)
[0031] Here, x represents the input to the neuron.
[0032] For noise level The noise level embedding vector is calculated using the sine curve coding formula:
[0033]
[0034] Two one-dimensional convolutional layers are used to perform convolution and activation operations on the noise level encoding vector;
[0035] The residual block cyclic layer comprises N residual blocks, wherein each residual block includes:
[0036] The embedded noise level is mapped to the dimension of the number of residual channels C through a fully connected layer;
[0037] The input is convolved using dilated convolutional layers, where the dilation coefficient is a power of 2, to achieve feature extraction of different receptive fields.
[0038] Perform gated linear unit operations:
[0039] y = σ(gate) ⊙ tanh(filter)
[0040] Where σ represents the Sigmoid function, and gate and filter represent the outputs of the dilated convolution, respectively; the symbol ⊙ represents the element-wise multiplication operation.
[0041] The output after convolution is split into residual and skip connection parts;
[0042] The output projection layer includes:
[0043] Accumulate the jump connection portion of the residual block and divide by Standardize;
[0044] The skip connections are convolutional and activation operations are performed using two one-dimensional convolutional layers, and the output is projected onto the same number of channels as the input.
[0045] Preferably, the model sampling step includes:
[0046] We sample a random noise vector from a Gaussian distribution, denoted as x. t ;
[0047] Noise estimation is performed using the trained and converged deep learning model;
[0048] Inverse data generation is performed based on the estimated noise to obtain the noisy data x from the previous time step. t-1 ;
[0049] Repeat the above steps until x0 is restored.
[0050] Preferably, the merged dataset is evaluated, specifically including:
[0051] The KL divergence index is used to evaluate whether the generated dataset conforms to the original distribution. The calculation formula is as follows:
[0052]
[0053] Where i represents the index of each discrete voltage value, and P and Q represent the distribution of the original dataset and the distribution of the generated dataset, respectively;
[0054] The diversity lift metric is used to assess the difference between the generated dataset and the original dataset. The calculation formula is as follows:
[0055]
[0056] Where N new and N orgin These represent the number of samples that generated the new features and the original number of samples, respectively.
[0057] Secondly, a voltage sag data generation system based on a probability diffusion model is provided, the system comprising the following modules:
[0058] The data preprocessing module is used to preprocess the voltage sag data samples and construct the original dataset;
[0059] The model training module is used to train a probability diffusion model using the original dataset to learn the distribution characteristics of voltage sag data.
[0060] The model sampling module is used to generate voltage sag data using the trained probability diffusion model sampling algorithm.
[0061] The generation and evaluation module is used to merge the generated voltage sag data with the original dataset and evaluate the merged dataset.
[0062] Preferably, the data preprocessing module specifically includes:
[0063] The RMS conversion module is used to convert the instantaneous value of the recorded voltage into an RMS value.
[0064] The sample denoising module is used to denoise voltage sag samples using a one-dimensional median filter;
[0065] The module is used to construct a three-channel representation of a one-dimensional sequence from three-phase voltage sag samples.
[0066] Preferably, the model training module specifically includes:
[0067] The data noise addition module is used to diffuse and add noise to the processed voltage sag data according to the noise level vector to obtain noisy data.
[0068] The noise prediction module is used to input the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result.
[0069] The parameter update module is used to calculate the loss and update the parameters of the conditional noise prediction model using gradient descent.
[0070] The first loop step involves repeating the above steps until the model converges.
[0071] (III) Beneficial Effects
[0072] This invention presents a method and system for generating voltage sag data based on a probability diffusion model. By introducing the probability diffusion model into the task of generating voltage sag time-series data, it can effectively generate synthetic data samples with similar distribution characteristics to the original dataset and a higher degree of diversity. By expanding and enhancing the existing voltage sag dataset, this invention improves the diversity and coverage of the dataset, providing richer training data for tasks such as power quality disturbance tracing, power system risk assessment and prediction based on artificial intelligence. For the voltage sag data generation task, this invention designs two evaluation indicators from the perspectives of the similarity and difference between the generated data samples and the original data samples, respectively, to achieve a reasonable assessment of the quality of the generated data. The method proposed in this invention outperforms GAN-based methods in both evaluation indicators and has higher training stability and reliability. Attached Figure Description
[0073] Figure 1 This is a schematic diagram of the voltage sag data generation method based on the probability diffusion model of the present invention;
[0074] Figure 2 This is a structural diagram of the deep learning model proposed in this invention. Detailed Implementation
[0075] The technical solutions in the embodiments of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0076] Example
[0077] refer to Figure 1-2 An embodiment of the present invention provides a method for generating voltage sag data based on a probability diffusion model, comprising:
[0078] The data preprocessing step involves preprocessing the voltage sag data samples to construct the original dataset;
[0079] The model training steps involve using the original dataset to train a probability diffusion model and learn the distribution characteristics of voltage sag data.
[0080] The model sampling step uses the trained probability diffusion model sampling algorithm to generate voltage sag data.
[0081] The generation and evaluation steps involve merging the generated voltage sag data with the original dataset and evaluating the merged dataset.
[0082] Furthermore, the voltage sag data generation method based on the probability diffusion model is characterized in that the data preprocessing step includes:
[0083] The effective value conversion step converts the instantaneous value of the recorded voltage into an effective value;
[0084] The sample denoising step uses a one-dimensional median filter to denoise the voltage sag samples;
[0085] The construction steps involve constructing a three-channel representation of a one-dimensional sequence from the three-phase voltage sag samples.
[0086] Furthermore, the window size of the one-dimensional median filter is selected as 1 / 200 of the total length of the voltage sag sample sequence to balance the denoising effect and the preservation of signal details.
[0087] Furthermore, the voltage sag data generation method based on the probability diffusion model is characterized in that the model training step includes:
[0088] The data noise addition step involves spreading and adding noise to the processed voltage sag data based on the noise level vector to obtain noisy data.
[0089] The noise prediction step involves inputting the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result.
[0090] The parameter update step involves calculating the loss and updating the parameters of the conditional noise prediction model using gradient descent.
[0091] The first loop step involves repeating the above steps until the model converges.
[0092] Furthermore, the noise level vector is obtained using the continuous noise level method. The steps for obtaining the noise level are as follows:
[0093] Time step t is uniformly and randomly selected from {1,2,…,T};
[0094] Obtain adjacent discrete noise values based on the defined diffusion schedule.
[0095] Randomly select a noise level vector between two discrete noise values.
[0096] Furthermore, the deep learning model includes an input embedding layer, a residual block recurrent layer, and an output projection layer.
[0097] Furthermore, the input embedding layer includes:
[0098] The noisy sample of length L is processed by a one-dimensional convolutional layer. The number of channels is converted from 3 to the number of residual channels C, and SiLu activation is used:
[0099] SiLu(x) = x * Sigmoid(x)
[0100] Here, x represents the input to the neuron.
[0101] Output an embedding vector of shape (B,3,L), where B is the batch size;
[0102] For noise level The noise level embedding vector is calculated using the sine curve coding formula:
[0103]
[0104] Two one-dimensional convolutional layers are used to perform convolution and activation operations on the noise level encoding vector, and the output noise embedding vector has a shape of (B, 512, 1).
[0105] Furthermore, the residual block cyclic layer comprises N residual blocks, wherein each residual block includes:
[0106] The embedded noise level is mapped to the dimension of the number of residual channels C through a fully connected layer;
[0107] The input is convolved using dilated convolutional layers, where the dilation coefficient is a power of 2, to achieve feature extraction of different receptive fields.
[0108] Perform gated linear unit operations:
[0109] y = σ(gate) ⊙ tanh(filter)
[0110] Where σ represents the Sigmoid function, and gate and filter represent the outputs of the dilated convolution. The symbol ⊙ represents the element-wise multiplication operation.
[0111] The output after convolution is split into residual and jump connection parts, both of which have the shape (B,C,L).
[0112] Furthermore, the output projection layer includes:
[0113] Accumulate the jump connection portion of the residual block and divide by Standardize;
[0114] The skip connections are convolutional and activation operations are performed through two one-dimensional convolutional layers, and the output is projected onto the same number of channels as the input. The noise vector of the output has the shape (B,3,L).
[0115] Furthermore, in the voltage sag data generation method based on the probability diffusion model, the model sampling step includes:
[0116] We sample a random noise vector from a Gaussian distribution, denoted as x. t ;
[0117] Noise estimation is performed using the trained and converged deep learning model;
[0118] Inverse data generation is performed based on the estimated noise to obtain the noisy data x from the previous time step. t-1 ;
[0119] Repeat the above steps until x0 is restored.
[0120] Furthermore, the merged dataset is evaluated, specifically including:
[0121] The KL divergence index is used to evaluate whether the generated dataset conforms to the original distribution. The calculation formula is as follows:
[0122]
[0123] Where i represents the index of each discrete voltage value, and P and Q represent the distribution of the original dataset and the distribution of the generated dataset, respectively.
[0124] The diversity lift metric is used to assess the difference between the generated dataset and the original dataset. The calculation formula is as follows:
[0125]
[0126] Where N new and N orgin These represent the number of samples that generated the new features and the original number of samples, respectively.
[0127] This invention introduces a probabilistic diffusion model into the task of generating voltage sag time-series data, effectively generating synthetic data samples with similar distribution characteristics to the original dataset and a higher degree of diversity. By expanding and enhancing existing voltage sag datasets, this invention improves the diversity and coverage of the dataset, providing richer training data for tasks such as AI-based power quality disturbance tracing, power system risk assessment and prediction.
[0128] Another embodiment of the present invention provides a voltage sag data generation system based on a probability diffusion model, the system comprising the following modules:
[0129] The data preprocessing module is used to preprocess the voltage sag data samples and construct the original dataset;
[0130] The model training module is used to train a probability diffusion model using the original dataset to learn the distribution characteristics of voltage sag data.
[0131] The model sampling module is used to generate voltage sag data using the trained probability diffusion model sampling algorithm.
[0132] The generation and evaluation module is used to merge the generated voltage sag data with the original dataset and evaluate the merged dataset.
[0133] Furthermore, the data preprocessing module specifically includes:
[0134] The RMS conversion module is used to convert the instantaneous value of the recorded voltage into an RMS value.
[0135] The sample denoising module is used to denoise voltage sag samples using a one-dimensional median filter;
[0136] The module is used to construct a three-channel representation of a one-dimensional sequence from three-phase voltage sag samples.
[0137] Furthermore, the model training module specifically includes:
[0138] The data noise addition module is used to diffuse and add noise to the processed voltage sag data according to the noise level vector to obtain noisy data.
[0139] The noise prediction module is used to input the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result.
[0140] The parameter update module is used to calculate the loss and update the parameters of the conditional noise prediction model using gradient descent.
[0141] The first loop step involves repeating the above steps until the model converges.
[0142] This invention addresses the task of generating voltage sag data by designing two evaluation indicators based on the similarity and difference in distribution between the generated data samples and the original data samples, thereby achieving a reasonable assessment of the quality of the generated data.
[0143] The method proposed in this invention outperforms GAN-based methods in both evaluation metrics and has higher training stability and reliability.
[0144] The embodiments of this application can be provided as methods or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented in various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0145] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0146] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0147] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
Claims
1. A method for generating voltage sag data based on a probability diffusion model, characterized in that, The method includes the following steps: The data preprocessing step involves preprocessing the voltage sag data samples to construct the original dataset; The model training steps involve using the original dataset to train a probability diffusion model and learn the distribution characteristics of voltage sag data. The model sampling step uses the trained probability diffusion model sampling algorithm to generate voltage sag data. The generation and evaluation steps involve merging the generated voltage sag data with the original dataset and evaluating the merged dataset. The model training steps specifically include: The data noise addition step involves spreading and adding noise to the processed voltage sag data based on the noise level vector to obtain noisy data. The noise prediction step involves inputting the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result. The parameter update step involves calculating the loss and updating the parameters of the conditional noise prediction model using gradient descent. The first loop step involves repeating the above steps until the model converges. The deep learning model includes an input embedding layer, a residual block recurrent layer, and an output projection layer; The input embedding layer includes: A one-dimensional convolutional layer is used to process the length of... L Noisy samples The number of channels is converted from 3 to the number of residual channels. C And activated using SiLu: in, x This represents the input to the neuron; For noise level The noise level embedding vector is calculated using the sine curve coding formula: Two one-dimensional convolutional layers are used to perform convolution and activation operations on the noise level encoding vector; The residual block recycle layer includes N Each residual block comprises: The embedded noise level is mapped to the number of residual channels using a fully connected layer. C The dimension; The input is convolved using dilated convolutional layers, where the dilation coefficient is a power of 2, to achieve feature extraction of different receptive fields. Perform gated linear unit operations: in The symbol represents the Sigmoid function, and gate and filter represent the outputs of the dilated convolution, respectively; the symbol ⊙ represents the element-wise multiplication operation. The output after convolution is split into residual and skip connection parts; The output projection layer includes: Accumulate the jump connection portion of the residual block and divide by Standardize; The skip connections are convolutional and activation operations are performed using two one-dimensional convolutional layers, and the output is projected onto the same number of channels as the input.
2. The voltage sag data generation method based on the probability diffusion model according to claim 1, characterized in that, The data preprocessing steps specifically include: The effective value conversion step converts the instantaneous value of the recorded voltage into an effective value; The sample denoising step uses a one-dimensional median filter to denoise the voltage sag samples; The construction steps involve constructing a three-channel representation of a one-dimensional sequence from the three-phase voltage sag samples.
3. The voltage sag data generation method based on the probability diffusion model according to claim 2, characterized in that, The noise level vector is obtained using the continuous noise level method. The steps for obtaining the noise level vector are as follows: In {1,2,…, T Uniformly and randomly select time steps in} t ; Obtain adjacent discrete noise values based on the defined diffusion schedule. ; Randomly select a noise level vector between two discrete noise values. .
4. The voltage sag data generation method based on the probability diffusion model according to claim 1, characterized in that, The model sampling step includes: A random noise vector is sampled from a Gaussian distribution, denoted as . ; Noise estimation is performed using the trained and converged deep learning model; Inverse data generation is performed based on the estimated noise to obtain the noisy data from the previous time step. ; Repeat the above steps until restored. .
5. The voltage sag data generation method based on the probability diffusion model according to claim 1, characterized in that, The merged dataset is evaluated, specifically including: The KL divergence index is used to evaluate whether the generated dataset conforms to the original distribution. The calculation formula is as follows: in i An index representing each discrete voltage value. P and Q These represent the distribution of the original dataset and the distribution of the generated dataset, respectively. The diversity lift metric is used to assess the difference between the generated dataset and the original dataset. The calculation formula is as follows: in N new and N orgin These represent the number of samples that generated the new features and the original number of samples, respectively.
6. A voltage sag data generation system based on a probability diffusion model, characterized in that, The system is used to implement the voltage sag data generation method based on the probability diffusion model as described in claim 1, and the system includes the following modules: The data preprocessing module is used to preprocess the voltage sag data samples and construct the original dataset; The model training module is used to train a probability diffusion model using the original dataset to learn the distribution characteristics of voltage sag data. The model sampling module is used to generate voltage sag data using the trained probability diffusion model sampling algorithm. The generation and evaluation module is used to merge the generated voltage sag data with the original dataset and evaluate the merged dataset.
7. The voltage sag data generation system based on the probability diffusion model according to claim 6, characterized in that, The data preprocessing module specifically includes: The RMS conversion module is used to convert the instantaneous value of the recorded voltage into an RMS value. The sample denoising module is used to denoise voltage sag samples using a one-dimensional median filter; The module is used to construct a three-channel representation of a one-dimensional sequence from three-phase voltage sag samples.
8. The voltage sag data generation system based on the probability diffusion model according to claim 7, characterized in that, The model training module specifically includes: The data noise addition module is used to diffuse and add noise to the processed voltage sag data according to the noise level vector to obtain noisy data. The noise prediction module is used to input the noisy data and the noise level vector into the noise prediction deep learning model, and the deep learning model outputs the noise prediction result. The parameter update module is used to calculate the loss and update the parameters of the conditional noise prediction model using gradient descent. The first loop step involves repeating the above steps until the model converges.
Citation Information
Patent Citations
Power distribution network voltage sag classification method, device and equipment based on deep learning
CN116127370A
Voltage sag data enhancement method based on diffusion probability model
CN116361656A