Photovoltaic power ultra-short-term prediction method and system based on itransfomer

The photovoltaic power ultra-short-term prediction method based on itransfomer solves the problem of insufficient photovoltaic power prediction accuracy in the existing technology, and achieves high-precision prediction under rapid changes in clouds and local weather anomalies.

CN119312054AInactive Publication Date: 2025-01-14STATE GRID ZHEJIANG ELECTRIC POWER CO LTD ZHOUSHAN POWER SUPPLY CO

Patent Information

Application Number
CN202411840458.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-01-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing photovoltaic power prediction methods have limited accuracy in the case of rapid changes in clouds and local weather abnormalities, which cannot meet the high-precision requirements of ultra-short-term prediction.

Method used

The photovoltaic power ultra-short-term prediction method based on itransfomer is used to achieve high-precision photovoltaic power prediction through the collection and processing of weather data, feature construction and iTransformer model construction and training.

Benefits of technology

This method can efficiently capture the complex nonlinear relationship between photovoltaic power and weather data, and provide high-precision ultra-short-term photovoltaic power prediction, especially under complex weather conditions such as rapid changes in clouds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312054A_ABST
    Figure CN119312054A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic power ultra-short-term prediction method and system based on itransfomer, and relates to the technical field of photovoltaic power generation. A traditional prediction method is relatively limited in precision under the conditions of rapid cloud layer change and abnormal local weather. The method comprises the steps of weather data collection and processing, feature construction based on weather data, iTransform model construction and training, and photovoltaic power ultra-short-term prediction. According to the technical scheme, the multi-dimensional features are constructed by processing the weather data, and efficient feature extraction and photovoltaic power prediction are realized in combination with the multi-head attention mechanism and nonlinear mapping of the iTransform model. Model training is combined with actual measurement data and weather forecast correction, accuracy and reliability of input data are ensured, prediction precision is improved, high instantaneity and adaptability are achieved, high accuracy, instantaneity and reliability are achieved under the complex weather processing condition, powerful support is provided for power grid dispatching, and especially in the aspect of ultra-short-term photovoltaic power prediction, the method has a good application prospect. And the safety and reliability of a power system can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of photovoltaic power generation, and in particular to an ultra-short-term photovoltaic power prediction method and system based on iTransformer. Background Art

[0002] With the transformation of the global energy structure and the advancement of the sustainable development strategy, renewable energy, especially photovoltaic power generation, has been widely used because of its cleanness, environmental protection and abundant resources. The scale of photovoltaic power stations continues to expand, and the proportion of power generation increases year by year, which is of great significance for optimizing the energy structure and reducing greenhouse gas emissions. However, photovoltaic power generation is affected by many factors, such as solar radiation, cloud changes, temperature, etc., resulting in high uncertainty and volatility in output power, which brings great challenges to grid dispatching. Especially in clear weather, cloud cover will cause a sharp drop in photovoltaic power generation, which puts great pressure on the real-time dispatching and supply and demand balance of the power grid.

[0003] To meet this challenge, accurate prediction of PV power becomes particularly important. Accurate PV power prediction helps the grid dispatching department to formulate dispatching plans in advance, optimize resource allocation, and improve the reliability of the power system. However, current prediction methods mainly rely on traditional meteorological forecast sources, such as numerical weather forecasts or public meteorological services. These methods have problems such as model errors and insufficient data update frequency, resulting in large errors in the prediction results, which cannot meet the high-precision requirements of ultra-short-term predictions.

[0004] Traditional forecasting methods have limited accuracy in the case of rapid cloud changes and local weather anomalies. The spatial and temporal resolution of numerical weather forecast models is low, making it difficult to effectively capture cloud changes; and the data update frequency of public meteorological services is low, which cannot meet the real-time requirements. Therefore, it is particularly important to develop an ultra-short-term forecasting method that can capture cloud changes in real time and accurately predict photovoltaic power. Summary of the invention

[0005] The technical problem to be solved and the technical task proposed by the present invention are to improve and perfect the existing technical solutions, and provide a photovoltaic power ultra-short-term prediction method and system based on iTransformer, so as to achieve high-precision prediction. To this end, the present invention adopts the following technical solutions.

[0006] A photovoltaic power ultra-short-term prediction method based on iTransfomer comprises the following steps: 1) Weather data collection and processing: Collect weather data related to photovoltaic power, including light intensity, temperature, cloud cover, wind speed and humidity; Preprocess the collected weather data, including data cleaning, temporal interpolation and spatial interpolation, to obtain a standard data format that can be used for model input; 2) Feature construction based on weather data: Feature construction of weather data, specifically incremental features, statistical features, and time-varying features, and these constructed features are used as inputs to the iTransformer model; 3) iTransformer model construction and training: 301) Build iTransformer model: The iTransformer model consists of an input embedding module, an encoder module, and a projection layer module. Input embedding module: input weather features and PV output time series into the iTransformer model to obtain the embedding labels of each input feature; Encoder module: uses a multi-head attention mechanism to calculate the attention distribution value of multivariate data, assigns high weights to important features, and performs deep feature mining; Projection layer module: nonlinear mapping output of multivariate labels to obtain photovoltaic power prediction results; 302) iTransformer model training: The iTransformer model is trained using a training set containing measured PV output time series data and processed weather characteristic data, and is corrected using numerical weather forecast data and weather type forecast data provided by public meteorological services to ensure the accuracy and reliability of input data; 4) Ultra-short-term forecast of photovoltaic power: The parameters obtained through iTransformer model training are applied to the ultra-short-term prediction of photovoltaic power to predict photovoltaic power.

[0007] The iTransformer model can efficiently capture the complex nonlinear relationship between photovoltaic power and weather data using a multi-head attention mechanism. Through deep feature mining of weather data, it can provide highly accurate ultra-short-term photovoltaic power forecasts, especially under complex weather conditions such as rapid changes in clouds.

[0008] This technical solution has high accuracy, real-time and reliability in dealing with complex meteorological conditions, providing strong support for power grid dispatching, especially in ultra-short-term photovoltaic power forecasting, and can effectively improve the safety and reliability of the power system. This technical solution can quickly reflect weather changes and more accurately predict photovoltaic power by acquiring and processing weather data in real time. Compared with traditional forecasting methods based on numerical weather forecasts and public meteorological services, it has higher real-time performance and response speed.

[0009] During the data collection and processing stage, technologies such as data cleaning, time interpolation and spatial interpolation were used to ensure the quality and reliability of input data and solve the error problems caused by data anomalies and missing data.

[0010] Through the construction of incremental features, statistical features and time-varying features, the relationship between weather data and photovoltaic power can be fully reflected, especially when dealing with complex weather patterns (such as cloud changes and temperature fluctuations), it has strong adaptability and accuracy.

[0011] The iTransformer model is highly flexible and can adapt to a variety of different meteorological data input forms, and can improve the prediction effect through self-learning optimization model. In addition, the model can be expanded according to actual application scenarios to adapt to the prediction needs of larger-scale photovoltaic power plants or other types of renewable energy generation.

[0012] Through the multi-head attention mechanism and encoder structure, the iTransformer model can effectively cope with the interference of data noise, missing values ​​and abnormal data, and improve the robustness and prediction stability of the model in the face of different types of weather changes.

[0013] As a preferred technical means: in step 1), data cleaning is used to remove invalid or abnormal data, including removing erroneous data caused by equipment failure or data transmission errors; using mean filtering and setting thresholds to remove outliers; Time interpolation uses linear interpolation to fill in missing values ​​in time series data. The linear interpolation formula is:

[0014] in, and are known data points, is the time point to be interpolated, is the interpolation result; Spatial interpolation uses inverse distance weighted interpolation to fill in missing values ​​in spatial distribution data, where the inverse distance weighted interpolation IDW formula is:

[0015] Where Z is the value of the point to be interpolated, is the value of the known point, is the distance from the point to be interpolated to the known point, is the weight index, is the number of known points.

[0016] This technical solution enhances the integrity and consistency of data through precise data cleaning, time interpolation and space interpolation processing, provides more reliable input data for the model, and thus improves the accuracy, stability and reliability of ultra-short-term photovoltaic power forecasting. Specifically: This technical solution uses a data cleaning method to remove erroneous data caused by equipment failure or data transmission errors, avoiding the impact of these abnormal data on the prediction model, thereby improving the accuracy of the prediction results. The use of mean filtering and setting thresholds can effectively smooth data and remove outliers, reducing noise interference.

[0017] Time interpolation uses linear interpolation to fill in missing time series data. Through the linear interpolation formula, the missing data can be smoothly supplemented according to the change trend between known data points, ensuring the continuity and consistency of the time series and avoiding prediction errors caused by missing data.

[0018] Spatial interpolation uses the inverse distance weighted interpolation (IDW) method to fill in missing values ​​in spatially distributed data. Through the IDW formula, the weights of known data points (the relationship with distance) are used to interpolate missing data, ensuring that the filling of spatial data can fully reflect the influence of known points and taking into account the distance differences between different points, making spatial interpolation more accurate and reasonable.

[0019] These data preprocessing methods can ensure that the data input into the model is valid data that has been cleaned, filled and processed, thereby improving the robustness and accuracy of the prediction model. Especially on large-scale data sets, these methods can significantly reduce the impact of data anomalies, missing data or inconsistencies on the prediction effect.

[0020] Data cleaning and interpolation techniques help ensure that the model can use stable and complete data during the training process, avoiding problems such as model non-convergence or performance degradation due to incomplete or abnormal data, thereby improving the stability and predictive ability of the model.

[0021] The choice of temporal interpolation and spatial interpolation (linear interpolation and inverse distance weighted interpolation) provides flexibility for processing different types of data, and can be adjusted according to actual data conditions and needs to adapt to various practical application scenarios.

[0022] As a preferred technical means: in step 2), the feature construction includes the following contents: 1) Obtain meteorological characteristics:

[0023] Among them, X i represents the features at the i-th moment, i=1,2,…,N, Represents X i The kth feature of ; Indicates the total number of features; 2) Calculate the incremental features. The incremental features are used to represent the changing trend of weather data within the offset time. The calculation formula is:

[0024]

[0025] In the formula, is the incremental feature; t is the offset time; 3) Calculate statistical features. Statistical features are used to measure the fluctuation degree of meteorological data within the time window parameter t. The calculation expression is:

[0026]

[0027] Where: x max,kt , S ikt , is the maximum value, standard deviation and mean of the meteorological data in [i - t, i + t]; 4) Calculate the time-varying features. The time-varying features are used to mine the time-varying characteristics of photovoltaic output data at different time scales. The calculation formula is:

[0028] Where: It is a time-varying feature; = [ 1,…, ] is the time window range; is the time window type; and It is the average photovoltaic output of the same minute / hour in different time windows K.

[0029] This technical solution introduces a variety of meteorological parameters (such as light intensity, temperature, cloud cover, wind speed, humidity, etc.) to fully capture the key factors affecting photovoltaic power and ensure the diversity and coverage of features. Meteorological features are expressed in vector form, laying the foundation for subsequent correlation analysis of multivariate data and model input.

[0030] The incremental feature directly reflects the dynamic trend of weather data by calculating the change between the current time and the offset time, which is especially suitable for scenes such as rapid changes in cloud cover. Through the design of different time offsets, it can flexibly adapt to a variety of weather change cycles and enhance the model's sensitivity and predictive ability to short-term changes.

[0031] Statistical features provide the overall volatility and extreme value information of meteorological data within a certain time window by calculating the mean, standard deviation and maximum value, helping the model understand the fluctuation pattern of the data. After introducing statistical features, the model can more accurately describe the stability, extreme values ​​and distribution characteristics of weather data, thereby improving the accuracy of prediction.

[0032] Time-varying features combine PV output data within different time windows to mine the laws of different time scales in time series, such as periodicity or trend of minutes and hours. By extracting features of the same minute and hour, fine-grained changes in PV output can be captured, improving the accuracy of capturing time series changes.

[0033] The combination of incremental, statistical and time-varying features makes the solution highly adaptable and can cope with a variety of weather scenarios such as sunny days, cloudy days, and rapid changes in cloud cover. Feature construction can not only enhance the understanding of existing data patterns, but also improve the generalization ability of new weather data through temporal and spatial scalability.

[0034] Rich incremental, statistical and time-varying features provide multi-dimensional information input, enhancing the iTransformer model's ability to learn and predict complex meteorological data. By calculating incremental and statistical features, it makes up for the sparsity of meteorological data itself, providing higher quality data support for model training.

[0035] By constructing refined incremental, statistical and time-varying features, the model's ability to capture complex nonlinear relationships is significantly improved, thereby improving the accuracy of photovoltaic power prediction. Rich feature design ensures the model's robustness to complex weather conditions (such as rapid cloud movement or local weather changes).

[0036] As a preferred technical means: the input embedding module marks the weather characteristics and photovoltaic output time series through embedding operation, and the calculation formula is:

[0037] Where: X is the input matrix including weather characteristics and photovoltaic output time series; is the embedding mark of weather characteristics and photovoltaic output time series; Embedding is the embedding operation function.

[0038] By integrating weather features and PV output time series into an input matrix X and labeling them through embedding operations, we can ensure that these two types of data are effectively combined and processed in the same model. The advantage of this is that it can simultaneously utilize the dynamic changes in weather data and the historical time series information of PV power, thereby achieving more accurate PV power forecasts. The embedding operation maps high-dimensional input data (including multiple weather features and PV output time series) to a continuous, low-dimensional space, allowing the model to more effectively learn the potential patterns in the data.

[0039] Through the embedding operation, the weather characteristics and photovoltaic output time series in the input matrix X are converted into a unified embedding tag, which not only improves the computational efficiency of the model, but also enhances the model's ability to comprehensively understand different types of information. The temporal and nonlinear characteristics of weather and photovoltaic output data may be complex and difficult to model directly. By embedding tags, the model can effectively capture these complex temporal patterns in a low-dimensional space.

[0040] The embedding operation can design appropriate embedding layers according to specific needs and feature types, making the representation of input data more flexible. For example, different embedding methods can be set according to the characteristics of different weather features, so that the model can adapt to different data types. Through embedding, the input data is mapped to a relatively smaller space, making the data representation easier to pass to subsequent network layers for further processing, enhancing the effectiveness of the model in the high-level learning process.

[0041] The embedding operation maps high-dimensional input data to a low-dimensional space, which helps reduce the dimensionality curse in subsequent calculations and reduces the computational complexity of model training and reasoning. The low-dimensional representation of the embedding operation can effectively improve the computational efficiency during the training process compared to the original high-dimensional input data, especially when processing large-scale data, it can significantly reduce time and space overhead.

[0042] The embedding module processes the input data in a way suitable for neural network learning, so that the model can better capture the deep relationships in the data. Especially when using deep neural networks (such as iTransformer), the embedding layer is one of the key steps to achieve efficient learning. Through embedding, the model can extract effective information from different data sources and provide higher quality input for subsequent encoder modules, thereby improving the accuracy and stability of the overall prediction.

[0043] The embedding operation helps the model effectively model a variety of different weather conditions and photovoltaic output modes, making the model more generalizable and able to operate stably in different environments and weather changes. By effectively embedding multiple weather and photovoltaic output characteristics, the model can adapt to complex weather patterns such as cloud changes in actual applications, thereby improving the accuracy and reliability of predictions.

[0044] As a preferred technical means: the encoder module calculates the attention distribution value by adopting a multi-head attention mechanism, and the calculation formula is:

[0045]

[0046] in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the The attention distribution value.

[0047] By calculating the attention distribution in different subspaces, the model can focus on different aspects of the input data at multiple levels. This allows the model to capture more diverse information and better learn the complex relationships between input features. The multi-head attention mechanism enables the model to process information in multiple directions, helping the model to better capture the nonlinear relationship between weather data and photovoltaic output data, and to adapt to changing patterns at different time scales.

[0048] The multi-head attention mechanism allows the calculation of the results of multiple attention heads at the same time, which can effectively speed up the calculation process and improve the training efficiency of the model. Under large-scale data sets, the model can handle more diverse features and reduce calculation bottlenecks. By using multiple attention heads, the model can automatically select the appropriate representation method according to the complexity of the data, has stronger adaptability, and can handle data of different sizes and complexities.

[0049] The multi-head attention mechanism can capture global and local dependencies in the input sequence by calculating the attention distribution at different positions. In photovoltaic power forecasting, this means that the model can not only focus on short-term time series changes, but also learn trend changes on long time scales. Through the interaction of the query matrix (Q), key matrix (K), and value matrix (V), the model can adaptively adjust the attention level of features (i.e., assign different attention weights), so that important weather data and photovoltaic output data can receive more attention.

[0050] The multi-head attention mechanism allows multiple attention heads to learn simultaneously on different feature subspaces, which enables the model to fuse and represent input data in multiple ways, further enhancing the model's perception of complex time series and multi-dimensional features. When processing time series data (such as photovoltaic power prediction), the multi-head attention mechanism can capture the potential periodicity, trend and mutation changes in the time series by calculating attention at different time points, thereby improving the accuracy of the prediction.

[0051] Since the multi-head attention mechanism calculates attention weights in parallel through multiple heads, the model can effectively reduce the deviation that may be caused by relying on a single head for calculation. In addition, the multi-head attention mechanism helps to improve the generalization ability of the model on different features and samples and reduce the risk of overfitting. Through weight distribution, the model can automatically select important features in the multi-dimensional feature space, so that the impact of unimportant or redundant features on the model is reduced, thereby improving the stability of the prediction results.

[0052] When it comes to photovoltaic power generation forecasting, the complex spatiotemporal relationship between weather changes and photovoltaic output is key. Through the multi-head attention mechanism, the encoder module is able to simultaneously process the relationship between different time points in the time series and the interaction of various weather features in space, allowing the model to fully understand the interactions and dependencies between different features.

[0053] The parameters in the multi-head attention mechanism, such as the key matrix, query matrix, value matrix, and output projection matrix, can be flexibly tuned according to the specific tasks and data characteristics to achieve the best balance between the model's expressiveness and computational efficiency.

[0054] In the multi-head attention mechanism, each attention head performs weighted summation based on different input features, so that each head can independently focus on different feature patterns. Through this mechanism, the model can more accurately control the flow of information, optimize the interaction between features, and thus improve the accuracy of prediction.

[0055] As a preferred technical means: the projection layer module is composed of a multi-layer perceptron MLP, which is used to perform nonlinear mapping output on the multivariate labels processed by the encoder module.

[0056] Multilayer Perceptron (MLP) can effectively capture complex nonlinear relationships in input data by stacking multiple layers of fully connected networks. In the photovoltaic power forecasting task, the relationship between weather characteristics and photovoltaic power output is often nonlinear. Using MLP can improve the model's ability to express these complex relationships. Each layer of MLP can use nonlinear activation functions (such as ReLU, Sigmoid, etc.), which enables the model to perform complex transformations on the data and learn richer feature representations.

[0057] Through the stacking of multi-layer perceptrons, the model can extract deeper feature information layer by layer, thereby providing a more refined representation of the input data. In photovoltaic power forecasting, data usually has multiple dimensions and may contain different time scales and spatial scales. MLP can integrate information at different levels through hierarchical processing to improve forecasting capabilities. MLP can combine multiple input features together and map them by learning appropriate weights, thereby improving the processing capabilities of multi-dimensional input data (such as weather data and historical photovoltaic output) and generating more accurate output results.

[0058] Since MLP maps through multiple fully connected layers, it can effectively process high-dimensional data and map complex input features to a suitable output space. In photovoltaic power forecasting, there is a highly complex relationship between weather data, historical power data and other features, and MLP can convert this information into predicted values ​​of photovoltaic power. By adjusting the weights of neurons during training, MLP can automatically learn and adapt to the characteristics of input data, generate accurate prediction outputs, and provide efficient and accurate data support for power grid dispatch.

[0059] The MLP structure usually prevents overfitting through activation functions and appropriate regularization (such as dropout), so that the model can have better generalization ability on new data. Photovoltaic power forecasting often faces unpredictable weather conditions. Through appropriate regularization methods, MLP can avoid overfitting problems and improve the prediction stability of the model under various weather conditions. By continuously training and updating weights, MLP can adaptively learn from a large amount of data, thereby adapting to different data characteristics and changes, and maintaining a high prediction accuracy.

[0060] The number of layers of MLP and the number of neurons in each layer can be flexibly adjusted according to the complexity of the task and the size of the data. In the photovoltaic power prediction task, the MLP structure can be flexibly designed to meet different prediction accuracy requirements according to different regions and data volumes. As the amount of data increases, MLP can expand its processing power by increasing the number of layers or neurons in the network, and can effectively cope with the challenges of large-scale, high-dimensional data sets.

[0061] During the calculation process, MLP supports parallel computing technologies such as GPU acceleration through matrix operations in the fully connected layer, thereby improving training speed and reasoning efficiency. In practical applications, it can speed up the model training process and improve real-time prediction capabilities. MLP has a relatively simple structure and can process large-scale data inputs more efficiently. The computational complexity during training and reasoning is moderate, making it suitable for actual deployment and real-time prediction.

[0062] Multilayer perceptrons can automatically learn high-order features of data and extract more discernible high-level features from input features through layer-by-layer nonlinear mapping. This is crucial for the complex interaction between weather data and photovoltaic power output, especially under rapidly changing weather conditions, where MLP can help the model identify potential influencing factors.

[0063] MLP can process multi-dimensional input data, such as time series data (PV output) and various meteorological features (temperature, humidity, wind speed, etc.). By converting these multi-dimensional input data into a suitable feature space, MLP can learn the association between input features and perform accurate PV power forecasting.

[0064] As a preferred technical means: the photovoltaic power ultra-short-term prediction is based on a training set and evaluated through a test set, using evaluation indicators including mean square error (MSE), root mean square error (RMSE) and / or mean absolute error (MAE).

[0065] Using evaluation indicators such as mean square error (MSE), root mean square error (RMSE) and mean absolute error (MAE), the prediction performance of the model can be comprehensively and intuitively evaluated. These indicators help optimize the model training process, improve the stability and accuracy of the model, and enhance the model's adaptability to photovoltaic power prediction, thereby providing efficient and reliable support for power grid dispatching and practical applications.

[0066] Another object of the present invention is to provide a photovoltaic power ultra-short-term prediction system based on the photovoltaic power ultra-short-term prediction method of iTransformer, the photovoltaic power ultra-short-term prediction system comprising: Weather data collection and processing module: used to collect weather data related to photovoltaic power, including light intensity, temperature, cloud cover, wind speed and humidity; pre-process the collected weather data, including data cleaning, time interpolation and space interpolation, to generate a standardized weather data format; Feature construction module: used to generate incremental features, statistical features and time-varying features based on processed weather data as input for subsequent models; iTransformer model modules: Includes the following submodules: Input embedding module: used to input weather characteristics and PV output time series into the model and generate embedding tags; Encoder module: uses a multi-head attention mechanism to calculate the attention distribution value of multivariate data and perform deep feature mining; Projection layer module: nonlinearly maps the multivariate labels output by the encoder and outputs the photovoltaic power prediction results; Model training module: The iTransformer model is trained using a training set containing measured PV output time series data and processed weather characteristic data, and is corrected using numerical weather forecast data and data provided by public meteorological services; Photovoltaic power prediction module: used to perform ultra-short-term prediction of photovoltaic power based on the trained iTransformer model.

[0067] This technical solution combines the advanced iTransformer model with comprehensive data processing and feature construction methods, and has strong predictive capabilities and adaptability. Through high-precision ultra-short-term predictions, it can provide real-time support for power grid dispatching, optimize the operating efficiency of the power system, and improve the reliability of power supply. At the same time, the modular design of the system and the multi-dimensional data processing method make the solution highly flexible and scalable, adapting to the needs of different regions and different weather conditions. These advantages make this technical solution have broad application potential in the field of photovoltaic power prediction. Specifically: The system can collect and process multi-dimensional weather data including light intensity, temperature, cloud cover, wind speed and humidity, which have a direct impact on photovoltaic power generation. Through this comprehensive data collection, the operating environment of the photovoltaic power station can be more accurately reflected. Through steps such as data cleaning, time interpolation and spatial interpolation, noise data and missing values ​​can be removed to ensure the accuracy and completeness of input data. This provides a high-quality data foundation for subsequent modeling and reduces prediction errors caused by data problems. After standardization, the data can be in a unified format, which is conducive to the efficient application of subsequent algorithm models and ensures the stability and consistency of model training and prediction.

[0068] Through a variety of feature construction methods, the system can characterize the impact of weather data on photovoltaic power from different perspectives and extract more valuable information. These features can help the model capture the complex nonlinear relationship between weather and photovoltaic power generation and improve prediction accuracy. Incremental features reflect the trend of weather data over time, while statistical features and time-varying features can capture the volatility and periodicity in the data. Through these features, the model can dynamically adapt to different weather patterns and improve the accuracy of ultra-short-term predictions.

[0069] The encoder module uses a multi-head attention mechanism, which can effectively capture the relationship and importance between input features and assign appropriate weights to each feature. This enables the model to deeply explore the contribution of different features to the prediction results when processing photovoltaic power and weather data, thereby improving the accuracy of the model. Through adaptive deep learning methods, the model can automatically discover and learn potential patterns in photovoltaic power prediction during training, avoid the shortcomings of manual feature design, and improve the prediction effect. The projection layer module maps the multivariate features output by the encoder to the predicted value of photovoltaic power through nonlinear mapping, so that the model can handle highly nonlinear data relationships and meet the complex photovoltaic power prediction needs.

[0070] The model training process combines measured PV output data with processed weather characteristic data, and ensures the high quality and accuracy of the training data through the correction of numerical weather forecast and public meteorological service data. This multi-dimensional data correction mechanism helps to reduce errors and improve the adaptability of the model in complex environments. Through refined data set division and training, the system can ensure efficient performance on different data sets. Continuous optimization and adjustment of model performance can ensure its stability and reliability in actual operation.

[0071] Through the trained iTransformer model, the system can accurately predict photovoltaic power in the ultra-short term, which is particularly suitable for power dispatching needs under rapidly changing weather conditions. This can effectively help the power grid dispatching department to dispatch resources in real time and improve the stability and reliability of the power grid. The system can process and analyze newly collected weather data in real time and make instant predictions. For photovoltaic power stations, this means that power generation can be quickly predicted based on the latest weather conditions and the power grid dispatching strategy can be adjusted in a timely manner.

[0072] The system can adapt to different weather conditions, such as sunny, cloudy or overcast weather, by dynamically adjusting weather data and feature construction. This flexibility enables the system to cope with different meteorological environments and improve overall forecasting capabilities.

[0073] Through ultra-short-term PV power forecasting, grid dispatchers can learn about the changing trend of PV power generation in advance and make dispatching decisions in a timely manner. This provides effective forecasting support for the grid and reduces the impact of PV power generation fluctuations on grid operation. Through high-precision PV power forecasting, the system can identify potential power generation fluctuations in a short period of time, reduce the impact of PV power generation uncertainty on grid load balance, and improve the reliability and stability of the power system.

[0074] As a preferred technical means: the weather data collection and processing module performs data cleaning, time interpolation and space interpolation in the following ways: Data cleaning: Remove invalid or abnormal data caused by equipment failure or data transmission errors, and use mean filtering and threshold setting to process abnormal values; Time interpolation: Linear interpolation is used to fill missing values ​​in time series data; Spatial interpolation: Use the inverse distance weighted interpolation method to fill in the missing values ​​of spatially distributed data; The incremental features, statistical features and time-varying features generated by the feature construction module include: Incremental feature: represents the changing trend of weather data within the offset time; Statistical characteristics: measure the degree of fluctuation of meteorological data within the time window, including mean, standard deviation and maximum value; Time-varying characteristics: describe the changing characteristics of photovoltaic output at different time scales, including the average output characteristics of minutes and hours.

[0075] This technical solution improves the accuracy and adaptability of ultra-short-term prediction of photovoltaic power through refined data processing and comprehensive feature construction. The comprehensive use of incremental features, statistical features and time-varying features can fully explore the complex relationship between weather and photovoltaic power and provide real-time and accurate prediction results. Specifically: By removing invalid or abnormal data caused by equipment failure or data transmission errors, and processing abnormal values ​​by using mean filtering and setting thresholds, the reliability and accuracy of the data can be effectively improved, and abnormal data can be prevented from having a negative impact on subsequent model training and prediction. Linear interpolation is used to fill in missing values ​​in time series data, so that the prediction model can use complete time series data to ensure the consistency and accuracy of the prediction. This is particularly important for the problem of missing data caused by weather changes in photovoltaic power prediction. The use of inverse distance weighted interpolation (IDW) to fill in missing values ​​in spatially distributed data ensures the integrity and continuity of data in space. This is crucial for the processing of weather data for multi-point photovoltaic systems and can effectively improve the spatial adaptability and accuracy of the model.

[0076] By calculating the changing trend of weather data within the offset time, the incremental feature can capture the time series changes of weather data and provide timeliness information for PV power forecasting. This feature can reflect the dynamic changes of PV power and help to more accurately predict PV output. Statistical features such as mean, standard deviation and maximum value can measure the volatility of meteorological data within the time window. These features can help the model identify the degree of fluctuation of weather changes and predict abnormal weather that may affect PV power generation, further improving the prediction accuracy. Describing the changing characteristics of PV output at different time scales (such as minutes and hours) can capture the short-term trend of PV power changes. Time-varying features help the model identify the periodic or non-periodic relationship between PV power generation and weather conditions, and improve the real-time and accuracy of PV power generation forecasts.

[0077] By integrating incremental features, statistical features, and time-varying features, the system can extract the complex relationship between weather data and photovoltaic output from multiple perspectives. These multi-dimensional features help capture potential patterns in the data and improve the generalization ability and prediction accuracy of the model. Incremental features and time-varying features help the model to quickly respond to and accurately predict changes in photovoltaic power in different periods and under different meteorological conditions. Especially when the weather changes rapidly, the system can efficiently handle different time scales and fluctuation characteristics. Through precise weather data processing and feature construction, the system can make high-precision photovoltaic power forecasts in the ultra-short term. This is crucial for real-time decision-making in power grid dispatching and the power market, especially to reduce the dispatch difficulty and operation risk of the power grid caused by photovoltaic power fluctuations. The system can update and output short-term prediction results of photovoltaic power in real time, helping the power grid to better adapt to the volatility of photovoltaic power generation, improve power grid stability, and optimize dispatch strategies.

[0078] This solution adopts a variety of weather data processing methods, which can adapt to the complexity of the impact of different weather conditions on photovoltaic power generation and provide reliable forecasting support for photovoltaic power generation in different environments in different regions.

[0079] Through accurate ultra-short-term photovoltaic power forecasting, the power grid can better cope with the uncertainty of photovoltaic power generation, adjust power load and dispatching strategies in a timely manner, and improve the accuracy and response speed of power grid dispatching. By using accurate incremental characteristics and time-varying characteristics, it is possible to predict short-term fluctuations in photovoltaic power generation, effectively reduce the impact of such fluctuations on the power grid, and improve the stability of the power system and the reliability of power supply.

[0080] As a preferred technical means: the input embedding module marks the weather characteristics and photovoltaic output time series through embedding operation, and the calculation formula is:

[0081] Where: X is the input matrix including weather characteristics and photovoltaic output time series; is the embedding mark of weather characteristics and photovoltaic output time series; Embedding is the embedding operation function; The encoder module calculates the attention distribution value by adopting the multi-head attention mechanism, and the calculation formula is:

[0082]

[0083] in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the Attention distribution value; The projection layer module consists of a multi-layer perceptron (MLP) to output the multivariate labels processed by the encoder module through nonlinear mapping.

[0084] This technical solution combines input embedding, encoder module (multi-head attention mechanism), and projection layer (multi-layer perceptron MLP) to show the following significant advantages for the ultra-short-term photovoltaic power prediction task: Through the embedding operation, weather characteristics and photovoltaic output time series data can be converted into embedded tags in a high-dimensional space. This not only enhances the richness of data representation, but also effectively captures the complex relationship between weather data and photovoltaic power. In this way, the system can process and understand input data with different time scales and multiple dimensions, enhancing the performance of the prediction model. Through this embedding method, the system is able to simultaneously process and understand input data from different sources (such as weather and photovoltaic data), making the feature representation more comprehensive.

[0085] The multi-head attention mechanism is used to capture the correlation between different features. The mechanism calculates the attention distribution by calculating the inner product of the query matrix (Q), the key matrix (K), and the value matrix (V), and further calculates the attention distribution of each subspace through multi-head attention. This approach enables the model to focus on different important features in multiple feature spaces at the same time, improving the model's ability to recognize complex patterns. Multi-head attention can dynamically adjust the model's attention to different input features, and automatically capture weather change characteristics that are important for photovoltaic power prediction at different time steps or time scales. This is particularly important for processing time series data such as photovoltaic power and weather data.

[0086] The multivariate labels output by the encoder module are nonlinearly mapped through a multi-layer perceptron (MLP) to effectively extract and fuse features of different dimensions. The nonlinear characteristics of MLP enable the model to learn the complex patterns of the input data, thereby improving the accuracy of photovoltaic power prediction. This module can help further refine features so that they can play a greater role in subsequent prediction steps; through multiple processing layers (such as multi-head attention mechanisms and multi-layer perceptrons), the system can learn features at multiple levels, enhancing the ability to model complex nonlinear relationships.

[0087] By using matrix operations in the multi-head attention mechanism, efficient parallel computing can be achieved, which improves the computational efficiency of the system. This is particularly important for photovoltaic power prediction systems, especially when large amounts of input data need to be processed, to ensure that the system responds in real time and outputs prediction results quickly. The combination of efficient computing and nonlinear mapping can speed up the model training and reasoning process, further improving prediction accuracy.

[0088] The combination of multi-layer perceptron (MLP) and multi-head attention mechanism can help the system dynamically adjust the weight of the model in the short-term prediction of photovoltaic power to adapt to the impact of different weather conditions on photovoltaic output. This flexibility allows the model to be adaptively adjusted under different environmental conditions, thereby improving the generalization ability and accuracy of the prediction. It can handle complex multivariate input data and capture the complex relationship between various weather data and photovoltaic output, thereby providing more accurate photovoltaic power prediction results.

[0089] Through the attention calculation of multiple heads, the model can learn more feature correlations in different dimensions and time windows, improving the performance of the model in predicting complex weather patterns, especially in the ultra-short-term prediction of photovoltaic power. The combination of multi-head attention mechanism and MLP enables the model to have stronger feature learning capabilities, effectively capture complex dependencies and patterns in the data, and provide support for the accurate prediction of photovoltaic power.

[0090] Beneficial effects: 1. The iTransformer model proposed in this patent effectively retains the correlation between multivariate data by independently embedding the time series of each variable as a marker, thereby improving the model's ability to capture key meteorological features.

[0091] 2. By constructing incremental features, statistical features, and time-varying features of weather features, this technical solution deeply explores the fine-grained features under weather conditions corresponding to photovoltaic output. These features can more accurately reflect the impact of weather changes on photovoltaic output, thereby improving the accuracy of the photovoltaic output prediction model.

[0092] 3. This patent uses multi-source weather forecast data (such as numerical weather forecast data and weather type forecast data provided by public meteorological services) for comprehensive correction to ensure the accuracy and reliability of input data. This fusion of multi-source data further improves the robustness and accuracy of the prediction model.

[0093] 4. The iTransformer model uses a multi-head attention mechanism to calculate the attention distribution value of independently embedded multivariate variables, achieving high weight allocation for important features. At the same time, the nonlinear mapping output of the projection layer module improves the prediction performance of the model. This structural optimization enables the model to better capture long-term series dependencies and the correlation of multivariate data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0095] Figure 2 It is a schematic diagram of the Transformer model structure of the present invention.

[0096] Figure 3 It is a flow chart of the Transformer model training of the present invention. DETAILED DESCRIPTION

[0097] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings.

[0098] Embodiment 1: This embodiment proposes an ultra-short-term photovoltaic power prediction method based on iTransfomer, which aims to improve the accuracy and reliability of photovoltaic power prediction by fusing numerical weather prediction (NWP) and public meteorological service weather type forecast and correcting the total irradiance in combination with measured data.

[0099] like Figure 1 As shown, in order to achieve the above purpose, the technical solution of the present invention is implemented as follows: a photovoltaic power ultra-short-term prediction method based on iTransformer, comprising: 1. Weather Data Collection and Processing Photovoltaic output is affected by many environmental factors, among which weather conditions are one of the most influential factors. Light intensity, temperature, cloud cover, wind speed and humidity will affect the size and efficiency of photovoltaic output. In order to accurately predict photovoltaic output, it is necessary to collect the following key weather information: light intensity, temperature, cloud cover, wind speed, humidity, etc.

[0100] The collected weather information needs to go through a series of preprocessing steps to form a standard data format that can be used to input the iTransformer model. The following is a detailed description of the preprocessing process: Data cleaning: Remove invalid or abnormal data. For example, erroneous data caused by equipment failure or data transmission errors. Use mean filtering and set thresholds to remove outliers.

[0101] Interpolation in time and space: Time interpolation: fill in missing values ​​in time series data. The linear interpolation formula is:

[0102] in, and is the known data point, x is the time point to be interpolated, and y is the interpolation result.

[0103] Spatial interpolation: fill in missing values ​​in spatially distributed data. The inverse distance weighted interpolation (IDW) formula is:

[0104] Where Z is the value of the point to be interpolated, Z i is the value of the known point, d i is the distance from the point to be interpolated to the known point, p is the weight index, and n is the number of known points.

[0105] 2. Feature construction based on weather data The present invention constructs features for weather features and mines fine-grained features under weather conditions corresponding to photovoltaic output, thereby improving the accuracy of a photovoltaic output prediction model.

[0106] For meteorological feature X Q =[X1,X2,…,X N ] T ,X i represents the characteristics of the i-th (i=1,2,…,N) moment, Represents X i The kth feature of M represents the total number of features. Feature construction includes the following four steps: 1. Original features

[0107] 2) Incremental feature, used to represent the changing trend of weather data within the offset time t, and the calculation formula is as follows:

[0108] Where: X it. Z Incremental feature.

[0109] 3. Statistical characteristics, used to measure the fluctuation degree of meteorological data within the time window parameter t, the expression is as follows:

[0110] Where: x max,kt , S ikt , is the maximum value, standard deviation and mean of the meteorological data in [i - t, i + t].

[0111] 4. Time-varying features are used to mine the short-term regularity of photovoltaic output data on different time scales (such as day, month and season), so as to more accurately extract the time-varying characteristics of photovoltaic output. Assume that the photovoltaic output data is , then the time-varying characteristics can be expressed as:

[0112] Where: Y i.S is a time-varying feature; l = [l1,…,l K ] is the time window range; K is the time window type; and It is the average photovoltaic output of the same minute / hour in different time windows K.

[0113] 3. iTransformer model construction Transformer introduces the self-attention mechanism to achieve parallel computing, improve computing speed, and effectively capture long-term series dependencies, and has achieved good results in natural language processing and image fields. However, due to the influence of multivariate merging and embedding, it is difficult for the model to retain the correlation between multivariate data, thus limiting the model's capture of key meteorological features. The present invention adopts the iTransformer model. On the basis of the traditional Transformer, the time series of each variable is independently embedded as a label, and the self-attention mechanism is used to process multivariate correlations. Its overall framework structure can be divided into three modules: input embedding, encoder, and projection layer. The overall structure of iTransformer is as follows: Figure 2 shown.

[0114] Input embedding module, input weather characteristics and photovoltaic output time series into iTransformer model. The calculation formula is:

[0115] Where: X is the input matrix of weather characteristics, photovoltaic output time series, etc.; is the embedding mark of weather characteristics and photovoltaic output time series; Embedding is the embedding operation.

[0116] The encoder module uses a multi-head attention mechanism to calculate the attention distribution value of independently embedded multivariables and assign high weights to important features, thereby achieving deep mining of nonlinear features of weather data that have a greater impact on photovoltaic output. The calculation formula is as follows:

[0117]

[0118] in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the The attention distribution value.

[0119] The projection layer module, which consists of a multi-layer perceptron (MLP), performs nonlinear mapping output on the multi-variable labels processed independently by the encoder module.

[0120] 4. Ultra-short-term prediction of photovoltaic power Based on the previous analysis, we selected key meteorological factors such as total irradiance, temperature, humidity and wind speed as input variables of the iTransformer model. Among them, the total irradiance data is the result of comprehensive correction of multi-source meteorological forecast data to ensure its accuracy and reliability.

[0121] To build and train the iTransformer model, we use historical data from PV plants, which includes actual measured PV power output and meteorological data (irradiance, temperature, humidity, wind speed) for the same period. In addition, we also combine numerical weather forecast data and weather type forecast data provided by public meteorological services. These data are arranged in chronological order and divided into training and test sets for model training and performance evaluation.

[0122] Model evaluation: Use the test set data to evaluate the trained iTransformer model and verify its prediction performance. Evaluation indicators include MSE, RMSE (root mean square error), MAE (mean absolute error), etc.

[0123] Ultra-short-term prediction: The total irradiance and other meteorological data corrected by multi-source weather forecasts are input into the trained iTransformer model to perform ultra-short-term prediction of photovoltaic power. The prediction results can provide important reference for power grid dispatching, power market transactions, etc.

[0124] The iTransformer photovoltaic prediction model proposed in this paper has the following process: Figure 3 As shown. First, the incremental features, statistical features and time-varying features under the meteorological feature mining time window t are constructed. Then the iTransformer module is input to embed each variable independently as a tag to capture the correlation between key fine-grained features and multivariate data; until the set maximum number of iterations is completed, the photovoltaic output prediction model is obtained.

[0125] Compared with the traditional Transformer model, this technical solution has more advantages: when processing multivariate data, the traditional Transformer model is prone to lose the correlation between data due to merging and embedding. The iTransformer model proposed in this patent effectively retains the correlation between multivariate data by independently embedding the time series of each variable as a marker, and improves the model's ability to capture key meteorological features.

[0126] Fine-grained feature construction: By constructing incremental features, statistical features, and time-varying features of weather features, this patent deeply explores the fine-grained features under weather conditions corresponding to photovoltaic output. These features can more accurately reflect the impact of weather changes on photovoltaic output, thereby improving the accuracy of the photovoltaic output prediction model.

[0127] Multi-source meteorological data fusion: This patent uses multi-source meteorological forecast data (such as numerical weather forecast data and weather type forecast data provided by public meteorological services) for comprehensive correction to ensure the accuracy and reliability of input data. This fusion of multi-source data further improves the robustness and accuracy of the prediction model.

[0128] iTransformer model structure optimization: The iTransformer model uses a multi-head attention mechanism to calculate the attention distribution value of independently embedded multivariate variables, achieving high weight allocation for important features. At the same time, the nonlinear mapping output of the projection layer module improves the prediction performance of the model. This structural optimization enables the model to better capture long-term series dependencies and the correlation of multivariate data.

[0129] The present invention will be further described below with regard to specific examples: Data input: The photovoltaic data in this embodiment selects the actual photovoltaic power generation data of a photovoltaic power station in a certain place in China, and the data sampling frequency is 15 minutes. The sample data of the photovoltaic power station includes temperature, irradiance, humidity, wind speed, etc. and the actual photovoltaic output. The number of training set data is 62,042.

[0130] Feature construction: The original features include five types of meteorological features: irradiance, humidity, temperature, pressure, and wind speed. Each feature extracts 2 × 24 × 5 incremental features, 3 × 5 statistical features, and 2 × 9 time-varying features, for a total of 273 features.

[0131] Ultra-short-term photovoltaic power forecast results: statistical results of prediction error evaluation indicators (MAE, MSE).

[0132]

[0133] This table shows the statistical results of the error evaluation indicators (MAE, MSE and R²) for ultra-short-term prediction based on photovoltaic data under different weather conditions, reflecting the prediction performance of the model under different weather conditions. Through these evaluation indicators, the accuracy and fit of the model under different meteorological conditions can be intuitively compared.

[0134] Embodiment 2: This embodiment provides a photovoltaic power ultra-short-term prediction system including: 1. Weather data collection and processing module: used to collect weather data related to photovoltaic power, including light intensity, temperature, cloud cover, wind speed and humidity; pre-process the collected weather data, including data cleaning, time interpolation and space interpolation, to generate a standardized weather data format; The weather data collection and processing module performs data cleaning, temporal interpolation, and spatial interpolation in the following ways: Data cleaning: Remove invalid or abnormal data caused by equipment failure or data transmission errors, and use mean filtering and threshold setting to process abnormal values; Time interpolation: Linear interpolation is used to fill missing values ​​in time series data; Spatial interpolation: Use the inverse distance weighted interpolation method to fill in the missing values ​​of spatially distributed data; The incremental features, statistical features and time-varying features generated by the feature construction module include: Incremental feature: represents the changing trend of weather data within the offset time; Statistical characteristics: measure the degree of fluctuation of meteorological data within the time window, including mean, standard deviation and maximum value; Time-varying characteristics: describe the changing characteristics of photovoltaic output at different time scales, including the average output characteristics of minutes and hours.

[0135] 2. Feature construction module: used to generate incremental features, statistical features and time-varying features based on the processed weather data as input for subsequent models; 3. iTransformer model module: Includes the following submodules: 1. Input embedding module: used to input weather characteristics and PV output time series into the model and generate embedding tags; The input embedding module labels the weather characteristics and photovoltaic output time series through embedding operations. The calculation formula is:

[0136] Where: X is the input matrix including weather characteristics and photovoltaic output time series; is the embedding mark of weather characteristics and photovoltaic output time series; Embedding is the embedding operation function.

[0137] 2. Encoder module: uses a multi-head attention mechanism to calculate the attention distribution value of multivariate data and perform deep feature mining; The encoder module calculates the attention distribution value by adopting the multi-head attention mechanism, and the calculation formula is:

[0138]

[0139] in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the The attention distribution value.

[0140] 3. Projection layer module: nonlinearly maps the multivariate labels output by the encoder and outputs the photovoltaic power prediction results; The projection layer module consists of a multi-layer perceptron (MLP) to output the multivariate labels processed by the encoder module through nonlinear mapping.

[0141] 4. Model training module: The iTransformer model is trained using a training set containing measured PV output time series data and processed weather characteristic data, and is corrected using numerical weather forecast data and data provided by public meteorological services; The system trains the iTransformer model using the training set and evaluates it using the test set. Evaluation indicators include mean square error (MSE), root mean square error (RMSE), mean absolute error (MAE), etc.

[0142] 5. Photovoltaic power prediction module: used for ultra-short-term prediction of photovoltaic power based on the trained iTransformer model.

[0143] This technical solution combines the advanced iTransformer model with comprehensive data processing and feature construction methods, and has strong predictive capabilities and adaptability. Through high-precision ultra-short-term predictions, it can provide real-time support for power grid dispatching, optimize the operating efficiency of the power system, and improve the reliability of power supply. At the same time, the modular design of the system and the multi-dimensional data processing method make the solution highly flexible and scalable, adapting to the needs of different regions and different weather conditions. These advantages make this technical solution have broad application potential in the field of photovoltaic power prediction. Specifically: The system can collect and process multi-dimensional weather data including light intensity, temperature, cloud cover, wind speed and humidity, which have a direct impact on photovoltaic power generation. Through this comprehensive data collection, the operating environment of the photovoltaic power station can be more accurately reflected. Through steps such as data cleaning, time interpolation and spatial interpolation, noise data and missing values ​​can be removed to ensure the accuracy and completeness of input data. This provides a high-quality data foundation for subsequent modeling and reduces prediction errors caused by data problems. After standardization, the data can be in a unified format, which is conducive to the efficient application of subsequent algorithm models and ensures the stability and consistency of model training and prediction.

[0144] Through a variety of feature construction methods, the system can characterize the impact of weather data on photovoltaic power from different perspectives and extract more valuable information. These features can help the model capture the complex nonlinear relationship between weather and photovoltaic power generation and improve prediction accuracy. Incremental features reflect the trend of weather data over time, while statistical features and time-varying features can capture the volatility and periodicity in the data. Through these features, the model can dynamically adapt to different weather patterns and improve the accuracy of ultra-short-term predictions.

[0145] The encoder module uses a multi-head attention mechanism, which can effectively capture the relationship and importance between input features and assign appropriate weights to each feature. This enables the model to deeply explore the contribution of different features to the prediction results when processing photovoltaic power and weather data, thereby improving the accuracy of the model. Through adaptive deep learning methods, the model can automatically discover and learn potential patterns in photovoltaic power prediction during training, avoid the shortcomings of manual feature design, and improve the prediction effect. The projection layer module maps the multivariate features output by the encoder to the predicted value of photovoltaic power through nonlinear mapping, so that the model can handle highly nonlinear data relationships and meet the complex photovoltaic power prediction needs.

[0146] The model training process combines measured PV output data with processed weather characteristic data, and ensures the high quality and accuracy of the training data through the correction of numerical weather forecast and public meteorological service data. This multi-dimensional data correction mechanism helps to reduce errors and improve the adaptability of the model in complex environments. Through refined data set division and training, the system can ensure efficient performance on different data sets. Continuous optimization and adjustment of model performance can ensure its stability and reliability in actual operation.

[0147] Through the trained iTransformer model, the system can accurately predict photovoltaic power in the ultra-short term, which is particularly suitable for power dispatching needs under rapidly changing weather conditions. This can effectively help the power grid dispatching department to dispatch resources in real time and improve the stability and reliability of the power grid. The system can process and analyze newly collected weather data in real time and make instant predictions. For photovoltaic power stations, this means that power generation can be quickly predicted based on the latest weather conditions and the power grid dispatching strategy can be adjusted in a timely manner.

[0148] The system can adapt to different weather conditions, such as sunny, cloudy or overcast weather, by dynamically adjusting weather data and feature construction. This flexibility enables the system to cope with different meteorological environments and improve overall forecasting capabilities.

[0149] Through ultra-short-term PV power forecasting, grid dispatchers can learn about the changing trend of PV power generation in advance and make dispatching decisions in a timely manner. This provides effective forecasting support for the grid and reduces the impact of PV power generation fluctuations on grid operation. Through high-precision PV power forecasting, the system can identify potential power generation fluctuations in a short period of time, reduce the impact of PV power generation uncertainty on grid load balance, and improve the reliability and stability of the power system.

[0150] The above-mentioned method and system for ultra-short-term prediction of photovoltaic power based on iTransfomer is a specific embodiment of the present invention, which has embodied the substantial characteristics and progress of the present invention. According to actual use needs and under the guidance of the present invention, equivalent modifications in shape, structure, etc. can be made to the method and system, which are all within the protection scope of this scheme.

Claims

1. A photovoltaic power ultra-short-term prediction method based on iTransformer, characterized in that The following steps are involved: 1) Weather data collection and processing: Collect weather data related to photovoltaic power, including light intensity, temperature, cloud cover, wind speed and humidity; Preprocess the collected weather data, including data cleaning, temporal interpolation and spatial interpolation, to obtain a standard data format that can be used for model input; 2) Feature construction based on weather data: Feature construction of weather data, specifically incremental features, statistical features, and time-varying features, and these constructed features are used as inputs to the iTransformer model; 3) iTransformer model construction and training: 301) Build iTransformer model: The iTransformer model consists of an input embedding module, an encoder module, and a projection layer module. Input embedding module: input weather features and PV output time series into the iTransformer model to obtain the embedding labels of each input feature; Encoder module: uses a multi-head attention mechanism to calculate the attention distribution value of multivariate data, assigns high weights to important features, and performs deep feature mining; Projection layer module: nonlinear mapping output of multivariate labels to obtain photovoltaic power prediction results; 302) iTransformer model training: The iTransformer model is trained using a training set containing measured PV output time series data and processed weather characteristic data, and is corrected using numerical weather forecast data and weather type forecast data provided by public meteorological services to ensure the accuracy and reliability of input data; 4) Ultra-short-term forecast of photovoltaic power: The parameters obtained through iTransformer model training are applied to the ultra-short-term prediction of photovoltaic power to predict photovoltaic power.

2. The method for ultra-short-term photovoltaic power prediction based on iTransformer according to claim 1, characterized in that: In step 1), data cleaning is used to remove invalid or abnormal data, including removing erroneous data caused by equipment failure or data transmission errors; using mean filtering and setting thresholds to remove outliers; Time interpolation uses linear interpolation to fill in missing values ​​in time series data. The linear interpolation formula is: in, and are known data points, is the time point to be interpolated, is the interpolation result; Spatial interpolation uses inverse distance weighted interpolation to fill in missing values ​​in spatial distribution data, where the inverse distance weighted interpolation IDW formula is: Where Z is the value of the point to be interpolated, is the value of the known point, is the distance from the point to be interpolated to the known point, is the weight index, is the number of known points.

3. The photovoltaic power ultra-short-term prediction method based on iTransformer according to claim 2 is characterized in that: In step 2), feature construction includes the following: 1) Obtain meteorological characteristics: Among them, X i represents the features at the i-th moment, i=1,2,…,N, Represents X i The kth feature of ; Indicates the total number of features; 2) Calculate the incremental features. The incremental features are used to represent the changing trend of weather data within the offset time. The calculation formula is: In the formula, is the incremental feature; t is the offset time; 3) Calculate statistical features. Statistical features are used to measure the fluctuation degree of meteorological data within the time window parameter t. The calculation expression is: Where: , , is the maximum value, standard deviation and mean of the meteorological data in [i - t, i + t]; 4) Calculate time-varying features. Time-varying features are used to mine the time-varying characteristics of photovoltaic output data at different time scales. The calculation formula is: Where: It is a time-varying feature; = [ 1 ,…, ] is the time window range; is the time window type; and It is the average photovoltaic output of the same minute / hour in different time windows K.

4. The photovoltaic power ultra-short-term prediction method based on iTransformer according to claim 3 is characterized by: The input embedding module marks the weather characteristics and photovoltaic output time series through embedding operation, and the calculation formula is: Where: X is the input matrix including weather characteristics and photovoltaic output time series; Embedding tags for weather characteristics and photovoltaic output time series; Embedding is the embedding operation function.

5. The photovoltaic power ultra-short-term prediction method based on iTransformer according to claim 4 is characterized by: The encoder module calculates the attention distribution value by adopting a multi-head attention mechanism, and the calculation formula is: in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the The attention distribution value.

6. The photovoltaic power ultra-short-term prediction method based on iTransformer according to claim 5, characterized in that: The projection layer module is composed of a multi-layer perceptron MLP, which is used to perform nonlinear mapping output on the multivariate labels processed by the encoder module.

7. The photovoltaic power ultra-short-term prediction method based on iTransformer according to claim 6 is characterized by: The photovoltaic power ultra-short-term prediction is based on a training set and is evaluated through a test set, using evaluation indicators including mean square error (MSE), root mean square error (RMSE) and / or mean absolute error (MAE).

8. A photovoltaic power ultra-short-term prediction system using an iTransformer-based photovoltaic power ultra-short-term prediction method as described in any one of claims 1 to 7, characterized in that include: Weather data collection and processing module: used to collect weather data related to photovoltaic power, including light intensity, temperature, cloud cover, wind speed and humidity; pre-process the collected weather data, including data cleaning, time interpolation and space interpolation, to generate a standardized weather data format; Feature construction module: used to generate incremental features, statistical features and time-varying features based on processed weather data as input for subsequent models; iTransformer model modules: Includes the following submodules: Input embedding module: used to input weather characteristics and PV output time series into the model and generate embedding tags; Encoder module: uses a multi-head attention mechanism to calculate the attention distribution value of multivariate data and perform deep feature mining; Projection layer module: nonlinearly maps the multivariate labels output by the encoder and outputs the photovoltaic power prediction results; Model training module: The iTransformer model is trained using a training set containing measured PV output time series data and processed weather characteristic data, and is corrected using numerical weather forecast data and data provided by public meteorological services; Photovoltaic power prediction module: used to perform ultra-short-term prediction of photovoltaic power based on the trained iTransformer model.

9. The photovoltaic power ultra-short-term prediction system according to claim 8, characterized in that: The weather data collection and processing module performs data cleaning, time interpolation and space interpolation in the following ways: Data cleaning: Remove invalid or abnormal data caused by equipment failure or data transmission errors, and use mean filtering and threshold setting to process abnormal values; Time interpolation: Linear interpolation is used to fill missing values ​​in time series data; Spatial interpolation: Use the inverse distance weighted interpolation method to fill in the missing values ​​of spatially distributed data; The incremental features, statistical features and time-varying features generated by the feature construction module include: Incremental feature: represents the changing trend of weather data within the offset time; Statistical characteristics: measure the degree of fluctuation of meteorological data within the time window, including mean, standard deviation and maximum value; Time-varying characteristics: describe the changing characteristics of photovoltaic output at different time scales, including the average output characteristics of minutes and hours.

10. The photovoltaic power ultra-short-term prediction system according to claim 9, characterized in that: The input embedding module labels the weather characteristics and photovoltaic output time series through embedding operations. The calculation formula is: Where: X is the input matrix including weather characteristics and photovoltaic output time series; Embedding tags for weather characteristics and photovoltaic output time series; Embedding is the embedding operation function; The encoder module calculates the attention distribution value by adopting the multi-head attention mechanism, and the calculation formula is: in, ; is the query matrix; ; is the key matrix; ; is the value matrix; ; is the parameter vector; and are the dimensions of keys and values; is the dimension of the input; is the activation function; is the connection function; is the attention distribution value; is the multi-head attention distribution value; For the Attention distribution value; The projection layer module consists of a multi-layer perceptron (MLP) to output the multivariate labels processed by the encoder module through nonlinear mapping.

Citation Information

Patent Citations

  • Short-term photovoltaic power generation power prediction method, system and equipment based on similar weather discovery and medium

    CN118213987A

Cited By

  • Photovoltaic power prediction method and system based on KAN

    CN119482456A

  • A Photovoltaic Power Prediction Method and System Based on KAN

    CN119482456B

  • Photovoltaic equipment automatic operation and maintenance management system and method based on computer vision

    CN120238050A

  • Seamless fine forecasting method, device and equipment for marine meteorology of offshore wind plant and medium

    CN120450166A

  • Indoor environment data prediction method and system based on LSTM-iTransform

    CN120744481A