Intelligent safety early warning method for photovoltaic factory
By adopting the intelligent safety warning method of the PVSformer model in the photovoltaic factory, the problem of predicting safety risks during operation of the photovoltaic factory is solved, and accurate prediction of future events and time is achieved, which improves safety performance and reliability.
Patent Information
- Application Number
- CN202510071166.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-13
AI Technical Summary
The photovoltaic plant faces a variety of potential safety risks during operation, including the complexity of environmental conditions, the non-stationary equipment operation and the uncertainty of human operation, making it difficult to achieve effective safety warnings.
An intelligent safety warning method for photovoltaic factory areas is proposed, using the PVSformer model, which consists of feature extraction module, location coding and context integration module and security warning module. Key features are extracted through event type embedding, time embedding and device state embedding, combined with rotational position embedding and position self-attention, dynamically model the spatial relationship and context information between sensors to achieve accurate prediction of future events and time.
It effectively improves the prediction accuracy of safety incidents in photovoltaic plant areas, optimizes the safety management process, improves the overall safety performance and reliability, and provides reliable technical support for intelligent management.
Smart Images

Figure CN119989220A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of machine learning, and in particular relates to an intelligent safety early warning method for a photovoltaic plant. Background Art
[0002] With the rapid development of renewable energy, photovoltaic plants, as the core sites of solar power generation, are of great significance for ensuring energy supply and environmental protection in their safe and stable operation. However, photovoltaic plants face a variety of potential safety risks during operation, including the complexity of environmental conditions, the non-stationary nature of equipment operation, and the uncertainty of human operation. These factors may lead to serious safety accidents and affect the normal operation of photovoltaic plants and energy output efficiency.
[0003] The development of intelligent safety warning methods for photovoltaic plants aims to use advanced technical means to conduct real-time monitoring and early warning of potential risks within the plant. Traditional safety warning methods rely on manual inspections and simple automated equipment, which are difficult to cope with the complex operating environment and changing security threats of photovoltaic plants. Deep learning can automatically extract complex multi-dimensional features from data. Compared with traditional manual feature selection, deep learning can effectively capture the nonlinear relationship between various variables during the operation of photovoltaic plants, thereby greatly improving the prediction accuracy.
[0004] The data at the construction site is often non-stationary and is greatly affected by fluctuations in the external environment and construction technology. This non-stationarity also exists in the safety management of photovoltaic plants. Factors such as weather changes and equipment aging will cause fluctuations in safety risks. Therefore, developing an intelligent safety early warning method that can adapt to this non-stationarity and analyze and predict potential safety threats in real time is crucial to improving the safe operation level of photovoltaic plants. Through accurate safety early warnings, the safety management process can be optimized and the overall safety performance and reliability of photovoltaic plants can be improved. Summary of the invention
[0005] The present invention provides an intelligent safety early warning method for photovoltaic plants. Aiming at photovoltaic plant data with non-stationary and multivariable characteristics, a PVSformer model is proposed, which consists of a feature extraction module, a position coding and context integration module and a safety early warning module.
[0006] The technical solution adopted by the present invention to achieve the above-mentioned purpose specifically comprises the following steps:
[0007] S1. Collect data related to intelligent production of photovoltaic plants, namely diagnostic data, which is generated during the actual production process of photovoltaic plants;
[0008] S2, using the RobustScaler method to pre-process the photovoltaic plant intelligent production related data and divide the data set;
[0009] S3. Construct a feature extraction module and propose three embeddings to capture the spatial and temporal dependencies of irregular events. The specific steps are:
[0010] S31, event type embedding, mapping the relevant information of each event in the photovoltaic plant to a unique embedding vector to obtain the event type embedding matrix Where n is the total number of event types and d is the dimension of embedding;
[0011] S32, absolute time embedding, input time information t, normalize t to get t′, use time embedding function T(t) to convert t′ into an embedding vector, expand it, and finally get the time embedding matrix T through the fully connected layer;
[0012] S33, device state embedding, input the relevant data of each device in the photovoltaic plant, generate embedding through statistical and Fourier transform operations, and combine them into a state embedding matrix S′, perform nonlinear transformation, and finally use the fully connected layer to obtain the device state embedding matrix S;
[0013] S4. Construct a position encoding and context integration module to perform rotation position embedding and context information integration on the input feature embedding matrix. The specific steps are as follows:
[0014] S41. Obtain the query Q, key K and value V from the feature extraction module, integrate the relative position information using the rotation embedding position method, and rotate it through the orthogonal rotation matrix R(θ) to obtain a new query vector Q rot and the key vector K rot ;
[0015] S42, propose position self-attention, input the rotated query and key, and calculate the similarity (Q rot ·K rot ), then generate the normalized calculated attention weights, and finally perform weighted summation on the value vector V to obtain the final output vector O;
[0016] S43, linearly transform the output vector O through the fully connected layer to obtain y, and then perform nonlinear operations on y to generate the final output
[0017] S5. Build a security warning module to get the next event type prediction Y s And the next event time prediction
[0018] Optimally, in S1, the photovoltaic plant intelligent production related data include equipment operation data, production data, environmental monitoring data and equipment status data. The equipment operation data includes the real-time operation parameters of various photovoltaic power generation equipment; the production data includes the production progress and output of photovoltaic power generation; the environmental monitoring data includes the monitoring data of temperature, humidity, light intensity and wind speed; the equipment status data includes the working status, fault information and maintenance records of the equipment, so as to fully understand the intelligent production and equipment status in the photovoltaic plant.
[0019] Preferably, in S2, the photovoltaic plant intelligent production related data is preprocessed, and for each feature, its median in the data set is calculated, and the median and the interquartile range are used to calculate the standardized value. The interquartile range is to calculate the first quartile Q1(x) and the third quartile Q3(x) of each feature, and the formula is:
[0020]
[0021] In the formula, x is the intelligent production data point of the photovoltaic plant, median(x) is the median, IQR(x)=Q3(x)-Q1(x) is the interquartile range, and finally the data set is divided into training set and test set according to a certain ratio to ensure the effectiveness of model training and evaluation.
[0022] Preferably, the event sequence data of the photovoltaic plant is input in S3 and S31, and two overlapping subsequences are randomly selected, where T1 and T2 are the start and end indexes of the first subsequence, respectively, and T3 and T4 are the start and end indexes of the second subsequence, respectively. The two subsequences are mapped to potential representations h1 and h2 through a fully connected layer, and time series masking is used to perform data enhancement operations. The specific formula is:
[0023]
[0024] In the formula, is the potential representation after time series masking, Mask(*,M) is the element-by-element masking operation of the potential representation through the binary masking matrix M, is an element-by-element multiplication operation, h1 and h2 are the potential representations of the first and second subsequences obtained through the fully connected layer, and M1 and M2 are the binary masking matrices of the corresponding subsequences.
[0025] Preferably, event type embedding processing enhances the model's ability to understand events and improves the efficiency of data representation by mapping event types to embedding space, and helps to improve the training effect and generalization ability of the model, providing rich feature inputs for subsequent safety warning tasks, so that the model can more accurately predict and judge the safety risks of photovoltaic plants.
[0026] Preferably, in the S32 part of S3, the absolute time embedding is to encode each event in the photovoltaic plant through the time information t, input the time information t, firstly perform linear normalization processing on the time data to obtain t′, and the formula is:
[0027]
[0028] In the formula, t min and t max are the minimum and maximum values in the timestamp, respectively, so that it falls into a suitable range. Then, the normalized time t′ is converted into an embedding vector using the time embedding function T(t), and then expanded by sine and cosine functions to capture the periodic characteristics of time. For odd dimensions, For even dimensions, where sin() is the sine function, cos() is the cosine function, and v i is the i-th embedding dimension, t′ i is the normalized time data, period i is the period related to the embedding dimension, π is the ratio of the circumference of a circle to its diameter, which is approximately 314159. According to the periodicity of the event or the sampling frequency of the time series, the sine and cosine functions are used to expand the embedding vector to capture the different frequency information of the time data, and then the time embedding matrix L is obtained through the fully connected layer. The formula is:
[0029] L = FC(v);
[0030] In the formula, FC is the fully connected layer, v is the time embedding vector obtained by expanding the sine and cosine functions, and finally L is the time embedding matrix after processing by the fully connected layer, which serves as the input for subsequent model calculations.
[0031] Preferably, in the S33 part of S3, the state data matrix D of each device in the photovoltaic plant is input, and statistical features are extracted from the state data of each device, including the mean Where N is the number of devices, U is the time, and the standard deviation Maximum value n =max(D n ), minimum value min n =min(D n ), where D n For device status data, these statistical features are combined into a feature vector f n , indicating the status characteristics of the nth device: f n =[μ n , σ n , max n , min n], and at the same time n Perform Fourier transform to extract frequency domain features. The formula is:
[0032] F n =FFT(D n );
[0033] Where FFT is Fourier transform, and then the frequency components are selected and combined into the eigenvector f′ n In the formula:
[0034] f′ n =[f n ,Re(F n ), Im(F n )];
[0035] In the formula, Re(F n ) and Im(F n ) are the real and imaginary parts of the frequency component, respectively. The characteristic vector f of each device n The state embedding matrix S′ is combined into a state embedding matrix S′, whose shape is [N, d], where d is the feature dimension. The ReLU activation function is used for nonlinear transformation S″=ReLU(S′), and finally the fully connected layer is used for further transformation to obtain the final device state embedding matrix S, which is formulated as follows:
[0036] S = W·S″+b;
[0037] Where W is the weight matrix of the fully connected layer and b is the bias vector.
[0038] Preferably, in the S41 part of S4, the position encoding and context integration module integrates the position information of the photovoltaic plant area sensor by a rotation position embedding method, obtains the query Q, key K and value V from the feature extraction module, integrates the relative position information by using the rotation embedding position method, rotates the query and key by an orthogonal rotation matrix to encode the relative position information, and thus obtains the rotated query vector Q rot =Q·R(θ) and the key vector K rot =K·R(θ), where R(θ) is an orthogonal rotation matrix. For each dimension i, the rotation matrix is defined as:
[0039]
[0040] In the formula, θ i It is a relative position encoding.
[0041] Preferably, the position encoding and context integration module in the photovoltaic plant aims to combine the spatial position and context information of the sensor, capture the spatial dependencies between devices and the timing characteristics of events, and use the self-attention mechanism to dynamically adjust the interaction weights between devices and sensors, effectively modeling the spatiotemporal correlation between environmental parameters and device status, accurately analyzing the dynamic changes in equipment operation, and comprehensively improving the model's ability to understand complex multivariate data, providing accurate input for the safety warning module.
[0042] Preferably, in the S42 part of S4, position self-attention is proposed, and the rotated query Q is input rot and key K rot , the similarity between the query and the key is calculated through the dot product operation, the formula is:
[0043]
[0044] In the formula, T′ represents the transposition operation, d k is the feature dimension of the key vector, and the similarity is normalized using the softmax function to generate the attention weight softmax (Similarity (Q rot ·K rot )), and finally use these attention weights to perform weighted summation on the value vector V to obtain the final output vector O.
[0045] Preferably, position attention captures the relative spatial relationship and time dependency between photovoltaic plant equipment and sensors by weighted processing of query, key, and value vectors. By introducing rotational position embedding, position attention can naturally embed sensor position information into the model, helping the model understand the interaction patterns between different sensors and devices, so that the model can dynamically pay attention to other device states and environmental parameters that are most relevant to the current device, effectively improving the accuracy and timeliness of security event warnings, and providing more intelligent security protection for photovoltaic plants.
[0046] Preferably, in the S43 part of S4, the fully connected layer maps O to a new feature space, and the formula is:
[0047] y=W·O+b;
[0048] In the formula, W is the weight matrix of the fully connected layer, b is the bias vector, y is the output of the fully connected layer, and the activation function is applied for nonlinear transformation to finally obtain The formula is:
[0049]
[0050] Where tanh is the hyperbolic tangent function and π is the ratio of the circumference of a circle to its diameter, which is approximately 314159.
[0051] Preferably, in S5, the next event prediction module integrates the feature vector after feature extraction and position encoding. Input to a fully connected layer and map it to the probability space of event types. The formula is:
[0052]
[0053] Where, Y′ s is the output of the fully connected layer, FCL is the fully connected layer, and then the softmax activation function is used to transform Y′ s Normalize and get the final probability distribution Y of photovoltaic plant event type s , the formula is:
[0054]
[0055] Where C is the total number of event types, Y′ s , i is the unnormalized probability of the i-th event type output by the fully connected layer, and the cross entropy loss function is used to train the model and calculate the predicted probability distribution Y s and the true label Y true The difference between the two is:
[0056]
[0057] Where Y true,i is the true label, Y s , i is the probability predicted by the model.
[0058] Preferably, the next event type prediction module can calculate the probability distribution of the safety event types in the photovoltaic plant and use the cross-entropy loss function to train the model. This probability distribution reflects the model's likelihood of occurrence of different event types. The cross-entropy loss function is used to evaluate the difference between the model's prediction and the actual situation, thereby guiding the optimization and training of the model. The model can more accurately predict the safety event types in the photovoltaic plant and provide important reference information for safety warnings.
[0059] Preferably, in S5, the next event time prediction module predicts the time interval of the safe time, and uses the Huber loss function to optimize the prediction performance of the model, and converts the feature vector Input to the fully connected layer to predict the time interval of safety incidents in photovoltaic plants in is the time interval predicted by the model, and the current time is t current , then the time of occurrence of safety incidents in photovoltaic plants is predicted At the same time, the Huber loss function is used to train the model and calculate the prediction time interval The real time interval Δt true The difference between the two is:
[0060]
[0061] In the formula, δ is the threshold parameter of Huber loss, Δt true is the real time interval.
[0062] Preferably, the next event time prediction module can effectively estimate the time interval between events and use the Huber loss function to optimize the prediction performance of the model. The Huber loss function combines the advantages of mean square error and absolute error, has strong robustness to outliers, and is suitable for processing time prediction errors that may occur in photovoltaic plant data.
[0063] In summary, due to the adoption of the technical scheme, the beneficial effects of the present invention are as follows: the present invention proposes a PVSformer prediction model, which is applied to the intelligent safety warning scenario of photovoltaic plants, including a feature extraction module, a position coding and context integration module and a safety warning module. The feature extraction module extracts key features through event type embedding, time embedding and equipment status embedding to capture the time dependence and spatial distribution characteristics of the operation of photovoltaic plant equipment; the position coding and context integration module uses rotational position embedding and position self-attention to dynamically model the spatial relationship and context information between sensors; the safety warning module realizes accurate prediction of future events and time by jointly optimizing event type and time prediction. This scheme effectively improves the prediction accuracy of safety events in photovoltaic plants and provides reliable technical support for intelligent management. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 The present invention is a step-by-step diagram of an intelligent safety early warning method for photovoltaic plants.
[0065] Figure 2 This is the structure diagram of the PVSformer prediction model.
[0066] Figure 3 This is the structure diagram of the feature extraction module.
[0067] Figure 4 This is the structural diagram of the position encoding and context integration module.
[0068] Figure 5 The PVSformer prediction model realizes the intelligent safety warning fitting effect diagram of the photovoltaic plant. DETAILED DESCRIPTION
[0069] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0070] See also Figure 1-Figure 5 ,The present invention provides a technical solution: an intelligent safety warning method for photovoltaic plants, constructing a feature extraction module, extracting key features through event type embedding, time embedding and equipment state embedding, capturing the time dependence and spatial distribution characteristics of photovoltaic plant equipment operation; the position encoding and context integration module uses rotation position embedding and position self-attention to dynamically model the spatial relationship and context information between sensors; the safety warning module jointly optimizes event type and time prediction, and the specific steps are as follows Figure 1 shown.
[0071] Construct the PVSformer prediction model, whose structure is as follows Figure 2 As shown, the specific steps are:
[0072] S1. Collect relevant data on various safety incidents in the intelligent production of photovoltaic plants through sensors, including equipment operation data, production data, environmental monitoring data and equipment status data.
[0073] Furthermore, equipment operation data includes real-time operating parameters of various photovoltaic power generation equipment, including equipment output power, power generation efficiency, current, and voltage; production data includes production progress and output of photovoltaic power generation; environmental monitoring data includes monitoring data of temperature, humidity, light intensity, and wind speed; equipment status data includes equipment working status, fault information, and maintenance records. In addition, real-time diagnostic data of various equipment is also collected, including temperature, humidity, and electromagnetic environment parameters.
[0074] S2. The RobustScaler method is used to preprocess the data related to the intelligent production of photovoltaic plants, handle outliers and standardize them. Finally, the data set is divided into training set and test set in a ratio of 7:3.
[0075] Furthermore, the RobustScaler method is used to preprocess the data related to the intelligent production of photovoltaic plants, handle outliers and standardize them, calculate the median of each feature in the data set, and use the median and interquartile range to calculate the standardized value. The interquartile range is to calculate the first quartile Q1(x) and the third quartile Q3(x) of each feature. The first quartile is the median of the smaller half of the data, and the third quartile is the median of the larger half of the data. The formula is:
[0076]
[0077] In the formula, x is the intelligent production data point of the photovoltaic plant, median(x) is the median, and IQR(x)=Q3(x)-Q1(x) is the interquartile range.
[0078] S31, construct a feature extraction module, whose structure is as follows Figure 3 As shown in the figure, the event sequence data of the photovoltaic plant is input, and two overlapping subsequences are randomly selected using the sliding window method, where T1 and T2 are the start and end indexes of the first subsequence, and T3 and T4 are the start and end indexes of the second subsequence, respectively. The two subsequences are mapped to potential representations h1 and h2 through the fully connected layer, and time series masking is used for data enhancement. The specific formula is:
[0079]
[0080] In the formula, is the potential representation after time series masking, Mask(*,M) is the element-by-element masking operation of the potential representation through the binary masking matrix M, is an element-by-element multiplication operation, h1 and h2 are the potential representations of the first and second subsequences obtained through the fully connected layer, and M1 and M2 are the binary masking matrices of the corresponding subsequences.
[0081] S32, absolute time embedding is to encode each event in the photovoltaic plant through time information t.
[0082] Furthermore, the time information t is input, and the time data is first linearly normalized to obtain t′. Here, the minimum-maximum normalization method is used to map the time data to the range of [0, 1] so that each value can reflect its relative size in the data distribution while retaining the proportional relationship of the data. The formula is:
[0083]
[0084] In the formula, t min and t max are the minimum and maximum values in the timestamp, respectively, so that it falls into a suitable range, and then the time embedding function T(t) is used to convert the normalized time t′ into an embedding vector. The formula is:
[0085] T(t)=[sin(ω k t′), cos(ω k t′)];
[0086] In the formula, sin() is the sine function, cos() is the cosine function, ω kis the frequency value of different dimensions, and then expanded by sine and cosine functions to capture the periodic characteristics of time. For odd dimensions, For even dimensions, where v i is the i-th embedding dimension, t′ i is the normalized time data, period i is the period related to the embedding dimension, π is the ratio of the circumference of a circle to its diameter, which is approximately 314159. According to the periodicity of the event or the sampling frequency setting of the time series, the sine and cosine functions are used to expand the embedding vector to capture the different frequency information of the time data, and then the time embedding matrix L is obtained through the fully connected layer. The formula is L=FC(v), where FC represents the fully connected layer, v is the time embedding vector obtained by expanding the sine and cosine functions, and finally L is the time embedding matrix after processing by the fully connected layer, which serves as the input for subsequent model calculations.
[0087] S33, input the state data matrix D of each device in the photovoltaic plant, the shape is [N, U], N represents the number of devices, U represents time, and extract statistical features of the state data of each device, including the mean Standard Deviation Maximum value n =max(D n ), minimum value min n =min(D n ), where D n For device status data, these statistical features are combined into a feature vector f n , indicating the status characteristics of the nth device: f n =[μ n , σ n , max n , min n ], and at the same time n Perform Fourier transform to extract frequency domain features. The formula is:
[0088] F n =FFT(D n );
[0089] Where FFT is Fourier transform, and then the frequency components are selected and combined into the eigenvector f′ n In the formula:
[0090] f′ n =[f n ,Re(F n ), Im(F n )];
[0091] In the formula, Re(F n) and Im(F n ) are the real and imaginary parts of the frequency component, respectively. The characteristic vector f of each device n The combination is a state embedding matrix S′, whose shape is [N, d], where d is the feature dimension.
[0092] Furthermore, the ReLU activation function is used for nonlinear transformation S″=ReLU(S′), and finally the fully connected layer is used for further transformation to obtain the final device state embedding matrix S, which is:
[0093] S = W·S″+b;
[0094] Where W is the weight matrix of the fully connected layer and b is the bias vector.
[0095] S41, construct the position encoding and context integration module, whose structure is as follows Figure 4 As shown in the figure, the location information of the photovoltaic plant sensors is integrated through the rotation position embedding method, and the query Q, key K and value V are obtained from the feature extraction module.
[0096] Furthermore, the relative position information is integrated using the rotation embedding method, and the query and key are rotated by the orthogonal rotation matrix to encode the relative position information, thereby obtaining the rotated query vector Q rot =Q·R(θ) and the key vector K rot =K·R(θ), where R(θ) is an orthogonal rotation matrix. For each dimension i, the rotation matrix is defined as:
[0097]
[0098] Where θi is the relative position code.
[0099] S42. Build position self-attention and input the rotated query Q rot and key K rot , the similarity between the query and the key is calculated by the dot product, the formula is:
[0100]
[0101] In the formula, T′ represents the transposition operation, d k is the feature dimension of the key vector, and the similarity is normalized using the softmax function to generate the attention weight softmax (Similarity (Q rot ·K rot )), and finally use these attention weights to perform weighted summation on the value vector V to obtain the final output vector O.
[0102] S43, the fully connected layer maps O to the new feature space, the formula is:
[0103] y=W·O+b;
[0104] In the formula, W is the weight matrix of the fully connected layer, b is the bias vector, y is the output of the fully connected layer, and the activation function is applied for nonlinear transformation to finally obtain The formula is:
[0105]
[0106] Where tanh is the hyperbolic tangent function and π is the ratio of the circumference of a circle to its diameter, which is approximately 314159.
[0107] S5. Construct a safety warning module. The next event prediction module will integrate the feature vector after feature extraction and position encoding. Input to a fully connected layer and map it to the probability space of event types. The formula is:
[0108]
[0109] Where, Y′ s is the output of the fully connected layer, and FCL is the fully connected layer.
[0110] Furthermore, the softmax activation function is used to s Normalize and get the final probability distribution Y of photovoltaic plant event type s , the formula is:
[0111]
[0112] Where C is the total number of event types, Y′ s , i is the unnormalized probability of the i-th event type output by the fully connected layer, and the cross entropy loss function is used to train the model and calculate the predicted probability distribution Y s and the true label Y true The difference between the two is:
[0113]
[0114] Where Y true,i is the true label, Y s , i is the probability predicted by the model.
[0115] Furthermore, the next event time prediction module predicts the time interval of the safe time and uses the Huber loss function to optimize the prediction performance of the model. Input to the fully connected layer to predict the time interval of safety incidents in photovoltaic plants in is the time interval predicted by the model, and the current time is tcurrent , then the time of occurrence of safety incidents in photovoltaic plants is predicted
[0116] Furthermore, the Huber loss function is used to train the model and calculate the prediction time interval The real time interval Δt true The difference between the two is:
[0117]
[0118] In the formula, δ is the threshold parameter of Huber loss, Δt true is the real time interval.
[0119] Furthermore, the PVSformer prediction model is written in Python. The experiment runs on the Linux operating system. Pytorch is selected as the framework in the CUDA1127 environment and trained on the NVIDIA A100 40GB GPU. The data set is an 8-month intelligent production data set of photovoltaic plants. After data preprocessing, it is input into the PVSformer prediction model. The training batch is set to 128, the AdamW optimizer is used, and the learning rate is set to 1e-4.
[0120] Furthermore, the PVSformer prediction model realizes the intelligent safety warning fitting effect of photovoltaic plants. Figure 5 As shown in the figure, the horizontal axis is the date, the vertical axis is the warning value, the black solid line and dots represent the actual warning value, and the gray dotted line and cross represent the predicted warning value. It can be seen from the figure that the changing trends of the actual value and the predicted value are roughly similar, especially in the peak and trough parts, the change directions of the two are consistent. The experimental results show that the PVSformer model can effectively capture the changing trend of the intelligent production safety warning of photovoltaic plants, especially in the time period with large fluctuations, it can better predict safety incidents.
Claims
1. An intelligent safety early warning method for photovoltaic plants, characterized in that: The following steps are involved: S1. Collect relevant data on intelligent production of photovoltaic plants through sensors; S2, using the RobustScaler method to pre-process the photovoltaic plant intelligent production related data and divide the data set; S3. Construct a feature extraction module and propose three embeddings to capture the spatial and temporal dependencies of irregular events. The specific steps are: S31, propose event type embedding, map each event in the photovoltaic plant to a unique embedding vector using the embedding layer method, and obtain the event type embedding matrix Where n is the total number of event types and d is the dimension of embedding; S32, absolute time embedding is proposed, and the time information t is processed by the minimum-maximum normalization method to obtain t′, and t′ is converted into an embedding vector using the time embedding function T(t) and expanded, and finally the time embedding matrix T is obtained; S33, propose equipment state embedding, use statistics and Fourier transform operations to process equipment-related data in the photovoltaic plant, and combine them into a state embedding matrix S′, perform nonlinear transformation, and finally use a fully connected layer to obtain the equipment state embedding matrix S; S4. Construct a position encoding and context integration module to process the input feature embedding matrix. The specific steps are as follows: S41, obtain the query Q, key K and value V from the feature extraction module, integrate the relative position information using the rotation embedding position method, and rotate them through the orthogonal rotation matrix R(θ) to obtain a new query vector Qrot and key vector Krot; S42, propose position self-attention, calculate the similarity (Qrot) between Qrot and Krot rot ·K rot ), then generate the normalized calculated attention weights, and finally perform weighted summation on V to obtain the output vector O; S43, linearly transform vector O through the fully connected layer to obtain y, and then perform nonlinear operations to generate S5. Build a security warning module and use the fully connected layer and loss function to get the next event type prediction Y s And the next event time prediction 2. The intelligent safety early warning method for photovoltaic plants according to claim 1 is characterized in that: In S31, the event sequence data of the photovoltaic plant is input, and two overlapping subsequences are randomly selected using the sliding window method, where h1 and h2 are potential representations of the two subsequences mapped by the fully connected layer, T1 and T2 are the start and end indexes of the first subsequence, T3 and T4 are the start and end indexes of the second subsequence, and time series masking is used to perform data enhancement operations. The specific formula is: In the formula, is the potential representation after time series masking, Mask(*,M) is the element-by-element masking operation of the potential representation through the binary masking matrix M, is an element-by-element multiplication operation, h1 and h2 are the potential representations of the first and second subsequences obtained through the fully connected layer, and M1 and M2 are the binary masking matrices of the corresponding subsequences.
3. The intelligent safety early warning method for photovoltaic plants according to claim 2 is characterized in that: In S32, the input time information t is linearly normalized using the minimum-maximum normalization method to obtain t′, and the time data is mapped to the range of [0, 1] so that each value can reflect its relative size in the data distribution while retaining the proportional relationship of the data. The specific formula is: Where, t max and t min are the maximum and minimum values in the timestamp respectively. Then, the normalized time t′ is converted into an embedding vector using the time embedding function T(t). The specific formula is: T(t)=[sin(ω k t′), cos(ω k t′)]; In the formula, sin() is the sine function, cos() is the cosine function, ω k are the frequency values of different dimensions, specifically Where scale is a constant used to control the frequency drop, and then expanded by sine and cosine functions to capture the periodic characteristics of time. For odd dimensions, For even dimensions, where π is the ratio of the circumference of a circle to its diameter, approximately 3.14159, v i is the i-th embedding dimension, t′ i is the normalized time data, period i is the period related to the embedding dimension. According to the periodicity of the event or the sampling frequency of the time series, the sine and cosine functions are used to expand the embedding vector to capture the different frequency information of the time data. Then, the time embedding matrix L is obtained through the fully connected layer. The formula is L=FC(v), where FC represents the fully connected layer, and v is the time embedding vector obtained by expanding the sine and cosine functions. Finally, L is the time embedding matrix after processing by the fully connected layer, which serves as the input for subsequent model calculations.
4. The intelligent safety early warning method for photovoltaic plants according to claim 3 is characterized in that: In S33, the state data matrix D of each device in the photovoltaic plant is input, and the shape is [N, U], where N represents the number of devices and U represents time. Statistical features are extracted from the state data of each device, including the standard deviation Mean Maximum value n =max(D n ), minimum value min n =min(D n ), where D n For device status data, these statistical features are combined into a feature vector f n , indicating the status characteristics of the nth device: f n =[μ n , σ n , max n , min n ], and at the same time n Perform Fourier transform to extract frequency domain features. The specific formula is: F n =FFT(D n ); Where FFT is Fourier transform, and then the frequency components are selected and combined into the eigenvector f′ n In the formula: f′ n =[f n ,Re(F n ),Im(F n )]; In the formula, Re(F n ) and Im(F n ) are the real and imaginary parts of the frequency component, respectively. The characteristic vector f of each device n The state embedding matrix S′ is combined into a state embedding matrix S′, whose shape is [N, d], where d is the feature dimension. The ReLU activation function is used for nonlinear transformation S″=ReLU(S′), and finally the fully connected layer is used for further transformation to obtain the final device state embedding matrix S. The specific formula is: S = W·S″+b; Where W is the weight matrix of the fully connected layer and b is the bias vector.
5. The intelligent safety early warning method for photovoltaic plants according to claim 4 is characterized in that: In step S41, the position information of the photovoltaic plant sensors is integrated by the rotation position embedding method, and the query Q, key K and value V are obtained from the feature extraction module. The relative position information is integrated by the rotation embedding method, and the query and key are rotated by the orthogonal rotation matrix to encode the relative position information, so as to obtain the rotated query vector Q rot =Q·R(θ) and the key vector K rot =K·R(θ), where R(θ) is an orthogonal rotation matrix. For each dimension i, the specific formula of the rotation matrix is: In the formula, θ i It is a relative position encoding.
6. The intelligent safety early warning method for photovoltaic plants according to claim 5, characterized in that: In step S42, position self-attention is constructed and the rotated query Q is input. rot and key K rot , the similarity between the query and the key is calculated through the dot product operation. The specific formula is: In the formula, T′ represents the transposition operation, d k is the feature dimension of the key vector, and the similarity is normalized using the softmax function to generate the attention weight softmax (Similarity (Q rot ·K rot )), and finally use these attention weights to perform weighted summation on V to obtain the final output vector O.
7. The photovoltaic plant intelligent safety early warning method according to claim 6, characterized in that: In step S43, O is mapped to a new feature space, and the specific formula is: y=W·O+b; In the formula, W is the weight matrix of the fully connected layer, b is the bias vector, y is the output of the fully connected layer, and the activation function is applied for nonlinear transformation to finally obtain The specific formula is: Where π is the ratio of the circumference of a circle to its diameter, which is approximately 3.14159, and tanh is the hyperbolic tangent function.
8. The intelligent safety early warning method for photovoltaic plants according to claim 7, characterized in that: In step S5, the next event prediction module is first constructed, and the feature vector after feature extraction and position encoding is integrated. Input to a fully connected layer and map it to the probability space of event types. The specific formula is: In the formula, Y′ s is the output of the fully connected layer, FCL is the fully connected layer, and then the softmax activation function is used to transform Y′ s Normalize and get the final probability distribution Y of photovoltaic plant event type s , the specific formula is: Where C is the total number of event types, Y′ s , i is the unnormalized probability of the i-th event type output by the fully connected layer, and the cross entropy loss function is used to train the model and calculate the predicted probability distribution Y s and the true label Y true The specific formula is: Where Y true,i is the true label, Y s , i is the probability predicted by the model; the next event time prediction module predicts the time interval of the safe time, and uses the Huber loss function to optimize the prediction performance of the model, and converts the feature vector Input to the fully connected layer to predict the time interval of safety incidents in photovoltaic plants in is the time interval predicted by the model, and the current time is t current , then the time of occurrence of safety incidents in photovoltaic plants is predicted Use Huber loss function to train the model and calculate the prediction time interval The real time interval Δt true The specific formula is: In the formula, δ is the threshold parameter of Huber loss, Δt true is the real time interval.
9. The photovoltaic plant intelligent safety early warning method according to claim 1, characterized in that: In response to the problem of intelligent safety early warning in photovoltaic plants, sensors are used to collect relevant data on various safety incidents in the intelligent production of photovoltaic plants, including equipment operation data, production data, environmental monitoring data and equipment status data. Equipment operation data includes real-time operating parameters of various photovoltaic power generation equipment; production data includes production progress and output of photovoltaic power generation; environmental monitoring data includes monitoring data of temperature, humidity, light intensity and wind speed; equipment status data includes working status, fault information and maintenance records of equipment. The collected relevant data are preprocessed to ensure data quality, and then the processed relevant data are divided into training set and test set for training and evaluating the performance of intelligent safety early warning model in photovoltaic plants.
Citation Information
Patent Citations
Prediction method and device based on novel rotation time coding Transform hokes process
CN118446261A
Comprehensive relay protection and management system based on intelligent algorithm
CN118508381A
Distribution task adaptive load prediction method and system oriented to edge computing, and medium
CN119110350A