Photovoltaic abnormal data reconstruction method and system based on feature weighted local abnormal factors

Identify and delete abnormal data through the feature-weighted local abnormal factor model, and use the reconstruction model adding gradient penalty to solve the problem that the influence of abnormal data and feature correlation are not considered in the reconstruction of missing data in the existing technology, and achieve higher Data reconstruction accuracy and stability.

CN119337069APending Publication Date: 2025-01-21STATE GRID JIANGSU ELECTRIC POWER CO LTD SUZHOU BRANCH +5

Patent Information

Application Number
CN202411362243.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The prior art fails to effectively consider the impact of abnormal data on the data set and the correlation of features in missing data reconstruction, resulting in misleading analysis results, low accuracy and poor stability.

Method used

Adopting feature weighted local abnormal factor models, the linear relationship between variables is measured through Pilson phase relationship numbers, calculating the weighted Oushi distance and local density density, and finally calculating the local iconic factor to identify and delete abnormal data. At the same time, the reconstruction of the gradient punishment is missing the lack of data models to improve the quality and availability of the data set.

Benefits of technology

Improve the accuracy of abnormal detection, identify and delete abnormal data more accurately, ensure the integrity and quality of the data set, and improve the accuracy and stability of the data reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337069A_ABST
    Figure CN119337069A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic power station abnormal data reconstruction method and system based on a feature weighted local abnormal factor, and the method comprises the steps: obtaining the historical data of a photovoltaic power station, and constructing and training a feature weighted local abnormal factor model; inputting power grid data into the model for identification, deleting abnormal data and obtaining a missing data set; normalizing the data, and dividing the normalized data into a training set and a test set; training the reconstruction missing data model by using the training set, and judging the reconstruction performance according to the test set; and acquiring photovoltaic power station data in real time, acquiring a missing data set, inputting the missing data set into the trained missing data reconstruction model, and reconstructing missing data. According to the method, different importance is given to different features when the local abnormal factors are calculated, so that the overall abnormal point detection accuracy is improved, the gradient stability is remarkably improved, and the data reconstruction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of abnormal data reconstruction, and in particular relates to a method and system for reconstructing abnormal data of a photovoltaic power station based on feature-weighted local abnormal factors. Background Art

[0002] The power system is a highly complex and dynamic network, including power generation, transmission, distribution and consumption. In this process, the monitoring and control system continuously collects and analyzes data to ensure the stable supply of electricity and the normal operation of the system. However, due to equipment aging, operating errors, environmental interference or technical failures, abnormal data may be generated in the electrical system, which destroys the original distribution of the data set and causes insufficient data redundancy, hindering the improvement of the prediction accuracy of power grid data. Therefore, accurate outlier identification of the original data is a key step to improve the accuracy of missing data reconstruction.

[0003] Existing technologies for reconstructing missing data include:

[0004] The patent with publication number CN118364326A discloses a photovoltaic data repair method, device, equipment and computer-readable storage medium. Taking into account the periodicity and seasonality of photovoltaic output data, the K-means++ clustering algorithm is used to cluster the photovoltaic data according to weather type, and then each cluster cluster after clustering, that is, each class of data set, is trained separately to generate adversarial filling network to fill the missing data of the category. Before clustering the photovoltaic data, the generative adversarial filling network is used to pre-fill the original photovoltaic historical output sequence containing missing data to obtain a complete pre-filled sequence, and then the complete sequence after pre-filling is clustered using the K-means++ algorithm.

[0005] The patent with the authorization announcement number CN115115098B discloses a two-stage identification method of distributed photovoltaic output based on missing data reconstruction technology, which belongs to the field of electrical engineering technology. The method of the present invention utilizes the characteristics of no photovoltaic output at night to transform the photovoltaic output identification problem into the actual load missing data reconstruction problem. A data-driven method is adopted, and deep learning technology is used to mine the distribution characteristics and distribution laws of historical loads, so that new data that meets the distribution can be generated, and the missing part of the actual load data during the daytime period can be accurately filled, thereby realizing the rough identification of photovoltaic output. On this basis, the measured output data and installed capacity information of the photovoltaic reference station are fully considered to realize the refined identification of the target distributed photovoltaic output and installed capacity. However, the current reconstruction method of missing data still has some defects in terms of accuracy, rapidity and universality. First, the impact of abnormal data on the data set is not considered. The outliers in the data set may mislead the analysis results and affect the decision-making process and operation efficiency. Second, the importance of features is not considered, which affects the accuracy of anomaly detection. Third, the stability and efficiency are low. Traditional generative adversarial networks often face the problem of convergence difficulties during training. This instability usually manifests itself as oscillations in the loss function, making it difficult for the model to reach a stable state. Summary of the invention

[0006] In view of the deficiencies in the prior art, the present invention provides a method and system for reconstructing abnormal data of a photovoltaic power station based on a feature-weighted local anomaly factor. The present invention uses the Pearson correlation coefficient to measure the linear relationship between variables, which is used to understand the interaction between data features. At the same time, based on the local anomaly factor, an improved abnormal data identification scheme, feature-weighted local anomaly factor, is proposed. By considering the relevance and importance of the features for weight allocation, the model's sensitivity and recognition ability to abnormal states are enhanced, and the accuracy of anomaly detection is improved. Finally, the superior stability and generation ability of the reconstruction missing data model with gradient penalty are used to fill data gaps, thereby improving the quality and availability of the entire data set.

[0007] To achieve the above object, the present invention adopts the following technical solutions:

[0008] The first aspect of the present invention proposes a method for reconstructing abnormal data of a photovoltaic power station based on a feature-weighted local abnormal factor, comprising the following steps:

[0009] S1. Obtain historical data of photovoltaic power plants and construct a feature-weighted local anomaly factor model;

[0010] S2, inputting the power grid data into the feature-weighted local anomaly factor model for identification, deleting the anomaly data and obtaining the missing data set;

[0011] S3, normalizing the data after deleting abnormal data, and dividing the normalized data into a training set and a test set;

[0012] S4, construct a missing data reconstruction model, train the missing data reconstruction model with the training set, and then judge the reconstruction performance based on the test set;

[0013] S5. Acquire the photovoltaic power station data in real time, perform S2 to delete abnormal data and obtain the missing data set, input the missing data set into the trained missing data reconstruction model, and reconstruct the missing data.

[0014] Preferably, the photovoltaic power station historical data obtained in step S1 specifically includes: voltage, current, reactive load, and active load.

[0015] Preferably, constructing the feature-weighted local anomaly factor model in step S1 includes the following steps:

[0016] Perform correlation analysis on each feature, set weights for each feature based on the correlation analysis, calculate weighted Euclidean distance and local reachability density lrd; finally calculate the local outlier factor LOF as a model.

[0017] Preferably, the correlation analysis of each feature is performed, and a weight is set for each feature according to the correlation analysis, specifically:

[0018] The following correlation coefficient formula is used to perform correlation analysis of each feature:

[0019]

[0020] Among them, r x,y is the correlation coefficient between the xth feature and the yth feature, x i ,y i is the i-th sample point of the x-th feature and the y-th feature, is the sample mean of the xth feature and the yth feature;

[0021] The sum of the correlation coefficients between the jth feature and all features except the jth feature is the r of the jth feature. j ;

[0022] Set weights for each feature according to the correlation coefficient, calculate the sum S of the absolute values ​​of all correlation coefficients, and divide the absolute value of each correlation coefficient by the sum to get the normalized weight ω j :

[0023]

[0024]

[0025] Here, n is the total number of features.

[0026] Preferably, the weighted Euclidean distance and the local reachable density lrd are calculated; finally, the local outlier factor LOF is calculated as a model, and the specific process is:

[0027] Weighted Euclidean distance d w The calculation formula is:

[0028]

[0029] Among them, p, q are data points, p j ,q j is the value of the jth feature of the point, ω j is the weight of the jth feature;

[0030] The calculation formula of local reachable density lrd is:

[0031]

[0032] Where N k (p) is the k-nearest neighbor of point p, |N k (p)|=k is the number of k data points closest to data point p, lrd k (p) is the sparseness of data point p in its first k nearest points, and o is the N of the set. k (p) data point, o∈N k (p);

[0033] Calculate the local outlier factor LOF and save the model:

[0034]

[0035] Among them, o′ is the N of the set k (p) data point, i′∈N k (p).

[0036] Preferably, in step S2, the power grid data is input into the feature-weighted local anomaly factor model for identification as follows:

[0037] Identify outliers and use the feature-weighted LOF model to analyze each data point in the power grid data set. The outlier factor LOF reflects the degree of abnormality of the data set and represents a density difference between the data point and the overall data set. If the value is close to 1, it means that the density of the data point is similar to that of the neighborhood points; if the value is less than 1, it means that the density of the data point is higher than that of the neighborhood points; if the ratio is greater than 1, it means that the density of the data point is lower than that of the neighborhood points, and there may be anomalies. Set the LOF of the data point k If the value is greater than 1, it means it is an outlier; delete the outlier and save the dataset.

[0038] Preferably, in step S4, reconstructing the missing data model specifically includes:

[0039] Generator model and discriminator model, the generator G is a deep neural network whose input is a random noise vector z and the output is a fake data sample close to the real data The discriminator D is also a deep neural network. The output of the discriminator is a real value, not a probability. The real value represents the degree of authenticity of the evaluated data sample.

[0040] The discriminator loss function is:

[0041]

[0042] in, It's expectation. is from The real data samples are obtained by sampling. is from The generated data samples are obtained by sampling from is the distribution of the real data, is the data distribution generated by the generator, D(x) represents the score of the discriminator on the real data x, Represents the discriminator to generate data The goal is to maximize this loss function;

[0043] The generator loss function is:

[0044]

[0045] The goal is to minimize this loss function.

[0046] Preferably, in step S4, during the training process of the reconstructed missing data model, it is ensured that the discriminator satisfies the K-Lipschitz condition, gradient penalty is used to ensure Lipschitz continuity, and the discriminator loss function is updated; specifically, it includes:

[0047] In each iteration, the real data sample x and the generated data sample are calculated Interpolation points between Interpolation Points The calculation formula is:

[0048]

[0049] Where, ∈ is a random number sampled from a uniform distribution U[0, 1];

[0050] Evaluate the gradients of the discriminator at the interpolation point. The gradient calculation formula is:

[0051]

[0052] Calculate the gradient penalty, the gradient penalty term is the square of the deviation between the norm of the calculated gradient and 1:

[0053] GP=λ(||gradients||2-1) 2

[0054] Here, ||gradients||2 represents the Euclidean norm of the gradient, and λ is the weight coefficient of the gradient penalty.

[0055] Incorporate the gradient penalty into the discriminator's loss function:

[0056]

[0057] Among them, GP is the gradient penalty term.

[0058] Preferably, the weight coefficient λ of the gradient penalty is set to 10.

[0059] Preferably, in step S4, using the training set to train and save the reconstructed missing data model includes the following steps: fixing the generator, training according to the updated loss function, and updating the discriminator parameters; fixing the discriminator, training and updating the generator parameters through the generator loss function, so as to prompt the generator to generate samples closer to the real data; applying the Adam optimizer and the stochastic gradient descent algorithm during the training process, repeatedly training the discriminator and the generator alternately until the preset convergence standard is reached, and calculating the average rate of change of the discriminator loss over the past 10 epochs. If the rate of change is less than 0.001, the discriminator is considered to have converged.

[0060] Preferably, in step S4, the test set is input into the missing data reconstruction model, the missing data is reconstructed, and its reconstruction performance is determined, including the following steps:

[0061] Input the missing data set of the test set into the trained model and output the reconstructed value;

[0062] The mean absolute error and root mean square error are used as accuracy evaluation indicators. The mean absolute error X mae and the root mean square error X rmse The smaller it is, the better the model reconstruction performance is. The formula is as follows:

[0063]

[0064]

[0065] Where N is the total number of reconstructed data, x m is the mth true value, is the mth reconstruction value.

[0066] The second aspect of the present invention proposes a photovoltaic power station abnormal data reconstruction system based on feature-weighted local abnormal factors, using the method described in the first aspect of the present invention, comprising:

[0067] Data acquisition module, to obtain historical data of photovoltaic power plants;

[0068] The abnormal data deletion module builds a feature-weighted local abnormal factor model, inputs the historical data of the photovoltaic power station into the model for identification, and deletes the abnormal data;

[0069] Data partitioning module normalizes the data and divides it into training set and test set;

[0070] Reconstruct missing data model building module, build reconstruct missing data model, add gradient penalty, use training set to train and save reconstruct missing data model;

[0071] The missing data reconstruction module inputs the test set into the trained model, reconstructs the missing data, and judges its reconstruction performance.

[0072] The beneficial effect of the present invention is that, compared with the prior art, the present invention takes into account the impact of abnormal data on data analysis results and the correlation between different features in the data set, and proposes a method combining correlation coefficients and feature-weighted local anomaly factors. First, correlation analysis is performed through correlation coefficients to understand the interaction between data features, and then the feature-weighted LOF method is used to consider the correlation and importance of features for weight allocation, thereby enhancing the sensitivity and recognition ability of the model to abnormal states, improving the accuracy of anomaly detection, and more accurately identifying and deleting abnormal data. After processing abnormal data, the present invention uses a generative network based on Wasserstein distance with gradient penalty to construct a reconstructed data model to reconstruct missing data, thereby ensuring the integrity and quality of the data set. The model has superior stability and the ability to generate and fill data gaps, and improves the quality and availability of the entire data set. The present invention solves the deviation problem caused by abnormal data and missing data in the data reconstruction process through the above technical means, and improves the accuracy and stability of data reconstruction. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a flow chart of the method of the present invention.

[0074] Figure 2 It is a flow chart of constructing a feature-weighted local anomaly factor model of the present invention.

[0075] Figure 3 It is a flow chart of reconstructing missing data using a reconstructed data model of the present invention. DETAILED DESCRIPTION

[0076] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The embodiments described in this application are only embodiments of a part of the present invention, rather than all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work belong to the protection scope of the present invention.

[0077] like Figure 1 As shown, Embodiment 1 of the present invention provides a method for reconstructing abnormal data of a photovoltaic power station based on a feature-weighted local abnormal factor, comprising the following steps:

[0078] S1. Obtain historical data of photovoltaic power plants and construct a feature-weighted local anomaly factor model.

[0079] Preferably, the photovoltaic power station historical data obtained in step S1 specifically includes: voltage, current, reactive load, active load and other data.

[0080] Preferably, constructing the feature-weighted local anomaly factor model in step S1 includes the following steps: performing correlation analysis on each feature, setting a weight for each feature according to the correlation analysis, calculating the weighted Euclidean distance and calculating the local reachable density lrd; and finally calculating the local outlier factor LOF as a model.

[0081] Preferably, the correlation analysis of each feature is performed, and a weight is set for each feature according to the correlation analysis, specifically:

[0082] The following correlation coefficient formula is used to perform correlation analysis of each feature:

[0083]

[0084] Among them, r x,y is the correlation coefficient between the xth feature and the yth feature, x i ,y i is the i-th sample point of the x-th feature and the y-th feature, is the sample mean of the xth feature and the yth feature;

[0085] The sum of the correlation coefficients between the jth feature and all features except the jth feature is the r of the jth feature. j ;

[0086] Set weights for each feature according to the correlation coefficient, calculate the sum S of the absolute values ​​of all correlation coefficients, and divide the absolute value of each correlation coefficient by the sum to get the normalized weight ω j :

[0087]

[0088]

[0089] Here, n is the total number of features.

[0090] It should be noted that when using the correlation coefficient to analyze the linear relationship between variables, normalization is not required, because the correlation coefficient is calculated based on the standardized covariance, which has eliminated the impact of the dimension. The value of the coefficient is between -1 and 1, where 1 indicates a complete positive correlation, -1 indicates a complete negative correlation, and 0 indicates no (linear) correlation between the two. However, directly using the correlation coefficient as a weight may lead to over-emphasis on certain features, especially when the correlation of some features is significantly higher than that of other features, and the normalized weight can help explain the relative importance of each feature for anomaly detection.

[0091] Preferably, the calculating of the weighted Euclidean distance and the calculating of the local reachable density 1rd are specifically as follows:

[0092] Weighted Euclidean distance d w The calculation formula is:

[0093]

[0094] Among them, p, q are data points, p j ,q j is the value of the jth feature of the point, ω j is the weight of the jth feature;

[0095] The calculation formula of local reachable density 1rd is:

[0096]

[0097] Where N k (p) is the k-nearest neighbor of point p, |N k (p)|=k is the number of k data points closest to data point p, lrd k (p) is the sparseness of data point p in its first k nearest points, and o is the N of the set. k (p) data point, o∈N k (p);

[0098] Calculate the local outlier factor LOF and save the model:

[0099]

[0100] Among them, o′ is the N of the set k (p) data point, o′∈N k (p).

[0101] It should be noted that using weighted Euclidean distance instead of ordinary Euclidean distance can more effectively identify data points that perform abnormally on more important features.

[0102] S2. Input the power grid data into the feature-weighted local anomaly factor model for identification, delete the anomaly data and obtain the missing data set.

[0103] Preferably, in step S2, the power grid data is input into the feature-weighted local anomaly factor model for identification as follows:

[0104] Identify outliers and use the feature-weighted LOF model to analyze each data point in the power grid data set. The outlier factor LOF reflects the degree of abnormality of the data set and represents a density difference between the data point and the overall data set. If the value is close to 1, it means that the density of the data point is similar to that of the neighborhood points; if the value is less than 1, it means that the density of the data point is higher than that of the neighborhood points; if the ratio is greater than 1, it means that the density of the data point is lower than that of the neighborhood points, and there may be anomalies. Set the LOF of the data point k If the value is greater than 1, it means it is an outlier; delete the outlier and save the dataset.

[0105] S3. Normalize the data after deleting abnormal data, and divide the normalized data into a training set and a test set.

[0106] Specifically, normalizing the data and dividing it into a training set and a test set in step S3 includes the following steps:

[0107] The specific formula for normalizing the original power grid data is as follows:

[0108]

[0109] Among them, a n is the result after data normalization, a max and a min They represent the maximum and minimum values ​​of the results after data normalization, and a is the initial value of the data; the normalized data is divided into a training set and a test set.

[0110] S4. Build a missing data reconstruction model, train the missing data reconstruction model with the training set, and then judge the reconstruction performance based on the test set.

[0111] Preferably, in step S4, reconstructing the missing data model specifically includes:

[0112] Generator model and discriminator model, the generator G is a deep neural network whose input is a random noise vector z and the output is a fake data sample close to the real data The discriminator D is also a deep neural network. The output of the discriminator is a real value, not a probability. The real value represents the degree of authenticity of the evaluated data sample.

[0113] It should be noted that the input of the generator is a random noise vector z, which is usually sampled from a standard normal distribution (i.e., a Gaussian distribution with a mean of 0 and a variance of 1). The noise vector z is mapped to an output vector of the same dimension as the real data space through a nonlinear transformation of a multi-layer neural network. The goal of the generator is to generate fake data samples that are very close to the real data distribution by learning the mapping function from the random noise vector z to the target data distribution.

[0114] The discriminator loss function is:

[0115]

[0116] in, It's expectation. is from The real data samples are obtained by sampling. is from The generated data samples are obtained by sampling from is the distribution of the real data, is the data distribution generated by the generator, D(x) represents the score of the discriminator on the real data x, Represents the discriminator to generate data The goal is to maximize this loss function;

[0117] The generator loss function is:

[0118]

[0119] The goal is to minimize this loss function.

[0120] Preferably, in step S4, during the training process of the reconstructed missing data model, it is ensured that the discriminator satisfies the K-Lipschitz condition, gradient penalty is used to ensure Lipschitz continuity, and the discriminator loss function is updated; specifically, it includes:

[0121] In each iteration, the real data sample x and the generated data sample are calculated Interpolation points between Interpolation Points The calculation formula is:

[0122]

[0123] Where, ∈ is a random number sampled from a uniform distribution U[0, 1];

[0124] Evaluate the gradients of the discriminator at the interpolation point. The gradient calculation formula is:

[0125]

[0126] Calculate the gradient penalty, the gradient penalty term is the square of the deviation between the norm of the calculated gradient and 1:

[0127] GP=λ(||gradients||2-1) 2

[0128] Here, ||gradients||2 represents the Euclidean norm of the gradient, and λ is the weight coefficient of the gradient penalty.

[0129] Incorporate the gradient penalty into the discriminator's loss function:

[0130]

[0131] Among them, GP is the gradient penalty term.

[0132] Preferably, the weight coefficient λ of the gradient penalty is set to 10.

[0133] Preferably, in step S4, using the training set to train and save the reconstructed missing data model includes the following steps: fixing the generator, training according to the updated loss function, and updating the discriminator parameters; fixing the discriminator, training and updating the generator parameters through the generator loss function, so as to prompt the generator to generate samples closer to the real data; applying the Adam optimizer and the stochastic gradient descent algorithm during the training process, repeatedly training the discriminator and the generator alternately until the preset convergence standard is reached, and calculating the average rate of change of the discriminator loss over the past 10 epochs. If the rate of change is less than 0.001, the discriminator is considered to have converged.

[0134] Preferably, in step S4, the test set is input into the missing data reconstruction model, the missing data is reconstructed, and its reconstruction performance is determined, including the following steps:

[0135] Input the missing data set of the test set into the trained model and output the reconstructed value;

[0136] The mean absolute error and root mean square error are used as accuracy evaluation indicators. The mean absolute error X mae and the root mean square error X rmse The smaller it is, the better the model reconstruction performance is. The formula is as follows:

[0137]

[0138]

[0139] Where N is the total number of reconstructed data, x m is the mth true value, is the mth reconstruction value.

[0140] S5. Acquire the photovoltaic power station data in real time, perform S2 to delete abnormal data and obtain the missing data set, input the missing data set into the trained missing data reconstruction model, and reconstruct the missing data.

[0141] Embodiment 2 of the present invention provides a photovoltaic power station abnormal data reconstruction system based on feature-weighted local abnormal factors, using the method described in Embodiment 1 of the present invention, including:

[0142] Data acquisition module, to obtain historical data of photovoltaic power plants;

[0143] The abnormal data deletion module builds a feature-weighted local abnormal factor model, inputs the historical data of the photovoltaic power station into the model for identification, and deletes the abnormal data;

[0144] Data partitioning module normalizes the data and divides it into training set and test set;

[0145] Reconstruct missing data model building module, build reconstruct missing data model, add gradient penalty, use training set to train and save reconstruct missing data model;

[0146] The missing data reconstruction module inputs the test set into the trained model, reconstructs the missing data, and judges its reconstruction performance.

[0147] The beneficial effect of the present invention is that, compared with the prior art, the present invention takes into account the impact of abnormal data on data analysis results and the correlation between different features in the data set, and proposes a method combining correlation coefficients and feature-weighted local anomaly factors. First, correlation analysis is performed through correlation coefficients to understand the interaction between data features, and then the feature-weighted LOF method is used to consider the correlation and importance of features for weight allocation, thereby enhancing the sensitivity and recognition ability of the model to abnormal states, improving the accuracy of anomaly detection, and more accurately identifying and deleting abnormal data. After processing abnormal data, the present invention uses a generative network based on Wasserstein distance with gradient penalty to construct a reconstructed data model to reconstruct missing data, thereby ensuring the integrity and quality of the data set. The model has superior stability and the ability to generate and fill data gaps, and improves the quality and availability of the entire data set. The present invention solves the deviation problem caused by abnormal data and missing data in the data reconstruction process through the above technical means, and improves the accuracy and stability of data reconstruction.

[0148] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0149] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0150] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0151] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A photovoltaic power station abnormal data reconstruction method based on feature-weighted local abnormal factors, characterized in that: The steps include: S1. Obtain historical data of photovoltaic power plants and construct a feature-weighted local anomaly factor model; S2, inputting the power grid data into the feature-weighted local anomaly factor model for identification, deleting the anomaly data and obtaining the missing data set; S3, normalizing the data after deleting abnormal data, and dividing the normalized data into a training set and a test set; S4, construct a missing data reconstruction model, train the missing data reconstruction model with the training set, and then judge the reconstruction performance based on the test set; S5. Acquire the photovoltaic power station data in real time, perform S2 to delete abnormal data and obtain the missing data set, input the missing data set into the trained missing data reconstruction model, and reconstruct the missing data.

2. The photovoltaic abnormal data reconstruction method according to claim 1, characterized in that: The historical data of the photovoltaic power station obtained in step S1 specifically includes: voltage, current, reactive load, and active load.

3. The photovoltaic abnormal data reconstruction method according to claim 1 or 2, characterized in that: Constructing the feature-weighted local anomaly factor model in step S1 includes the following steps: Perform correlation analysis on each feature, set weights for each feature based on the correlation analysis, calculate weighted Euclidean distance and local reachability density lrd; finally calculate the local outlier factor LOF as a model.

4. The photovoltaic abnormal data reconstruction method according to claim 3, characterized in that: The correlation analysis of each feature is performed, and a weight is set for each feature according to the correlation analysis, specifically: The following correlation coefficient formula is used to perform correlation analysis of each feature: Among them, r x,y is the correlation coefficient between the xth feature and the yth feature, x i ,y i is the i-th sample point of the x-th feature and the y-th feature, is the sample mean of the xth feature and the yth feature; The sum of the correlation coefficients between the jth feature and all features except the jth feature is the r of the jth feature. j ; Set weights for each feature according to the correlation coefficient, calculate the sum S of the absolute values ​​of all correlation coefficients, and divide the absolute value of each correlation coefficient by the sum to get the normalized weight ω j : Here, n is the total number of features.

5. The photovoltaic abnormal data reconstruction method according to claim 3, characterized in that: The weighted Euclidean distance and the local reachable density lrd are calculated; finally, the local outlier factor LOF is calculated as a model. The specific process is: Weighted Euclidean distance d w The calculation formula is: Among them, p, q are data points, p j ,q j is the value of the jth feature of the point, ω j is the weight of the jth feature; The calculation formula of local reachable density lrd is: Where N k (p) is the k-nearest neighbor of point p, |N k (p)|=k is the number of k data points closest to data point p, lrd k (p) is the sparseness of data point p in its first k nearest points, and o is the N of the set. k (p) data point, o∈N k (p); Calculate the local outlier factor LOF and save the model: Among them, o′ is the N of the set k (p) data point, o′∈N k (p).

6. The photovoltaic abnormal data reconstruction method according to claim 1, characterized in that: In step S2, the power grid data is input into the feature weighted local anomaly factor model for identification, specifically: Identify outliers and use the feature-weighted LOF model to analyze each data point in the power grid data set. The outlier factor LOF reflects the degree of abnormality of the data set and represents a density difference between the data point and the overall data set. If the value is close to 1, it means that the density of the data point is similar to that of the neighborhood points; if the value is less than 1, it means that the density of the data point is higher than that of the neighborhood points; if the ratio is greater than 1, it means that the density of the data point is lower than that of the neighborhood points, and there may be anomalies. Set the LOF of the data point k If the value is greater than 1, it means it is an outlier; delete the outlier and save the dataset.

7. The photovoltaic abnormal data reconstruction method according to claim 1, characterized in that: In step S4, reconstructing the missing data model specifically includes: Generator model and discriminator model, the generator G is a deep neural network whose input is a random noise vector z and the output is a fake data sample close to the real data The discriminator D is also a deep neural network. The output of the discriminator is a real value, not a probability. The real value represents the degree of authenticity of the evaluated data sample. The discriminator loss function is: in, It's expectation. is from The real data samples are obtained by sampling. is from The generated data samples are obtained by sampling from is the distribution of the real data, is the data distribution generated by the generator, D(x) represents the score of the discriminator on the real data x, Represents the discriminator to generate data The goal is to maximize this loss function; The generator loss function is: The goal is to minimize this loss function.

8. The photovoltaic abnormal data reconstruction method according to claim 1 or 7, characterized in that: In step S4, during the training of the model for reconstructing missing data, ensure that the discriminator satisfies the K-Lipschitz condition, use gradient penalty to ensure Lipschitz continuity, and update the discriminator loss function; specifically, it includes: In each iteration, the real data sample x and the generated data sample are calculated Interpolation points between Interpolation Points The calculation formula is: Where ∈ is a random number sampled from a uniform distribution U[0,1]; Evaluate the gradients of the discriminator at the interpolation point. The gradient calculation formula is: Calculate the gradient penalty, the gradient penalty term is the square of the deviation between the norm of the calculated gradient and 1: GP=λ(||gradients||2-1) 2 Here, ∥gradients∥2 represents the Euclidean norm of the gradient, and λ is the weight coefficient of the gradient penalty. Incorporate the gradient penalty into the discriminator's loss function: Among them, GP is the gradient penalty term.

9. The photovoltaic abnormal data reconstruction method according to claim 8, characterized in that: The weight coefficient λ of the gradient penalty is set to 10.

10. The photovoltaic abnormal data reconstruction method according to claim 1, characterized in that: In step S4, using the training set to train and save the reconstructed missing data model includes the following steps: fixing the generator, training according to the updated loss function, and updating the discriminator parameters; fixing the discriminator, training and updating the generator parameters through the generator loss function, so as to prompt the generator to generate samples closer to the real data; applying the Adam optimizer and the stochastic gradient descent algorithm during the training process, repeatedly training the discriminator and the generator alternately until the preset convergence standard is reached, and calculating the average change rate of the discriminator loss in the past 10 epochs. If the change rate is less than 0.001, the discriminator is considered to have converged.

11. The photovoltaic abnormal data reconstruction method according to claim 1, characterized in that: In step S4, the test set is input into the missing data reconstruction model, the missing data is reconstructed, and its reconstruction performance is determined, including the following steps: Input the missing data set of the test set into the trained model and output the reconstructed value; The mean absolute error and root mean square error are used as accuracy evaluation indicators. The mean absolute error X mae and the root mean square error X rmse The smaller it is, the better the model reconstruction performance is. The formula is as follows: Where N is the total number of reconstructed data, x m is the mth true value, is the mth reconstruction value.

12. A photovoltaic power station abnormal data reconstruction system based on feature-weighted local abnormal factors, using the method described in any one of claims 1 to 11, characterized in that: include: Data acquisition module, to obtain historical data of photovoltaic power plants; The abnormal data deletion module builds a feature-weighted local abnormal factor model, inputs the historical data of the photovoltaic power station into the model for identification, and deletes the abnormal data; Data partitioning module normalizes the data and divides it into training set and test set; Reconstruct missing data model building module, build reconstruct missing data model, add gradient penalty, use training set to train and save reconstruct missing data model; The missing data reconstruction module inputs the test set into the trained model, reconstructs the missing data, and judges its reconstruction performance.

Citation Information

Patent Citations

  • Two-stage identification method of distributed photovoltaic output based on missing data reconstruction technology

    CN115115098B

  • Photovoltaic data restoration method, device and equipment and computer readable storage medium

    CN118364326A

Cited By

  • Bio-oil yield prediction method based on interpretable machine learning

    CN120148703A

  • Photovoltaic power data reconstruction method, system and device and storage medium

    CN122432504A