Photovoltaic power generation anomaly detection method, system, device and storage medium

By employing a photovoltaic power generation anomaly detection method that integrates covariate embedding into a large time-series model and contrastive learning, the problems of high stability and cost of traditional photovoltaic anomaly detection technologies under different conditions are solved, achieving efficient anomaly detection and prediction.

CN122334567APending Publication Date: 2026-07-03上海沄熹科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
上海沄熹科技有限公司
Filing Date
2026-03-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Traditional photovoltaic anomaly detection technologies struggle to maintain stability and reliability under varying seasons, weather conditions, and site conditions. Furthermore, deep learning models suffer from high costs and a lack of sharing capabilities in anomaly detection.

Method used

By employing a covariate embedded time-series large model, and through joint modeling of inverter active power and meteorological information, combined with comparative learning, an anomaly scoring method is constructed to achieve anomaly detection in photovoltaic power generation systems.

Benefits of technology

It improves the photovoltaic system's ability to interpret weather-induced power fluctuations, reduces false alarm rates, and reduces the workload of repetitive development and maintenance of multiple models, making it suitable for large-scale deployments with multiple sites and multiple inverters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334567A_ABST
    Figure CN122334567A_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, device, and storage medium for photovoltaic power generation anomaly detection, comprising: S1: collecting the active power time series of the inverter as the main variable and using the meteorological and environmental characteristic time series collected by the environmental monitoring instrument as covariates to form a structured sample; S2: inputting the structured sample into a large-scale time series model and outputting the final power prediction value; S3: fine-tuning the large-scale time series model using historical structured samples under normal operating conditions; S4: applying the fine-tuned large-scale time series model to unlabeled historical structured samples to form a normal side sample set and an anomaly side sample set; S5: clustering the embedding vectors of the normal side samples in the embedding space and separating the embedding vectors of the normal side samples and the anomaly side samples in the embedding space; S6: performing anomaly detection. This invention enables simultaneous power generation prediction and anomaly detection within the same model, reducing the workload of redundant development and maintenance of multiple models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of photovoltaic power generation and artificial intelligence technology, specifically to a method, system, device, and storage medium for detecting anomalies in photovoltaic power generation. Background Technology

[0002] With the continuous expansion of new energy installed capacity and the increasing number and capacity of photovoltaic power plants, high-precision prediction of inverter active power in large-scale photovoltaic scenarios has become a crucial foundation for grid dispatching and revenue assessment. However, the power generation process is heavily influenced by weather and equipment condition. Component shading, inverter failure, performance degradation, or communication anomalies can not only reduce actual power generation but also directly undermine the reliability of prediction results. Therefore, while prediction is the core objective in photovoltaic applications, timely identification of abnormal operating conditions that may affect prediction accuracy is equally indispensable and crucial for ensuring prediction stability and improving the overall profitability of the power plant.

[0003] Traditional photovoltaic anomaly detection technologies primarily rely on manual thresholds, empirical rules, or outlier detection methods based on simple statistical characteristics, such as alarms based on the power generation / irradiance ratio. These methods are sensitive to changes in seasons, weather, and site conditions, making it difficult to maintain stable and reliable performance over the long term. Furthermore, most rely on fixed decision logic, lacking the ability to model complex dynamic behaviors and accurately capture the temporal evolution of abnormal states. As power plant scale increases and operating environments diversify, detection strategies based on manual experience or static thresholds are increasingly unable to meet actual operation and maintenance needs.

[0004] In recent years, end-to-end deep learning models have been widely used in the field of photovoltaic power prediction, but there are still limitations in anomaly-related modeling: First, covariates such as weather are crucial to power generation behavior, while deep learning models often need to be trained from scratch on the relationship between the model and covariates for each power plant or even each inverter, resulting in high development and deployment costs; Second, such models usually focus on photovoltaic power generation prediction tasks and lack anomaly detection capabilities, which means that prediction and anomaly detection still need to be modeled and deployed separately, and cannot share the same set of time series understanding capabilities, increasing the cost of engineering implementation and maintenance.

[0005] Therefore, there is an urgent need for a technical solution that can simultaneously utilize both main variables and covariates for modeling within a unified model framework, while also taking into account power prediction and anomaly detection, so as to reduce deployment and maintenance costs while ensuring prediction accuracy. Summary of the Invention

[0006] The technical objective of this invention is to address the above-mentioned shortcomings by providing a photovoltaic power generation anomaly detection method, system, device, and storage medium. This method is based on a covariate-embedded time-series model and contrastive learning for photovoltaic power generation anomaly detection. It uses inverter active power as the main variable and meteorological information as a covariate as input to a pre-trained time-series model. After fine-tuning with normal operating data, the prediction results after covariate embedding are obtained. Anomaly scores are constructed using the prediction residuals, and contrastive learning is combined to improve the ability to distinguish between normal and abnormal operating conditions. This enables photovoltaic power generation system anomaly detection without requiring a large amount of labeled data.

[0007] In a first aspect, the present invention provides a method for detecting anomalies in photovoltaic power generation, comprising the following steps: S1: In the photovoltaic power station, the active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp, and the active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample. S2: Input the structured sample into the time series large model pre-trained with the sequence dataset. The time series large model generates prediction results through the baseline prediction branch and the covariate embedding prediction branch, respectively, and then performs weighted fusion through trainable weights to output the final power prediction value. S3: Use historical structured samples from normal operating conditions to fine-tune the time series model to minimize prediction error; S4: Apply the fine-tuned time series model to the unlabeled historical structured samples and calculate the prediction residual score for each time window; based on the residual score, select low residual windows from the unlabeled historical structured samples as pseudo-normal samples to form a normal side sample set, and select high residual windows as pseudo-anomaly candidate samples; apply controlled perturbation to the power sequence by simulating typical abnormal operating conditions to generate enhanced abnormal samples, which together with the pseudo-anomaly candidate samples form an abnormal side sample set; S5: The temporal feature tensor output by the fine-tuned temporal large model is pooled and then input into the multilayer perceptron projection head to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space. S6: In the anomaly detection stage, the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample are calculated simultaneously for the structured sample to be detected. The two are weighted and fused to obtain a comprehensive anomaly score. The comprehensive anomaly score is compared with a preset threshold. If the score exceeds the detection threshold, it is determined to be an anomaly.

[0008] In S1, the meteorological and environmental characteristics include at least ambient temperature, solar radiation intensity, wind speed, wind direction, real-time radiation, total radiation, dew point temperature, backplane temperature, and humidity. In S1, missing value imputation, outlier screening, and standardization are performed on the collected main variables and covariates to unify the dimensions of each variable and reduce noise interference.

[0009] In S2, the time-series large model generates prediction results through a baseline prediction branch and a covariate embedding prediction branch, respectively, and then performs weighted fusion using trainable weights to output the final power prediction value, including: The active power time series of each inverter is time-sliced ​​and attention-based modeled in a channel-independent manner to obtain the corresponding principal variable time series features. The principal variable time series features are regressed through the first prediction head to output the future power baseline prediction result that depends only on the historical power of the inverter. The backbone network of the time series model extracts the covariate time series features and inputs them together with the principal variable time series features into a multilayer perceptron for feature fusion. The fused features are regressed through the second prediction head to obtain the covariate embedding prediction result. The results of the covariate embedding prediction branch are then adjusted by trainable weights with sigmoid functions and fused with the baseline prediction results to obtain the final power prediction output. In the early stage of training, the weights are initially set to negative values ​​and gradually increased as the training process progresses.

[0010] In step S3, the historical structured samples of normal operating conditions are used to fine-tune the time-series large model to minimize the prediction error. This includes: the historical structured samples of normal operating conditions include data that has been confirmed by at least maintenance records and alarm logs that no faults, repairs, or abnormal events have occurred; the data is input into the time-series large model, and the covariate embedded predicted active power is output; the difference between the covariate embedded predicted active power and the actual observed active power is used as the training target; the mean square error loss function is used to update the parameters of the pre-trained time-series large model so that the model fits the normal power generation behavior pattern of the target power station.

[0011] In step S4, the predicted residual score for each time window is calculated. Based on the residual score, low residual windows are selected as pseudo-normal samples and high residual windows are selected as pseudo-anomaly candidate samples from the unlabeled historical structured samples. This includes: for each time window, the predicted active power of each inverter at each moment within the window is calculated using a fine-tuned time-series large model, and the time-by-time residual is obtained based on the predicted active power; then, the mean of the squared residuals is used as the residual score for that time window to quantify the degree of deviation of the power generation behavior from the normal power generation mode. The residuals are calculated for all time windows. After scoring, the time windows are sorted from low to high according to the residual scores. The top α% of windows are selected as pseudo-normal samples, and the bottom β% of windows are selected as pseudo-abnormal candidate samples, where α% and β% are preset proportions. Enhanced anomalous samples are generated by applying controlled perturbations to a portion of the power sequence by simulating typical abnormal operating conditions. These abnormal operating conditions include at least component blocking, voltage fluctuations, sensor drift, and communication interruption. When perturbing the power sequence, the covariates are kept or reasonably set within a physically reasonable range so that the anomalousness of the constructed enhanced anomalous samples is mainly caused by changes in power generation behavior or equipment status.

[0012] In step S5, the time-series feature tensor output by the fine-tuned time-series large model is pooled and input into the multilayer perceptron projection head to obtain contrastive learning embedding vectors. Based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed and trained using the contrastive loss function, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space. This includes: for each input time window structured sample, after processing by the backbone network of the time-series large model, a corresponding three-dimensional time-series feature tensor is obtained. The feature tensor is globally averaged in the inverter dimension and the time dimension to obtain a fixed-length feature vector, and the feature vector is input to... A multilayer perceptron projector, after passing through a fully connected layer and nonlinear activation, yields a contrastive learning embedding vector. Positive and negative sample pairs are constructed using normal and abnormal sample sets. A positive sample pair consists of two independently sampled normal samples, while a negative sample pair consists of one normal sample and one abnormal sample. A contrastive loss is calculated based on these embedding vectors to reduce the distance between normal sample embeddings and increase the distance between normal and abnormal sample embeddings. During contrastive learning training, a weighted sum of the prediction loss and the contrastive loss is used as the total loss. The prediction loss is calculated on the normal sample set, while the contrastive loss is calculated on both the normal and abnormal sample sets. The weighting coefficients are adjusted to balance the model's prediction accuracy and anomaly detection capability.

[0013] In step S6, the predicted residual score and the distance score between the embedded vector and the embedded center of the normal sample are calculated simultaneously for the structured sample to be detected. The two are then weighted and fused to obtain a comprehensive anomaly score. This includes: statistically analyzing the distribution characteristics of the residual score sequence and the distance score sequence respectively; performing scale normalization on the two types of scores to make them fall within a similar numerical range; and, based on the statistical results on the calibration set, determining a set of fixed weights and linearly weighting the normalized two types of scores to obtain the final anomaly score.

[0014] Secondly, the present invention provides a voltage power generation anomaly detection system, comprising: Sample construction module: The active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp, and the active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample. Modeling and prediction result fusion module: used to input structured samples into a time series large model pre-trained with sequence datasets. The time series large model generates prediction results through baseline prediction branch and covariate embedding prediction branch respectively, and then performs weighted fusion through trainable weights to output the final power prediction value. Model fine-tuning module: used to fine-tune the time series model using historical structured samples from normal operating conditions to minimize prediction error; Normal / Abnormal Sample Set Construction Module: This module applies the fine-tuned time-series large model to unlabeled historical structured samples and calculates the prediction residual score for each time window. Based on the residual score, it selects low-residual windows from the unlabeled historical structured samples as pseudo-normal samples to form a normal-side sample set, and selects high-residual windows as pseudo-abnormal candidate samples. By simulating typical abnormal operating conditions, it applies controlled perturbations to the power sequence to generate enhanced abnormal samples, which, together with the pseudo-abnormal candidate samples, constitute the abnormal-side sample set. Normal and Abnormal Sample Separation Module: This module is used to input the temporal feature tensor output by the fine-tuned temporal large model into the multilayer perceptron projection head after pooling, so as to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space. Anomaly detection module: It is used to simultaneously calculate the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample for the structured sample to be detected, and to perform weighted fusion of the two to obtain a comprehensive anomaly score; the comprehensive anomaly score is compared with a preset threshold, and if the score exceeds the detection threshold, it is determined to be an anomaly.

[0015] Thirdly, the present invention provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for detecting abnormal voltage generation.

[0016] Fourthly, the present invention provides a computer-readable storage medium comprising a computer program, wherein when the computer program is executed by a processor, it implements the steps of the above-described method for detecting abnormal voltage generation.

[0017] The photovoltaic power generation anomaly detection method, system, device, and storage medium of the present invention have the following advantages: By jointly modeling the inverter power time series and meteorological covariates through a pre-trained time series large model, the normal power generation law of the photovoltaic system can be accurately characterized, improving the interpretability of weather-induced power fluctuations and reducing the false alarm rate; by relying on covariate embedding prediction output to construct residual representations and combining comparative learning to form a distinguishable embedding space, the system can reliably identify abnormal operation without relying on a large amount of manual annotation; by simultaneously completing power generation prediction and anomaly detection in the same model, the workload of repeated development and maintenance of multiple models is reduced, making it suitable for large-scale deployment applications with multiple sites and multiple inverters. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] The invention will be further described below with reference to the accompanying drawings.

[0020] Figure 1 This is a flowchart of a photovoltaic power generation anomaly detection method according to Embodiment 1 of the present invention; Figure 2 This is a principal covariate fusion modeling diagram according to Embodiment 1 of the present invention; Figure 3 This is a block diagram of the logic structure of a photovoltaic power generation anomaly detection system according to Embodiment 2 of the present invention. Detailed Implementation

[0021] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments are not intended to limit the present invention. In the absence of conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0022] It should be understood that in the description of the embodiments of the present invention, terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance, nor as indicating or implying order. In the embodiments of the present invention, "multiple" refers to two or more.

[0023] In this embodiment of the invention, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, B existing alone, or both A and B existing simultaneously. Furthermore, in this document, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Example

[0024] like Figure 1 and Figure 2 As shown in this embodiment, the photovoltaic power generation anomaly detection method is a predictive anomaly detection method for photovoltaic power generation scenarios. The overall scheme includes three parts: data acquisition and preprocessing; a time-series prediction network for joint modeling of multiple inverters and covariates; and anomaly representation construction and detection based on prediction residuals and contrastive learning. The aim is to enable the photovoltaic power generation system to automatically identify abnormal operating conditions while completing the prediction of inverter active power. This allows the prediction model to not only output future power trends but also determine whether the current operating state deviates from normal power generation behavior, thereby improving the stability and reliability of photovoltaic power plant operation monitoring.

[0025] This embodiment provides a method for detecting abnormal photovoltaic power generation, which may include the following steps: S1: Within the photovoltaic power station, the active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp, and the active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample.

[0026] Meteorological and environmental characteristics include at least ambient temperature, solar radiation intensity, wind speed, wind direction, real-time radiation, total radiation, dew point temperature, backplane temperature, and humidity. In S1, missing value imputation, outlier screening, and standardization are performed on the collected main variables and covariates to unify the dimensions of each variable and reduce noise interference.

[0027] This step involves data acquisition and preprocessing. First, operational monitoring data of the photovoltaic power station is collected, including the active power time series of multiple inverters (as the main variable), and meteorological and environmental characteristics collected by environmental monitoring instruments within the same power station (as covariates). Covariates include, but are not limited to, ambient temperature, solar radiation intensity, wind speed, wind direction, real-time radiation, total radiation, dew point temperature, backsheet temperature, and humidity, and are shared by all inverters within the power station.

[0028] When constructing the model input, continuous data is organized into model training samples using a sliding time window approach. For a given time window, the power sequences of multiple inverters are used as the main variable input, while the covariate data within that time period is copied and broadcast to each inverter channel, ensuring that the main variable sequence and the covariate sequence are consistent in the time dimension. This method generates structured input samples that fully cover the joint time-series information of "multiple inverter power + site-level meteorological factors".

[0029] In addition, to ensure input quality, data cleaning and consistency processing are performed based on the following strategies: historical statistics for both main variables and covariates are calculated and standardized to ensure comparability of data of different dimensions and magnitudes within the model; missing values ​​are handled using linear interpolation, time-series imputation, or physical constraints based on photovoltaic characteristics to avoid input breakpoints; values ​​that clearly violate physical laws (such as sudden high power at night, abnormal power spikes when irradiance is zero, etc.) are initially screened out to reduce the impact of noise on model learning. Regarding time alignment, the multi-inverter power sequence and the meteorological covariate sequence are strictly aligned at a unified time step, using timestamps as the benchmark. If sampling bias exists, forward imputation or local resampling is used to correct it, ensuring no temporal misalignment exists between sequences.

[0030] After the above preprocessing, the final structured data that meets the model input requirements is obtained. Each sample contains multiple inverter power sequences within a continuous time window and their strictly corresponding covariate sequences, providing an accurate, stable and consistent data foundation for the subsequent time series prediction network.

[0031] S2: Input the structured samples into the time series large model pre-trained on the sequence dataset. The time series large model generates prediction results through the baseline prediction branch and the covariate embedding prediction branch, respectively, and then performs weighted fusion through trainable weights to output the final power prediction value.

[0032] The time-series large model generates prediction results through a baseline prediction branch and a covariate embedding prediction branch, respectively. These results are then weighted and fused using trainable weights to output the final power prediction value. This process includes: performing time-slicing and attention modeling on the active power time series of each inverter in a channel-independent manner to obtain the corresponding principal variable time-series features; regressing these features using a first prediction head to output a future power baseline prediction result that depends only on the inverter's historical power; extracting covariate time-series features from the backbone network of the time-series large model and inputting them, along with the principal variable time-series features, into a multilayer perceptron for feature fusion; regressing the fused features using a second prediction head to obtain the covariate embedding prediction result; adjusting the result of the covariate embedding prediction branch using trainable weights with a sigmoid function; and fusing this result with the baseline prediction result to obtain the final power prediction output; initially setting the weights to negative values ​​during training, the weights are gradually increased during the training process.

[0033] This step involves multi-inverter principal variable modeling and covariate embedding fusion based on a large-scale time-series model. A photovoltaic multi-inverter power prediction network is constructed using a Transformer-based large-scale time-series model. This type of large-scale time-series model learns its temporal evolution structure and general patterns across different business scenarios through pre-training on large-scale time-series datasets from multiple industries, especially energy and power generation systems. This results in good generalization ability and stability in downstream photovoltaic power generation scenarios. During the pre-training phase, multivariate time series are modeled in a channel-independent manner. This means that time-dependent features are extracted independently for each time series, without forcibly introducing cross-channel interactions. This adapts to various time-series channels with heterogeneous sources and significant distribution differences. This mechanism matches the characteristic of multiple inverters in a photovoltaic power plant being independent but structurally similar.

[0034] In downstream photovoltaic power generation scenarios, two types of prediction outputs are constructed simultaneously using predictive modeling: a baseline prediction based solely on the inverter's historical power generation behavior; and a prediction correction incorporating meteorological and environmental covariates for subsequent anomaly detection.

[0035] The specific structure and execution process are as follows: 1. Main variable modeling and baseline prediction output The active power sequences of multiple inverters within a power station are input into the backbone network of a large-scale time-series model. After time-patch partitioning and attention mechanism modeling of long-term dependencies and local variation trends, a time-series representation vector for each inverter is obtained. Subsequently, the first prediction head outputs the predicted future power generation value, yielding a baseline prediction result that relies solely on the historical power sequences of the inverters, denoted as . This prediction branch does not consider the influence of meteorological environment and is used to reflect the power change trend of the inverter in pure equipment state given by the general learning capability of the time series large model. It can provide a reference for subsequent anomaly detection based on prediction residuals.

[0036] 2. Covariate embedding This branch takes the same time window as the main variable as input, and inputs the meteorological and environmental covariate sequences (such as temperature, solar radiation intensity, wind speed, wind direction, irradiance, dew point temperature, backsheet temperature, humidity, etc.) of the same time period into the backbone network of the time series large model after being divided by the same patch, to obtain the time representation of the covariates. Then, the main variable representation and the covariate representation are input into the multilayer perceptron (MLP) fusion module. Through linear transformation, normalization, and MLP mapping, the two types of information are aligned and fused, resulting in a fused feature vector containing a joint representation of power generation trends and environmental impacts, to learn the impact of environmental changes on the power generation behavior of different inverters. The fused features are output through the second prediction head as predicted values ​​for subsequent corrections. .

[0037] 3. Prediction result fusion To avoid covariates interfering with the prediction of the main variable during the early stages of training, this scheme sets trainable boosting weights for the second prediction branch and adjusts them using the sigmoid function, gradually increasing the contribution of the covariates to the prediction. The final prediction output is expressed as: .

[0038] Where σ(•) is the sigmoid function, and w The initial setting is a large negative value, so that σ( w The result is approximately 0, meaning that the enhancement branch has a very weak impact on prediction in the early stages of training. As training progresses, the model gradually improves under data-driven conditions, and the effect of covariate embedding gradually becomes apparent. This enables a progressive fusion from predicting only device behavior to predicting both device behavior and environmental impact, thereby reducing interference from external factors such as weather when subsequent anomaly detection is based on prediction residuals.

[0039] S3: Use historical structured samples from normal operating conditions to fine-tune the time series model to minimize prediction error.

[0040] The historical structured samples of normal operating conditions include data that has been confirmed by at least maintenance records and alarm logs to be free of faults, repairs, or abnormal events. The data is input into the time series large model, and the output is covariate embedded prediction of active power. The difference between the covariate embedded prediction of active power and the actual observed active power is used as the training objective. The mean square error loss function is used to update the parameters of the pre-trained time series large model so that the model fits the normal power generation behavior pattern of the target power station.

[0041] After completing the construction of the time-series prediction network for joint modeling of multiple inverters and covariates, the prediction model is fine-tuned based on the normal operation data of the target site.

[0042] First, a fine-tuning dataset is constructed by selecting historical operating data containing only normal operating conditions from the target photovoltaic power plant. Normal operating data includes data confirmed through maintenance records, alarm logs, etc., indicating no faults, repairs, or other abnormal events have occurred. The inputs for the fine-tuning phase include historical active power time series from multiple inverters and corresponding meteorological and environmental covariate time series for each time point. The output is the covariate-embedded predicted active power for each inverter within a preset prediction time span.

[0043] During fine-tuning, the difference between the predicted active power and the actual observed active power is embedded as a covariate and used as the training objective. The mean squared error loss function is employed to update the parameters of the pre-trained time-series large-scale model, enabling the model to fit the normal power generation behavior pattern of the target power station. Specifically, for the... i An inverter, in time t The actual active power is denoted as The enhanced prediction result is denoted as The residual is then defined as: .

[0044] The model is backpropagated and iteratively optimized using the sum of squared residuals at each time step as the loss term, gradually reducing the overall amplitude of the residual sequence under normal operating conditions. After this training stage, a covariate embedding prediction model that converges to the normal power generation mode of the target plant can be obtained, and the time-by-time residual sequence of each inverter can be calculated at any time window. The residual sequence serves as the basic input for subsequent mining of pseudo-normal and pseudo-abnormal samples based on the prediction residuals, distinguishing between time windows consistent with the normal power generation mode and time windows that significantly deviate from the normal mode.

[0045] S4: Apply the fine-tuned time series model to the unlabeled historical structured samples and calculate the prediction residual score for each time window; based on the residual score, select low residual windows as pseudo-normal samples and high residual windows as pseudo-anomaly candidate samples from the unlabeled historical structured samples; apply controlled perturbation to the power sequence by simulating typical abnormal operating conditions to generate enhanced abnormal samples, which together with the pseudo-anomaly candidate samples constitute the anomaly side sample set.

[0046] For each time window, the predicted active power of each inverter at each moment within the window is calculated using a fine-tuned time-series large model, and the time-by-time residuals are obtained based on the predicted active power. The mean of the squared residuals is then used as the residual score for that time window to quantify the degree of deviation of the power generation behavior from the normal power generation mode. After calculating the residual scores for all time windows, the time windows are sorted from low to high according to their residual scores. The top α% of windows are selected as pseudo-normal samples, and the bottom β% are selected as pseudo-anomaly candidate samples, where α% and β% are preset percentages. Abnormal operating conditions include at least component shading, voltage fluctuations, sensor drift, and communication interruptions. When perturbing the power sequence, the covariates are kept or reasonably set within a physically reasonable range so that the anomalies in the constructed enhanced anomaly samples are mainly caused by changes in power generation behavior or equipment status.

[0047] This step involves identifying pseudo-normal and pseudo-anomaly samples based on residuals in historical data without manual anomaly labeling. After fine-tuning the prediction model for the target photovoltaic power plant's normal operation data, the fine-tuned covariate embedding prediction model is applied to a large amount of historical operation data without manual anomaly labeling to identify high-confidence pseudo-normal and pseudo-anomaly samples. For each time window, the predicted active power of each inverter at each moment within that window is calculated using the fine-tuned covariate embedding prediction model, and the time-by-time residuals are obtained accordingly. Then, the mean of the squared residuals is used as the residual score for that time window to quantify the degree of deviation of the power generation behavior from the normal power generation mode. Specifically, let the window... k Include T k One time step. Involves M One inverter, then window k residual score s k Defined as: .

[0048] After calculating the residual scores for all time windows, the time windows are sorted from lowest to highest residual scores. Based on pre-set first and second proportion thresholds, time windows with scores within the lowest proportion threshold are selected from the sorted results to form a high-confidence pseudo-normal sample set; time windows with scores within the highest proportion threshold are selected to form a high-confidence pseudo-anomaly sample candidate set. The proportion thresholds are configured offline based on the historical data scale and the business requirements for anomaly detection rate and false alarm rate. For example, the lowest 5% of windows can be considered high-confidence pseudo-normal, and the highest 5% can be considered high-confidence pseudo-anomaly candidates, thus obtaining a stable set of pseudo samples with controllable confidence.

[0049] To enhance the coverage of anomalous samples and improve the model's ability to perceive various anomaly patterns, this phase establishes an anomaly sample enhancement mechanism based on the high-confidence pseudo-anomaly sample candidate set. This mechanism, based on photovoltaic power plant operation and maintenance experience, constructs representative equipment-side anomaly patterns around the power sequence, including power drops caused by module shading, voltage spikes, overall upward or downward shifts in the power baseline caused by sensor offset, and power sequences dropping to zero within a certain time period due to communication interruptions. Specifically, while keeping the time series of meteorological and environmental covariates unchanged within the window, a predefined numerical perturbation is applied to the active power sequence within the corresponding time window: for example, in the shading scenario, the power values ​​within the selected sub-interval are scaled by a preset coefficient; in the spike scenario, positive or negative pulses are superimposed at individual time steps; in the baseline drift scenario, a fixed offset is added to the entire power sequence; and in the communication interruption scenario, the power values ​​for the selected time period are replaced with zero. The samples generated through the above controlled perturbations, together with the high-confidence pseudo-anomaly samples, constitute the anomaly sample set.

[0050] Ultimately, this stage generates two sample sets for the subsequent comparative learning stage: a normal sample set, consisting of time windows corresponding to real normal operation data and high-confidence pseudo-normal samples with residual scores at the lowest proportion threshold; and an abnormal sample set, consisting of high-confidence pseudo-abnormal samples with residual scores at the highest proportion threshold and abnormal samples generated using an abnormal sample enhancement mechanism.

[0051] S5: The temporal feature tensor output by the fine-tuned temporal large model is pooled and then input into the multilayer perceptron projection head to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space.

[0052] For each input time window's structured sample, after processing by the backbone network of the temporal large model, a corresponding three-dimensional temporal feature tensor is obtained. The feature tensor is globally averaged in the inverter dimension and time dimension to obtain a fixed-length feature vector. The feature vector is input to the multilayer perceptron projection head, and after passing through a fully connected layer and nonlinear activation, a contrastive learning embedding vector is obtained. Positive and negative sample pairs are constructed using the normal side sample set and the abnormal side sample set. The positive sample pair consists of two independently sampled normal side samples, and the negative sample pair consists of one normal side sample and one abnormal side sample. Based on the embedding vector, the contrastive learning loss is calculated to reduce the distance between the normal side sample embeddings and increase the distance between the normal side and abnormal side sample embeddings.

[0053] In the contrastive learning training process, the weighted sum of the prediction loss and the contrastive loss is used as the total loss. The prediction loss is calculated on the normal side samples, and the contrastive loss is calculated on both the normal and abnormal side samples. The prediction accuracy and anomaly discrimination ability of the model are adjusted by balancing the weighting coefficients.

[0054] This step, while maintaining the covariate embedding prediction capability, introduces a contrastive learning mechanism based on prediction residuals to construct and detect abnormal representations of inverter operating status.

[0055] Based on contrastive learning to enhance the separability of normal and abnormal data in the embedding space, for each input time window sample, a corresponding three-dimensional temporal feature tensor is obtained after processing by the backbone network. The feature tensor is then subjected to global average pooling in both the inverter and time dimensions to obtain a fixed-length feature vector. h Then the feature vector h The input is fed into the multilayer perceptron projector, passes through a fully connected layer and nonlinear activation, and yields a contrastive learning embedding vector. z The embedding vector is used as the embedding representation of the time window. Then, positive and negative sample pairs required for contrastive learning are constructed based on the embedding vector. A positive sample pair consists of two time window samples, both from the normal side sample set, and a negative sample pair consists of one time window sample from the normal side sample set and one time window sample from the abnormal side sample set.

[0056] Let the embedding vector of a certain anchor point sample be . z a The corresponding positive sample embedding vector is z p A set of negative sample embedding vectors is z n Each embedding vector is normalized and then subjected to cosine similarity. sim If similarity is calculated using (∙,∙), then the contrast loss of the anchor point is defined as: .

[0057] in, τ The temperature coefficient is used. By minimizing the contrast loss on both the normal and abnormal sample sets, the embedding vectors of the normal samples are clustered in the embedding space, while the normal and abnormal embedding vectors are separated in the embedding space, forming a distinguishable normal and abnormal cluster structure.

[0058] A phased joint optimization strategy is adopted. In the first phase, the parameters of the temporal prediction backbone network are frozen, and only the parameters of the multilayer perceptron projector head are trained with a relatively large learning rate to initially enable the embedding space to distinguish between normal and abnormal data. In the second phase, the parameters of the temporal prediction backbone network are unfrozen, and the backbone network and projector head are jointly fine-tuned. The backbone network uses a smaller learning rate, while the projector head uses a relatively larger learning rate. Simultaneously, the mean squared error loss for covariate embedding prediction is calculated on the normal sample set. L forecast and in accordance with L total = L forecast + λ · L contrast The weighted sum is used as the total loss function to train the model, where... λ ≥0 is a weight parameter. L contrast To compare the losses.

[0059] S6: In the anomaly detection phase, the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample are calculated simultaneously for the structured sample to be detected. The two are weighted and fused to obtain a comprehensive anomaly score. The comprehensive anomaly score is compared with a preset threshold. If the score exceeds the detection threshold, it is determined to be an anomaly.

[0060] The distribution characteristics of the residual score sequence and the distance score sequence are statistically analyzed separately. The two types of scores are scaled and normalized to make them fall within a similar numerical range. Based on this, a set of fixed weights is determined according to the statistical results on the calibration set, and the normalized two types of scores are linearly weighted to obtain the final anomaly score.

[0061] This step integrates the prediction residuals and embedding distance to achieve final anomaly detection. It receives the active power sequence within the current time window and the corresponding meteorological and environmental covariate sequences. These are then processed by the time-series prediction backbone network to obtain future power predictions, and the residual score for that window is calculated according to the aforementioned definition. s k This is used as the first anomaly score. Simultaneously, the current window sample is input into the projection head to obtain the embedding vector. z k During the training phase, the system calculates the mean of the embedding vectors on the normal side samples as the normal center, and then calculates the Euclidean distance during detection. d k =‖ z k −μ norm || 2 The second anomaly score is used to characterize the degree of deviation of the current sample from the normal state in the embedding space.

[0062] To eliminate the dimensional differences between the two types of scores, the system first statistically analyzes the residual score sequences { on a threshold calibration set that only includes normal operating conditions. s k} and embedding distance score sequence { d k Based on the distribution characteristics of the two types of scores, scale normalization is performed to bring them into a similar numerical range; on this basis, a set of fixed weights is determined according to the statistical results on the calibration set. w r ,w z ≥ 0. Linearly weight the normalized scores of the two classes to obtain the final anomaly score. .

[0063] Initially select w r = w z =0.5. When a sufficient number of truly labeled anomaly samples are accumulated during subsequent runs, the weights can be adjusted on a small number of labeled samples to further optimize the separability of normal and anomaly samples in the final anomaly score. During threshold calibration, the trained model is applied to the threshold calibration set, and calculations are performed for each time window. s k And select the corresponding quantile from the score distribution as the detection threshold based on the target false alarm rate. T .

[0064] During anomaly detection, when s k ≥T If an anomaly is detected within the specified time window, an alarm will be output; otherwise, the inverter will be considered to be in normal operating condition.

[0065] This embodiment fully utilizes the correlation information between main variables and covariates such as weather within a unified model framework. This enables the model to learn the normal power generation patterns of photovoltaic systems under different meteorological conditions, avoiding misjudging natural power fluctuations caused by environmental factors such as irradiance and temperature as anomalies, thereby improving the accuracy and interpretability of anomaly detection. Furthermore, an anomaly detection mechanism is constructed based on the prediction model through residual representation and contrastive learning, thus achieving integrated operation of prediction and anomaly identification. Simultaneously, by leveraging the general time-series representation capabilities of pre-trained large-scale time-series models, it eliminates the need to train independent models from scratch for each site or inverter, reducing development and operation costs while ensuring modeling accuracy. Example

[0066] like Figure 3As shown, the photovoltaic power generation anomaly detection system provided in this embodiment is a system corresponding to Embodiment 1, including: Sample construction module: The active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp. The active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample.

[0067] The active power time series of multiple inverters were obtained as the main variables and the meteorological covariates of the same station. The structured samples were constructed by missing data completion, standardization, time alignment and sliding window.

[0068] Active power data, operating status, and timestamps of multiple inverters in a photovoltaic power station are collected. Meteorological and environmental covariates such as ambient temperature, solar radiation intensity, wind speed, wind direction, real-time radiation, total radiation, dew point temperature, backsheet temperature, and humidity are also collected within the same power station and used as shared inputs for all inverters in the power station. Missing values ​​are filled, outliers are initially screened, and the collected principal and covariates are standardized to unify the dimensions of each variable and reduce noise interference. The principal and covariates are time-aligned according to a unified timestamp, and the power sequences and covariate sequences of multiple inverters are aligned and organized using a sliding time window. Covariates within the same time window are copied and broadcast to each inverter channel to form a structured sample that meets the model input requirements.

[0069] Historical mean and standard deviation were calculated for the main variables and covariates, and the series were normalized using a standardization method based on the mean and standard deviation. Values ​​that clearly violated photovoltaic operating conditions were screened out using physical constraint rules, including high power at night and abnormal power surges when irradiance was zero. The remaining missing points were repaired using linear interpolation or time series imputation.

[0070] Modeling and prediction result fusion module: This module is used to input structured samples into a time series large model pre-trained with a sequence dataset. The time series large model generates prediction results through a baseline prediction branch and a covariate embedding prediction branch, respectively, and then performs weighted fusion using trainable weights to output the final power prediction value.

[0071] Structured samples are input into a pre-trained time series model. Two types of prediction results are output through the baseline prediction branch and the covariate embedding prediction branch, respectively. The final prediction value is obtained by fusing the results with trainable weights.

[0072] A Transformer-based time-series model pre-trained on large-scale time-series datasets covering multiple industries, equipment types, and energy systems is employed. The power sequences of each inverter are time-sliced ​​and attention-based in a channel-independent manner to obtain the corresponding principal variable time-series representations. The first prediction head regresses these principal variable time-series representations, outputting a future power baseline prediction result that depends only on the inverter's historical power. The covariate sequences corresponding to the principal variable time windows are input into the backbone network of the time-series model to obtain covariate representations. These covariate representations, along with the principal variable representations, are input into a multilayer perceptron fusion module. The fused features are then passed through a second prediction head to obtain the covariate embedding prediction result. The second prediction branch is then adjusted using trainable weights with a sigmoid function, and finally, weighted and fused with the baseline prediction result to obtain the final prediction output.

[0073] The trainable weights are set as follows: a learnable scalar parameter is set before the second prediction branch. w The enhancement coefficient is obtained by mapping with the sigmoid function. σ ( w ), initially w Set to a larger negative value σ ( w The value is approached zero to reduce the influence of covariates on the prediction results; during training, it is automatically updated based on backpropagation of the loss function. w ,make σ ( w The number of covariates is gradually increased, thereby gradually introducing the covariate embedding effect while ensuring the stability of the main variable prediction.

[0074] Model fine-tuning module: Used to fine-tune the time series model using historical structured samples from normal operating conditions to minimize prediction error.

[0075] Normal / abnormal sample set construction module: This module applies the fine-tuned time series model to unlabeled historical structured samples and calculates the prediction residual score for each time window. Based on the residual score, it selects low residual windows from the unlabeled historical structured samples as pseudo-normal samples to form a normal-side sample set, and selects high residual windows as pseudo-abnormal candidate samples. By simulating typical abnormal operating conditions, it applies controlled perturbations to the power sequence to generate enhanced abnormal samples, which, together with the pseudo-abnormal candidate samples, constitute the abnormal-side sample set.

[0076] The model is fine-tuned on normal operating data to obtain residuals; the residual scores are calculated on unlabeled historical data using the fine-tuned model to form pseudo-normal and pseudo-abnormal samples, and anomalous sample enhancement is added.

[0077] The pre-trained time-series large model is fine-tuned on historical data containing only normal operating conditions to bring the prediction error between the enhanced prediction results and the actual active power under normal operating conditions into convergence. The fine-tuned model is then applied to unlabeled historical data, and the prediction residuals are calculated and residual scores are generated for each time window. Based on the residual scores, low residual windows are selected to form a pseudo-normal sample set, and high residual windows are selected to form a pseudo-anomaly sample candidate set. Combined with photovoltaic power plant operation and maintenance experience, some power sequences are subjected to controlled perturbation to construct enhanced anomaly samples, thus forming an anomaly side sample set composed of pseudo-anomaly sample candidates and enhanced anomaly samples.

[0078] The enhanced abnormal samples are generated by simulating actual abnormal operating conditions of photovoltaic power plants. These abnormal operating conditions include typical abnormal scenarios such as component shading, voltage fluctuations, sensor drift, and communication interruption. When perturbing the power sequence, the covariates are kept or reasonably set within a physically reasonable range so that the anomalies in the constructed samples are mainly caused by changes in power generation behavior or equipment status.

[0079] Normal and Abnormal Sample Separation Module: This module is used to input the temporal feature tensor output by the fine-tuned temporal large model into the multilayer perceptron projection head after pooling, so as to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space.

[0080] A contrastive learning projector is introduced to construct positive and negative sample pairs based on normal and abnormal side samples for contrastive learning training. A multilayer perceptron projector is connected in series after the output of the main network of the temporal large-scale model to map the high-dimensional sequence representation corresponding to the time window into contrastive learning embedding vectors. Positive and negative sample pairs are constructed using the normal and abnormal side sample sets. A positive sample pair consists of two independently sampled normal side samples, and a negative sample pair consists of one normal side sample and one abnormal side sample. The contrastive learning loss is calculated based on these embedding vectors to reduce the distance between normal side sample embeddings and increase the distance between normal and abnormal side sample embeddings. During contrastive learning training, the weighted sum of the prediction loss and the contrastive loss is used as the total loss. The prediction loss is calculated on the normal side samples, and the contrastive loss is calculated on both normal and abnormal side samples. The weighting coefficients are adjusted to balance the model's prediction accuracy and anomaly detection capability.

[0081] The total loss is in the form of L_total = L_forecast + λ·L_contrast, where L_forecast is the prediction loss calculated on the normal side samples, L_contrast is the contrastive learning loss calculated on the normal side samples and the abnormal side samples, and λ is an adjustable non-negative weight coefficient used to control the degree of influence of abnormal representation learning on the overall training process.

[0082] In the anomaly detection module: the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample are calculated simultaneously for the structured sample to be detected, and the two are weighted and fused to obtain a comprehensive anomaly score; the comprehensive anomaly score is compared with a preset threshold, and if the score exceeds the detection threshold, it is determined to be an anomaly.

[0083] During anomaly detection, the residual score and embedding distance score are combined and compared with a threshold to output the anomaly result.

[0084] When using the combined prediction residual and embedding distance to achieve final anomaly detection, the method further includes: in the offline stage, selecting a historical dataset containing only normal operating conditions as a threshold calibration set, applying the trained model to this dataset, calculating the residual score and embedding distance score for each time window and weighting them according to preset weights to obtain the final anomaly score, performing statistical analysis on all scores, and selecting the corresponding quantile as the anomaly detection threshold based on the target false alarm rate; in the operating stage, comparing the final anomaly score of the detection window with the anomaly detection threshold, determining that the corresponding inverter is in an abnormal operating state when the score is greater than or equal to the threshold, otherwise determining it to be in a normal operating state. Example

[0085] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the voltage generation anomaly detection method of Embodiment 1. Example

[0086] A computer-readable storage medium includes a computer program that, when executed by a processor, implements the steps of the voltage generation anomaly detection method in Embodiment 1.

[0087] The photovoltaic power generation anomaly detection method, system, apparatus, and storage medium according to the present invention have been described above by way of example with reference to the accompanying drawings. However, those skilled in the art should understand that various modifications can be made to the photovoltaic power generation anomaly detection method, system, apparatus, and storage medium proposed in the present invention without departing from the scope of the invention. Therefore, the scope of protection of the present invention should be determined by the content of the appended claims.

Claims

1. A method for detecting anomalies in photovoltaic power generation, characterized in that, Includes the following steps: S1: In the photovoltaic power station, the active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp, and the active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample. S2: Input the structured sample into the time series large model pre-trained with the sequence dataset. The time series large model generates prediction results through the baseline prediction branch and the covariate embedding prediction branch, respectively, and then performs weighted fusion through trainable weights to output the final power prediction value. S3: Use historical structured samples from normal operating conditions to fine-tune the time series model to minimize prediction error; S4: Apply the fine-tuned time series model to the unlabeled historical structured samples and calculate the prediction residual score for each time window; based on the residual score, select low residual windows from the unlabeled historical structured samples as pseudo-normal samples to form a normal side sample set, and select high residual windows as pseudo-anomaly candidate samples; apply controlled perturbation to the power sequence by simulating typical abnormal operating conditions to generate enhanced abnormal samples, which together with the pseudo-anomaly candidate samples form an abnormal side sample set; S5: The temporal feature tensor output by the fine-tuned temporal large model is pooled and then input into the multilayer perceptron projection head to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space. S6: In the anomaly detection stage, the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample are calculated simultaneously for the structured sample to be detected. The two are weighted and fused to obtain a comprehensive anomaly score. The comprehensive anomaly score is compared with a preset threshold. If the score exceeds the detection threshold, it is determined to be an anomaly.

2. The fault power generation abnormality detection method according to claim 1, characterized by In S1, the meteorological and environmental characteristics include at least ambient temperature, solar radiation intensity, wind speed, wind direction, real-time radiation, total radiation, dew point temperature, backplane temperature, and humidity. In S1, missing value imputation, outlier screening, and standardization are performed on the collected main variables and covariates to unify the dimensions of each variable and reduce noise interference.

3. The method according to claim 1, wherein In S2, the time-series large model generates prediction results through a baseline prediction branch and a covariate embedding prediction branch, respectively, and then performs weighted fusion using trainable weights to output the final power prediction value, including: The active power time series of each inverter is time-sliced ​​and attention-based modeled in a channel-independent manner to obtain the corresponding principal variable time series features. The principal variable time series features are regressed through the first prediction head to output the future power baseline prediction result that depends only on the historical power of the inverter. The backbone network of the time series model extracts the covariate time series features and inputs them together with the principal variable time series features into a multilayer perceptron for feature fusion. The fused features are regressed through the second prediction head to obtain the covariate embedding prediction result. The results of the covariate embedding prediction branch are then adjusted by trainable weights with sigmoid functions and fused with the baseline prediction results to obtain the final power prediction output. In the early stage of training, the weights are initially set to negative values ​​and gradually increased as the training process progresses.

4. The method according to claim 1, wherein In step S3, the time-series large model is fine-tuned using historical structured samples from normal operating conditions to minimize prediction error, including: The historical structured samples of the normal operating conditions include data that has been confirmed by at least maintenance records and alarm logs to have no faults, repairs, or abnormal events. The data is input into the time series large model, and the output is covariate embedded predicted active power. The difference between the covariate embedded predicted active power and the actual observed active power is used as the training target. The mean square error loss function is used to update the parameters of the pre-trained time series large model so that the model fits the normal power generation behavior pattern of the target power station.

5. The method of claim 1, wherein In step S4, the prediction residual score for each time window is calculated; based on the residual score, low residual windows are selected as pseudo-normal samples from the unlabeled historical structured samples, and high residual windows are selected as pseudo-anomaly candidate samples, including: For each time window, the predicted active power of each inverter at each moment within the window is calculated using the finely tuned time-series large model, and the time-by-time residual is obtained based on the predicted active power. Then, the mean of the squared residuals is used as the residual score of the time window to quantify the degree of deviation of the power generation behavior of the window from the normal power generation mode. After calculating the residual scores for all time windows, the time windows are sorted from low to high according to the residual scores. The top α% of windows are selected as pseudo-normal samples, and the bottom β% of windows are selected as pseudo-abnormal candidate samples, where α% and β% are preset proportions. By simulating typical abnormal operating conditions, a controlled perturbation is applied to a portion of the power sequence to generate enhanced abnormal samples. These abnormal operating conditions include at least component blocking, voltage fluctuations, sensor drift, and communication interruption. When perturbing the power sequence, the covariates are kept or reasonably set within a physically reasonable range so that the anomalies of the constructed enhanced abnormal samples are mainly caused by changes in power generation behavior or equipment status.

6. The method of detecting a fault in a power generator according to claim 1, wherein In step S5, the temporal feature tensor output by the fine-tuned temporal large model is pooled and then input into the multilayer perceptron projection head to obtain contrastive learning embedding vectors. Based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed and trained using the contrastive loss function, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space, including: For each input time window's structured sample, after processing by the backbone network of the aforementioned time-series large model, a corresponding three-dimensional time-series feature tensor is obtained. The feature tensor undergoes global average pooling in both the inverter and time dimensions to obtain a fixed-length feature vector. This feature vector is then input into the multilayer perceptron projection head, passing through a fully connected layer and nonlinear activation to obtain a contrastive learning embedding vector. Positive and negative sample pairs are constructed using the normal and abnormal sample sets. A positive sample pair consists of two independently sampled normal samples, while a negative sample pair consists of one normal sample and one abnormal sample. Based on the embedding vector, a contrastive loss is calculated to reduce the distance between normal sample embeddings and increase the distance between normal and abnormal sample embeddings. In the contrastive learning training process, the weighted sum of the prediction loss and the contrastive loss is used as the total loss. The prediction loss is calculated on the normal side samples, and the contrastive loss is calculated on both the normal and abnormal side samples. The prediction accuracy and anomaly detection ability of the model are balanced by adjusting the weighting coefficients.

7. The method for detecting abnormal voltage generation according to claim 1, characterized in that, In step S6, the predicted residual score and the distance score between the embedded vector and the embedded center of the normal sample are calculated simultaneously for the structured sample to be detected. These two scores are then weighted and fused to obtain a comprehensive anomaly score, including: The distribution characteristics of the residual score sequence and the distance score sequence are statistically analyzed separately. The two types of scores are scaled and normalized to make them fall within a similar numerical range. Based on this, a set of fixed weights is determined according to the statistical results on the calibration set, and the normalized two types of scores are linearly weighted to obtain the final anomaly score.

8. A photovoltaic power generation anomaly detection system, characterized in that, include: Sample construction module: The active power time series of each inverter is collected as the main variable, and the meteorological and environmental characteristic time series continuously collected by the environmental monitoring instrument is used as the covariate. The main variable and covariate are time-aligned according to a unified timestamp, and the active power time series and covariate of each inverter are organized with the same sliding time window parameters. The covariate sequence within the same time window is copied and broadcast to each inverter channel to form a structured sample. Modeling and prediction result fusion module: used to input structured samples into a time series large model pre-trained with sequence datasets. The time series large model generates prediction results through baseline prediction branch and covariate embedding prediction branch respectively, and then performs weighted fusion through trainable weights to output the final power prediction value. Model fine-tuning module: used to fine-tune the time series model using historical structured samples from normal operating conditions to minimize prediction error; Normal / abnormal sample set construction module: used to apply the fine-tuned time series large model to unlabeled historical structured samples, calculate the prediction residual score of each time window; based on the residual score, select low residual windows from the unlabeled historical structured samples as pseudo-normal samples to form a normal side sample set, and select high residual windows as pseudo-abnormal candidate samples. By simulating typical abnormal operating conditions, a controlled perturbation is applied to the power sequence to generate enhanced abnormal samples, which together with the pseudo-abnormal candidate samples constitute the abnormal side sample set. Normal and Abnormal Sample Separation Module: This module is used to input the temporal feature tensor output by the fine-tuned temporal large model into the multilayer perceptron projection head after pooling, so as to obtain the contrastive learning embedding vector; based on the normal side sample set and the abnormal side sample set, positive sample pairs and negative sample pairs are constructed, and the contrastive loss function is used for training, so that the embedding vectors of the normal side samples are clustered in the embedding space, and the embedding vectors of the normal side samples and the abnormal side samples are separated in the embedding space. Anomaly detection module: It is used to simultaneously calculate the predicted residual score and the distance score between the embedding vector and the embedding center of the normal sample for the structured sample to be detected, and to perform weighted fusion of the two to obtain a comprehensive anomaly score; the comprehensive anomaly score is compared with a preset threshold, and if the score exceeds the detection threshold, it is determined to be an anomaly.

9. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the steps of the voltage-generating anomaly detection method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program that, when executed by a processor, implements the steps of the voltage generation anomaly detection method as described in any one of claims 1 to 7.