A distribution network grid spatial load clustering method, device, and storage medium

Through the combination of distribution network gridding and adversarial generation network, the problem of cluster number determination and difference in load clustering method is solved, load data clustering under all meteorological conditions is realized, and clustering accuracy and management are improved. efficiency.

CN118520324BActive Publication Date: 2024-09-20STATE GRID JIANGSU ELECTRIC POWER CO LTD RESEARCH INSTITUTE +3
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410979164.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-09-20
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

Existing load clustering methods have problems in determining the number of clusters and reflecting differences in load patterns, and the analysis of load fluctuations in harsh environments is not thorough enough, resulting in poor clustering results, cumbersome and limited to local optimal solutions.

Method used

The distribution network gridding method is combined with the adversarial generation network, and grid division and reverse coding are carried out through load data in all periods and under all meteorological conditions to generate grid space load clustering results. The improved E-K-means algorithm and Adversarial generative networks enable deep clustering of load data.

Benefits of technology

It improves the accuracy and multi-dimensionality of load clustering, can more intuitively display load fluctuations in different regions and meteorological conditions, achieves more efficient demand-side management, and avoids the dilemma of local optimal solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520324B
    Figure CN118520324B
Patent Text Reader

Abstract

This invention proposes a method, apparatus, and storage medium for spatial load clustering in a distribution network grid. The method includes: dividing the target distribution network area into grids using a clustering algorithm based on load power data and load spatial distance distribution data, obtaining the grid division results, and calculating the grid spatial load density; generating discrete continuous distribution sets for each grid based on the grid division results and grid spatial load density; inputting the discrete continuous distribution sets of each grid and load power data under all time periods and weather conditions into an improved generative adversarial network (GAN), and obtaining the grid spatial load clustering result through generative adversarial processing and inverse coding; wherein the improved GAN includes a generator, a discriminator, and an encoder for inverse coding. This invention can gridify the load and obtain grid spatial load clustering results, more accurately and objectively reflecting the load fluctuations in different regions and under different weather conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a distribution network grid space load clustering method, device and storage medium, and belongs to the technical field of load clustering. Background Art

[0002] With the continuous advancement of smart grid construction, more and more data collection devices such as smart meters can collect a large number of users' load fluctuations. How to analyze and process these load data has become an important issue in the development of the power grid. Different types of users, such as civil, commercial, industrial, and agricultural, have great differences in electricity consumption patterns. Even for the same type of users, their electricity consumption patterns may be different. Therefore, it is necessary to classify and mine load data and study them.

[0003] Based on load data classification, mining the power consumption patterns of different power users can not only support power supply companies in implementing market competition strategies such as orderly power consumption, peak-shifting management, and time-of-use power consumption and providing more personalized power services, but also help to improve the understanding of power consumption patterns of different power users. Cluster analysis of load data can more efficiently grasp the real-time fluctuations on the user side, thereby conducting more efficient demand-side management and improving power utilization.

[0004] Most of the existing research on load clustering in China focuses on the selection of load clustering methods, but all clustering methods on the market face the same problems: the problem of determining the number of clusters, how to ensure the effectiveness of clustering and the difference of load patterns, and the problem of sensitivity to the initial cluster center for the clustering problem. The above problems will affect the effect of load clustering. In addition, with the continuous increase in load nodes, the existing load clustering methods are often too cumbersome, and there are few existing studies on load clustering under full meteorological conditions, and the analysis of user-side demand fluctuations under harsh environments is not very thorough. Summary of the invention

[0005] The purpose of the present invention is to provide a distribution network grid space load clustering method, device, and storage medium, grid the load nodes in the distribution network area, use the load data under all time periods and all weather conditions, combine the adversarial generation network to perform generative adversarial, and finally obtain the grid space load clustering result through reverse coding, which can more accurately and objectively reflect the fluctuation of load in different regions and different weather conditions.

[0006] In order to achieve the above objectives / solve the above technical problems, the present invention is implemented by adopting the following technical solutions.

[0007] In a first aspect, the present invention provides a method for clustering spatial loads in a distribution network grid, comprising the following steps:

[0008] According to the load power data and load space distance distribution data in the target distribution network area, the target distribution network area is gridded using a clustering algorithm to obtain the grid division result and calculate the grid space load density;

[0009] Generate discrete continuous distribution sets of each grid according to the grid division results and grid space load density;

[0010] The discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions are input into the improved adversarial generative network, and the grid spatial load clustering results are obtained through generative adversarial and reverse coding.

[0011] The improved generative adversarial network includes a generator, a discriminator and an encoder for reverse encoding.

[0012] In combination with the first aspect, further, the target distribution network area is gridded using a clustering algorithm according to the load power data and the load space distance distribution data in the target distribution network area, a grid division result is obtained, and the grid space load density is calculated, including:

[0013] The total number of grids is selected based on the sum of the squares of the distances between the internal nodes of the grid and the center of the grid;

[0014] Initialize the center position of the grid according to the total number of grids;

[0015] Based on the improved EK-means algorithm, the electrical distance from each node to each grid center in the target distribution network area is calculated, and the node is added to the nearest grid center according to the electrical distance to obtain an updated grid; the calculation formula of the electrical distance is as follows:

[0016] ;

[0017] in, represents the electrical distance between the i-th node and the j-th node, Representation Node When the reactive power changes, the node The voltage change of the node The ratio of the voltage change to the target distribution network area. N is the total number of nodes in the target distribution network area.

[0018] According to the updated grid, update the grid center of each grid. The calculation formula is as follows:

[0019] ;

[0020] ;

[0021] in, is the objective function, K is the total number of grids, n is the total number of nodes in the grid, Indicates that is the distance between the ith node in the grid and the center of the grid The electrical distance is the kth grid center;

[0022] Repeatedly update the grid and grid center until the preset maximum number of iterations is reached, stop iteration, and output the grid division results;

[0023] The grid space load density of each grid is calculated according to the grid division results. The calculation formula is as follows:

[0024] ;

[0025] in, represents the grid space load density of the bth grid, is the load of the ith node in the bth grid, is the spatial area of ​​the b-th grid, .

[0026] In combination with the first aspect, further, initializing the center position of the grid according to the total number of grids includes:

[0027] (1) Obtain the distance set corresponding to node i based on the electrical distance between node i and other nodes ,in, =0, , is the total number of nodes in the current node set M. In the first iteration, =N;

[0028] (2) Arrange the distance sets of all nodes in the current node set M in ascending order to obtain the connection index set ,in, is the i-th distance set in the connection index set;

[0029] (3) From the connection index set Select the first T elements from the list to form a set of highly connected nodes , , where T is the preset value;

[0030] (4) If the current iteration number l = 1, from the set of highly connected nodes Select the node with the smallest connection index as the first grid center , and at the same time, from the set of high-connectivity nodes Select the node with the largest connection index as the second grid center ; If the current iteration number l > 1, then select the node with the largest connection index from the set of high-connectivity nodes as the (l + 1)-th grid center ; where the connection index is the sum of all electrical distances in the distance set;

[0031] (5) If the current number of grid centers l + 1 < K, then delete the nodes corresponding to the grid centers from the current node set M, update the node set M, and return to step (1); if the current number of grid centers l + 1 = K, then end the iteration, obtain the positions of K grid centers, and complete the initialization of the grid center positions.

[0032] Combined with the first aspect, further, the generating the discrete and continuous distribution sets of each grid according to the grid division result and the grid space load density includes:

[0033] Generating a continuous vector set for each grid according to the grid division result and the grid space load density , where the continuous vector set satisfies a normal distribution, , is the variance, represents the grid space load density of the b-th grid, , and K is the total number of grids;

[0034] Generating a discrete distribution set through one-hot encoding according to the preset number of load clusters :

[0035] ;

[0036] where, represents the q-th basic vector of the one-hot encoding vector, u is the set of natural numbers, and Q is the preset number of load clusters;

[0037] Using the continuous vector set of each grid and the discrete distribution set to generate the discrete and continuous distribution set Z of each grid, .

[0038] Combined with the first aspect, further, the improved adversarial generation network training method includes:

[0039] Generating a mixed difference sample according to the discrete and continuous distribution set Z and the load power data under all time periods and all meteorological conditions:

[0040] ;

[0041] where, ​​is a mixed difference sample, x is the load power data under all time periods and weather conditions, is the data generated by the generator according to the random noise elements in the discrete continuous distribution set Z, is the dynamic gradient penalty coefficient;

[0042] Initialize the discriminator parameters, generator parameters and encoder parameters of the adversarial generation network, and mix the interpolation samples Input the generator and get the data generated by the generator , the data generated by the generator And the original load power data x are input into the discriminator to obtain the discriminator's discriminant result;

[0043] Without changing the generator parameters and encoder parameters, the discriminator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal discriminator parameters; the update formula of the discriminator parameters is:

[0044] ;

[0045] in, is the discriminator dynamic gradient penalty parameter, are the discriminator parameters, It means to find the gradient of the discriminator parameters. Represents the judgement of the The probability of being true, is the probability that the discriminator judges x to be true, To control the parameters, For the discriminator to judge The probability of being true, express The gradient of is the two-norm operation, express The second norm of , l represents the current number of iterations, and m represents the total number of iterations;

[0046] Without changing the optimal discriminator parameters and encoder parameters, the generator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal generator parameters; the update formula of the generator parameters is:

[0047] ;

[0048] in, is the generator dynamic gradient penalty parameter, is the generator parameter, It means to find the gradient of the generator parameters. is the discrete continuous distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, Indicates the judgment of the lth iteration discriminator The probability of being true, is the regularization coefficient of the b-th grid, represents the bth continuous vector set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, represents the lth iteration encoder pair The encoder continuous partial items for reverse encoding, Represents a discrete distribution set The corresponding regularization coefficient is is the discrete distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, represents the lth iteration encoder pair The discrete part terms of the encoder for reverse encoding, Represents the discrete distribution set of the lth iteration All elements in the discrete part of the encoder The cross entropy loss of

[0049] Without changing the optimal discriminator parameters and the optimal generator parameters, the encoder parameters are input into the Adam optimizer for iterative optimization to obtain the optimal encoder parameters; the update formula of the encoder parameters is:

[0050] ;

[0051] in, are encoder parameters, is the encoder dynamic gradient penalty parameter, Indicates the gradient of the encoder parameters;

[0052] A trained improved adversarial generation network is obtained according to the optimal discriminator parameters, the optimal generator parameters and the optimal encoder parameters.

[0053] In combination with the first aspect, further, the loss function of the improved adversarial generative network is expressed as follows:

[0054] ;

[0055] in, represents the mathematical expectation of x, is the data distribution of x, represents the mathematical expectation of the discrete continuous distribution set Z, is the data distribution of the discrete continuous distribution set Z, is the data generated by the generator according to the discrete continuous distribution set Z, For the discriminator to judge The probability of being true, express The mathematical expectation of for Data distribution;

[0056] The expression of the clustering loss function of the improved adversarial generation network is as follows:

[0057] ;

[0058] in, For the generator based on the continuous vector set The data generated, Indicates the encoder pair The continuous partial items of the encoder obtained by reverse encoding, For the generator according to the discrete distribution set The data generated, Indicates the encoder pair The discrete part of the encoder obtained by reverse encoding, For a discrete distribution set Discrete part terms with encoder The cross entropy of .

[0059] Combined with the first aspect, further, the discrete continuous distribution set of each grid and the load power data under all time periods and all weather conditions are input into the improved adversarial generation network, and new data is generated through the generator. ; Use the encoder to encode new data Perform reverse encoding to obtain reconstructed data , That is the grid space load clustering result.

[0060] In a second aspect, the present invention provides a distribution network grid spatial load clustering device, comprising:

[0061] A grid division module is used to divide the target distribution network area into grids according to the load power data and load space distance distribution data in the target distribution network area by using a clustering algorithm to obtain a grid division result and calculate the grid space load density;

[0062] The data preparation module is used to generate discrete continuous distribution sets of each grid according to the grid division results and grid space load density;

[0063] The load clustering module is used to input the discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions into the improved adversarial generation network, and obtain the grid space load clustering results through generative adversarial and reverse coding;

[0064] The improved generative adversarial network includes a generator, a discriminator and an encoder for reverse encoding.

[0065] In combination with the second aspect, further, the improved adversarial generative network training method includes:

[0066] Generate mixed difference samples based on the discrete continuous distribution set Z and the load power data under all time periods and all weather conditions:

[0067] ;

[0068] in, is a mixed difference sample, x is the load power data under all time periods and weather conditions, is the data generated by the generator according to the random noise elements in the discrete continuous distribution set Z, is the dynamic gradient penalty coefficient;

[0069] Initialize the discriminator parameters, generator parameters and encoder parameters of the adversarial generation network, and mix the interpolation samples Input the generator and get the data generated by the generator , the data generated by the generator And the original load power data x are input into the discriminator to obtain the discriminator's discriminant result;

[0070] Without changing the generator parameters and encoder parameters, the discriminator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal discriminator parameters; the update formula of the discriminator parameters is:

[0071] ;

[0072] in, is the discriminator dynamic gradient penalty parameter, are the discriminator parameters, It means to find the gradient of the discriminator parameters. Represents the judgement of the The probability of being true, is the probability that the discriminator judges x to be true, To control the parameters, For the discriminator to judge The probability of being true, express The gradient of is the two-norm operation, express The second norm of , l represents the current number of iterations, and m represents the total number of iterations;

[0073] Without changing the optimal discriminator parameters and encoder parameters, the generator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal generator parameters; the update formula of the generator parameters is:

[0074] ;

[0075] in, is the generator dynamic gradient penalty parameter, is the generator parameter, It means to find the gradient of the generator parameters. is the discrete continuous distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, Indicates the judgment of the lth iteration discriminator The probability of being true, is the regularization coefficient of the b-th grid, represents the bth continuous vector set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, represents the lth iteration encoder pair The encoder continuous partial items for reverse encoding, Represents a discrete distribution set The corresponding regularization coefficient is is the discrete distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, represents the lth iteration encoder pair The discrete part terms of the encoder for reverse encoding, Represents the discrete distribution set of the lth iteration All elements in the discrete part of the encoder The cross entropy loss of

[0076] Without changing the optimal discriminator parameters and the optimal generator parameters, the encoder parameters are input into the Adam optimizer for iterative optimization to obtain the optimal encoder parameters; the update formula of the encoder parameters is:

[0077] ;

[0078] in, are encoder parameters, is the encoder dynamic gradient penalty parameter, Indicates the gradient of the encoder parameters;

[0079] A trained improved adversarial generation network is obtained according to the optimal discriminator parameters, the optimal generator parameters and the optimal encoder parameters.

[0080] In a third aspect, the present invention provides a computer-readable storage medium having a computer program / instruction stored thereon, which, when executed by a processor, implements the steps of the distribution network grid spatial load clustering method provided in the first aspect.

[0081] Compared with the prior art, the present invention has the following beneficial effects:

[0082] The present invention proposes a distribution network grid space load clustering method, device, and storage medium. Based on the distribution network gridding and the distribution characteristics of the load under all meteorological conditions, many small nodes in the distribution room area are integrated into distribution network grids with similar attributes, which is conducive to accurately and effectively analyzing and planning a large number of distributed nodes in the region, and reasonably classifying and integrating the nodes. Then the present invention processes the load data in each grid through an improved adversarial generative network, and finally reverse encodes the data to achieve clustering through adversarial iterative convergence, thereby finally achieving clustering of grid space load data under all meteorological conditions.

[0083] The method of the present invention avoids the dilemma of traditional clustering methods being limited to local optimal solutions, expands the multidimensionality and randomness of clustering targets, and has better clustering accuracy. Therefore, the gridding of distribution networks is realized, and grid spatial loads are clustered under the full meteorological environment, which can more intuitively display the fluctuations and characteristics of grid loads under different meteorological periods or even in severe meteorological environments, which is conducive to more efficient demand-side management. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] Figure 1 The figure shows a schematic diagram of the steps of a distribution network grid spatial load clustering method provided by the present invention;

[0085] Figure 2 Shown is a schematic structural diagram of a distribution network grid spatial load clustering device provided by the present invention. DETAILED DESCRIPTION

[0086] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.

[0087] Example 1

[0088] This embodiment introduces a distribution network grid spatial load clustering method, such as Figure 1 As shown, the specific steps include:

[0089] Step 1: According to the load power data and load space distance distribution data in the target distribution network area, the target distribution network area is gridded using a clustering algorithm to obtain the grid division result and calculate the grid space load density.

[0090] Step 2: Generate a discrete continuous distribution set for each grid based on the grid division results and grid space load density.

[0091] Step 3: Input the discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions into the improved adversarial generative network, and obtain the grid space load clustering result by generative adversarial and reverse encoding. Among them, the improved adversarial generative network adds an encoder, which can reverse encode the data generated by the generator, reconstruct the latent space, and realize the deep clustering of grid space load data under all meteorological conditions, so as to obtain the grid space load clustering result required by the present invention.

[0092] In the embodiment of the present invention, the specific operations of step 1 are as follows:

[0093] The load power data of the load objects to be classified in the target distribution network area is expressed as a set: ,in, represents the load power data of the i-th node, R is a real number, and N is the total number of nodes in the target distribution network area.

[0094] The Euclidean distance is introduced. The Euclidean distance can accurately reflect the distance between two points. The expression is as follows:

[0095] (1)

[0096] in, represents the Euclidean distance between the i-th node and the j-th node, represents the coordinates of the i-th node in N-dimensional space, represents the coordinates of the jth node in N-dimensional space, .

[0097] Euclidean distance can show the topological relationship of each node in the distribution network, but only measures the structural performance of the cluster based on the topological relationship of the distribution network, lacks consideration of the electrical connection between nodes, and has major defects in the clustering process of load nodes in the distribution network. Therefore, the present invention introduces electrical distance in addition to Euclidean distance, and measures the tightness of electrical coupling between nodes through electrical distance.

[0098] First, the changes in the mutual influence between nodes are calculated based on the node sensitivity coefficient. The formula is as follows:

[0099] (2)

[0100] (3)

[0101] in, is the voltage change, is the node sensitivity coefficient, is the reactive power change; Representation Node When the reactive power changes, the node The voltage change of the node The ratio of the voltage change; Representation Node The change in reactive power causes the change in voltage at node j; Representation Node The change of reactive power causes the node The change in voltage.

[0102] Secondly, according to the changes in the mutual influence between each node, the electrical distance between each node in the distribution network area is derived, and the formula is as follows:

[0103] (4)

[0104] in, Represents the electrical distance between the i-th node and the j-th node.

[0105] Step 101: Select the total number of grids according to the sum of squares of distances between internal nodes of the grid and the center of the grid (ie, the SSE index).

[0106] Since the traditional K-means algorithm has the disadvantage of artificial uncertainty in the number of grids, the present invention adopts an improved EK-means algorithm and introduces the SSE indicator into the improved algorithm, so as to more conveniently observe the number of grids and distribution results and better determine the selection of the number of grids.

[0107] The calculation formula of the SSE indicator is as follows:

[0108] (5)

[0109] in, Indicates that is the distance between the ith node in the grid and the center of the grid The electrical distance is K, the total number of grids, and n is the total number of nodes in the grid.

[0110] Generally, the SSE index does not decrease linearly with the increase of K. When K is small, SSE decreases faster with the increase of K. As K continues to increase, the degree of reduction of SSE will become smaller and smaller. Therefore, there will be an inflection point. , in K = Before, It decreases with the increase of K, and the decreasing speed is faster; when K= After that, the increase of K The reduction of the influence is not large. The present invention can find , as the optimal total number of grids.

[0111] Step 102: Initialize the center position of the grid according to the total number of grids.

[0112] Step 1201: For any node i in the distribution network regional node set M, calculate the electrical distance between node i and other nodes to obtain the distance set ,in, =0, , is the total number of nodes in the current node set M. In the first iteration, = N. In the distance set The larger the value of the element, the farther the distance between the two nodes.

[0113] Step 1202: Arrange the distance sets of all nodes in the node set M in ascending order to obtain a connection index set: , is the ith element in the connection index set, that is, the ith distance set. In the embodiment of the present invention, the size of the distance set is determined according to the size of the sum of all electrical distances in the node distance set.

[0114] Step 1203: From the connection index set Select the first T elements from the list to form a set of highly connected nodes , . T is an artificially set value.

[0115] Step 1204: If the current iteration number l=1, select the node set with high connectivity. Select the node with the smallest connection index as the first grid center , and at the same time, from the set of high-connectivity nodes Select the node with the largest connection index as the second grid center ; If the current iteration number l>1, then select the node from the high connectivity set Select the node with the largest connection index as the l+1th grid center .

[0116] In the present invention, the connection index is the sum of all electrical distances in the distance set. The smaller the connection index, the more nodes there are around the node, and the more likely the node is to be a grid center. However, if all nodes with the smallest connection index are selected as grid centers, it is easy to fall into a local optimal solution. Therefore, in the present invention, only the node with the smallest connection index is selected when choosing the first grid node, and the node with the largest connection index in is selected at other times.

[0117] Step 1205: If the current number of grid centers l + 1 < K, then delete the node corresponding to the grid center from the node set M, update the node set, and return to Step 1201; if the current number of grid centers l + 1 = K, then end the iteration, obtain the positions of K grid centers, and complete the initialization of the grid center positions. If the current number of grid centers l + 1 = K, then end the iteration, obtain the positions of K grid centers, and complete the initialization of the grid center positions.

[0118] Step 103: Based on the improved E-K-means algorithm, calculate the electrical distances from the nodes in the distribution network area to each grid center, and then add the nodes to the nearest grid center to obtain an updated grid.

[0119] Step 104: Update the grid center according to the updated grid to minimize the sum of the distances between the updated grid center and the remaining nodes in the grid. The formula is as follows:

[0120] (6)

[0121] (7)

[0122] where is the objective function.

[0123] Step 105: Repeat Step 103 to Step 104 until the preset maximum number of iterations is reached, stop the iteration, and output the grid division result.

[0124] Step 106: After obtaining the grid division result, the grid space load density of each grid can be calculated according to the grid division result. The calculation formula is as follows:

[0125] (8)

[0126] where represents the grid space load density of the b-th grid, n is the total number of nodes in the grid, is the load of the i-th node in the b-th grid, is the space area of the b-th grid.

[0127] The present invention selects the total number of grids according to the SSE index, and iteratively optimizes the distribution network grid division through the improved EK-means algorithm, which can effectively improve the accuracy and reliability of grid division and provide support for subsequent load clustering.

[0128] In the embodiment of the present invention, the specific operations of step 2 are as follows:

[0129] Step 201: Generate a continuous vector set for each grid based on the grid division result and grid space load density , the continuous vector set satisfies the normal distribution, , is the variance, generally =1.

[0130] Step 202: Generate a discrete distribution set by one-hot encoding according to the preset number of load clusters :

[0131] (9)

[0132] in, represents the qth basic vector of the one-hot encoding vector, u is a natural number set, Q is the number of load clusters set artificially, It means to take from 1 to Q in sequence.

[0133] Only one element in the one-hot encoding vector is 1 (indicating the existence of the category), and the rest of the elements are 0. One-hot encoding can assign an independent binary vector to each category to eliminate noise duplication.

[0134] Step 203: Using the continuous vector set of each grid and discrete distribution sets Generate a discrete continuous distribution set Z for each grid, The discrete continuous distribution set Z is actually a noise set, which is used to input the generator of the adversarial generative network.

[0135] The present invention uses a generative adversarial network to achieve clustering of data in a latent space, but the traditional generative adversarial network cannot achieve this function. Therefore, the present invention improves the traditional generative adversarial network by adding an encoder for reverse encoding to the generative adversarial network. At the same time, in order to improve the clustering effect, the present invention also adds a clustering loss function on the basis of the generative adversarial model to achieve the discrimination of the data generated by the generator each time.

[0136] In an embodiment of the present invention, the loss function of the improved adversarial generative network is expressed as follows:

[0137] (10)

[0138] in, is the generator parameter, is the discriminator parameter, x is the load power data, represents the mathematical expectation of x, is the data distribution of x, is the probability that the discriminator judges x to be true, represents the mathematical expectation of the discrete continuous distribution set Z, is the data distribution of the discrete continuous distribution set Z, is the data generated by the generator according to the discrete continuous distribution set Z, For the discriminator to judge The probability of being true, To control the parameters, is a mixed difference sample generated according to the load power data x and the discrete continuous distribution set Z, for The data distribution, express The mathematical expectation of For the discriminator to judge The probability of being true, represents the gradient operation, express The gradient of is the two-norm operation, express The second norm of is the dynamic gradient penalty coefficient, .

[0139] In formula (10), is a dynamic gradient penalty term. The present invention only performs interpolation on the original sample and the noise-generated sample. Apply a penalty to limit the discriminator gradient to a dynamic Within , the generator parameters are trained by alternating between minimum and maximum and the discriminator parameters .

[0140] The expression of the clustering loss function of the improved adversarial generation network is as follows:

[0141] (11)

[0142] in, is the encoder parameter, is the regularization coefficient of the b-th grid, used to manage the continuous vector set corresponding to the b-th grid The weight ratio of For the generator based on the continuous vector set The data generated, Indicates the encoder pair The continuous partial items of the encoder obtained by reverse encoding, Represents a discrete distribution set The corresponding regularization coefficient is used to manage the discrete distribution set The weight ratio of For the generator according to the discrete distribution set The data generated, Indicates the encoder pair The discrete part of the encoder obtained by reverse encoding, For a discrete distribution set Discrete part term with encoder The cross entropy of .

[0143] In formula (11), by simultaneously minimizing the continuous part of the latent vector Continuous partial terms with encoder The L2 loss and the discrete part of the latent vector Discrete part term with encoder The cross entropy loss is used to jointly train the generator parameters and encoder parameters .

[0144] Before using the improved generative adversarial network to cluster grid space loads, the present invention trains the improved generative adversarial network by inputting random sample into the generator module and confronting the discriminator module that inputs the original data, so that after continuous iterations, the generator latent space contains the cluster information of the original data.

[0145] In an embodiment of the present invention, the improved training method of the generative adversarial network includes:

[0146] Step A: Generate mixed difference samples based on the discrete continuous distribution set Z and the load power data under all time periods and weather conditions as inputs to the generator in the improved adversarial generation network. The expression of the mixed difference samples is as follows:

[0147] (12)

[0148] in, is a mixed difference sample, x is the load power data under all time periods and weather conditions, The data generated by the generator is a random noise element in the discrete continuous distribution set Z.

[0149] Formula (12) can be used to complete continuous iteration of input data.

[0150] Step B: Initialize the discriminator parameters, generator parameters and encoder parameters of the adversarial generation network, and mix the interpolation samples Input generator to generate new data , the new data The original load power data x is input into the discriminator for discrimination to obtain the discrimination result of the discriminator, that is, to judge whether the data is true or false.

[0151] Step C: Update the discriminator parameters according to the discriminator's discriminant results to enhance the discriminator's ability to distinguish the difference between the generated data and the original data.

[0152] The update formula of the discriminator parameters is as follows:

[0153] (13)

[0154] in, is the discriminator dynamic gradient penalty parameter, It means to find the gradient of the discriminator parameters. Represents the judgement of the The probability of being true, l represents the current iteration number, and m represents the total number of iterations. In formula (13), is the dynamic gradient penalty term, Mixed interpolation samples The 2-norm of the gradient of the probability that y is true.

[0155] Without changing the generator parameters and encoder parameters, the discriminator parameters are sent to the Adam optimizer for iterative optimization. When the discriminator is trained, the optimal discriminator parameters are obtained and fixed. During the iterative optimization process, the optimization can be guided by the loss function.

[0156] Step D: Without changing the optimal discriminator parameters and encoder parameters, the generator parameters are input into the Adam optimizer for iterative optimization, the generator parameters are updated, and the difference between the generator generated data and the original data is reduced. After the generator training is completed, the optimal generator parameters are obtained and fixed. In the iterative optimization process, the optimization can be guided by the loss function.

[0157] The update formula of the generator parameters is as follows:

[0158] (14)

[0159] in, is the generator dynamic gradient penalty parameter, It means to find the gradient of the generator parameters. is the discrete continuous distribution set of the lth iteration, Indicates that the lth iteration generator is based on The data generated, Indicates the judgment of the lth iteration discriminator The probability of being true, represents the bth continuous vector set of the lth iteration, Indicates that the lth iteration generator is based on The data generated, Represents the l-th iteration encoder pair The encoder continuous partial items for reverse encoding, is the discrete distribution set of the lth iteration, Indicates that the lth iteration generator is based on The data generated, Represents the l-th iteration encoder pair The discrete part terms of the encoder for reverse encoding, Represents the discrete distribution set of the lth iteration The cross entropy loss of all elements in y with the discrete part of the encoder.

[0160] In formula (14), is the sum of the distances from all elements in the continuous vector set to the cluster center, is the sum of the cross entropy losses between all elements in the discrete distribution set and the cluster center, The change in the probability that the discriminator classifies the fake data generated by the generator as true.

[0161] Step E: On the basis of not changing the optimal discriminator parameters and the optimal generator parameters, the encoder parameters are input into the Adam optimizer for iterative optimization, and the encoder parameters are updated to make the clustering results more accurate. After completing the encoder training, the optimal encoder parameters are obtained. In the iterative optimization process, the clustering loss function can be used to guide the optimization, and the clustering loss can be used to continuously discriminate and screen, and finally reconstruct the potential space.

[0162] The update formula of the encoder parameters is as follows:

[0163] (15)

[0164] in, is the encoder dynamic gradient penalty parameter, Indicates the gradient of the encoder parameters.

[0165] Step F: obtaining a trained improved adversarial generative network according to the optimal discriminator parameters, the optimal generator parameters and the optimal encoder parameters.

[0166] In the embodiment of the present invention, the specific operations of step 3 are as follows:

[0167] Step 301: Input the discrete continuous distribution set of each grid and the load power data under all time periods and all weather conditions into the improved adversarial generation network, and generate new data through the generator. .

[0168] Step 302: Encode the new data using the encoder Perform reverse encoding to obtain reconstructed data , It is the result of reconstructing the original data in the latent space, that is, the grid space load clustering result.

[0169] Example 2

[0170] Based on the same inventive concept as Example 1, this embodiment introduces a distribution network grid space load clustering device, such as Figure 2 As shown, it includes a grid division module, a data preparation module and a load clustering module.

[0171] The grid division module is used to grid the target distribution network area according to the load power data and load space distance distribution data in the target distribution network area using a clustering algorithm to obtain the grid division results and calculate the grid space load density.

[0172] The data preparation module is used to generate discrete continuous distribution sets of each grid according to the grid division results and grid space load density.

[0173] The load clustering module is used to input the discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions into the improved adversarial generation network, and obtain the grid space load clustering results through generative adversarial and reverse coding.

[0174] The improved generative adversarial network includes a generator, a discriminator and an encoder, wherein the encoder can reversely encode the data generated by the generator, reconstruct the latent space, and realize deep clustering of grid space load data under all meteorological conditions.

[0175] The specific functional implementation of each of the above modules can be found in the relevant contents of the method in Example 1 and will not be elaborated here.

[0176] Example 3

[0177] Based on the same inventive concept as other embodiments, this embodiment introduces a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the steps of the distribution network grid spatial load clustering method introduced in Embodiment 1 are implemented.

[0178] In summary, based on the distribution characteristics of distribution network gridding and load under full meteorological conditions, the present invention integrates numerous small nodes in the distribution room area into distribution network grids with similar attributes, and accurately and effectively analyzes and plans a large number of distributed nodes in the region by combining the improved EK-means algorithm with relevant parameters such as grid load spatial distribution and time period meteorological fluctuations, and reasonably classifies and integrates the nodes, and finally obtains accurate distribution network gridding results. Then the present invention processes the load data in each grid through an improved adversarial generative network, and finally reverse encodes the data to achieve clustering through adversarial iterative convergence, and finally achieves clustering of grid space load data under full meteorological conditions.

[0179] The present invention adopts grid processing for regional load clustering, which can solve the problem that the processing of clustering objects in the prior art is not very clear. By taking the relevant parameters as grid reference parameters, each node is aligned and integrated with the grid reference parameters, and finally the distribution network grid is realized, which is convenient for overall management and lower data analysis.

[0180] The present invention performs grid space load clustering based on an improved generative adversarial network, which solves the problem of determining the number of clusters in the prior art. It uses load power data under all time periods and all weather conditions, which can effectively improve the effectiveness of clustering results and estimate the differences in load patterns, thereby obtaining grid space load clustering results that are more objective and ready for the next step of load forecasting. In addition, the method of the present invention avoids the dilemma of traditional clustering methods being limited to local optimal solutions, expands the multidimensionality and randomness of clustering targets, and has better clustering accuracy. The present invention realizes the gridding of distribution networks and clusters grid space loads under all weather conditions, which can more intuitively display the fluctuations and characteristics of grid loads under different weather periods or even in severe weather environments.

[0181] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may 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.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.

Claims

1. A distribution network grid spatial load clustering method, characterized in that: The steps include: According to the load power data and load space distance distribution data in the target distribution network area, the target distribution network area is gridded using a clustering algorithm to obtain the grid division result and calculate the grid space load density; Generate discrete continuous distribution sets of each grid according to the grid division results and grid space load density; The discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions are input into the improved adversarial generative network, and the grid spatial load clustering results are obtained through generative adversarial and reverse coding. The improved generative adversarial network includes a generator, a discriminator and an encoder for reverse encoding; The improved adversarial generative network training method comprises: Generate mixed difference samples based on the discrete continuous distribution set Z and the load power data under all time periods and all weather conditions: ; in, is a mixed difference sample, x is the load power data under all time periods and weather conditions, is the data generated by the generator according to the random noise elements in the discrete continuous distribution set Z, is the dynamic gradient penalty coefficient; Initialize the discriminator parameters, generator parameters and encoder parameters of the adversarial generation network, and mix the interpolation samples Input the generator and get the data generated by the generator , the data generated by the generator And the original load power data x are input into the discriminator to obtain the discriminator's discriminant result; Without changing the generator parameters and encoder parameters, the discriminator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal discriminator parameters; the update formula of the discriminator parameters is: ; in, is the discriminator dynamic gradient penalty parameter, are the discriminator parameters, It means to find the gradient of the discriminator parameters. Represents the judgement of the The probability of being true, is the probability that the discriminator judges x to be true, To control the parameters, For the discriminator to judge The probability of being true, express The gradient of is the two-norm operation, express The second norm of , l represents the current number of iterations, and m represents the total number of iterations; Without changing the optimal discriminator parameters and encoder parameters, the generator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal generator parameters; the update formula of the generator parameters is: ; in, is the generator dynamic gradient penalty parameter, is the generator parameter, It means to find the gradient of the generator parameters. is the discrete continuous distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, Indicates the judgment of the lth iteration discriminator The probability of being true, is the regularization coefficient of the b-th grid, represents the bth continuous vector set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, Represents the l-th iteration encoder pair The encoder continuous partial items for reverse encoding, Represents a discrete distribution set The corresponding regularization coefficient is is the discrete distribution set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, Represents the l-th iteration encoder pair The discrete part terms of the encoder for reverse encoding, Represents the discrete distribution set of the lth iteration All elements in the discrete part of the encoder The cross entropy loss of Without changing the optimal discriminator parameters and the optimal generator parameters, the encoder parameters are input into the Adam optimizer for iterative optimization to obtain the optimal encoder parameters; the update formula of the encoder parameters is: ; in, is the encoder parameter, is the encoder dynamic gradient penalty parameter, Indicates the gradient of the encoder parameters; A trained improved adversarial generation network is obtained according to the optimal discriminator parameters, the optimal generator parameters and the optimal encoder parameters.

2. The method for spatial load clustering of distribution network grids according to claim 1, characterized in that: The target distribution network area is gridded by using a clustering algorithm according to the load power data and load space distance distribution data in the target distribution network area, a grid division result is obtained, and the grid space load density is calculated, including: The total number of grids is selected based on the sum of the squares of the distances between the internal nodes of the grid and the center of the grid; Initialize the center position of the grid according to the total number of grids; Based on the improved EK-means algorithm, the electrical distance from each node to each grid center in the target distribution network area is calculated, and the node is added to the nearest grid center according to the electrical distance to obtain an updated grid; the calculation formula of the electrical distance is as follows: ; in, represents the electrical distance between the i-th node and the j-th node, Representation Node When the reactive power changes, the node The voltage change of the node The ratio of the voltage change to the target distribution network area. N is the total number of nodes in the target distribution network area. According to the updated grid, update the grid center of each grid. The calculation formula is as follows: ; ; in, is the objective function, K is the total number of grids, n is the total number of nodes in the grid, Indicates that is the distance between the ith node in the grid and the center of the grid The electrical distance is the kth grid center; Repeatedly update the grid and grid center until the preset maximum number of iterations is reached, stop iteration, and output the grid division results; The grid space load density of each grid is calculated according to the grid division results. The calculation formula is as follows: ; in, represents the grid space load density of the bth grid, is the load of the ith node in the bth grid, is the spatial area of ​​the b-th grid, .

3. The method for spatial load clustering of distribution network grids according to claim 2, characterized in that: Initializing the center position of the grid according to the total number of grids includes: (1) Obtain the distance set corresponding to node i based on the electrical distance between node i and other nodes ,in, =0, , is the total number of nodes in the current node set M. In the first iteration, =N; (2) Arrange the distance sets of all nodes in the current node set M in ascending order to obtain the connection index set ,in, is the i-th distance set in the connection index set; (3) From the connection index set Select the first T elements from the list to form a set of highly connected nodes , , where T is the preset value; (4) If the current iteration number l = 1, from the set of highly connected nodes Select the node with the smallest connection index as the first grid center , and at the same time, from the set of high-connectivity nodes Select the node with the largest connection index as the second grid center ; If the current iteration number l>1, then select the node from the high connectivity set Select the node with the largest connection index as the l+1th grid center ; Wherein, the connection index is the sum of all electrical distances in the distance set; (5) If the number of current grid centers l + 1 < K, then delete the corresponding nodes from the current node set M, update the node set M, and return to step (1); if the number of current grid centers l + 1 = K, then end the iteration, obtain the positions of K grid centers, and complete the initialization of the grid center positions. The corresponding nodes, update the node set M, and return to step (1); if the number of current grid centers l + 1 = K, then end the iteration, obtain the positions of K grid centers, and complete the initialization of the grid center positions.

4. The method for spatial load clustering of distribution network grids according to claim 1, characterized in that: The discrete continuous distribution set of each grid is generated according to the grid division result and the grid space load density, including: Generate a continuous vector set for each grid based on the grid division results and grid space load density , where the continuous vector set Satisfies the normal distribution, , is the variance, represents the grid space load density of the bth grid, , K is the total number of grids; According to the preset number of load clusters, a discrete distribution set is generated through one-hot encoding : ; in, represents the qth basic vector of the one-hot encoding vector, u is a natural number set, and Q is the preset number of load clusters; Using a continuous set of vectors for each grid and discrete distribution sets Generate a discrete continuous distribution set Z for each grid, .

5. The method for spatial load clustering of distribution network grids according to claim 1, characterized in that: The expression of the loss function of the improved adversarial generation network is as follows: ; in, represents the mathematical expectation of x, is the data distribution of x, represents the mathematical expectation of the discrete continuous distribution set Z, is the data distribution of the discrete continuous distribution set Z, is the data generated by the generator according to the discrete continuous distribution set Z, For the discriminator to judge The probability of being true, express The mathematical expectation of for Data distribution; The expression of the clustering loss function of the improved adversarial generation network is as follows: ; in, For the generator based on the continuous vector set The data generated, Indicates the encoder pair The continuous partial items of the encoder obtained by reverse encoding, For the generator according to the discrete distribution set The data generated, Indicates the encoder pair The discrete part of the encoder obtained by reverse encoding, For a discrete distribution set Discrete part term with encoder The cross entropy of .

6. The method for spatial load clustering of distribution network grids according to claim 1, characterized in that: The discrete continuous distribution sets of each grid and the load power data under all time periods and weather conditions are input into the improved adversarial generation network, and new data are generated through the generator. ; Use the encoder to encode new data Perform reverse encoding to obtain reconstructed data , That is the grid space load clustering result.

7. A distribution network grid spatial load clustering device, characterized in that: include: A grid division module is used to divide the target distribution network area into grids according to the load power data and load space distance distribution data in the target distribution network area by using a clustering algorithm to obtain a grid division result and calculate the grid space load density; The data preparation module is used to generate discrete continuous distribution sets of each grid according to the grid division results and grid space load density; The load clustering module is used to input the discrete continuous distribution set of each grid and the load power data under all time periods and all meteorological conditions into the improved adversarial generation network, and obtain the grid space load clustering results through generative adversarial and reverse coding; The improved generative adversarial network includes a generator, a discriminator and an encoder for reverse encoding; The improved adversarial generative network training method comprises: Generate mixed difference samples based on the discrete continuous distribution set Z and the load power data under all time periods and all weather conditions: ; in, is a mixed difference sample, x is the load power data under all time periods and weather conditions, is the data generated by the generator according to the random noise elements in the discrete continuous distribution set Z, is the dynamic gradient penalty coefficient; Initialize the discriminator parameters, generator parameters and encoder parameters of the adversarial generation network, and mix the interpolation samples Input the generator and get the data generated by the generator , the data generated by the generator And the original load power data x are input into the discriminator to obtain the discriminator's discriminant result; Without changing the generator parameters and encoder parameters, the discriminator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal discriminator parameters; the update formula of the discriminator parameters is: ; in, is the discriminator dynamic gradient penalty parameter, are the discriminator parameters, It means to find the gradient of the discriminator parameters. Represents the discriminator's judgment The probability of being true, is the probability that the discriminator judges x to be true, To control the parameters, For the discriminator to judge The probability of being true, express The gradient of is the two-norm operation, express The second norm of , l represents the current number of iterations, and m represents the total number of iterations; Without changing the optimal discriminator parameters and encoder parameters, the generator parameters are input into the Adam optimizer for iterative optimization to obtain the optimal generator parameters; the update formula of the generator parameters is: ; in, is the generator dynamic gradient penalty parameter, is the generator parameter, It means to find the gradient of the generator parameters. is the discrete continuous distribution set of the lth iteration, Indicates that the lth iteration generator is based on The data generated, Indicates the judgment of the lth iteration discriminator The probability of being true, is the regularization coefficient of the b-th grid, represents the bth continuous vector set of the lth iteration, Indicates that the l-th iteration generator is based on The data generated, represents the lth iteration encoder pair The encoder continuous partial items for reverse encoding, Represents a discrete distribution set The corresponding regularization coefficient is is the discrete distribution set of the lth iteration, Indicates that the lth iteration generator is based on The data generated, Represents the l-th iteration encoder pair The discrete part terms of the encoder for reverse encoding, Represents the discrete distribution set of the lth iteration All elements in the discrete part of the encoder The cross entropy loss of Without changing the optimal discriminator parameters and the optimal generator parameters, the encoder parameters are input into the Adam optimizer for iterative optimization to obtain the optimal encoder parameters; the update formula of the encoder parameters is: ; in, is the encoder parameter, is the encoder dynamic gradient penalty parameter, Indicates the gradient of the encoder parameters; A trained improved adversarial generation network is obtained according to the optimal discriminator parameters, the optimal generator parameters and the optimal encoder parameters.

8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the steps of the distribution network grid spatial load clustering method described in any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Clustering-based controllable load space density prediction method

    CN115186882A

  • Photovoltaic monthly scene generation method and system

    CN115841280A

  • Power distribution network distribution robust optimization scheduling method based on conditional generative adversarial network

    CN117291292A

  • Daily load curve clustering method based on variable convolution auto-encoder

    CN117349687A

  • Risk prevention and control method, device and equipment for main distribution network and medium

    CN117973859A