Photovoltaic module data anomaly detection method and device based on unsupervised algorithm integration, electronic equipment and medium
By integrating unsupervised algorithms and combining multiple unsupervised learning algorithms and data preprocessing techniques, the accuracy and efficiency issues of photovoltaic module anomaly detection have been solved, realizing automated anomaly detection, reducing operation and maintenance costs, and extending module life.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA PETROCHEMICAL CORP
- Filing Date
- 2025-01-02
- Publication Date
- 2026-07-03
AI Technical Summary
Traditional manual inspections and regular maintenance methods are inefficient and lack unified standards, making it difficult to achieve full coverage anomaly detection for photovoltaic modules. Furthermore, the application of supervised learning algorithms is limited in the absence of labeled data, resulting in insufficient accuracy and efficiency in photovoltaic module anomaly detection.
An unsupervised algorithm ensemble approach was adopted, which combined algorithms such as Mahalanobis distance, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual with wavelet transform, time series interpolation, and principal component analysis to construct an anomaly detection model and use the SCADA dataset for anomaly detection of photovoltaic modules.
It improves the accuracy and robustness of photovoltaic module anomaly detection, reduces reliance on manual inspections, lowers operation and maintenance costs, extends module lifespan, and improves power generation efficiency.
Smart Images

Figure CN122333242A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic module data anomaly detection, and more specifically, to a photovoltaic module data anomaly detection method, apparatus, electronic device, and medium based on unsupervised algorithm integration. Background Technology
[0002] With the transformation of the global energy structure and the rapid development of renewable energy technologies, solar photovoltaic (PV) power generation, as a clean and sustainable energy form, is gradually becoming an important part of the global energy supply. PV modules are the core components for photoelectric conversion, and their stability and reliability directly determine the power generation efficiency and economic benefits of the entire PV power generation system. However, long-term exposure to harsh outdoor environments makes PV modules highly susceptible to various adverse factors such as temperature, humidity, dust, and shadows, leading to decreased power generation performance or even malfunctions. This not only causes economic losses but may also pose safety hazards; therefore, real-time monitoring and anomaly detection of PV modules are particularly important.
[0003] Traditional anomaly detection methods mainly rely on manual inspections and periodic maintenance, but this approach has many drawbacks. First, manual inspection is inefficient and prone to errors, making it difficult to achieve full coverage in large-scale photovoltaic power plants. Second, the long intervals between periodic maintenance may cause anomalies to go undetected for extended periods. Furthermore, inspection methods relying on human experience lack standardized protocols, making it difficult to guarantee consistent results. With the development of emerging technologies such as the Internet of Things and big data, data analysis-based anomaly detection methods have emerged, demonstrating broad application prospects.
[0004] Supervised learning algorithms have always been the mainstream method in machine learning, but they require a large amount of labeled data for training. However, in real-world anomaly detection scenarios, anomaly data is often difficult to obtain, which severely limits the application of supervised methods. In contrast, unsupervised learning algorithms do not require pre-labeled training data and can automatically learn anomaly patterns from raw data, thus demonstrating greater feasibility and superiority in the field of anomaly detection.
[0005] In the daily operation of a photovoltaic power station, each photovoltaic module is equipped with sensors to monitor key parameters such as current, voltage, temperature, and light intensity in real time. These data are typically multi-dimensional, high-noise, and nonlinear, posing challenges to anomaly detection algorithms.
[0006] Therefore, it is necessary to develop a method, device, electronic device, and medium for detecting anomalies in photovoltaic module data based on unsupervised algorithm integration.
[0007] The information disclosed in the background section of this invention is intended only to enhance the understanding of the general background of this invention, and should not be construed as an admission or in any way implying that such information constitutes prior art known to those skilled in the art. Summary of the Invention
[0008] This invention proposes a photovoltaic module data anomaly detection method, device, electronic equipment, and medium based on unsupervised algorithm integration. It can improve the automation level of detection, reduce manual workload, promptly detect and handle anomalies, effectively prevent the expansion of faults, extend the service life of photovoltaic modules, thereby improving the power generation efficiency of the entire system and reducing operation and maintenance costs.
[0009] In a first aspect, embodiments of this disclosure provide a method for detecting anomalies in photovoltaic module data based on unsupervised algorithm integration, including:
[0010] Based on the SCADA dataset, corresponding base learners are established and trained using multiple unsupervised algorithms.
[0011] Determine the anomaly scores and weights for each base learner;
[0012] Anomaly detection is performed based on the anomaly score and the weight.
[0013] As a specific implementation of this disclosure, the SCADA dataset includes the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t).
[0014] Secondly, this disclosure also provides a photovoltaic module data anomaly detection device based on an unsupervised algorithm integration, comprising:
[0015] The training module establishes and trains corresponding base learners based on multiple unsupervised algorithms using the SCADA dataset.
[0016] The calculation module determines the anomaly scores and weights corresponding to each base learner.
[0017] The detection module performs anomaly detection based on the anomaly score and the weight.
[0018] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0019] Memory, which stores executable instructions;
[0020] A processor that executes the executable instructions in the memory to implement the photovoltaic module data anomaly detection method based on unsupervised algorithm integration.
[0021] Fourthly, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned photovoltaic module data anomaly detection method based on unsupervised algorithm integration.
[0022] Its beneficial effects are as follows:
[0023] 1. Significantly improved anomaly detection accuracy and robustness
[0024] This invention integrates multiple unsupervised learning algorithms, fully leveraging the advantages of each algorithm in different aspects, significantly improving the accuracy of anomaly detection and enhancing the system's adaptability to unknown anomaly patterns.
[0025] 2. Significantly reduced operation and maintenance costs of photovoltaic power plants
[0026] This invention realizes an automated anomaly detection process. By monitoring the key parameters of photovoltaic modules in real time, it can promptly detect abnormalities, reduce reliance on manual inspections, and improve the operation and maintenance efficiency of photovoltaic power plants.
[0027] 3. Improved lifespan and power generation efficiency of photovoltaic modules
[0028] This invention facilitates preventative maintenance by promptly identifying photovoltaic modules that have experienced performance degradation or malfunction, thereby extending the modules' lifespan. The system's high accuracy and robustness ensure that the photovoltaic modules operate in optimal condition, reducing performance losses and downtime caused by abnormal conditions and improving the overall power generation efficiency of the photovoltaic system.
[0029] The methods and apparatus of the present invention have other features and advantages that will be apparent from or will be set forth in detail in the accompanying drawings and following detailed description, which together serve to explain the particular principles of the invention. Attached Figure Description
[0030] The above and other objects, features and advantages of the present invention will become more apparent from the more detailed description of exemplary embodiments of the invention in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same parts.
[0031] Figure 1 A flowchart illustrating the steps of a photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to an embodiment of the present invention is shown.
[0032] Figure 2 A schematic diagram of Mahalanobis distance according to an embodiment of the present invention is shown.
[0033] Figure 3 A schematic diagram of a single-class support vector machine according to an embodiment of the present invention is shown.
[0034] Figure 4 A schematic diagram of a cluster-based outlier factor according to an embodiment of the present invention is shown.
[0035] Figure 5 A schematic diagram of the spectral residuals according to an embodiment of the present invention is shown.
[0036] Figure 6 A schematic diagram of a dataset according to an embodiment of the present invention is shown.
[0037] Figure 7 A block diagram of a photovoltaic module data anomaly detection device based on an unsupervised algorithm integration according to an embodiment of the present invention is shown.
[0038] Explanation of reference numerals in the attached figures:
[0039] 201. Training module; 202. Calculation module; 203. Detection module. Detailed Implementation
[0040] Preferred embodiments of the invention will now be described in more detail. While preferred embodiments of the invention are described below, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0041] To facilitate understanding of the solutions and effects of the embodiments of the present invention, six specific application examples are given below. Those skilled in the art should understand that these examples are merely for the purpose of understanding the present invention, and any specific details therein are not intended to limit the present invention in any way.
[0042] Example 1
[0043] Figure 1 A flowchart illustrating the steps of a photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to an embodiment of the present invention is shown.
[0044] like Figure 1 As shown, the photovoltaic module data anomaly detection method based on unsupervised algorithm integration includes:
[0045] Step 101: Based on the SCADA dataset, establish and train corresponding base learners using multiple unsupervised algorithms;
[0046] Step 102: Determine the anomaly scores and weights corresponding to each base learner;
[0047] Step 103: Perform anomaly detection based on the anomaly score and weight.
[0048] In one example, the SCADA dataset includes the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t).
[0049] In one example, unsupervised algorithms include Mahalanobis distance calculation, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual.
[0050] In one example, preprocessing of the SCADA dataset is also included:
[0051] Wavelet transform is used to remove high-frequency noise:
[0052] D clean =W(D,t)
[0053] Among them, D clean The signal is denoised, W is wavelet transform, D is the original SCADA data, and t is time.
[0054] Based on the denoised signal, time series interpolation is used to handle missing values:
[0055] ∧
[0056] D = I(D) clean ,t),
[0057] Where D∧ is the interpolated dataset and I is the interpolation function;
[0058] Principal component analysis is used for dimensionality reduction to extract principal components from the dataset.
[0059] ∧
[0060] P = PCA(D)
[0061] Where P represents the training dataset after the key feature vectors have been calculated;
[0062] Connect the principal component vectors with the dataset By piecing them together, we get:
[0063]
[0064] Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates column concatenation operation.
[0065] For dataset D concat In the time-varying features, new feature columns are added through time-series translation operations:
[0066] D new =SHIFT(D concat ,k)
[0067] Where SHIFT represents the time-series feature lag calculation and column concatenation operation, and k represents the timestamp span of each shift;
[0068] Calculate dataset D new All eigenvectors f i First-order and second-order statistics:
[0069]
[0070] Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
[0071] In one example, determining the anomaly scores and weights for each base learner includes:
[0072] Determine the outlier score S of the output data of each base learner. i And determining the 1st percentile θ t ;
[0073] Collect historical dataset D history ;
[0074] For historical dataset D history Resampling is performed to generate synthetic samples using the SMOTE technique:
[0075]
[0076] in, For synthetic samples;
[0077] Based on each base learner Calculate the corresponding F1 score based on the performance on the chart.
[0078]
[0079] The weights ω are dynamically implemented based on the F1 score. i distribute:
[0080]
[0081] In one example, anomaly detection based on anomaly scores and weights includes:
[0082] Calculate the weighted result of the outlier scores based on the outlier scores and their weights;
[0083] The judgment threshold is dynamically determined using an adaptive method;
[0084] Determine the relationship between the weighted result of the abnormal score and the judgment threshold to perform abnormal detection.
[0085] In one example, if the weighted result of the abnormal score is greater than the judgment threshold, it is judged as abnormal.
[0086] Specifically, the data in this invention is acquired based on the SCADA (Supervisory Control and Data Acquisition) system built into the component and other status detection devices, such as electricity meters and environmental monitoring instruments.
[0087] This method employs five unsupervised algorithms—Mahathano distance calculation, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual—to detect anomalies in photovoltaic module data. Subsequently, an ensemble learning approach is used to aggregate the outputs of each algorithm, and the final result is obtained through weighted calculation.
[0088] Figure 2 A schematic diagram of Mahalanobis distance according to an embodiment of the present invention is shown.
[0089] like Figure 2 As shown, Mahalanobis distance is a method for measuring the similarity between two unknown sample sets. It is a multivariate analysis method that considers the covariance structure of the data, and therefore is an effective distance metric, especially suitable for situations where the data has high dimensionality and there is correlation between variables.
[0090] Mahalanobis distance represents the covariance distance of data and is an efficient method for calculating the similarity between two sample sets. It is independent of the measurement scale, meaning it is unaffected by dimensions. When Mahalanobis distance is applied to anomaly detection, the specific calculation formula is as follows:
[0091]
[0092] Here, x is an n-dimensional observation vector, Σ is the covariance matrix of the multidimensional random variables, and μ is the mean of the corresponding vector. When the covariance matrix is an identity matrix, meaning each dimension is independent and identically distributed, the Mahalanobis distance becomes the Euclidean distance. When the variables follow a normal distribution, the square of their Mahalanobis distance follows a chi-square distribution. Mahalanobis distance can also eliminate the interference of correlations between variables. Because Mahalanobis distance uses the covariance matrix, it can eliminate the influence of scale differences between different variables, thus making it more stable in multivariate analysis. Furthermore, since this algorithm is based on statistical principles, it no longer needs to rely on prior knowledge like expert systems that only use a few key parameters for anomaly detection. Instead, it uses all features related to the component, even if the influence weight of the feature is relatively weak, it can still serve as an auxiliary discriminant, making the anomaly detection results more comprehensive and accurate.
[0093] Figure 3 A schematic diagram of a single-class support vector machine according to an embodiment of the present invention is shown.
[0094] like Figure 3 As shown, a one-class support vector machine (One-Class SVM) is a machine learning method used for anomaly detection and unsupervised learning. One-class SVM is primarily used to learn decision boundaries representing variations within a dataset to distinguish between normal and anomalous data. It is often used to handle "classification" problems when the dataset contains almost only one class of data. In this case, unlike traditional SVMs, the algorithm actually needs to learn the boundary of the training dataset, i.e., estimate a high-dimensional distribution of support vectors rather than maximizing the margin. Typically, this boundary is far from the origin in the feature space.
[0095] In summary, the goal of One-Class SVM is to find a hyperplane that encloses as much normal training data as possible while excluding outlier data. This hyperplane is called the decision boundary. During training, One-Class SVM searches for a hyperplane that maximizes the dataset boundary, such that as much normal data as possible is contained on one side of this hyperplane, while outlier data is excluded.
[0096] The basic formula for One-Class SVM can be expressed as:
[0097]
[0098] Where w is the weight vector of the hyperplane, ξ iρ is a slack variable used to allow some data points to violate the constraints, ν is the bias term of the hyperplane, ν is a parameter that controls the upper limit of the number of support vectors and the misclassification rate, and n is the number of training data points. The constraints of the optimization problem are:
[0099] (w·φ(x i ))≥ρ-ξ i ,ξ i ≥0, i=1,...,n
[0100] In anomaly detection scenarios, One-Class SVMs typically use kernel tricks to handle non-linearly separable data. Kernel functions are used to compute the inner product of data points in a high-dimensional space without explicitly mapping the data points. Commonly used kernel functions include linear kernels, polynomial kernels, and radial basis function (RBF) kernels.
[0101] The decision function of One-Class SVM can be expressed as:
[0102] f(x) = sgn((w·φ(x)) - ρ)
[0103] If the result is positive, x is considered normal; if the result is negative, x is considered abnormal.
[0104] Figure 4 A schematic diagram of a cluster-based outlier factor according to an embodiment of the present invention is shown.
[0105] like Figure 4 As shown, the Local Outlier Factor (LOF) and Cluster-Based Local Outlier Factor (CBLOF) are two commonly used anomaly detection algorithms. They are both density-based methods used to identify outliers or outliers in a dataset.
[0106] In the LOF method, a point is considered an outlier by comparing its local density with that of its neighbors. The key idea of the LOF algorithm is to compare the Local Outlier Factor (LOF) of a point with a value of 1. If the LOF is close to 1, it indicates that the point's local density is similar to that of its neighbors; if the LOF is much greater than 1, it indicates that the point's local density is much smaller than that of its neighbors, and therefore it can be considered an outlier.
[0107] The specific process of the LOF algorithm is as follows: First, for a sample point O, calculate its distance from other sample points, sort them, and select the k points closest to it; with point O as the center, the reachable distance from any point to it is at least the Kth distance of that point, that is, the k points closest to the sample point O have the same reachable distance from that point.
[0108] Locally reachable density is defined as follows:
[0109]
[0110] The above formula can be interpreted as follows: If P and its surrounding neighboring points belong to the same cluster, then the reachable distance is more likely to be the smaller K-th distance of point O, resulting in a decrease in the sum of reachable distances and an increase in local reachability density. If O and its surrounding neighboring points are far apart, then the reachable distance may take a larger value, resulting in an increase in the sum of reachable distances and a decrease in local reachability density.
[0111] After defining the local reachability density, the local outlier factor is defined as follows:
[0112]
[0113] Finally, by analyzing the LOF value, we can determine whether a point is an outlier. Generally, if the LOF is much greater than 1, the data point is considered an outlier; if the LOF is close to 1, the data point is considered normal.
[0114] Building upon LOF (List of Elements), the CBLOF algorithm combines clustering algorithms to create the CBLOF algorithm. The CBLOF algorithm first uses clustering to divide the data into multiple clusters, then calculates the size and density of each cluster, as well as the distance from each point to the nearest larger cluster. The CBLOF algorithm determines whether a point is an outlier by comparing these values. The basic steps of the CBLOF algorithm are as follows: First, the data is divided into multiple clusters using a clustering algorithm (such as K-means); second, for each cluster, its size and density are calculated. For each point, its distance to the nearest larger cluster is calculated, and this distance, along with the cluster density and size, is encoded into a CBLOF score. If a point's CBLOF score is higher than a certain threshold, it is considered an outlier.
[0115] Isolation Forest is a tree-based unsupervised learning method, particularly suitable for anomaly detection in high-dimensional datasets. The Isolation Forest algorithm constructs trees by randomly selecting features and split values, allowing anomalies to be isolated early in the tree structure.
[0116] The core idea is that outliers are usually "isolated" in the dataset, meaning their location in the feature space makes them far from other points. Therefore, by randomly selecting features and split values to build a tree, outliers are usually isolated at a shallow level in the tree structure.
[0117] The formula for calculating outlier scores in the Isolation Forest algorithm is based on the average path length of data points in the random trees. Path length refers to the number of edges on the path from a tree node to a leaf node. In an Isolation Forest, outlier points typically have short path lengths because they are "isolated" in the feature space. The outlier score for a data point can be calculated using the following steps:
[0118] 1. Calculate path length. For each tree in the isolated forest, calculate the path length h(x) of the data point in the tree. If the data point is successfully isolated in the tree (i.e., reaches a leaf node), then h(x) is the path length from the root node to the leaf node. If the data point is not isolated in the tree (i.e., the maximum depth is reached during tree construction), then h(x) is the maximum path length of the data point in the tree.
[0119] 2. Average path length: For each point in the dataset, calculate its average path length h(x) across all trees.
[0120] 3. Calculate the outlier score S using the following formula:
[0121]
[0122] Where c(m) is a positive constant used to normalize the path length, and it is calculated as follows:
[0123]
[0124] 4. Anomaly detection: The closer a sample point's anomaly score is to 1, the more likely the data point is to be an anomaly.
[0125] Figure 5 A schematic diagram of the spectral residuals according to an embodiment of the present invention is shown.
[0126] like Figure 5 As shown, spectral residual is an algorithm used for time-frequency domain analysis. Originally used for feature extraction in image processing, it has since been applied to noise reduction and enhancement of audio signals. In the field of anomaly detection, the spectral residual method extracts spectral features from the signal through time-frequency analysis, thereby detecting anomalous signals that do not conform to normal patterns.
[0127] The algorithm is based on Fourier transform. It extracts the amplitude and phase spectra from the transformed signal, performs a logarithmic operation on the amplitude spectrum, multiplies the resulting logarithmic spectrum by an average filtered signal, and subtracts the filtered signal from the logarithmic spectrum to obtain the spectra. Finally, the spectra and phase spectra are used as the real and imaginary parts, respectively, for inverse Fourier transform to obtain the salience map of the original signal.
[0128] The overall implementation process is as follows:
[0129] A(f) = Amplitude(F(x))
[0130] P(f) = Phrase(F(x))
[0131] L(f) = log(A(f))
[0132] AL(f)=h q (f)·L(f)
[0133] R(f) = L(f) - AL(f)
[0134] S(x)=∥F -1 (exp(R(f)+iP(f)))∥
[0135] An anomaly can be identified when the Salience Map value exceeds a certain threshold. This method combines the advantages of time-domain and frequency-domain analysis, effectively extracting signal features. It allows for the selection of appropriate short-time Fourier transform parameters based on different application scenarios, adapting to varying signal characteristics. Furthermore, it exhibits robustness to noise, resisting noise interference to a certain extent.
[0136] In practical data processing, various methods often fail to effectively label all outliers or result in normal data being labeled as anomalous. Therefore, this method employs ensemble learning with a weighted voting approach. Weighted ensemble learning improves overall prediction performance by combining the predictions of multiple base learners. In ensemble learning, each base learner has unique predictive capabilities and error distributions. Weighted ensemble learning optimizes the final prediction results by assigning different weights to each base learner, allowing the better-performing learner to have a greater influence in the final prediction. Specifically, for each sample point, if a majority of sample points are classified as belonging to a certain class, then that sample point is considered to belong to that class.
[0137] The steps of this invention are as follows:
[0138] Real-time data collection of key parameters of photovoltaic modules, such as current I(t), voltage V(t), temperature T(t), and illuminance L(t), is used as the raw dataset D; wavelet transform is employed to remove high-frequency noise.
[0139] D clean =W(D,t)
[0140] Where D clean The signal is denoised, W is wavelet transform, D is the original data, and t is time.
[0141] Missing values are handled using time series interpolation:
[0142]
[0143] in The dataset is after interpolation, and I is the interpolation function. Principal Component Analysis (PCA) is used for dimensionality reduction to extract the principal components of the dataset, with a principal component dimension of 2.
[0144]
[0145] Where P represents the training dataset after the key feature vectors have been calculated; the dataset after the principal component vectors are interpolated with the dataset after the difference is calculated. splicing:
[0146]
[0147] Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates the column concatenation operation. For time-varying features in the dataset, new feature columns are added through a time-series shift operation.
[0148] D new =SHIFT(D concat ,k)
[0149] Here, SHIFT represents the time-series feature lag calculation and column concatenation operation, k represents the timestamp span of each shift, k = 1, 2, 3, 4, 5, meaning 5 shifts, each time merging into the original dataset; calculate dataset D. new All eigenvectors f i First-order and second-order statistics:
[0150]
[0151] Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
[0152] The target algorithms selected include Mahalanobis distance, OCSVM, CBLOF, Isolation Forest, and spectral residual. The set of algorithms can be represented as:
[0153] A = {a1, a2, a3, a4, a5};
[0154] Each algorithm outputs its own value in the dataset. abnormal score S i And determining the 1st percentile θ t The data collected is consistent with the above-mentioned measurement points, using historical data as D. history For historical dataset D history Resampling is performed to increase the proportion of samples from outlier categories. The aforementioned measurement points include the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t), as well as the data subsequently used to form the training dataset D. train The features included include principal component features, time lag features, and first- and second-order statistical features. Synthetic samples are generated using the SMOTE (Synthetic Minority Over-sampling Technique).
[0155]
[0156] Based on each algorithm in the historical dataset To assess performance, each trained base learner is assigned a weight. The weight calculation method treats anomaly detection as a binary classification scenario with imbalanced sample labels for inference. The weights are derived from the F1 scores of each unsupervised algorithm model on the same labeled photovoltaic module dataset, and are calculated as follows:
[0157]
[0158] Here, TP (True Positives) is the number of true positives, i.e., the number of samples correctly predicted as positive by the model; FP (False Positives) is the number of false positives, i.e., the number of samples incorrectly predicted as positive by the model; and FN (False Negatives) is the number of false negatives, i.e., the number of positive samples incorrectly predicted as negative by the model. Since the F1-score represents the harmonic mean of precision and recall, it considers the balance between the two metrics, avoiding the problem of one metric being very high while the other is very low in extreme cases. Therefore, it is suitable for evaluating the algorithm model's capabilities in imbalanced scenarios.
[0159] The weights ω are dynamically implemented based on the F1 score. i The allocation formula is as follows:
[0160]
[0161] Weighted summation of outlier scores:
[0162]
[0163] An adaptive method is used to dynamically adjust the judgment threshold. The threshold adjustment formula is as follows:
[0164]
[0165] Where α is the adjustment coefficient, F 1t This is the current F1 score.
[0166] Anomaly detection result determination:
[0167] If S final If the value is greater than θ, an anomaly detection signal will be triggered.
[0168] Example 2
[0169] This invention also provides a photovoltaic module data anomaly detection device based on unsupervised algorithm integration, comprising:
[0170] The training module establishes and trains corresponding base learners based on multiple unsupervised algorithms using the SCADA dataset.
[0171] The calculation module determines the anomaly scores and weights corresponding to each base learner.
[0172] The detection module performs anomaly detection based on anomaly scores and weights.
[0173] In one example, the SCADA dataset includes the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t).
[0174] In one example, unsupervised algorithms include Mahalanobis distance calculation, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual.
[0175] In one example, preprocessing of the SCADA dataset is also included:
[0176] Wavelet transform is used to remove high-frequency noise:
[0177] D clean =W(D,t)
[0178] Among them, D clean The signal is denoised, W is wavelet transform, D is the original SCADA data, and t is time.
[0179] Based on the denoised signal, time series interpolation is used to handle missing values:
[0180] ∧
[0181] D = I(D) clean ,t),
[0182] Where D∧ is the interpolated dataset and I is the interpolation function;
[0183] Principal component analysis is used for dimensionality reduction to extract principal components from the dataset.
[0184] ∧
[0185] P = PCA(D)
[0186] Where P represents the training dataset after the key feature vectors have been calculated;
[0187] Connect the principal component vectors with the dataset By piecing them together, we get:
[0188]
[0189] Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates column concatenation operation.
[0190] For dataset D concat In the time-varying features, new feature columns are added through time-series translation operations:
[0191] D new =SHIFT(D concat ,k)
[0192] Where SHIFT represents the time-series feature lag calculation and column concatenation operation, and k represents the timestamp span of each shift;
[0193] Calculate dataset D new All eigenvectors f i First-order and second-order statistics:
[0194]
[0195] Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
[0196] In one example, determining the anomaly scores and weights for each base learner includes:
[0197] Determine the outlier score S of the output data of each base learner. i And determining the 1st percentile θ t ;
[0198] Collect historical dataset D history ;
[0199] For historical dataset D history Resampling is performed to generate synthetic samples using the SMOTE technique:
[0200]
[0201] in, For synthetic samples;
[0202] Based on each base learner Calculate the corresponding F1 score based on the performance on the chart.
[0203]
[0204] The weights ω are dynamically implemented based on the F1 score. i distribute:
[0205]
[0206] In one example, anomaly detection based on anomaly scores and weights includes:
[0207] Calculate the weighted result of the outlier scores based on the outlier scores and their weights;
[0208] The judgment threshold is dynamically determined using an adaptive method;
[0209] Determine the relationship between the weighted result of the abnormal score and the judgment threshold to perform abnormal detection.
[0210] In one example, if the weighted result of the abnormal score is greater than the judgment threshold, it is judged as abnormal.
[0211] Specifically, key parameter data such as current I(t), voltage V(t), temperature T(t), and illuminance L(t) of the photovoltaic module are collected in real time as the raw dataset D; wavelet transform is used to remove high-frequency noise.
[0212] D clean =W(D,t)
[0213] Where D clean The signal is denoised, W is wavelet transform, D is the original data, and t is time.
[0214] Missing values are handled using time series interpolation:
[0215]
[0216] in The dataset is after interpolation, and I is the interpolation function. Principal Component Analysis (PCA) is used for dimensionality reduction to extract the principal components of the dataset, with a principal component dimension of 2.
[0217]
[0218] Where P represents the training dataset after the key feature vectors have been calculated; the dataset after the principal component vectors are interpolated with the dataset after the difference is calculated. splicing:
[0219]
[0220] Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates the column concatenation operation. For time-varying features in the dataset, new feature columns are added through a time-series shift operation.
[0221] D new =SHIFT(D concat ,k)
[0222] Here, SHIFT represents the time-series feature lag calculation and column concatenation operation, k represents the timestamp span of each shift, k = 1, 2, 3, 4, 5, meaning 5 shifts, each time merging into the original dataset; calculate dataset D. new All eigenvectors f i First-order and second-order statistics:
[0223]
[0224] Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
[0225] The target algorithms selected include Mahalanobis distance, OCSVM, CBLOF, Isolation Forest, and spectral residual. The set of algorithms can be represented as:
[0226] A = {a1, a2, a3, a4, a5};
[0227] Each algorithm outputs its own value in the dataset. abnormal score S i And determining the 1st percentile θ t Collect historical dataset D history For historical dataset D history Resampling is performed to increase the proportion of samples from the outlier category. Synthetic samples are generated using the SMOTE (Synthetic Minority Over-sampling Technique).
[0228]
[0229] Based on each algorithm in the historical dataset To assess performance, each trained base learner is assigned a weight. The weight calculation method treats anomaly detection as a binary classification scenario with imbalanced sample labels for inference. The weights are derived from the F1 scores of each unsupervised algorithm model on the same labeled photovoltaic module dataset, and are calculated as follows:
[0230]
[0231] Here, TP (True Positives) is the number of true positives, i.e., the number of samples correctly predicted as positive by the model; FP (False Positives) is the number of false positives, i.e., the number of samples incorrectly predicted as positive by the model; and FN (False Negatives) is the number of false negatives, i.e., the number of positive samples incorrectly predicted as negative by the model. Since the F1-score represents the harmonic mean of precision and recall, it considers the balance between the two metrics, avoiding the problem of one metric being very high while the other is very low in extreme cases. Therefore, it is suitable for evaluating the algorithm model's capabilities in imbalanced scenarios.
[0232] The weights ω are dynamically implemented based on the F1 score. i The allocation formula is as follows:
[0233]
[0234] Weighted summation of outlier scores:
[0235]
[0236] An adaptive method is used to dynamically adjust the judgment threshold. The threshold adjustment formula is as follows:
[0237]
[0238] Where α is the adjustment coefficient, F 1t This is the current F1 score.
[0239] Anomaly detection result determination:
[0240] If S final If the value is greater than θ, an anomaly detection signal will be triggered.
[0241] Example 3
[0242] Figure 6 A schematic diagram of a dataset according to an embodiment of the present invention is shown.
[0243] like Figure 6 As shown, this embodiment verifies the technical effectiveness of the method based on the SCADA operation data of XX photovoltaic modules and their supporting equipment (electricity meters, environmental monitoring instruments, etc.) of the XXXX photovoltaic power station from December 1, 2023 to March 1, 2024.
[0244] In the specific implementation of this invention, the method first sets the content and frequency of data acquisition, enabling the monitoring and recording of key parameters of the photovoltaic module, such as current I(t), voltage V(t), temperature T(t), and illuminance L(t). The data acquisition frequency is set to Δt = 5 mins to obtain the dataset D.
[0245] In the data preprocessing stage, all irrelevant variables in dataset D are first removed, including internal fault numbers of the manufacturer, preset state quantities, single constant quantities, and significantly abnormal constant variables, and then data denoising is performed.
[0246] This method uses wavelet transform to remove high-frequency noise and time series interpolation to fill in missing values in the data, so as to ensure the integrity and continuity of the data.
[0247] For a time series dataset D, this method uses wavelet transform W(D,t) to remove noise, resulting in a denoised dataset D. clean Subsequently, for missing values, this method employs the quadratic interpolation function ∧D=I(D clean ,t) to fill in.
[0248] Principal component analysis (PCA) was used to extract the principal components from the preprocessed dataset. The principal component temperature was set to d=2. Key feature vectors that effectively reflect the operating status of photovoltaic modules were extracted and added to the interpolated dataset, resulting in the following features:
[0249] F = [f1, f2, f3, ..., f n ]
[0250] Where n is the number of features.
[0251] Based on the above features, time-varying features were extracted and subjected to time-series shifting, a total of 5 shifts, with each shift result incorporated into the original dataset:
[0252] F new =[f1,f2,f3,...,f n+m ]
[0253] Where n is the number of original features and m is the number of newly added time-series features.
[0254] The statistics used to calculate these features, including mean μ, standard deviation σ, skewness S, and kurtosis K, yield a dataset D containing the new features. train ;
[0255] In addition, to ensure reasonable weight allocation for subsequent algorithms, this method additionally collects relevant historical dataset D. history , used for model F1-score evaluation during the weight allocation phase.
[0256] To ensure the historical dataset D history With sufficient outlier samples for subsequent algorithm evaluation, a resampling algorithm was used for processing. The resampling algorithm selected was the SMOTE algorithm, where the nearest neighbor number k=5, the doubling sample factor N=110%, and other settings remained at their default values.
[0257] In constructing the unsupervised algorithm ensemble framework, this method selected five algorithms: Mahalanobis distance, One-Class SVM, CBLOF, Isolation Forest, and Spectral Residual. Each algorithm analyzes different characteristics of the data.
[0258] The Mahalanobis distance parameters are set as follows: the data samples use dataset D, the mean is the mean vector of the dataset, and the covariance uses the covariance matrix of the dataset.
[0259] One-Class SVM parameters are set to: Data samples use dataset D train The upper bound of the error rate and the lower bound of the support vectors are nu = 0.5, the kernel function class is kernel = rbf, the kernel function coefficient is gamma = 0.1, and other parameters are kept at their default values.
[0260] The CBLOF parameters are set as follows: the number of clusters used for clustering n_clusters = 8, the weight alpha used to control the relative importance of cluster size and cluster density = 0.9, the weight beta used to control the relative importance of local density and cluster density = 5, and other parameters are kept at their default values.
[0261] The parameters for the isolated forest are set as follows: number of trees n_estimators = 100, number of samples used for training in each tree max_samples = auto, and maximum number of features considered in each tree max_features = 100.
[0262] The spectral residual parameters are set as follows: window_size = 1024 for calculating the spectral residual, alpha = 0.24 for controlling the smoothness of the spectral residual, and threshold = 0.01 for the outlier, indicating that the first 1% of outliers are located as anomalies.
[0263] To optimize the performance of ensemble learning, this method employs a dynamic weight allocation mechanism. This mechanism is based on the algorithm's performance on the historical dataset D. history Based on the F1-score performance, the weights of each algorithm are dynamically adjusted:
[0264] The formula for calculating the F1 score is: Where TP is the number of true positives, FP is the number of false positives, and FN is the number of false negatives.
[0265] The weights are allocated as follows:
[0266]
[0267] In the anomaly detection and decision-making phase, each algorithm within the algorithm framework performs anomaly detection on the newly input data.
[0268] Each algorithm independently calculates the anomaly score S. i Then according to the weight ω i Perform a weighted summation.
[0269] Final outlier score:
[0270]
[0271] An adaptive method is used to dynamically adjust the decision threshold, and the threshold θ is calculated as follows:
[0272]
[0273] Among them, F1 t This is the current F1 score.
[0274] Anomaly detection results, if S final If the value is greater than θ, then the current sample point is determined to be an outlier.
[0275] Example 4
[0276] Figure 7 A block diagram of a photovoltaic module data anomaly detection device based on an unsupervised algorithm integration according to an embodiment of the present invention is shown.
[0277] like Figure 7 As shown, the photovoltaic module data anomaly detection device based on unsupervised algorithm integration includes:
[0278] Training module 201 establishes and trains corresponding base learners based on multiple unsupervised algorithms according to the SCADA dataset;
[0279] Calculation module 202 determines the anomaly scores and weights corresponding to each base learner;
[0280] The detection module 203 performs anomaly detection based on the anomaly score and weight.
[0281] In one example, the SCADA dataset includes the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t).
[0282] In one example, unsupervised algorithms include Mahalanobis distance calculation, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual.
[0283] In one example, preprocessing of the SCADA dataset is also included:
[0284] Wavelet transform is used to remove high-frequency noise:
[0285] D clean =W(D,t)
[0286] Among them, D clean The signal is denoised, W is wavelet transform, D is the original SCADA data, and t is time.
[0287] Based on the denoised signal, time series interpolation is used to handle missing values:
[0288]
[0289] in, Let I be the interpolated dataset, and let I be the interpolation function.
[0290] Principal component analysis is used for dimensionality reduction to extract principal components from the dataset.
[0291]
[0292] Where P represents the training dataset after the key feature vectors have been calculated;
[0293] Connect the principal component vectors with the dataset By piecing them together, we get:
[0294]
[0295] Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates column concatenation operation.
[0296] For dataset D concat In the time-varying features, new feature columns are added through time-series translation operations:
[0297] D new =SHIFT(D concat ,k)
[0298] Where SHIFT represents the time-series feature lag calculation and column concatenation operation, and k represents the timestamp span of each shift;
[0299] Calculate dataset D new All eigenvectors f i First-order and second-order statistics:
[0300]
[0301] Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
[0302] In one example, determining the anomaly scores and weights for each base learner includes:
[0303] Determine the outlier score S of the output data of each base learner. i And determining the 1st percentile θ t ;
[0304] Collect historical dataset D history ;
[0305] For historical dataset D history Resampling is performed to generate synthetic samples using the SMOTE technique:
[0306]
[0307] in, For synthetic samples;
[0308] Based on each base learner Calculate the corresponding F1 score based on the performance on the chart.
[0309]
[0310] The weights ω are dynamically implemented based on the F1 score. i distribute:
[0311]
[0312] In one example, anomaly detection based on anomaly scores and weights includes:
[0313] Calculate the weighted result of the outlier scores based on the outlier scores and their weights;
[0314] The judgment threshold is dynamically determined using an adaptive method;
[0315] Determine the relationship between the weighted result of the abnormal score and the judgment threshold to perform abnormal detection.
[0316] In one example, if the weighted result of the abnormal score is greater than the judgment threshold, it is judged as abnormal.
[0317] Example 5
[0318] This disclosure provides an electronic device, comprising: a memory storing executable instructions; and a processor executing the executable instructions in the memory to implement the aforementioned photovoltaic module data anomaly detection method based on unsupervised algorithm integration.
[0319] An electronic device according to an embodiment of the present disclosure includes a memory and a processor.
[0320] This memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.
[0321] The processor may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory.
[0322] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.
[0323] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0324] Example 6
[0325] This disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned photovoltaic module data anomaly detection method based on unsupervised algorithm integration.
[0326] A computer-readable storage medium according to embodiments of the present disclosure stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the methods described in the foregoing embodiments of the present disclosure are performed.
[0327] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).
[0328] Those skilled in the art should understand that the above description of the embodiments of the present invention is only intended to illustrate the beneficial effects of the embodiments of the present invention, and is not intended to limit the embodiments of the present invention to any of the examples given.
[0329] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments.
Claims
1. A method for detecting anomalies in photovoltaic module data based on unsupervised algorithm integration, characterized in that, include: Based on the SCADA dataset, corresponding base learners are established and trained using multiple unsupervised algorithms. Determine the anomaly scores and weights for each base learner; Anomaly detection is performed based on the anomaly score and the weight.
2. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 1, wherein, The SCADA dataset includes the photovoltaic module's current I(t), voltage V(t), temperature T(t), and illuminance L(t).
3. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 1, wherein, The unsupervised algorithms include Mahalanobis distance calculation, single-class support vector machine, cluster-based local anomaly factor, isolated forest, and spectral residual.
4. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 1, wherein, This also includes preprocessing of the SCADA dataset: Wavelet transform is used to remove high-frequency noise: D clean =W(D,t) Among them, D clean The signal is denoised, W is wavelet transform, D is the original SCADA data, and t is time. Based on the denoised signal, time series interpolation is used to handle missing values: ∧ D=I(D clean ,t), ∧ Where D is the interpolated dataset and I is the interpolation function; Principal component analysis is used for dimensionality reduction to extract principal components from the dataset. Where P represents the training dataset after the key feature vectors have been calculated; Connect the principal component vectors with the dataset By piecing them together, we get: Among them, D concat This represents the dataset after concatenation with principal component features; CONCAT indicates column concatenation operation. For dataset D concat In the time-varying features, new feature columns are added through time-series translation operations: D new =SHIFT(D concat ,k) Where SHIFT represents the time-series feature lag calculation and column concatenation operation, and k represents the timestamp span of each shift; Calculate dataset D new All eigenvectors f i First-order and second-order statistics: Add the first-order and second-order statistics to dataset D. new From this, we obtain the dataset D used for subsequent model training. train .
5. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 1, wherein, Determining the anomaly scores and weights for each base learner includes: Determine the outlier score S of the output data of each base learner. i And determining the 1st percentile θ t ; Collect historical dataset D history ; For the historical dataset D history Resampling is performed to generate synthetic samples using the SMOTE technique: in, For synthetic samples; Based on each base learner Calculate the corresponding F1 score based on the performance on the chart. The weights ω are dynamically implemented based on the F1 score. i distribute:
6. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 1, wherein, Anomaly detection, based on the anomaly score and the weight, includes: Calculate the weighted result of the abnormal scores based on the abnormal scores and the weights; The judgment threshold is dynamically determined using an adaptive method; Determine the relationship between the weighted result of the abnormal score and the judgment threshold, and perform abnormal detection.
7. The photovoltaic module data anomaly detection method based on unsupervised algorithm integration according to claim 6, wherein, If the weighted result of the abnormal score is greater than the judgment threshold, it is judged as abnormal.
8. A photovoltaic module data anomaly detection device based on unsupervised algorithm integration, characterized in that, include: The training module establishes and trains corresponding base learners based on multiple unsupervised algorithms using the SCADA dataset. The calculation module determines the anomaly scores and weights corresponding to each base learner. The detection module performs anomaly detection based on the anomaly score and the weight.
9. An electronic device, characterized in that, The electronic device includes: Memory, which stores executable instructions; A processor that executes the executable instructions in the memory to implement the photovoltaic module data anomaly detection method based on unsupervised algorithm integration as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the photovoltaic module data anomaly detection method based on unsupervised algorithm integration as described in any one of claims 1-7.