Linear variation relationship recognition method based on GAN for processing imbalanced data

By using GAN-based data augmentation and a support vector machine classification model, the problem of data imbalance in the identification of line-transformer relationships in 10kV distribution networks was solved, achieving efficient and accurate identification of line-transformer relationships. This approach overcomes the limitations of traditional methods and improves identification efficiency and accuracy.

CN114818940BActive Publication Date: 2024-11-26NORTH CHINA ELECTRICAL POWER RES INST +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210471153.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-28
Publication Date
2024-11-26
Estimated Expiration
2042-04-28

AI Technical Summary

Technical Problem

Existing technologies suffer from low efficiency and poor accuracy in identifying line-transformer relationships in 10kV distribution networks, especially in medium-voltage distribution networks. Due to data imbalance, the identification rate of abnormal line-transformer relationships is low, and traditional methods are limited to voltage distribution correlation analysis, which cannot quickly and accurately identify line-transformer relationship errors.

Method used

A GAN-based data augmentation method is used to augment the data of a very small number of abnormal samples in the linear relationship feature set. Combined with the support vector machine classification model, the potential correlation between electrical quantity information and linear relationship is used to construct a feature set and perform identification, thus overcoming the limitations of voltage distribution correlation analysis.

Benefits of technology

It significantly improves the accuracy and efficiency of line loss relationship identification, reduces manpower and time costs, can identify incorrect line connection and equipment parameter errors, solves the classification problem under imbalanced datasets, and improves the efficiency of line loss management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818940B_ABST
    Figure CN114818940B_ABST
Patent Text Reader

Abstract

The present invention proposes a line-transformer relationship identification method based on GAN processing of unbalanced data, including: S1, collecting daily power consumption and establishing an original data set; S2, extracting feature quantities from the daily line loss of distribution lines, the daily input power of distribution lines and the daily power consumption of each transformer; S3, using GAN to expand the data of the line-transformer relationship feature set; S4, using the feature set after sample expansion, constructing a support vector machine classification model to realize the identification of line-transformer relationships. Based on the power supply of distribution lines and the power consumption of distribution transformers, the support vector machine classification model is used to mine the potential association between power information and different line-transformer relationships, realize the classification processing of different line-transformer relationships, and propose a new method for line-transformer relationship identification. Based on GAN, data expansion is performed on the line-transformer relationship abnormal samples that only account for a very small number of line-transformer relationship feature sets, so as to achieve a balanced distribution of the number of samples between different line-transformer relationship categories.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of line-transformer relationship identification and unbalanced data processing in a 10kV distribution network, and in particular to a line-transformer relationship identification method based on GAN for processing unbalanced data. Background Art

[0002] At present, line-transformer relationship errors in distribution networks with voltage levels of 10kV and below can be divided into two types:

[0003] (1) Improper connection of the distribution network topology. The most common example is connecting the distribution transformer to the wrong power line, or the customer to the wrong distribution transformer.

[0004] (2) Incorrect equipment parameters. The most common example is incorrect transformation ratio of the distribution transformer.

[0005] The traditional method of sorting out the relationship between 10kV lines and transformers is to conduct on-site surveys by grassroots staff, compare the actual situation with the archive information of the equipment (asset) operation and maintenance lean management system, and apply for equipment changes to achieve ledger maintenance if there are any differences. However, due to the large number of 10kV lines and the transformers connected to them, the traditional carpet-style on-site search requires a lot of manpower and material resources and has low timeliness. This is also the key reason why the rate of compliance with the line loss standards of 10kV branch lines is currently slow. Therefore, it is necessary to study a 10kV line loss management method that can quickly and effectively sort out the relationship between 10kV lines and transformers, accurately locate line-transformer relationship errors, and improve the efficiency of synchronous line loss management.

[0006] Current research focuses on identifying the relationship between transformers and users in low-voltage distribution networks, and the research method is mainly based on voltage distribution correlation analysis. However, this method is based on the electrical distance between the user and the transformer in the substation. For lines with long electrical distances, due to line voltage loss, when the line load is large, the voltage difference between the first and last users will be large, which will lead to a decrease in the similarity of the voltage curves.

[0007] There is little research on the identification method of line-transformer relationship in medium-voltage distribution network. On the one hand, if the method used in the identification of transformer-account relationship in low-voltage distribution network is used in the identification of line-transformer relationship in medium-voltage distribution network, there are still limitations brought by the voltage correlation analysis method in the identification of transformer-account relationship. This problem even becomes more prominent because the medium-voltage part of the distribution network has a larger distribution range than the low-voltage part, and the voltage correlation between different distribution transformer nodes will be reduced. On the other hand, the uncertainty of distributed generation leads to changes in the voltage of each node in the distribution network, which in turn affects the calculation results of the voltage curve similarity, resulting in misjudgment.

[0008] At the same time, in the intelligent identification of line-transformer relationships, the number of distribution transformers with abnormal line-transformer relationships is often very small. If the original data set is directly put into the classifier model for training, the classification result will tend to the majority class, that is, the classification accuracy of the normal line-transformer relationship class is very high, but the recognition rate of the line-transformer relationship abnormal class, which accounts for a small proportion, is very low. In actual engineering, this misjudgment of the line-transformer relationship abnormal class will have serious consequences. Therefore, when classifying line-transformer relationships, it is necessary to consider the limitations of traditional classifier algorithms on unbalanced data sets and adopt more appropriate unbalanced data classification methods. Summary of the invention

[0009] In response to the above-mentioned problems existing in the prior art, the present invention is based on the power supply of distribution lines and the power consumption of distribution transformers, and adds data expansion of abnormal samples of line-transformer relationships based on GAN to solve the classification problem under unbalanced data sets. The support vector machine classification model is used to mine the potential correlation between power information and different line-transformer relationships, thereby realizing accurate identification of line-transformer relationships, getting rid of the limitations of the voltage distribution correlation analysis method, and ensuring the accuracy of identification, which greatly improves work efficiency and saves a lot of manpower and time costs.

[0010] Specifically, the present invention provides a linear variation relationship identification method for processing unbalanced data based on GAN, which comprises the following steps:

[0011] S1, collect the daily input power of 10kV transmission line and the daily power consumption of each distribution transformer connected to the transmission line through the user power collection system, perform data preprocessing on the collected power data to obtain the daily line loss power, and divide the line-to-transformer relationship of the distribution line into three categories: line-to-line relationship, electric energy meter multiplier relationship, and normal line-to-transformer relationship, and establish the original data set for line-to-transformer relationship identification;

[0012] S2, using four parameters, namely, Pearson coefficient, relative variation coefficient, fluctuation coefficient and slope ratio, to extract 12 feature quantities from the daily line loss of distribution lines, the daily input power of distribution lines and the daily power consumption of each transformer as the feature set for line-transformer relationship identification;

[0013] S3, using GAN to expand the data of the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, so as to achieve a balanced distribution of the number of samples between different line-variation relationship categories, which specifically includes the following sub-steps:

[0014] S31. Build a data generation model for line-variable relationship anomaly samples based on GAN. The data production model includes a generator model and a discriminator model. The input layer, hidden layer and output layer of the fully connected neural network in the generator model are designed to be 1 layer, and the number of nodes in each layer is designed to be 10, 50 and 12 respectively. The discriminator model is designed to be a binary classifier composed of the input layer, hidden layer and output layer of the fully connected neural network. The number of nodes in the input layer, hidden layer and output layer of the network is designed to be 12, 50 and 1 respectively. The learning rate of the data generation model is set to 0.01, and the total number of iterations of the network model based on GAN for processing line-variable relationship data imbalance is set to 5000.

[0015] S32. The objective function of constructing the GAN model is:

[0016]

[0017] Where V(D,G) represents the objective function of the GAN model, D(·) represents the output of the discriminator model, E(·) represents the expected value, D(x) represents the probability that the discriminator considers x to be a real sample, G(z) represents that the random signal z is a synthetic sample obtained by the generator model G, 1-D(G(z)) is the probability that the discriminator model considers the synthetic sample to be false, x~P data (x) refers to sampling from the true sample distribution, z~P z (z) refers to the noise distribution P z (z) sampling;

[0018] S33. The loss function of the generator model is set to g_loss=log(D(G(z))), and the loss function of the discriminator model is set to: d_loss=-log(D(x))+log(1-D(G(z)));

[0019] Among them, G(z) indicates that the random signal z is a generated sample obtained by the generator model G, x indicates the real line-variable abnormal sample data, and D(·) indicates the output of the discriminator model;

[0020] S34, using the loss function to train the generator and discriminator models, which specifically includes the following sub-steps:

[0021] S341, the training process adopts the generator model and the discriminator model to perform separate alternating iterative training, first fix the generator model, train the discriminator model, then fix the discriminator model, and train the generator model;

[0022] S342, when training the discriminator model, the sample data generated by the previous round of the generator model and the real sample data are spliced ​​together as the input of the discriminator model, wherein the label of the fake sample is set to 0, and the label of the real sample is set to 1, and then a probability value η is generated through the discriminator model, where η is a number between 0 and 1, and the weights of the neural network in the discriminator are updated by using the loss function composed of the probability value η and the target value, and the stochastic gradient descent method;

[0023] S343, when training the generator model, the generator model and the discriminator model are output as a whole, a set of random vectors are input, a sample data is generated in the generator model, the generated sample data is discriminated by the discriminator model to obtain the output result probability value η, the difference between the probability value η and 1 is used to form a loss function, and then the stochastic gradient descent method is used to update the weights of the neural network in the generator;

[0024] S344: Complete the separate alternating iterative training of the generator model and the discriminator model according to step S342 and step S343. g =P data When the probability values ​​of the discriminator model for the generated samples and the real samples are both 0.5, the objective function of the GAN model reaches the global optimal solution, where P g Represents the discriminator’s judgment result on the generated sample, P data It represents the discriminant result of the real line-variation abnormal sample data;

[0025] S35, using the trained generator model to perform data expansion on the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, to obtain generated samples that are similar to the overall distribution of the real line-variation relationship sample data, thereby achieving a balanced distribution of the number of samples between different line-variation relationship categories;

[0026] S4, using the line-variation relationship feature set after sample expansion, construct a support vector machine classification model, and obtain the optimized line-variation relationship classification model by optimizing the kernel function selection, penalty parameters and kernel function coefficients of the support vector machine classification model, thereby realizing the recognition of line-variation relationship.

[0027] Preferably, step S2 specifically includes the following steps:

[0028] S21. The Pearson coefficient is used to define the correlation between two types of power data. The calculation formula is:

[0029]

[0030] Among them, r is the Pearson correlation coefficient, and its value is between -1 and 1. The closer |r| is to 1, the higher the degree of linear correlation is; y irepresents the input power or line loss power of the 10kV line on the i-th day, y represents the average value of the input power or line loss power of the 10kV line; i represents the power consumption of each distribution transformer connected to the line on the i-th day, x represents the average power consumption of each distribution transformer connected to the line; n represents the number of days, and the Pearson coefficient between the input power of the 10kV line and the power consumption of each distribution transformer is defined as r s ; The Pearson coefficient between the line loss of the 10kV line and the power consumption of each transformer is defined as r l ;

[0031] S22. Calculate the ratio of two dispersion coefficients using the relative dispersion coefficient, and the calculation formula is:

[0032]

[0033] Among them, c s represents the discrete coefficient of the 10kV line input power time series; c l represents the discrete coefficient of the time series of line loss of 10kV line; c c represents the coefficient of dispersion of the power consumption time series of each distribution transformer under the line; σ represents the standard deviation; μ represents the average value; C cs Represents the relative dispersion coefficient between the power consumption of each distribution transformer and the input power of the 10kV line; C cl It indicates the relative dispersion coefficient between the power consumption of each distribution transformer and the line loss of 10kV line;

[0034] S23. The relative fluctuation between two power data is measured by using the fluctuation coefficient, and the calculation formula is:

[0035]

[0036] Among them, p i represents the daily power consumption of each distribution transformer on the i-th day, q i represents the daily input power or daily line loss power of the 10kV line on the i-th day, n represents the number of days, and d is defined as s Define d as the fluctuation coefficient of the 10kV line input power time series and the power consumption time series of each distribution transformer connected to the line. l It is the fluctuation coefficient between the line loss power time series of the 10kV line and the power consumption time series of each distribution transformer connected to the line;

[0037] S24, calculate the slope coefficient ratio: for each type of power data, first determine the starting point, end point, peak point and valley point; then calculate the slope between the starting point and the end point, the slope between the end point and the peak point, and the slope between the peak point and the valley point; finally, calculate the slope coefficient ratio of the power consumption of each distribution transformer to the line input power and the slope coefficient ratio of the power consumption of each distribution transformer to the line loss power. The specific calculation process is shown in formula (5) and formula (6):

[0038]

[0039] Among them, X s , Y s and Z s Respectively represent the slope coefficient ratio of each distribution transformer power consumption to line input power; X l , Y l and Z l Respectively represent the slope coefficient ratio of each distribution transformer power consumption and line loss power; x s 、x l 、x c They represent the starting and ending slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line; y s ,y l ,y c They represent the end point and peak slope of the 10kV line input power data, the 10kV line line loss power data and the power consumption data of the distribution transformer under the line respectively; s 、z l 、z c They respectively represent the peak and valley slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line;

[0040] S25. According to step S22 to step S25, 12 characteristic quantities of the power data of each distribution transformer are obtained, which are r s 、r l , C cs , C cl ,d s ,d l , X s , Y s , Z s , X l , Y l and Z l And the obtained 12 feature quantities are used as the feature set for line-variable relationship recognition.

[0041] Preferably, the step S1 specifically includes the following steps:

[0042] S11. Check the daily input power of the 10kV transmission line collected from the user power collection system and the daily power consumption data of each distribution transformer connected to the transmission line. If there is missing power data, determine whether the missing power data is greater than the first collection amount threshold. When the missing power data is greater than the first collection amount threshold, remove the power data of the distribution transformer user from the original sample data set. For the distribution transformer user whose missing amount is less than the first collection amount threshold, replace the missing power data with the average value of the neighboring area.

[0043] S12. If there is abnormal power consumption data, when the abnormal value of the power consumption data is higher than the first collection threshold, the daily power consumption sequence of the transformer user collected will be removed from the sample, and the abnormal power consumption data of the user whose abnormal amount is lower than the second collection threshold will be replaced by the average value of the neighboring places. For the abnormal power consumption data whose abnormal amount is higher than the second collection threshold but lower than the first collection threshold, the abnormal value data will be corrected by using the smoothing correction method;

[0044] S13. Calculate the daily distribution line line loss using the pre-processed distribution line input power and the power consumption of each distribution transformer, where the distribution line loss = distribution line input power - ∑ power consumption of each distribution transformer, and establish an original database for line-transformer relationship identification based on the distribution line input power, the power consumption of each distribution transformer and the distribution line line loss power.

[0045] Preferably, in step S1, the first collection amount threshold is 20%, and the second collection amount threshold is 10%.

[0046] Preferably, step S4 further comprises evaluating the classification result of the line-variant relationship classification model based on the support vector machine by using the evaluation value mGM.

[0047] Preferably, evaluating the classification results specifically includes the following sub-steps:

[0048] First, determine the parameters of the support vector machine model: use the LIBSVM toolbox that comes with the software MatlabR2020a to establish a support vector machine model. The kernel function of the support vector machine model selects a polynomial kernel function, and the parameters of the SVM are tuned using the grid optimization method so that the penalty parameter and kernel function parameter of the SVM are discretely valued within a certain range, and the value that gives the highest classification accuracy of the test set is taken as the optimal parameter;

[0049] Secondly, determine the evaluation indicators and evaluate the classification effect: For the multi-classification problem of unbalanced data, G-mean is applied to multi-classification evaluation and multiclass G-mean is proposed, which is defined as: mGM represents the geometric mean of the recall of all classes. If the recall of one class is zero, this metric becomes 0. The calculation formula of mGM is as follows:

[0050]

[0051] Among them, M is the number of categories, recall is the recall rate, and the result is the proportion of correctly classified samples in all minority category samples. Its calculation formula is:

[0052]

[0053] Among them, TP is the number of minority class samples that are correctly classified, and FN is the number of minority class samples that are wrongly classified as the majority class.

[0054] Preferably, in step S31, the generator model and the discriminator model respectively select the linear function pureline as the activation function of the input layer, and select the Sigmoid function as the activation function of the hidden layer and the output layer.

[0055] Compared with the prior art, the beneficial technical effects of the present invention are as follows:

[0056] (1) The present invention proposes a new line-transformer relationship identification method that can accurately identify various line-transformer relationships. It converts the original data set into a feature set, then performs sample expansion, and then identifies the line-transformer relationship through a classification model. The present invention extracts feature quantities from the daily line loss of distribution lines, the daily input power of distribution lines, and the daily power consumption of each transformer using four parameters: the Pearson coefficient, the relative variation coefficient, the fluctuation coefficient, and the slope ratio, to form a user power feature quantity set suitable for intelligent identification of line-transformer relationships. Based on the power supply of distribution lines and the power consumption of distribution transformers, the support vector machine classification model is used to mine the potential correlation between power information and different line-transformer relationships, thereby realizing the intelligent identification of line-transformer relationships and getting rid of the limitations of traditional line-transformer relationship identification methods based on voltage distribution correlation analysis.

[0057] (2) The present invention proposes a data generation model for linear relationship anomaly samples based on GAN, and uses it to expand the data of linear relationship anomaly samples that only account for a very small number of linear relationship feature sets, thereby achieving a balanced distribution of the number of samples between different linear relationship categories, solving the classification problem under unbalanced data sets, and greatly improving the work efficiency and recognition accuracy of linear relationship recognition.

[0058] (3) When classifying the line-transformer relationship, the present invention selects the support vector machine in machine learning as the classifier model to realize the classification processing of different line-transformer relationships. The experimental verification results show that the recall rate of the three types of line-transformer relationships (line wrong line-transformer relationship, multiplier error line-transformer relationship and normal line-transformer relationship) of the method proposed in the present invention is more than 92%. This method can greatly reduce the workload of employees' on-site inspections, provide a new idea for the optimization and management of line-transformer relationships in 10kV distribution networks, and greatly save manpower and time costs.

[0059] (4) In terms of the object of solving the problem, compared with the previous line-transformer relationship detection method, the method proposed in the present invention can not only realize the distribution network topology identification in the line-transformer relationship error (line wrong hanging type), but also detect the equipment parameter error (multiplier error type) in the line-transformer relationship error.

[0060] (5) Compared with the traditional SMOTE oversampling method, the GAN-based linear variable relationship unbalanced data processing method of the present invention can generate generated data that is close to the real data without being based on real data. This proposes a new idea for the research on unbalanced data processing methods and is a great breakthrough.

[0061] (6) The data generation model of linear variation relationship anomaly samples based on GAN proposed in the present invention gets rid of the limitation that the traditional SMOTE oversampling method is no longer applicable to sample sets with large cross-domain or overlap, and the method proposed in the present invention is nearly 14% better than the traditional SMOTE method under the mGM indicator. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a schematic diagram of the process of the present invention;

[0063] Figure 2 It is a specific schematic diagram of the linear variation relationship identification method for processing unbalanced data based on GAN in the present invention;

[0064] Figure 3 It is a graph showing the mean square error change between the generator and the discriminator in the GAN model of the present invention;

[0065] Figure 4 Generate a sample discrimination result graph in the GAN model of the present invention;

[0066] Figure 5 A comparison chart of the generated data and the real data obtained by the GAN model of the present invention;

[0067] Figure 6 The present invention is based on GAN to generate a model structure for abnormal sample data of linear variation relationship;

[0068] Figure 7This is a comparison diagram of the effects of the unbalanced data processing method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0069] Hereinafter, embodiments of the present invention will be described with reference to the drawings.

[0070] like Figure 1 As shown, the present invention provides a linear variation relationship recognition method for processing unbalanced data based on GAN, which includes the following steps:

[0071] S1, collect the daily input power of 10kV transmission line and the daily power consumption of each distribution transformer connected to the transmission line through the user power collection system, perform data preprocessing on the collected power data to obtain the daily line loss power, and divide the line-to-transformer relationship of the distribution line into three categories: line-to-line relationship, electric energy meter multiplier relationship, and normal line-to-transformer relationship, and establish the original data set for line-to-transformer relationship identification;

[0072] S2, using four parameters, namely, Pearson coefficient, relative variation coefficient, fluctuation coefficient and slope ratio, to extract 12 characteristic quantities from the daily line loss of distribution lines, the daily input power of distribution lines and the daily power consumption of each transformer as the feature set of line-transformer relationship;

[0073] S3, using GAN to expand the data of the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, so as to achieve a balanced distribution of the number of samples between different line-variation relationship categories, which specifically includes the following sub-steps:

[0074] S31, press Figure 6 As shown in the figure, a data generation model of abnormal samples of linear variation relationship based on GAN is built. The model structure is mainly composed of a generator model and a discriminator model. Because the feature data of each category of samples in the linear variation relationship data set are all one-dimensional tensor data, the generator model and the discriminator model are designed as a fully connected neural network structure. The input layer, hidden layer and output layer of the fully connected neural network in the generator model are all designed to be 1 layer, and the number of nodes in each layer is designed to be 10, 50 and 12 respectively. The linear function pureline is selected as the activation function of the input layer, and the Sigmoid function is selected as the activation function of the hidden layer and the output layer. The discriminator model is designed as a binary classifier composed of 3 layers of fully connected neural networks. The number of nodes in the input layer, hidden layer and output layer of the network is designed to be 12, 50 and 1 respectively. The linear function pureline is selected as the activation function of the input layer, and the Sigmoid function is selected as the activation function of the hidden layer and the output layer. The learning rate is 0.01, and the total number of iterations of the network model based on GAN to process the imbalance of linear variation relationship data is set to 5000;

[0075] S32. The objective function of constructing the GAN model is:

[0076]

[0077] Where V(D,G) represents the objective function of the GAN model, D(·) represents the output of the discriminator model, E(·) represents the expected value, D(x) represents the probability that the discriminator considers x to be a real sample, G(z) represents that the random signal z is a synthetic sample obtained by the generator model G, 1-D(G(z)) is the probability that the discriminator model considers the synthetic sample to be false, x~P data (x) refers to sampling from the true sample distribution, z~P z (z) refers to the noise distribution P z (z) sampling;

[0078] This is a maximum-minimum optimization problem. The training network D is to classify the labels of the training samples with the maximum probability, that is, to maximize log(D(x)) and log(1-D(G(z))); while the training network G needs to minimize log(1-D(G(z)));

[0079] S33, such as Figure 6 As shown, the random signal is passed through the generator model to generate sample data similar to the real line-variation abnormal sample, and then the generated sample and the line-variation abnormal sample are simultaneously placed in the discriminator model. Since the discriminator model is a binary classifier, the output result is the probability value of the sample belonging to the real sample. The loss function is obtained according to the output result, and finally the generator and discriminator models are trained respectively according to the loss function. The loss function of the generator model is set to g_loss = log(D(G(z))), and the loss function of the discriminator model is set to: d_loss = -log(D(x)) + log(1-D(G(z)));

[0080] Among them, G(z) indicates that the random signal z is a generated sample obtained by the generator model G, x indicates the real line-variable abnormal sample data, and D(·) indicates the output of the discriminator model;

[0081] S34, using the loss function to train the generator and discriminator models, which specifically includes the following sub-steps:

[0082] S341, the training process adopts the generator model and the discriminator model to perform separate alternating iterative training, first fix the generator model, train the discriminator model, then fix the discriminator model, and train the generator model;

[0083] S342, when training the discriminator model, the sample data generated by the previous round of the generator model and the real sample data are spliced ​​together as the input of the discriminator model, wherein the label of the fake sample is set to 0, and the label of the real sample is set to 1, and then a probability value η is generated through the discriminator model, where η is a number between 0 and 1, and the weights of the neural network in the discriminator are updated by using the loss function composed of the probability value η and the target value, and the stochastic gradient descent method;

[0084] S343, when training the generator model, the generator model and the discriminator model are output as a whole, a set of random vectors are input, a sample data is generated in the generator model, the generated sample data is discriminated by the discriminator model to obtain the output result probability value η, the difference between the probability value η and 1 is used to form a loss function, and then the stochastic gradient descent method is used to update the weights of the neural network in the generator;

[0085] S344: Complete the separate alternating iterative training of the generator model and the discriminator model according to step S342 and step S343. g =P data When (where P g Represents the discriminator’s judgment result on the generated sample, P data represents the discriminant result of the real line-variation abnormal sample data), that is, when the probability value of the discriminator model outputs the generated sample and the real sample is 0.5, the objective function of the GAN model reaches the global optimal solution;

[0086] S35, using the trained generator model to perform data expansion on the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, to obtain generated samples that are similar to the overall distribution of the real line-variation relationship sample data, thereby achieving a balanced distribution of the number of samples between different line-variation relationship categories;

[0087] S4, using the line-variation relationship feature set after sample expansion, constructs a support vector machine classification model, and obtains the optimized line-variation relationship classification model by optimizing the kernel function selection, penalty parameters and kernel function coefficients of the support vector machine classification model, thereby realizing intelligent recognition of line-variation relationships. Specific embodiments

[0089] In a specific application scenario of an embodiment of the present invention, taking 18 10kV distribution lines in a certain area and the 449 distribution transformer users connected thereto as an example, the daily input power data of the distribution lines and the power consumption data of the transformers connected to the corresponding distribution lines are collected for a period of one month. In view of the actual situation, the errors in the relationship between distribution transformer users and lines are mainly manifested in two aspects: the user is connected to the wrong distribution line and the electric energy meter multiplier recorded by the system does not match the on-site situation, referred to as the line connection error category and the electric energy meter multiplier error category. Table 1 shows the data distribution of each category.

[0090] Table 1 Distribution of each category

[0091] category quantity Category Label Wrong line connection 12 1 The power meter multiplier is wrong 42 2 normal 395 3 total 449 /

[0092] The embodiment of the present invention provides a linear variation relationship recognition method based on GAN processing of unbalanced data, and the technical route is as follows: Figure 2 As shown, the specific steps of the method are as follows:

[0093] Through step S1, the collected power data is preprocessed, and the specific steps are shown in S11-S13:

[0094] S11. Check the daily input power of 10kV transmission lines collected from the user power collection system and the daily power consumption data of each distribution transformer connected to them. If there is missing power data, when the missing power data is greater than 20% of the collected amount, the power data of the distribution transformer user will be removed from the original sample data set. For the distribution transformer user whose missing amount is less than 20% of the collected amount, the missing power data will be replaced with the average value of the neighboring area.

[0095] S12. If there is abnormal power consumption data, when the abnormal value of power consumption data is higher than 20% of the collected amount, the daily power consumption sequence of the transformer user collected will be eliminated in the sample, and the abnormal value data of power consumption of users with abnormal amount lower than 10% of the collected amount will be replaced by the average of the nearby places. For the abnormal power consumption data higher than 10% of the collected amount but lower than 20% of the collected amount, the abnormal value data will be corrected by using the smoothing correction method.

[0096] S13. Calculate the daily line loss of the distribution line using the pre-processed input power of the distribution line and the power consumption of each distribution transformer. Line loss of the distribution line = input power of the distribution line - ∑ power consumption of each distribution transformer. Establish a line-transformer relationship identification original database based on the input power of the distribution line, the power consumption of each distribution transformer and the line loss of the distribution line. Take one of the A lines as an example, the power data is shown in Table 2.

[0097] Table 2 30-day power data of Line A and the relationship between line change

[0098]

[0099] Step S2, extracting characteristic quantities from the daily line loss of the distribution line, the daily input power of the distribution line and the daily power consumption of each transformer using four parameters, namely, the Pearson coefficient, the relative variation coefficient, the fluctuation coefficient and the slope ratio, as a characteristic set of the line-transformer relationship;

[0100] S21, 12 characteristic quantities are extracted from the four parameters of Pearson coefficient, relative variation coefficient, fluctuation coefficient and slope ratio, including daily line loss of distribution lines, daily input power of distribution lines and daily power consumption of each distribution transformer. The specific implementation process is as follows:

[0101] S22, Pearson coefficient: It defines the degree of correlation between two types of power data, and its calculation formula is:

[0102]

[0103] Among them, r is the Pearson correlation coefficient, and its value is between -1 and 1. The closer |r| is to 1, the higher the degree of linear correlation is; y i represents the input power or line loss power of the 10kV line on the i-th day, y represents the average value of the input power or line loss power of the 10kV line; i represents the power consumption of each distribution transformer connected to the line on the i-th day, x represents the average power consumption of each distribution transformer connected to the line; n represents the number of days. The Pearson coefficient between the input power of the 10kV line and the power consumption of each distribution transformer is defined as r s ; The Pearson coefficient between the line loss of the 10kV line and the power consumption of each transformer is defined as r l .

[0104] S23, relative dispersion coefficient: It is the ratio of two dispersion coefficients, and its calculation formula is:

[0105]

[0106] Among them, c s represents the discrete coefficient of the 10kV line input power time series; c l represents the discrete coefficient of the time series of line loss of 10kV line; c c represents the coefficient of dispersion of the power consumption time series of each distribution transformer under the line; σ represents the standard deviation; μ represents the average value; C cs Represents the relative dispersion coefficient between the power consumption of each distribution transformer and the input power of the 10kV line; C cl It represents the relative dispersion coefficient between the power consumption of each distribution transformer and the line loss of 10kV line.

[0107] S24, Fluctuation coefficient: It is used to measure the relative fluctuation between two power data. Its calculation formula is:

[0108]

[0109] Among them, p i represents the daily power consumption of each distribution transformer on the i-th day, q i represents the daily input power or daily line loss power of the 10kV line on the i-th day; n represents the number of days. Definition d s The fluctuation coefficient of the 10kV line input power time series and the power consumption time series of each distribution transformer connected to the line is defined as d l It is the fluctuation coefficient between the line loss power time series of the 10kV line and the power consumption time series of each distribution transformer connected to the line.

[0110] S25. Calculate the slope coefficient ratio: For each type of power data, first determine the starting point, end point, peak point and valley point; then calculate the slope between the starting point and the end point, the slope between the end point and the peak point, and the slope between the peak point and the valley point; finally, calculate the slope coefficient ratio of the power consumption of each distribution transformer to the line input power and the slope coefficient ratio of the power consumption of each distribution transformer to the line loss power. The specific calculation process is shown in formula (5) and formula (6):

[0111]

[0112] Among them, X s , Y s and Z s Respectively represent the slope coefficient ratio of each distribution transformer power consumption to line input power; X l , Y l and Z l Respectively represent the slope coefficient ratio of each distribution transformer power consumption and line loss power; x s 、x l 、x c They represent the starting and ending slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line; y s ,y l ,y c They represent the end point and peak slope of the 10kV line input power data, the 10kV line line loss power data and the power consumption data of the distribution transformer under the line respectively; s 、z l 、z c They respectively represent the peak and valley slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line;

[0113] S26, referring to step S22 to step S25, obtain the characteristic quantities of the power data of each distribution transformer, which are r s 、r l , C cs , C cl ,d s ,d l , X s , Y s , Z s , X l , Y l and Z l These 12 eigenvalues ​​are used as the feature set for line-varying relationship identification.

[0114] Step S3, as can be seen from Table 1, the number of the three categories of line error, rate error and normal in the original 449 transformer user data is 12, 42 and 395 respectively. The number distribution of the three categories is extremely unbalanced. If directly put into the classifier model for training, the classification result will tend to the majority class, that is, the classification accuracy for the normal class is very high, but the classification accuracy for the two categories of line error and rate error, which account for a small proportion, is very low. Therefore, GAN is used to expand the data of the two minority categories of line error and power meter rate error in the original data, so that the number of samples in each category is balanced, so as to solve the problem of inaccurate classification of unbalanced data sets on traditional classifier models;

[0115] S31, press Figure 6 As shown in the figure, a data generation model of abnormal samples of linear variation relationship based on GAN is built. The model structure is mainly composed of a generator model and a discriminator model. Because the feature data of each category of samples in the linear variation relationship data set are all one-dimensional tensor data, the generator model and the discriminator model are designed as a fully connected neural network structure. The input layer, hidden layer and output layer of the fully connected neural network in the generator model are all designed to be 1 layer, and the number of nodes in each layer is designed to be 10, 50 and 12 respectively. The linear function pureline is selected as the activation function of the input layer, and the Sigmoid function is selected as the activation function of the hidden layer and the output layer. The discriminator model is designed as a binary classifier composed of 3 layers of fully connected neural networks. The number of nodes in the input layer, hidden layer and output layer of the network is designed to be 12, 50 and 1 respectively. The linear function pureline is selected as the activation function of the input layer, and the Sigmoid function is selected as the activation function of the hidden layer and the output layer. The learning rate is 0.01, and the total number of iterations of the network model based on GAN to process the imbalance of linear variation relationship data is set to 5000;

[0116] S32. The objective function of constructing the GAN model is:

[0117]

[0118] Where V(D,G) represents the objective function of the GAN model, D(·) represents the output of the discriminator model, E(·) represents the expected value, D(x) represents the probability that the discriminator considers x to be a real sample, G(z) represents that the random signal z is a synthetic sample obtained by the generator model G, 1-D(G(z)) is the probability that the discriminator model considers the synthetic sample to be false, x~P data (x) refers to sampling from the true sample distribution, z~P z (z) refers to the noise distribution P z (z) sampling;

[0119] This is a maximum-minimum optimization problem. The training network D is to classify the labels of the training samples with the maximum probability, that is, to maximize log(D(x)) and log(1-D(G(z))); while the training network G needs to minimize log(1-D(G(z)));

[0120] Among them, G(z) indicates that the random signal z is a generated sample obtained by the generator model G, x indicates the real line-variable abnormal sample data, and D(·) indicates the output of the discriminator model;

[0121] The random signal passes through the generator model to generate sample data similar to the real sample. Then the generated sample and the linear variation relationship abnormal sample are put into the discriminator model at the same time. The discriminator model is a binary classifier, and the output result is the probability value of the sample belonging to the real sample. The loss function is obtained according to the output result, and finally the generator and discriminator models are trained according to the loss function.

[0122] S33. The training process uses the generator model and the discriminator model to iterate separately and alternately. Usually, the generator model is fixed first, the discriminator model is trained, and then the discriminator is fixed and the generator model is trained. When training the discriminator model: the sample data generated by the generator model in the previous round and the real sample data are directly spliced ​​together as the input of the discriminator. The label of the false sample corresponds to 0, and the label of the real sample corresponds to 1. Then, a probability value (a number between 0 and 1) can be generated by the discriminator model, and the gradient backpropagation can be performed through the loss function composed of the probability value and the target value. When training the generator model: the generator model and the discriminator model need to be treated as a whole. The output of this whole is still the probability value. By inputting a set of random vectors, a sample data can be generated in the generator, and the generated sample is discriminated by the discriminator model to obtain the result. This is the forward process of the whole system. The output probability value of the discriminator model is 1, which is the target that the whole system needs to optimize. The difference between the output value and 1 can constitute the loss function. Then the network weights can be updated by stochastic gradient descent. In this way, the generator model and the discriminator model are iterated alternately. When P g =P data When (where P g Represents the discriminator’s judgment result on the generated sample, P data Represents the discriminant result of the real sample), that is, when the probability value of the discriminator model outputs the generated sample and the real sample is 0.5, the objective function of the GAN model reaches the global optimal solution.

[0123] S34. Use the trained generator model to perform data expansion on sample data with abnormal linear variation relationships to obtain a batch of generated samples that are similar to the overall distribution of real data, thereby solving the problem of uneven distribution of sample data.

[0124] The loss function in step S33 is specifically defined as follows: the loss function of the generator model is g_loss=log(D(G(z))), and the loss function of the discriminator model is: d_loss=-log(D(x))+log(1-D(G(z))). Where G(z) represents the generated sample obtained by the generator model, x represents the real sample, and D(·) represents the output of the discriminator model.

[0125] Take the data expansion of samples with wrong multiplier calculation of electric energy meter as an example. Figure 3 The changes in the mean square error (G-mse and D-mse) of the generator and the discriminator are shown. It can be seen that the dynamic game process between the generator and the discriminator, as the iteration proceeds, the mean square error of the generator and the discriminator is constantly moving closer together, and the two sides of the game eventually reach the same "strength", thus reaching a Nash equilibrium. Figure 4It shows that the discrimination results of the final generated samples after the discriminator are all around 0.5, just like the final results derived from the GAN principle in step S33. It can be seen that the objective function of the GAN model reaches the global optimal solution.

[0126] Figure 5 The comparison between real data and generated data is shown. From the figure, it can be seen that the generated data of the generative adversarial network is closer to the overall distribution of real data.

[0127] Based on the above analysis, we can use the generated 42 sample data as real samples for training. Similarly, we expand the two categories of wrong wiring and wrong power meter multiplier from the original 12 and 42 to 12*33=396 and 42*9=378 respectively. This solves the problem of uneven distribution of sample numbers between categories.

[0128] Step S4, using the feature set after sample expansion, constructing a support vector machine classification model, and optimizing the linear variable relationship model by selecting the kernel function of the support vector machine model and optimizing the penalty parameters and kernel function coefficients.

[0129] S41. Parameter design of support vector machine: Use the LIBSVM toolbox that comes with the software MatlabR2020a to establish a support vector machine model. The kernel function of the support vector machine selects the polynomial kernel function, and the grid optimization method is used to tune the parameters of the SVM, that is, the penalty parameter and kernel function parameter of the SVM are discretely valued within a certain range, and the value that makes the classification accuracy of the test set the highest is taken as the optimal parameter. Finally, the penalty parameter is 16 and the kernel function parameter is 1. A 10-fold cross-validation strategy is used to select 90% of the total samples as training samples and the remaining 10% as test samples. The average classification recall rate of the 10 test sets is regarded as the recall rate of the classifier, and the average value is taken from multiple tests.

[0130] S42. Determine the evaluation index and evaluate the classification effect: For the multi-classification problem of unbalanced data, G-mean is applied to multi-classification evaluation and multiclass G-mean is proposed. Its definition is: mGM represents the geometric mean of the recall of all classes. If the recall of one class is zero, this metric becomes 0. The calculation formula of mGM is as follows:

[0131]

[0132] Where M is the number of categories. Recall is the recall rate, which is the proportion of correctly classified samples in all minority category samples. Its calculation formula is:

[0133]

[0134] Among them, TP is the number of minority class samples that are correctly classified, and FN is the number of minority class samples that are wrongly classified as the majority class.

[0135] S43. Put the expanded data set of S3 into the classifier model, and the results are shown in Table 3 (wherein, SMOTE-SVM refers to a line-varying relationship recognition model based on SMOTE to process unbalanced data and SVM as a classifier, and GAN-SVM refers to a line-varying relationship recognition model based on GAN to process unbalanced data and SVM as a classifier). From the results in Table 3, it can be concluded that the GAN-based unbalanced data processing method proposed in the present invention is superior to the traditional synthetic minority oversampling technology (SMOTE), and the line-varying relationship recognition model proposed in the present invention has an mGM index of 95.86% in identifying different line-varying relationships, which proves the accuracy of the method.

[0136] Table 3 Recall results of each category

[0137]

[0138] From the results, it can be seen that the present invention solves the classification problem of imbalanced data from the data level. Since the traditional SMOTE oversampling method starts from the local sample point and does not consider the overall distribution of the data set, it is no longer applicable to sample sets with more crossover or overlap of class domains. Therefore, a generative adversarial network is proposed as a generative model to expand the data set samples to solve the classification problem of imbalanced data. The experimental results show that under the mGM indicator, the GAN-based imbalanced data processing method is nearly 13.5% higher than the traditional SMOTE-based imbalanced data processing method. It can be seen that the GAN-based imbalanced data processing method proposed by the present invention is superior to the traditional synthetic minority class oversampling technology. Figure 7 As shown, the data generation model of linear variation relationship abnormal samples based on GAN proposed in the present invention gets rid of the limitation that the traditional SMOTE oversampling method is no longer applicable to sample sets with more crossover or overlap of class domains, and the method proposed in the present invention is nearly 14% better than the traditional SMOTE method under the mGM indicator.

[0139] The embodiments described above are only descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A linear variation relationship recognition method for processing unbalanced data based on GAN, characterized by: It includes the following steps: S1. The daily input power of the 10kV transmission line and the daily power consumption of each distribution transformer connected to the transmission line are collected through the user power collection system. The collected power data are preprocessed to obtain the daily line loss power. The line-to-transformer relationship of the distribution line is divided into three categories: the line-to-transformer relationship when the line is hung incorrectly, the line-to-transformer relationship when the electric energy meter multiplier is wrong, and the normal line-to-transformer relationship, and the original data set for line-to-transformer relationship identification is established; S2, using the four parameters of Pearson coefficient, relative variation coefficient, fluctuation coefficient and slope ratio, 12 feature quantities are extracted from the daily line loss of distribution lines, the daily input power of distribution lines and the daily power consumption of each transformer as the feature set for line-transformer relationship identification; S3. GAN is used to perform data expansion on the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, so as to achieve a balanced distribution of the number of samples between different line-variation relationship categories. Specifically, the following sub-steps are included: S31. Build a data generation model for line-variable relationship anomaly samples based on GAN. The data production model includes a generator model and a discriminator model. The input layer, hidden layer and output layer of the fully connected neural network in the generator model are designed to be 1 layer, and the number of nodes in each layer is designed to be 10, 50 and 12 respectively. The discriminator model is designed to be a binary classifier composed of the input layer, hidden layer and output layer of the fully connected neural network. The number of nodes in the input layer, hidden layer and output layer of the network is designed to be 12, 50 and 1 respectively. The learning rate of the data generation model is set to 0.01, and the total number of iterations of the network model based on GAN for processing line-variable relationship data imbalance is set to 5000. S32. The objective function of constructing the GAN model is: Where V(D,G) represents the objective function of the GAN model, D(·) represents the output of the discriminator model, E(·) represents the expected value, D(x) represents the probability that the discriminator considers x to be a real sample, G(z) represents that the random signal z is a synthetic sample obtained by the generator model G, 1-D(G(z)) is the probability that the discriminator model considers the synthetic sample to be false, x~P data (x) refers to sampling from the true sample distribution, z~P z (z) refers to the noise distribution P z (z) sampling; S33. The loss function of the generator model is set to g_loss=log(D(G(z))), and the loss function of the discriminator model is set to: d_loss=-log(D(x))+log(1-D(G(z))); Among them, G(z) indicates that the random signal z is a generated sample obtained by the generator model G, x indicates the real line-variable abnormal sample data, and D(·) indicates the output of the discriminator model; S34, using the loss function to train the generator and discriminator models, which specifically includes the following sub-steps: S341, the training process adopts the generator model and the discriminator model to perform separate alternating iterative training, first fix the generator model, train the discriminator model, then fix the discriminator model, and train the generator model; S342, when training the discriminator model, the sample data generated by the previous round of the generator model and the real sample data are spliced ​​together as the input of the discriminator model, wherein the label of the fake sample is set to 0, and the label of the real sample is set to 1, and then a probability value η is generated through the discriminator model, where η is a number between 0 and 1, and the weights of the neural network in the discriminator are updated by using the loss function composed of the probability value η and the target value, and the stochastic gradient descent method; S343, when training the generator model, the generator model and the discriminator model are output as a whole, a set of random vectors are input, a sample data is generated in the generator model, the generated sample data is discriminated by the discriminator model to obtain the output result probability value η, the difference between the probability value η and 1 is used to form a loss function, and then the stochastic gradient descent method is used to update the weights of the neural network in the generator; S344: Complete the separate alternating iterative training of the generator model and the discriminator model according to step S342 and step S343. g =P data When the probability values ​​of the discriminator model for the generated samples and the real samples are both 0.5, the objective function of the GAN model reaches the global optimal solution, where P g Represents the discriminator’s judgment result on the generated sample, P data It represents the discriminant result of the real line-variation abnormal sample data; S35, using the trained generator model to perform data expansion on the line-variation relationship abnormal samples that only account for a very small number of line-variation relationship feature sets, to obtain generated samples that are similar to the overall distribution of the real line-variation relationship sample data, thereby achieving a balanced distribution of the number of samples between different line-variation relationship categories; S4. Using the line-variable relationship feature set after sample expansion, a support vector machine classification model is constructed. By optimizing the kernel function selection, penalty parameters and kernel function coefficients of the support vector machine classification model, an optimized line-variable relationship classification model is obtained, thereby realizing the recognition of line-variable relationships.

2. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 1 is characterized by: Step S2 specifically includes the following steps: S21. The Pearson coefficient is used to define the correlation between two types of power data. The calculation formula is: Among them, r is the Pearson correlation coefficient, and its value is between -1 and 1. The closer |r| is to 1, the higher the degree of linear correlation is; y i represents the input power or line loss power of the 10kV line on the i-th day, Represents the average value of the input power or line loss power of the 10kV line; x i represents the power consumption of each distribution transformer connected to the line on the i-th day, x represents the average power consumption of each distribution transformer connected to the line; n represents the number of days, and the Pearson coefficient between the input power of the 10kV line and the power consumption of each distribution transformer is defined as r s ; The Pearson coefficient between the line loss of the 10kV line and the power consumption of each transformer is defined as r l ; S22. Calculate the ratio of two dispersion coefficients using the relative dispersion coefficient, and the calculation formula is: Among them, c s represents the discrete coefficient of the 10kV line input power time series; c l represents the discrete coefficient of the time series of line loss of 10kV line; c c represents the coefficient of dispersion of the power consumption time series of each distribution transformer under the line; σ represents the standard deviation; μ represents the average value; C cs Represents the relative dispersion coefficient between the power consumption of each distribution transformer and the input power of the 10kV line; C cl It indicates the relative dispersion coefficient between the power consumption of each distribution transformer and the line loss of 10kV line; S23. The relative fluctuation between two power data is measured by using the fluctuation coefficient, and the calculation formula is: Among them, p i represents the daily power consumption of each distribution transformer on the i-th day, q i represents the daily input power or daily line loss power of the 10kV line on the i-th day, n represents the number of days, and d is defined as s Define d as the fluctuation coefficient of the 10kV line input power time series and the power consumption time series of each distribution transformer connected to the line. l It is the fluctuation coefficient between the line loss power time series of the 10kV line and the power consumption time series of each distribution transformer connected to the line; S24, calculate the slope coefficient ratio: for each type of power data, first determine the starting point, end point, peak point and valley point; then calculate the slope between the starting point and the end point, the slope between the end point and the peak point, and the slope between the peak point and the valley point; finally, calculate the slope coefficient ratio of the power consumption of each distribution transformer to the line input power and the slope coefficient ratio of the power consumption of each distribution transformer to the line loss power. The specific calculation process is shown in formula (5) and formula (6): Among them, X s , Y s and Z s Respectively represent the slope coefficient ratio of each distribution transformer power consumption to line input power; X l , Y l and Z l Respectively represent the slope coefficient ratio of each distribution transformer power consumption and line loss power; x s 、x l 、x c They represent the starting and ending slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line; y s ,y l ,y c They represent the end point and peak slope of the 10kV line input power data, the 10kV line line loss power data and the power consumption data of the distribution transformer under the line respectively; s 、z l 、z c They represent the peak and valley slopes of the 10kV line input power data, the 10kV line line loss power data, and the power consumption data of the distribution transformer under the line; S25. According to step S22 to step S25, 12 characteristic quantities of the power data of each distribution transformer are obtained, which are r s 、r l , C cs , C cl d s d l , X s , Y s , Z s , X l , Y l and Z l And the obtained 12 feature quantities are used as the feature set for line-variable relationship recognition.

3. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 1, characterized in that: The step S1 specifically includes the following steps: S11. Check the daily input power of the 10kV transmission line collected from the user power collection system and the daily power consumption data of each distribution transformer connected to the transmission line. If there is missing power data, determine whether the missing power data is greater than the first collection amount threshold. When the missing power data is greater than the first collection amount threshold, remove the power data of the distribution transformer user from the original sample data set. For the distribution transformer user whose missing amount is less than the first collection amount threshold, replace the missing power data with the average value of the neighboring area. S12. If there is abnormal power consumption data, when the abnormal value of the power consumption data is higher than the first collection threshold, the daily power consumption sequence of the transformer user collected will be removed from the sample, and the abnormal power consumption data of the user whose abnormal amount is lower than the second collection threshold will be replaced by the average value of the neighboring places. For the abnormal power consumption data whose abnormal amount is higher than the second collection threshold but lower than the first collection threshold, the abnormal value data will be corrected by using the smoothing correction method; S13. Calculate the daily distribution line line loss using the pre-processed distribution line input power and the power consumption of each distribution transformer, where the distribution line loss = distribution line input power - ∑ power consumption of each distribution transformer, and establish an original database for line-transformer relationship identification based on the distribution line input power, the power consumption of each distribution transformer and the distribution line line loss power.

4. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 3 is characterized by: In step S1, the first collection amount threshold is 20%, and the second collection amount threshold is 10%.

5. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 1, characterized in that: Step S4 also includes evaluating the classification result of the line-variant relationship classification model based on the support vector machine using the evaluation value mGM.

6. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 5 is characterized by: The evaluation of the classification results specifically includes the following sub-steps: First, determine the parameters of the support vector machine model: use the LIBSVM toolbox that comes with the software MatlabR2020a to establish a support vector machine model. The kernel function of the support vector machine model selects a polynomial kernel function, and the parameters of the SVM are tuned using the grid optimization method so that the penalty parameter and kernel function parameter of the SVM are discretely valued within a certain range, and the value that gives the highest classification accuracy of the test set is taken as the optimal parameter; Secondly, determine the evaluation indicators and evaluate the classification effect: For the multi-classification problem of unbalanced data, G-mean is applied to multi-classification evaluation and multiclass G-mean is proposed, which is defined as: mGM represents the geometric mean of the recall of all classes. If the recall of one class is zero, this metric becomes 0. The calculation formula of mGM is as follows: Among them, M is the number of categories, recall is the recall rate, and the result is the proportion of samples that are correctly classified in all minority category samples. Its calculation formula is: Among them, TP is the number of minority class samples that are correctly classified, and FN is the number of minority class samples that are wrongly classified as the majority class.

7. The linear variation relationship identification method based on GAN processing of unbalanced data according to claim 1, characterized in that: In step S31, the generator model and the discriminator model respectively select the linear function pureline as the activation function of the input layer, and select the Sigmoid function as the activation function of the hidden layer and the output layer.