Electric power data expansion method and device, computer readable storage medium and electronic equipment
By performing multi-level K-means clustering of power system operation data and building a Wasserstein generative adversarial network, adding node voltage overlimit penalties, the problem that generated data cannot achieve trend convergence in small-scale sample scenarios is solved, and the distribution similarity of generated data and trend convergence ability are improved.
Patent Information
- Application Number
- CN202510163165.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-05-23
AI Technical Summary
In small-scale sample scenarios, it is difficult for the prior art to generate data similar to the operating data distribution of the power system, and the generated data cannot achieve trend convergence and cannot be used for actual work.
By performing multi-level K-means clustering of power system operation data, a Wasserstein generative adversarial network based on deep convolutional neural network is constructed, and a node voltage overlimit penalty is added to the generator's loss function, and the model is trained to generate data that meets the node voltage constraints.
It realizes the improvement of its current convergence ability while ensuring the similarity of generated data distribution, and overcomes the problems of insufficient performance of traditional methods in small-scale data scenarios and neglecting trend convergence ability.
Smart Images

Figure CN120030377A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power data generation, and in particular to a power data expansion method, device and storage medium. Background Art
[0002] The acquisition of power system operation data has always been an important basis for ensuring the safe operation of power systems. In actual operation, the dispatch and operation of power systems rely on a large amount of operation data, and the rise of data-driven methods in power system analysis has also increased the demand in this regard. Therefore, it is crucial to improve the quantity and quality of power system operation data. Nowadays, power systems are becoming more and more complex, and the data generated by each link show the significant characteristics of small scale and multiple features. Traditional data expansion methods are difficult to capture all of their distribution characteristics with small-scale data, and the generated data is quite different from the real data. At the same time, the operation data of the power system is different from the conventional operation data. The operation data of the power system not only has the time series variation characteristics of conventional operation data, but also has a variety of constraints within the data. It is precisely because of the existence of these constraints that the operation data of the power system can achieve power flow convergence through multiple iterations when used for power flow calculation. Traditional data-driven power system operation data generation methods often only focus on the similarity of data distribution, but ignore the constraints within the data, resulting in the inability of the generated data to achieve power flow convergence, so that it cannot be used in actual work.
[0003] It can be seen that how to generate data with similar distribution to the original power system operation data in the scenario of small-scale samples, and how to ensure the distribution similarity between the generated data and the original power system operation data while having the ability of power flow convergence is a challenging problem. Summary of the invention
[0004] The technical problem to be solved by the present invention is: to overcome the shortcomings of the prior art, to provide a power data expansion method, device, computer-readable storage medium and electronic device, to realize multi-level clustering of power system operation data, and to construct a generative adversarial network for each cluster that introduces node voltage over-limit penalty, so as to constrain the generated data to meet the node voltage constraint, thereby improving the power flow convergence ability of the generated data while ensuring the similarity of the generated data distribution.
[0005] The technical solution adopted by the present invention to solve the technical problem is: the power data expansion method is characterized by comprising the following steps: Collect power system operation data and construct them into an initial sample set; Based on the K-means algorithm, the initial sample set is clustered at multiple levels to obtain multiple clusters; A Wasserstein generative adversarial network based on a deep convolutional neural network is constructed for each cluster. A node voltage over-limit penalty is added to the loss function of the generator in the Wasserstein generative adversarial network. The Wasserstein generative adversarial network is trained until the training round is completed. The generator parameters of each training round are saved at the end of each training round. The generator is allowed to generate data using the generator parameters saved in each training round. The FID is used to measure the distribution similarity between the generated data and the real data to obtain the corresponding FID value. The FID values of the data generated in each training round are compared, and the generator corresponding to the group with the lowest value is selected as the final generator of the cluster. The final generator corresponding to each cluster is responsible for generating row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of the real data to achieve data expansion.
[0006] Furthermore, the initial sample set is subjected to multi-level clustering based on the K-means algorithm to obtain multiple clusters, specifically, the following steps are sequentially executed for at least one cycle until each of the remaining clusters cannot be further divided: Based on the K-means algorithm, clustering operations are performed on all row data of each sample to find the optimal clustering number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value suitable for the entire data set; The final K value is used as the key parameter K in the K-means algorithm, and clustering operations are performed on each sample; the number of clusters corresponding to each row in all samples is counted, and the cluster with the most occurrences in each row is found, and it is determined as the final cluster to which the row belongs; all data points in each cluster are reconstructed into a new sample set.
[0007] Furthermore, a Wasserstein generative adversarial network based on a deep convolutional neural network is constructed for each cluster, and a node voltage over-limit penalty is added to the generator loss function. The model is trained until the specified training rounds are completed, specifically: Execute the following steps in sequence for at least one cycle until the specified training rounds are completed: For each new sample set constructed from each cluster, the generator of GAN is constructed using a fully connected layer, a flattened layer, a reverse convolutional layer, and a batch normalization layer, and the discriminator of GAN is constructed using a fully connected layer, a flattened layer, a convolutional layer, and a pooling layer; After random noise is input into the generator, the generator outputs generated data with the same shape as the real data; after the generated data and the real data are input into the discriminator respectively, the discriminator outputs a value as the score of the generated data and the real data respectively; Wasserstein-1 distance is used as the loss function of the generator and discriminator, and a node voltage out-of-limit penalty is additionally added to the generator's loss function. The Adam optimizer is used to update the generator and discriminator parameters.
[0008] Furthermore, The final K value is expressed as follows: ; ; ; in, is the final K value, is a function that counts the frequency of the optimal K value. is the Kronecker function, It is a sample The optimal number of clusters, N is the number of samples.
[0009] Furthermore, Using the Silhouette Coefficient method to find samples The optimal number of clusters , The expression is as follows: ; ; ; ; ; ; ; in, is the clustering result of all samples. Perform K-means clustering to obtain: is the total number of clusters specified by the K-means algorithm, For the cluster number The The set of data points in a cluster, a(x) is the sample From the data point x to its cluster , d(x,y) is the Euclidean distance, and b(x) is the sample Data point x to other clusters The minimum average distance, s(x) is the silhouette coefficient of data point x, It is a sample the number of rows, The entire sample The average value of the silhouette coefficient when the number of clusters is K, It is a sample The optimal number of clusters is obtained by traversing a series of K values. The largest K is obtained.
[0010] Furthermore, it is characterized in that: The expression of the new sample set is as follows: ; ; ; ; ; ; ; in, It is to include A collection of clusters, through the sample K-means algorithm clustering is performed to obtain It is a sample The nth cluster of It is a sample The last cluster of is the final K value, is the number of rows in all samples The maximum value of represents the jth row of the ith sample, is an indicator function used to indicate Is it a cluster? , For statistical The sample The row data belongs to The number of clusters, Used to store the cluster number to which each sample and each row finally belongs. It is the newly constructed A sample set, including all samples that are finally divided into clusters The row data is , and N is the number of samples.
[0011] Furthermore, The loss function expressions of the discriminator and generator are as follows: ; ; in, is the loss function of the discriminator, is the loss function of the generator, is the i-th real data, It is generated data, and the output scores of the discriminator for the real data and the generated data are and , N is the number of samples, It is the penalty for node voltage exceeding the limit.
[0012] Furthermore, the node voltage over-limit penalty is specifically: a penalty is imposed on the generator's loss function by the number of voltage over-limit nodes in the generated data, constraining the generator to tend to generate generated data without voltage over-limit nodes, where: The expression of node voltage over-limit penalty is: ; ; in, is the node voltage over-limit penalty, is the node voltage over-limit penalty coefficient Represents a node The actual voltage value, Represents a node The voltage lower limit, Represents a node The upper voltage limit, Represents a node Indicator function for whether the limit is exceeded.
[0013] A device for implementing a power data expansion method, characterized in that it includes: A data collection module is used to collect power system operation data and construct it into an initial sample set; A clustering processing module, whose input end is connected to the data collection module, is used to perform multi-level clustering on the initial sample set based on the K-means algorithm to obtain multiple clusters; An adversarial network generation module, whose input end is connected to the output end of the cluster processing module, is used to construct a Wasserstein generation adversarial network based on a deep convolutional neural network for each cluster, add a node voltage limit penalty to the loss function of the generator in the Wasserstein generation adversarial network, train the Wasserstein generation adversarial network until the training round is completed, and save the generator parameters of each training round at the end of the training round; The generator construction module, whose input end is connected to the output end of the adversarial network generation module, is used to use the generator parameters saved in each training round to let the generator generate data, use FID to measure the distribution similarity between the generated data and the real data, obtain the corresponding FID value, compare the FID values of the data generated by each training round, and select the generator corresponding to the group with the lowest value as the final generator of the cluster; The data expansion module has its input end connected to the generator construction module, and the final generator corresponding to each cluster is responsible for generating the row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of the real data to achieve data expansion.
[0014] Furthermore, the clustering processing module includes: The final value determination unit is used to perform clustering operations on all row data of each sample based on the K-means algorithm, respectively find the optimal clustering number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value applicable to the entire data set; The clustering operation realization unit has its input end connected to the output end of the final value determination unit, and is used to use the final K value as the key parameter K in the K-means algorithm to perform clustering operations on each sample; count the number of clusters corresponding to each row in all samples, find the cluster with the largest number of occurrences in each row, and determine it as the final cluster to which the row belongs; reconstruct all data points in each cluster into a new sample set.
[0015] Furthermore, the adversarial network generation module includes: The generator construction unit is used to construct the GAN generator using a fully connected layer, a flattened layer, a reverse convolution layer, and a batch normalization layer for each new sample set constructed from each cluster. The discriminator generation unit is used to build the discriminator of GAN through fully connected layers, flattening layers, convolutional layers and pooling layers; Generator, which is used to convert the input random noise into generated data with the same shape as the real data; The discriminator has an input end connected to the output end of the generator, and is used to output a value as a score for the generated data and the real data respectively through the input generated data and the real data; The parameter updating unit is used to use the Wasserstein-1 distance as the loss function of the generator and the discriminator, and to add an additional penalty for node voltage exceeding the limit to the loss function of the generator, and to use the Adam optimizer to update the parameters of the generator and the discriminator.
[0016] A computer-readable storage medium stores computer instructions, which are used to implement a power data expansion method when executed by a processor.
[0017] An electronic device, characterized in that it includes a processor and a computer-readable storage medium connected to the processor; wherein the computer-readable storage medium stores instructions that can be executed by the processor, and the instructions are executed by the processor so that the processor can execute a power data expansion method.
[0018] Compared with the prior art, the present invention has the following beneficial effects: The power data expansion method proposed in the present invention performs a multi-level K-means algorithm on real data and its clustering to cluster data points with similar distribution into the same cluster, thereby reducing the feature complexity of each generative adversarial network input data and improving the distribution similarity between the generated data and the real data. In addition, by introducing a node voltage over-limit penalty to constrain the generated data to meet the node voltage constraint, the power flow convergence ability of the generated data is improved while ensuring the distribution similarity of the generated data.
[0019] The power data expansion method proposed in the present invention not only overcomes the shortcomings of the traditional power data expansion method in the small-scale data scenario, but also solves the limitation of only focusing on the similarity of numerical distribution and ignoring the power flow convergence ability. It has significant application prospects in the operation and scheduling of power systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 Flowchart of the power data augmentation method.
[0021] Figure 2 This is a graph showing how the loss of the generator in the GAN corresponding to a cluster changes with the number of cycles after multi-level clustering using the K-means algorithm.
[0022] Figure 3 This is a curve chart showing the change in the FID of the data generated by the generator in the GAN corresponding to a cluster after multi-level clustering by the K-means algorithm as the number of cycles increases.
[0023] Figure 4 This is a bar chart comparing the FID value of each cluster after multi-level clustering using the K-means algorithm with the FID value of random clustering. DETAILED DESCRIPTION
[0024] Figures 1 to 4 The best embodiment of the present invention is shown below in conjunction with the attached Figures 1 to 4 The present invention is further described.
[0025] The technical solutions 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, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0026] like Figure 1 As shown, a method for expanding power data includes the following steps: Step S1, collecting power system operation data and constructing it into an initial sample set; The simulation verification work was carried out using the QS file provided by a provincial electric power research institute in China. The experiment focused on generating the active and reactive output data of the generator nodes common to all QS files, and constructed it into a first dimension of the number of samples, a second dimension of the number of rows contained in each sample, and a third dimension of the number of columns contained in each sample.
[0027] Step S2, performing multi-level clustering on the initial sample set based on the K-means algorithm to obtain multiple clusters; Based on the K-means algorithm, the initial sample set is clustered into multiple clusters, and each cluster is clustered again until the remaining clusters cannot be divided any further.
[0028] Step S2 includes the following steps: Step S2-1, based on the K-means algorithm, cluster all the row data of each sample, find the optimal clustering number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value suitable for the entire data set.
[0029] For a single sample , use the silhouette coefficient method to find the optimal number of clusters The expression is as follows: ; ; ; ; ; ; ; in, is the clustering result of all samples. Perform K-means clustering to obtain: is the total number of clusters specified by the K-means algorithm, For the cluster number The The set of data points in a cluster, a(x) is the sample From the data point x to its cluster , d(x,y) is the Euclidean distance, and b(x) is the sample Data point x to other clusters The minimum average distance, s(x) is the silhouette coefficient of data point x, It is a sample the number of rows, The entire sample The average value of the silhouette coefficient when the number of clusters is K, It is a sample The optimal number of clusters is obtained by traversing a series of K values. The largest K is obtained.
[0030] Specifically, the expression of the final K value obtained through sample frequency statistics is as follows: ; ; ; in, is the final K value, is a function that counts the frequency of the optimal K value. is the Kronecker function, It is a sample The optimal number of clusters, N is the number of samples.
[0031] Step S2-2, use the final K value as the key parameter K in the K-means algorithm, and perform clustering operations on each sample. Count the number of clusters corresponding to each row in all samples, find the cluster with the most occurrences in each row, and determine it as the final cluster for the row. Reconstruct all data points in each cluster into a new sample set.
[0032] The expression for constructing a new sample set through row data frequency statistics is as follows: ; ; ; ; ; ; ; in, It is to include A collection of clusters, through the sample K-means algorithm clustering is performed to obtain It is a sample The nth cluster of It is a sample The last cluster of is the final K value, is the number of rows in all samples The maximum value of represents the jth row of the ith sample, is an indicator function used to indicate Is it a cluster? , For statistical The sample The row data belongs to The number of clusters, Used to store the cluster number to which each sample and each row finally belongs. It is the newly constructed A sample set, including all samples that are finally divided into clusters The row data is , and N is the number of samples.
[0033] Step S2-3, repeating steps S2-1 and S2-2 for each new sample set constructed from each cluster until each remaining cluster cannot be divided any further.
[0034] Step S3, constructing a Wasserstein generative adversarial network based on a deep convolutional neural network for each cluster, adding a node voltage over-limit penalty to the loss function of the generator in the Wasserstein generative adversarial network, training the Wasserstein generative adversarial network until the training round is completed, and saving the generator parameters of each training round at the end of the training round; Step S3 includes the following steps: Step S3-1, for each new sample set constructed from each cluster, a fully connected layer, a flattened layer, a reverse convolutional layer, and a batch normalization layer are used to construct the GAN generator, and a fully connected layer, a flattened layer, a convolutional layer, and a pooling layer are used to construct the GAN discriminator.
[0035] Step S-2, random noise enters the generator, is first mapped to a high-dimensional feature space by a fully connected layer, then processed by a flattening layer, reshaped into a new shape, and sent to the inverted convolution layer and batch normalization layer to extract features. After the flattening layer operation again, the generated data with the same shape as the real data is finally output. After the generated data and the real data enter the discriminator respectively, they are first mapped to a high-dimensional feature space by a fully connected layer, then processed by a flattening layer, reshaped into a new shape, and sent to the convolution layer and pooling layer to extract features. After the flattening layer operation again, a value is finally output as the score of the input data.
[0036] In step S-3, Wasserstein-1 (W-1) distance is used as the loss function of the generator and the discriminator, and a node voltage out-of-limit penalty is additionally added to the generator's loss function. The Adam optimizer is used to update the generator and discriminator parameters.
[0037] The loss function expressions of the discriminator and generator are as follows: ; ; in, is the loss function of the discriminator, is the loss function of the generator, is the i-th real data, It is generated data, and the output scores of the discriminator for the real data and the generated data are and , N is the number of samples, It is the penalty for node voltage exceeding the limit.
[0038] The node voltage over-limit penalty is specifically: by controlling the number of voltage over-limit nodes in the generated data, a penalty is imposed on the generator's loss function, and the generator is constrained to tend to generate generated data without voltage over-limit nodes. The expression is: ; ; in, is the node voltage over-limit penalty, is the node voltage over-limit penalty coefficient Represents a node The actual voltage value, Represents a node The voltage lower limit, Represents a node The upper voltage limit, Represents a node Indicator function for whether the limit is exceeded.
[0039] Step S3-3, repeat steps S3-1 and S3-2, save the parameters of the generator at the end of each round of training, until the specified training rounds are completed. During the training, the generator and the discriminator update the parameters according to the gradient provided by each other, and continue to perform adversarial optimization, so that the discriminator can better distinguish between real data and generated data, and make the data generated by the generator easier to "cheat" the discriminator to approach the real data distribution.
[0040] Step S4, use the generator parameters saved in each training round to let the generator generate data, use FID to measure the distribution similarity between the generated data and the real data, get the corresponding FID value, compare the FID values of the data generated by each training round, and select the generator corresponding to the group with the lowest value as the final generator of the cluster.
[0041] FID is an indicator that measures the difference between the data distribution generated by the generative model and the real data distribution. The lower the FID value, the closer the distribution of the generated data is to the real data.
[0042] Step S5, the final generator corresponding to each cluster is responsible for generating row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of real data to achieve data expansion.
[0043] The above-mentioned power data expansion method is implemented by the following power data device, including: A data collection module is used to collect power system operation data and construct it into an initial sample set; A clustering processing module, whose input end is connected to the data collection module, is used to perform multi-level clustering on the initial sample set based on the K-means algorithm to obtain multiple clusters; Furthermore, the cluster processing module includes a final value determination unit, which is used to perform clustering operations on all row data of each sample based on the K-means algorithm, respectively find the optimal cluster number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value applicable to the entire data set; The clustering operation realization unit has its input end connected to the output end of the final value determination unit, and is used to use the final K value as the key parameter K in the K-means algorithm to perform clustering operations on each sample; count the number of clusters corresponding to each row in all samples, find the cluster with the largest number of occurrences in each row, and determine it as the final cluster to which the row belongs; reconstruct all data points in each cluster into a new sample set.
[0044] An adversarial network generation module, whose input end is connected to the output end of the cluster processing module, is used to construct a Wasserstein generation adversarial network based on a deep convolutional neural network for each cluster, add a node voltage limit penalty to the loss function of the generator in the Wasserstein generation adversarial network, train the Wasserstein generation adversarial network until the training round is completed, and save the generator parameters of each training round at the end of the training round; Furthermore, the adversarial network generation module includes: The generator construction unit is used to construct the GAN generator using a fully connected layer, a flattened layer, a reverse convolution layer, and a batch normalization layer for each new sample set constructed from each cluster. The discriminator generation unit is used to build the discriminator of GAN through fully connected layers, flattening layers, convolutional layers and pooling layers; Generator, which is used to convert the input random noise into generated data with the same shape as the real data; The discriminator has an input end connected to the output end of the generator, and is used to output a value as a score for the generated data and the real data respectively through the input generated data and the real data; The parameter updating unit is used to use the Wasserstein-1 distance as the loss function of the generator and the discriminator, and to add an additional penalty for node voltage exceeding the limit to the loss function of the generator, and to use the Adam optimizer to update the parameters of the generator and the discriminator.
[0045] The generator construction module, whose input end is connected to the output end of the adversarial network generation module, is used to use the generator parameters saved in each training round to let the generator generate data, use FID to measure the distribution similarity between the generated data and the real data, obtain the corresponding FID value, compare the FID values of the data generated by each training round, and select the generator corresponding to the group with the lowest value as the final generator of the cluster; The data expansion module has its input end connected to the generator construction module, and the final generator corresponding to each cluster is responsible for generating the row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of the real data to achieve data expansion.
[0046] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products and electronic devices. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0047] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0048] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0049] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0050] The electronic device includes a processor, such as a computer. The above-mentioned computer-readable storage medium is connected to the processor, and the computer-readable storage medium stores instructions that can be executed by the processor. The instructions are executed by the processor so that the processor can execute the above-mentioned power data expansion method.
[0051] In order to make the content and actual effect of the present invention clearer and more intuitive, the original data is replaced by the generated data. Subsequently, with the help of PSDEdit, a professional power flow calculation software developed by the China Electric Power Research Institute, power flow analysis is carried out one by one for the 100 QS files that have completed data replacement, and the power flow convergence results of these replaced files are accurately counted to evaluate the effectiveness and reliability of the generated data in actual power flow scenario applications.
[0052] Figure 2The curve of the generator loss in the GAN corresponding to a cluster after multi-level clustering by the K-means algorithm is shown as the number of cycles changes. In the early stage of training, the generator loss is at a high level, with a value exceeding 0.6 and a large amplitude. This is because the generator has not yet mastered the method of generating data that can deceive the discriminator and is in the exploration and adaptation stage. As the training progresses, the amplitude of the generator loss shows a trend of repeated fluctuations, which shows that the generator is constantly adjusting its generation strategy, through continuous trial and error and optimization, in order to better "cheat" the discriminator. Figure 2 It can also be observed that when the number of cycles is between 8000 and 10000, the fluctuation range of the generator loss curve is the smallest, which indicates that the generator and the discriminator have reached a relatively ideal "Nash equilibrium" in this range, and the performance of the generator is the best in this range. Figure 2 The situation presented is similar.
[0053] Figure 3 The curve of the FID of the data generated by the generator in the GAN corresponding to a cluster after multi-level clustering by the K-means algorithm is shown as the number of cycles. It can be seen that in the early stage of training, the FID value is very high, close to 250, indicating that the quality of the data generated by the generator is poor and the distribution is quite different from the real data. At this time, the generator has not learned how to generate data similar to the real data. As the training progresses, the FID value shows a fluctuating downward trend, which shows that the generator is constantly learning and adjusting, and gradually generates data that is more similar to the distribution of the real data. Between about 2000 and 4000 cycles, there are some large fluctuations in the FID value. This is because the generator is trying different generation strategies at this stage, resulting in unstable quality of generated data. From 4000 cycles onwards, the fluctuation range of the FID value gradually decreases, and the overall downward trend shows that the generator has gradually found a more effective generation strategy and the quality of the generated data is constantly improving. Between about 8000 and 10000 cycles, the FID value drops to a low level and remains stable, indicating that the performance of the generator is best in this range and the generated data is most similar to the real data. The FID change trend of the data generated by the generator in the GAN corresponding to other clusters is Figure 3 The situation presented is similar.
[0054] Figure 4 A bar chart showing the FID value of each cluster after multi-level clustering using the K-means algorithm and the FID value of random clustering. Figure 4 In , KM-GAN is based on the K-means algorithm for multi-level clustering, while R-GAN uses random clustering. The number of clusters is the same for both, and the number of rows in each cluster is also consistent, and the GAN structure used in each cluster is the same. Figure 4 On the x-axis, the label of each coordinate point contains both the cluster number and the number of rows contained in the cluster. Figure 4 It can be seen that a total of 155 rows of data are divided into 16 clusters, of which 14 clusters show that the FID value of KM-GAN is lower than that of R-GAN. This is because after multi-level clustering by the K-means algorithm, the numerical distribution of each row of data in each cluster of KM-GAN is relatively similar, while the numerical difference between each row of data in each cluster of R-GAN is large, making it more difficult for GAN to learn its distribution characteristics. This phenomenon is more obvious in clusters with more rows, such as clusters 2-7, 4-8, 11-7, and 16-101. The FID values of KM-GAN and R-GAN in these clusters are very different. In addition, there are 2 clusters where the FID value of KM-GAN is higher than that of R-GAN, but the gap between the two is not obvious. This is because the number of rows covered by these two clusters is small, and the distribution characteristics of the data are relatively limited, making the generation effect of R-GAN slightly better in this cluster. In general, when faced with data of the same size, GANs that have undergone multi-level clustering using the K-means algorithm have significantly stronger feature learning and data generation capabilities than random clustering.
[0055] As shown in Table 1: Table 1 Comparison of FID values and power flow convergence rates of data generated by different GANs
[0056] As shown in Table 1, for GANs without adding node voltage constraints (nc), the FID value of the data generated by KM-GAN after multi-level clustering by the K-means algorithm is significantly lower than the FID value of the data generated by GAN, where the FID value of the data generated by KM-GAN is calculated by reorganizing and splicing all the data generated by clustering and calculating the complete real data. As shown in Table 1, after multi-level clustering by the K-means algorithm, the FID value of the data generated by KM-GAN is significantly reduced from the original 40.84 to 21.35 compared with GAN, with a reduction of up to 47.7%. This fully demonstrates that for data of the same scale, KM-GAN has stronger distribution feature learning and generation capabilities, and can more accurately generate samples that are close to the distribution of real samples when processing small-scale samples. For GANs with the same network structure, after adding node voltage constraints (nc), although the performance of the models in the FID index has slightly declined, the performance in the power flow convergence rate has been significantly improved. As shown in Table 1, after adding node voltage constraints to GAN, the power flow convergence rate jumped from the original 20% to 99%, an increase of 395%. This means that GAN with node voltage constraints can generate data with stronger power flow convergence ability and has higher practical value.
[0057] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0058] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for expanding power data, characterized in that: The steps include: Collect power system operation data and construct them into an initial sample set; Based on the K-means algorithm, the initial sample set is clustered at multiple levels to obtain multiple clusters; A Wasserstein generative adversarial network based on a deep convolutional neural network is constructed for each cluster. A node voltage over-limit penalty is added to the loss function of the generator of the Wasserstein generative adversarial network. The Wasserstein generative adversarial network is trained until the training round is completed. The generator parameters of each training round are saved at the end of each training round. Use the generator parameters saved in each training round to let the generator generate data, use FID to measure the distribution similarity between the generated data and the real data, get the corresponding FID value, compare the FID values of the data generated by each training round, and select the generator corresponding to the group with the lowest value as the final generator of the cluster; The final generator corresponding to each cluster is responsible for generating row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of the real data to achieve data expansion.
2. The power data expansion method according to claim 1, characterized in that: Based on the K-means algorithm, the initial sample set is clustered at multiple levels to obtain multiple clusters. Specifically, the following steps are executed sequentially for at least one cycle until each of the remaining clusters cannot be divided any further: Based on the K-means algorithm, clustering operations are performed on all row data of each sample to find the optimal clustering number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value suitable for the entire data set; The final K value is used as the key parameter K in the K-means algorithm, and clustering operations are performed on each sample; the number of clusters corresponding to each row in all samples is counted, and the cluster with the most occurrences in each row is found, and it is determined as the final cluster to which the row belongs; all data points in each cluster are reconstructed into a new sample set.
3. The power data expansion method according to claim 1, characterized in that: A Wasserstein generative adversarial network based on a deep convolutional neural network is constructed for each cluster. The node voltage limit penalty is added to the generator loss function, and the model is trained until the specified training rounds are completed. Specifically: Execute the following steps in sequence for at least one cycle until the specified training rounds are completed: For each new sample set constructed from each cluster, the generator of GAN is constructed using a fully connected layer, a flattened layer, a reverse convolutional layer, and a batch normalization layer, and the discriminator of GAN is constructed using a fully connected layer, a flattened layer, a convolutional layer, and a pooling layer; After random noise is input into the generator, the generator outputs generated data with the same shape as the real data; after the generated data and the real data are input into the discriminator respectively, the discriminator outputs a value as the score of the generated data and the real data respectively; Wasserstein-1 distance is used as the loss function of the generator and discriminator, and a node voltage out-of-limit penalty is additionally added to the generator's loss function. The Adam optimizer is used to update the generator and discriminator parameters.
4. The power data expansion method according to claim 2, characterized in that: The final K value is expressed as follows: ; ; ; in, is the final K value, is a function that counts the frequency of the optimal K value. is the Kronecker function, It is a sample The optimal number of clusters, N is the number of samples.
5. The power data expansion method according to claim 4, characterized in that: Using the Silhouette Coefficient method to find samples The optimal number of clusters , The expression is as follows: ; ; ; ; ; ; ; in, is the clustering result of all samples. Perform K-means clustering to obtain: is the total number of clusters specified by the K-means algorithm, For the cluster number The The set of data points in a cluster, a(x) is the sample From the data point x to its cluster , d(x,y) is the Euclidean distance, and b(x) is the sample Data point x to other clusters The minimum average distance, s(x) is the silhouette coefficient of data point x, It is a sample the number of rows, The entire sample The average value of the silhouette coefficient when the number of clusters is K, It is a sample The optimal number of clusters is obtained by traversing a series of K values. The largest K is obtained.
6. The power data expansion method according to claim 2, characterized in that: The expression of the new sample set is as follows: ; ; ; ; ; ; ; in, It is to include A collection of clusters, through the sample K-means algorithm clustering is performed to obtain It is a sample The nth cluster of It is a sample The last cluster of is the final K value, is the number of rows in all samples The maximum value of represents the jth row of the ith sample, is an indicator function used to indicate Is it a cluster? , For statistical The sample The row data belongs to The number of clusters, Used to store the cluster number to which each sample and each row finally belongs. It is the newly constructed A sample set, including all samples that are finally divided into clusters The row data is , and N is the number of samples.
7. The power data expansion method according to claim 3, characterized in that: The loss function expressions of the discriminator and generator are as follows: ; ; in, is the loss function of the discriminator, is the loss function of the generator, is the i-th real data, It is generated data, and the output scores of the discriminator for the real data and the generated data are and , N is the number of samples, It is the penalty for node voltage exceeding the limit.
8. The power data expansion method according to claim 3, characterized in that: The node voltage over-limit penalty is as follows: the number of voltage over-limit nodes in the generated data is used to impose a penalty on the generator's loss function, so that the generator is constrained to generate data that does not contain voltage over-limit nodes. The expression of the node voltage over-limit penalty is: ; ; in, is the node voltage over-limit penalty, is the node voltage over-limit penalty coefficient Represents a node The actual voltage value, Represents a node The voltage lower limit, Represents a node The upper voltage limit, Represents a node Indicator function for whether the limit is exceeded.
9. A device for implementing the power data expansion method according to any one of claims 1 to 8, characterized in that: include: A data collection module is used to collect power system operation data and construct it into an initial sample set; A clustering processing module, whose input end is connected to the data collection module, is used to perform multi-level clustering on the initial sample set based on the K-means algorithm to obtain multiple clusters; An adversarial network generation module, whose input end is connected to the output end of the cluster processing module, is used to construct a Wasserstein generation adversarial network based on a deep convolutional neural network for each cluster, add a node voltage limit penalty to the loss function of the generator in the Wasserstein generation adversarial network, train the Wasserstein generation adversarial network until the training round is completed, and save the generator parameters of each training round at the end of the training round; The generator construction module, whose input end is connected to the output end of the adversarial network generation module, is used to use the generator parameters saved in each training round to let the generator generate data, use FID to measure the distribution similarity between the generated data and the real data, obtain the corresponding FID value, compare the FID values of the data generated by each training round, and select the generator corresponding to the group with the lowest value as the final generator of the cluster; The data expansion module has its input end connected to the generator construction module, and the final generator corresponding to each cluster is responsible for generating the row data of the corresponding cluster; the row data generated by each cluster is reintegrated and spliced according to the arrangement of the real data to achieve data expansion.
10. The device according to claim 9, characterized in that: Cluster processing module, including: The final value determination unit is used to perform clustering operations on all row data of each sample based on the K-means algorithm, respectively find the optimal clustering number K value, count the frequency of occurrence of the optimal K value corresponding to each sample, select the optimal K value with the highest frequency, and determine it as the final K value applicable to the entire data set; The clustering operation realization unit has its input end connected to the output end of the final value determination unit, and is used to use the final K value as the key parameter K in the K-means algorithm to perform clustering operations on each sample; count the number of clusters corresponding to each row in all samples, find the cluster with the largest number of occurrences in each row, and determine it as the final cluster to which the row belongs; reconstruct all data points in each cluster into a new sample set.
11. The device according to claim 9, characterized in that: Adversarial network generation module, including: The generator construction unit is used to construct the GAN generator using a fully connected layer, a flattened layer, a reverse convolution layer, and a batch normalization layer for each new sample set constructed from each cluster. The discriminator generation unit is used to build the discriminator of GAN through fully connected layers, flattening layers, convolutional layers and pooling layers; Generator, which is used to convert the input random noise into generated data with the same shape as the real data; The discriminator has an input end connected to the output end of the generator, and is used to output a value as a score for the generated data and the real data respectively through the input generated data and the real data; The parameter updating unit is used to use the Wasserstein-1 distance as the loss function of the generator and the discriminator, and to add an additional penalty for node voltage exceeding the limit to the loss function of the generator, and to use the Adam optimizer to update the parameters of the generator and the discriminator.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the power data expansion method according to any one of claims 1 to 8 when executed.
13. An electronic device, characterized in that: It includes a processor and a computer-readable storage medium connected to the processor; wherein the computer-readable storage medium stores instructions that can be executed by the processor, and the instructions are executed by the processor so that the processor can execute the power data expansion method described in any one of claims 1 to 8.
Citation Information
Cited By
Power station equipment characteristic operation state trend analysis method, system and equipment and storage medium
CN120354102A