Distributed photovoltaic power prediction method, device, equipment and medium

Through gridded geospatial modeling and spatiotemporal Transformer model, the problem of unmodeled collaborative relationships in multi-site photovoltaic power forecasting is solved, and high-precision and stable distributed photovoltaic power forecasting is achieved.

CN120675068APending Publication Date: 2025-09-19STATE GRID BEIJING ELECTRIC POWER CO +1

Patent Information

Application Number
CN202510882406.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing distributed photovoltaic power prediction technology is unable to perform multi-site collaborative predictions. It lacks high-resolution spatiotemporal data in a unified format and cannot fully model the collaborative relationship between distributed sites, affecting prediction accuracy and stability.

Method used

Gridded geographic spatial modeling is used to map the geographic location information of photovoltaic power stations to spatial grid cells, integrate multi-source information within the grid, and use the spatiotemporal Transformer model to extract temporal dependency and spatial correlation information to construct a unified spatiotemporal feature representation.

Benefits of technology

By introducing the spatiotemporal Transformer model, the accuracy and stability of multi-site joint predictions are significantly improved, the model's interpretability and perception of regional spatial structure are enhanced, and its generalization and adaptability to new environments are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675068A_ABST
    Figure CN120675068A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of photovoltaic power prediction, and particularly relates to a distributed photovoltaic power prediction method, which comprises the following steps of: acquiring multi-source information of a plurality of photovoltaic power stations; constructing a gridding geographic space model based on the collected geographic position information; mapping the geographic position information of each photovoltaic power station to a corresponding space grid unit; for each space grid unit, fusing multi-source information of all photovoltaic stations in the grid, and constructing grid-level multi-source features including meteorological features, power features and geographic position features; and the grid-level multi-source features are inputted into a space-time Transform model which is already trained, and the space-time Transform model outputs a photovoltaic power prediction value. According to the method, the photovoltaic power prediction value of the target at the future moment is obtained through joint modeling of the time sequence dependence and the spatial relationship, so that the prediction precision and stability of the future power change trend of the distributed photovoltaic power station are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of photovoltaic power prediction, and specifically relates to a distributed photovoltaic power prediction method, device, equipment and medium based on a spatiotemporal Transformer model and gridded geographic space modeling. Background Art

[0002] Distributed photovoltaic power forecasting plays a vital role in achieving energy transition and ensuring stable grid operation. Current forecasting technologies include statistical models, machine learning, and deep learning. However, existing distributed photovoltaic forecasting technologies suffer from deficiencies in data quality and standardization. In particular, multi-site collaborative forecasting lacks high-resolution, uniformly formatted spatiotemporal data, making it impossible to uniformly calculate photovoltaic power across multiple sites. This computationally intensive approach also relies on single-point data, failing to fully model the collaborative relationships between distributed sites and neglecting spatial correlation and global synergy, thus compromising forecast accuracy and stability.

[0003] A Chinese invention with publication number CN116523145A provides a prediction method, which adds a time dimension to the one-dimensional feature data of the original historical data of the photovoltaic station to transform it into two-dimensional feature image data, and uses this as a training set to train a model based on a densely connected network structure to obtain an ultra-short-term photovoltaic power prediction model; future meteorological and load data are processed according to the same preprocessing method and input into the prediction model to obtain a power prediction value at a certain point in the future. However, this method only predicts the power of one site and cannot perform collaborative prediction of multiple sites. Summary of the Invention

[0004] The purpose of the present invention is to provide a distributed photovoltaic power prediction method, device, equipment and medium to solve the problem in the background technology that unified calculation cannot be performed between multiple sites, resulting in a large amount of calculation.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a distributed photovoltaic power prediction method, comprising: Collecting multi-source information of multiple photovoltaic power plants, the multi-source information including power data, meteorological data and corresponding geographic location information; Based on the collected geographic location information, a gridded geographic spatial model is constructed; the geographic location information of each photovoltaic power station is mapped to the corresponding spatial grid unit; For each spatial grid unit, the multi-source information of all photovoltaic sites in the grid is integrated to construct a grid-level multi-source feature that includes meteorological characteristics, power characteristics, and geographical location characteristics; The grid-level multi-source features are input into a trained spatiotemporal Transformer model, which outputs a photovoltaic power prediction value.

[0006] The spatiotemporal Transformer model includes: Input embedding layer: used to encode the meteorological features and power features in the grid-level multi-source features into a time feature vector sequence in the time dimension, encode the geographic location information features into a spatial feature vector sequence in the spatial dimension, and concatenate the time feature vector sequence and the spatial feature vector sequence to form a spatiotemporal feature vector sequence; Transformer encoder: It is used to extract the temporal dependency and spatial correlation information of the spatiotemporal feature vector sequence and generate a high-dimensional feature representation that integrates the temporal dependency and spatial correlation information; Spatiotemporal interaction module: used to generate spatiotemporal feature representations of future moments based on high-dimensional feature representations; Output layer: used to map the spatiotemporal feature representation of future moments into photovoltaic power prediction values ​​and output the photovoltaic power prediction values.

[0007] Preferably, in the spatiotemporal Transformer model, the processing steps of the input embedding layer are: The meteorological characteristics and power characteristics in the same grid are encoded into a time feature vector sequence in the time dimension according to the time step; Embed positional encoding in the sequence of temporal feature vectors in the time dimension; Encode geographic features into a sequence of spatial feature vectors in the spatial dimension through the embedding layer; The time feature vector sequence and the space feature vector sequence in the same grid are spliced ​​in the feature dimension to form a time-space feature vector sequence.

[0008] Preferably, in the spatiotemporal Transformer model, the processing steps of the Transformer encoder are: Perform linear projection on the eigenvectors in the input spatiotemporal eigenvector sequence to generate query matrix, key matrix, and value matrix; Split the query matrix, key matrix, and value matrix into multiple heads and calculate the self-attention score of each head; Calculate the output of all heads based on the self-attention score, and concatenate the outputs of all heads along the time dimension and spatial dimension to obtain the concatenated result; The concatenation result is mapped to a high-dimensional feature representation as the output of the Transformer encoder.

[0009] Preferably, in the spatiotemporal Transformer model, the processing steps of the spatiotemporal interaction module are: The high-dimensional feature representation is transformed nonlinearly through the forward fully connected network FNN to obtain the nonlinear features of the high-dimensional feature representation; The nonlinear features are connected to the high-dimensional feature representation residuals and stabilized by layer normalization to obtain the spatiotemporal feature representation of future moments.

[0010] Preferably, in the spatiotemporal Transformer model, the processing steps of the output layer are: The spatiotemporal feature representation of the future moment is mapped through the weight matrix to obtain the photovoltaic power prediction value, and the photovoltaic power prediction value is output.

[0011] Preferably, the training method of the spatiotemporal Transformer model is: Collect historical power, historical meteorological data and geographical data of photovoltaic power plants; Filter out normal historical power and historical meteorological data and remove abnormal data; Processing the filtered historical power, historical meteorological data and geographical data into a historical spatiotemporal feature vector sequence; Initialize the hidden state of the spatiotemporal Transformer model to 0 and randomly initialize the weights of the spatiotemporal Transformer model; Based on the historical spatiotemporal feature vector sequence, it is input into the spatiotemporal Transformer model for training to obtain the predicted output feature vector sequence, which is used to generate the power prediction result; Calculate the gap between the predicted power and the actual historical power, optimize the model based on the loss function, and adjust the model parameters through backpropagation to minimize the loss; If the loss function does not reach the predetermined convergence standard, continue training and optimizing the model and adjust the parameters; If the spatiotemporal Transformer model converges, that is, the loss function value no longer decreases significantly, it is considered that the model has achieved a good fitting effect.

[0012] Preferably, the prediction method of the spatiotemporal Transformer model includes: After training is complete and converged, the collected real-time meteorological data, real-time power, and geographic location information are used as input to predict the photovoltaic power at future moments through the trained spatiotemporal Transformer model. Continuously collect the actual power values ​​at the corresponding time in the future and calculate the mean square error between the predicted power and the actual power; If the prediction error of the spatiotemporal Transformer model increases during long-term operation, data should be collected again and the spatiotemporal Transformer model should be retrained to improve the prediction accuracy of the model.

[0013] A second aspect of the present invention provides a distributed photovoltaic power prediction device, comprising: A collection module, configured to collect multi-source information from multiple photovoltaic power plants, including power data, meteorological data, and corresponding geographic location information; The grid module is used to build a gridded geographic spatial model based on the collected geographic location information; the geographic location information of each photovoltaic power station is mapped to the corresponding spatial grid unit; The feature processing module integrates the multi-source information of all photovoltaic sites in each spatial grid unit to construct a grid-level multi-source feature that includes meteorological characteristics, power characteristics, and geographical location characteristics; The prediction module inputs the grid-level multi-source features into a trained spatiotemporal Transformer model, and the spatiotemporal Transformer model outputs a photovoltaic power prediction value.

[0014] According to a third aspect of the present invention, an electronic device is provided, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the distributed photovoltaic power prediction method.

[0015] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the distributed photovoltaic power prediction method is implemented.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: Unlike traditional methods based solely on single-point time series modeling, this method integrates photovoltaic power, meteorological information, and geographic location information to construct a unified spatiotemporal feature representation. By introducing the spatiotemporal Transformer model to model temporal dependence and spatial synergy, it achieves multi-site joint prediction, effectively improving overall prediction accuracy and model stability within the region. By introducing a self-attention mechanism to dynamically model spatiotemporal sequences, the model can explicitly identify the weighted contributions of each input feature and time point to the prediction results, enhancing model interpretability and addressing the difficulties of understanding and optimizing traditional black-box time series models. This provides a decision-making basis for subsequent operations, maintenance, and control. This paper adopts a gridded geospatial modeling strategy, mapping each photovoltaic site onto a regular spatial grid, establishing adjacency relationships between grids, and introducing a graph embedding mechanism to model spatial correlations. Compared to traditional modeling methods that cannot utilize information about neighboring sites, this approach significantly improves the model's ability to perceive regional spatial structure and generalize to new environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings: Figure 1 This is a flow chart of a distributed photovoltaic power prediction method according to embodiment 1 of the present invention; Figure 2 This is a structural block diagram of a distributed photovoltaic power prediction device according to an embodiment of the present invention; Figure 3 This is a structural block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0018] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0019] The following detailed description is an exemplary description, which is intended to provide further detailed description of the present invention. Unless otherwise indicated, all technical terms used in the present invention have the same meaning as those generally understood by those skilled in the art. The terms used in the present invention are only for describing specific embodiments, and are not intended to limit the exemplary embodiments according to the present invention.

[0020] Example 1 like Figure 1 As shown, the distributed photovoltaic power prediction method includes: S1. Collect multi-source information from multiple photovoltaic power stations, including power data, meteorological data, and corresponding geographic location information, including: Power acquisition: Collect historical power output data from multiple PV sites at a preset time step (15 minutes). This power data is acquired and synchronously recorded through a real-time monitoring system to form a power time series with a unified time step, which is used to construct the historical input features of the model. Meteorological data collection: Collect meteorological data related to photovoltaic power generation, including solar radiation, temperature, and wind speed. Data sources can include ground meteorological stations, numerical weather forecasts (NWP), and satellite remote sensing data to ensure comprehensive and accurate meteorological data coverage; Geographic location information collection: The geographic location information (latitude and longitude of the photovoltaic site), terrain data (slope), and altitude of the photovoltaic site are collected to provide spatial background information and capture power changes caused by regional differences, which helps to evaluate the impact of geographical differences on photovoltaic power output.

[0021] S2. Based on the geographic location information of each photovoltaic power station, a gridded geographic spatial model with a fixed spatial resolution is constructed, and each photovoltaic power station is mapped to the corresponding spatial grid unit according to the latitude and longitude coordinates, including: Spatial division: The geographical area where the PV site is located is divided into uniform 1km×1km grid cells. Each grid cell represents a geographical area and provides a unified spatial reference for subsequent data processing.

[0022] Grid data mapping: Map the geographic location information and meteorological data of each photovoltaic site to the corresponding grid cell to ensure the spatial consistency of the data, so that each grid contains relevant spatial and meteorological characteristics; Missing value filling: Missing power and meteorological data are filled. For missing values ​​in a short time period, linear interpolation is used to smooth the data using data from adjacent moments. For missing values ​​in a long time period or a large range, a historical mean filling strategy is introduced to fill the missing content with reference to the historical average value of the same period to maintain the overall trend consistency of the time series.

[0023] Data cleaning: Combining missing rate control with outlier detection, we remove noise and unreasonable data points to improve data reliability. To ensure data quality, we set a missing rate control mechanism. When the missing rate of a site or feature dimension exceeds a preset threshold (30%), it will be removed from the training set.

[0024] Data standardization: To eliminate the impact of data of different physical dimensions on model training, meteorological and power data are standardized. Specific methods include Z-score standardization to improve the model's convergence speed and prediction accuracy.

[0025] Time synchronization: Power data, meteorological data, and geographic location information are aligned to a unified time scale, using a 15-minute synchronization interval to ensure consistency and alignment of multi-source data in the time dimension, facilitating the construction of continuous time series feature input.

[0026] S3. For each spatial grid unit, integrate the multi-source information of all photovoltaic sites in the grid to construct a grid-level multi-source feature that includes meteorological characteristics, power characteristics, and geographical location characteristics; Meteorological data summarization: Summarize or compile statistics on meteorological data within each grid cell to provide spatial characteristics for subsequent modeling and ensure the spatial consistency and reliability of meteorological data; Spatial feature extraction: Extract spatial features highly correlated with photovoltaic power generation from each grid cell, such as solar radiation, temperature, and wind speed, as important input features for constructing the spatiotemporal Transformer model to model the impact of environmental factors on photovoltaic output; Geographic feature processing: Based on the geographic location of the photovoltaic site, static geographic features such as terrain type, altitude, and slope are extracted to enhance the model's ability to perceive changes in terrain and improve the accuracy of the spatiotemporal Transformer model's predictions. Feature selection: Through correlation analysis, we select spatial features closely related to photovoltaic power generation, remove redundant or noisy features, reduce model complexity, and improve training convergence speed and prediction accuracy.

[0027] S4. Inputting the grid-level multi-source features into the trained spatiotemporal Transformer model, wherein the spatiotemporal Transformer model outputs a photovoltaic power prediction value; The spatiotemporal Transformer model includes: Input embedding layer: This layer encodes the meteorological features and power data in the grid-level multi-source features into a temporal feature vector sequence in the time dimension, encodes the geographic location information into a spatial feature vector sequence in the spatial dimension, and concatenates the temporal feature vector sequence and the spatial feature vector sequence to form a spatiotemporal feature vector sequence as the input to the Transformer. Specifically, the meteorological characteristics and power characteristics in the same grid are linearly projected to obtain the time feature vector sequence X t ; Time feature vector sequence X t Each time step in t The corresponding position information PositionalEncoding(t) is embedded. This position encoding is used to characterize the sequential position of each time step in the entire sequence, thereby improving the model's ability to model temporal dependencies.

[0028] PE(t,2i)= ; PE(t,2i+1)= ; Among them, i is the position dimension corresponding to the i-th position, d model The total dimension of the position encoding; Linear projection and position coding embedding are performed on meteorological features and power features in the same grid to obtain a time feature vector sequence fused with position information. H t : ; Embed the geographic features to obtain the spatial feature vectors of each grid: ; Among them, G is the geographic spatial characteristics of each grid, including latitude and longitude, altitude, and terrain; The spatial feature vector sequence and the temporal feature vector sequence of the same grid are concatenated to obtain the spatiotemporal feature vector sequence: ; This feature splicing helps the model understand and capture the spatiotemporal variations in photovoltaic power generation, enabling the spatiotemporal Transformer model to simultaneously model time and space dimension information, thereby improving overall prediction accuracy.

[0029] Transformer encoder: used to model the input spatiotemporal feature vector sequence, extract the temporal dependency and spatial correlation information, and thus obtain a high-dimensional feature representation that integrates the temporal dependency and spatial correlation information; Specifically, linear projection is performed on the spatiotemporal feature vector sequence to generate the query matrix at time t , key matrix , value matrix , calculated as: = , , ; in, , , is the learnable parameter matrix; The query matrix , key matrix , value matrix Divide into multiple heads and calculate the self-attention score of each head: ; Calculate each head based on the self-attention score The output: ; Concatenate the outputs of all heads along the feature dimension to get the concatenated result: O concat =Concat( 1 ,O 2 ,…,O h ) ; Among them, h is the number of heads to be segmented, O h is the output of the h-th head; Map the splicing results to obtain high-dimensional feature representation As the output of the Transformer encoder: =O concat W O ; in, is the output mapping matrix.

[0030] Spatiotemporal interaction module: used to generate spatiotemporal feature representations of future moments based on high-dimensional feature representations; Specifically, through the forward fully connected network FNN Perform nonlinear transformation to obtain The nonlinear characteristics of: ; in, W 1 is the weight matrix of the first linear transformation, W 2The second linearly changing weight matrix, b 1 is the first linearly changing bias term, b 2 is the second linearly changing bias term; Then the nonlinear characteristics and Residual connections and layer normalization to stabilize training: =LayerNorm( ); It is the output feature value of the Transformer encoder, that is, the feature representation generated by the spatiotemporal interaction module, which contains temporal dependency and spatial association information.

[0031] Output layer: The output layer converts the output of the spatiotemporal interaction module Mapped to the final photovoltaic power prediction value y pred , calculated as follows; y pred =W out Z t ’’+b out in, W out is the weight matrix used to transform the output features of Transformer Z t ’’ Mapping to the predicted value space; b out is a bias term, which is a trainable bias parameter used to make the model more expressive.

[0032] As a preferred example of the above embodiment, the training method of the spatiotemporal Transformer model is: (1) Data collection: Collect historical power, historical meteorological data and geographic location information of photovoltaic power stations; Filter out abnormal values ​​and retain normal historical power and historical meteorological data; Based on the filtered historical power, historical meteorological data, and geographical data, historical spatiotemporal sequence features and static geographical features are constructed as input data for spatiotemporal Transformer model training. (2) Input data: Initialize the hidden state of the spatiotemporal Transformer model to 0 and randomly initialize the model parameters; Embed historical spatiotemporal sequence features and static geographic features into learnable input representations respectively; The above input representation is fed into the spatiotemporal Transformer model for forward calculation to obtain the predicted power value. (3) Model training The loss is calculated using the mean squared error (MSE) between the predicted power and the true historical power; Backpropagate based on the loss and update the model parameters; If the current loss does not reach the preset convergence standard, continue training iterations; If the loss function tends to be stable and no longer decreases significantly, the model is considered to have converged and the training is completed, and the trained spatiotemporal Transformer model is obtained. (4) Model evaluation After model training is complete and converged, the spatiotemporal Transformer model is deployed for future power forecasting. Parameter updates are no longer performed at this stage. Instead, the trained model uses real-time meteorological data (temperature, radiation, wind speed), real-time photovoltaic power data, and geographic location information as inputs to perform inference and forecasting of future power.

[0033] The system also continuously records the actual power values ​​at the corresponding time to evaluate the model's actual prediction results. The accuracy and robustness of the model in practical applications are measured by calculating metrics such as the mean squared error (MSE) between the predicted and true values.

[0034] ; in, is the predicted value at time t, is the true value at time t, and N is the total number of samples.

[0035] If the performance of the spatiotemporal Transformer model degrades or the prediction error increases during long-term operation, data can be recollected and the model retrained to maintain its prediction performance.

[0036] Historical power and meteorological data capture long-term trends and short-term cyclical changes in time series. By analyzing historical data, patterns in power variation can be identified. For example, diurnal and seasonal fluctuations in photovoltaic power can be automatically learned and predicted using time series methods.

[0037] As a preferred method of the above embodiment, the Adam optimization algorithm is used to iteratively train the spatiotemporal Transformer model. Through the gradient update mechanism based on backpropagation, the loss function between the predicted output and the true power value is minimized, thereby improving the fitting accuracy and generalization performance of the model in the multi-time-step photovoltaic power prediction task.

[0038] As a preferred example of the above embodiment, the hyperparameters (learning rate, number of layers, hidden layer dimension) of the spatiotemporal Transformer model are adjusted to optimize model performance and ensure efficient convergence during training.

[0039] As a preferred example of the above embodiment, a cross-validation method is used to evaluate the performance of different hyperparameter configurations to find the optimal hyperparameter combination and ensure the generalization ability of the spatiotemporal Transformer model.

[0040] As a preferred example of the above embodiment, the Dropout method is used to control the overfitting of the spatiotemporal Transformer model, ensure the balanced performance of the spatiotemporal Transformer model on the training set and the test set, and improve the generalization ability of the spatiotemporal Transformer model.

[0041] As a preferred example of the above embodiment, the trained spatiotemporal Transformer model is used to predict photovoltaic power in the future, and the prediction results are compared with the actual observation data to evaluate the accuracy and robustness of the prediction results.

[0042] As a preferred example of the above embodiment, the trained spatiotemporal Transformer model can be applied to a test set to perform point-by-point predictions of photovoltaic power at multiple preset time steps (every 15 minutes) in the future. This is done to evaluate the model's generalization performance and prediction accuracy under different data distribution conditions.

[0043] As a preferred example of the above-mentioned embodiment, the spatiotemporal Transformer model can be used to generate photovoltaic power forecasts at multiple fixed time steps in the future. This model is suitable for short-term (e.g., one hour into the future) or medium-term (e.g., three hours into the future) time series forecasting scenarios, providing data support for subsequent system evaluation and scheduling optimization.

[0044] As a preferred example of the above embodiment, the trained spatiotemporal Transformer model can be deployed in an actual photovoltaic power station or grid management system to achieve real-time prediction of photovoltaic power, thereby supporting load scheduling, energy storage control and optimized operation of photovoltaic power generation in smart grids.

[0045] As a preferred example of the above embodiment, the spatiotemporal Transformer model can be exported and converted into a deployment format suitable for real-time applications (ONNX, TensorRT) to ensure that it can run efficiently and stably on multiple hardware platforms (embedded devices, edge servers, etc.).

[0046] As a preferred example of the above embodiment, the spatiotemporal Transformer model can be deployed in edge computing devices or local servers to achieve rapid prediction of real-time data, reduce response delays, and improve the real-time application efficiency of the system in distributed scenarios.

[0047] As a preferred example of the above embodiment, power data and meteorological data (temperature, radiation, wind speed) of the photovoltaic site are collected in real time through sensors, weather stations and other equipment, and transmitted to the spatiotemporal Transformer model through IoT devices or data acquisition systems.

[0048] As a preferred example of the above embodiment, the real-time photovoltaic power prediction achieved through the spatiotemporal Transformer model can provide a scientific and accurate decision-making basis for the operation management and scheduling of photovoltaic power stations.

[0049] As a preferred example of the above embodiment, based on the prediction results output by the model, the system can assist the power grid in making key decisions such as load scheduling and energy storage resource allocation, further improving the operational stability of the power grid and the efficient utilization of photovoltaic energy.

[0050] Example 2 like Figure 2 As shown, based on the same inventive concept as the above embodiment, the present invention also provides a distributed photovoltaic power prediction device, comprising: The acquisition module is used to collect power data, meteorological data and geographic location information of each photovoltaic power station, and convert the collection results into a structured format data stream and output it to the feature processing module; The grid module is used to build a gridded geographic spatial model and map each photovoltaic power station to the corresponding spatial grid unit based on the geographic location information; The feature processing module is used to construct a grid-level multi-source feature set, that is, to fuse and process time series and spatial structure features to provide a unified input tensor for the model; The prediction module is used to input grid-level multi-source features into the trained spatiotemporal Transformer model and output the photovoltaic power prediction value at the target future time.

[0051] Example 3 like Figure 2 As shown, the present invention also provides an electronic device 100 for implementing a distributed photovoltaic power prediction method; The electronic device 100 includes a memory 101 , at least one processor 102 , a computer program 103 stored in the memory 101 and executable on the at least one processor 102 , and at least one communication bus 104 .

[0052] The memory 101 may be used to store a computer program 103 . The processor 102 implements the steps of the distributed photovoltaic power prediction method of Example 1 by running or executing the computer program stored in the memory 101 and calling the data stored in the memory 101 .

[0053] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the electronic device 100. In addition, the memory 101 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device.

[0054] The at least one processor 102 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 102 may be a microprocessor or any conventional processor. The processor 102 is the control center of the electronic device 100 and connects various parts of the entire electronic device 100 using various interfaces and lines.

[0055] The memory 101 in the electronic device 100 stores multiple instructions to implement a distributed photovoltaic power prediction method, and the processor 102 can execute the multiple instructions to implement: Collect historical power data, meteorological data and corresponding geographical location information of multiple photovoltaic power stations at preset time steps; Based on the collected geographic location information, a unified gridded geographic spatial model is constructed, and the coordinate information of each photovoltaic power station is mapped to the corresponding spatial grid unit to form a site grouping structure based on geographical division; For each spatial grid unit, the multi-source information of all photovoltaic sites within the grid is integrated to construct a grid-level spatiotemporal feature vector sequence containing time series meteorological characteristics, historical power characteristics, and static geographical characteristics. The constructed grid-level spatiotemporal feature vector sequence is input into the trained spatiotemporal Transformer model, which jointly models the temporal dependency and spatial correlation and outputs the photovoltaic power prediction value corresponding to the future target time.

[0056] Example 4 If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. Computer-readable media may include: any entity or device that can carry computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory and read-only memory (ROM, Read-Only Memory).

[0057] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0058] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0059] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0060] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0061] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

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

Claims

1. A distributed photovoltaic power prediction method, characterized in that: include: Collecting multi-source information of multiple photovoltaic power plants, the multi-source information including power data, meteorological data and corresponding geographic location information; Based on the collected geographic location information, a gridded geographic spatial model is constructed; the geographic location information of each photovoltaic power station is mapped to the corresponding spatial grid unit; For each spatial grid unit, the multi-source information of all photovoltaic sites in the grid is integrated to construct a grid-level multi-source feature that includes meteorological characteristics, power characteristics, and geographical location characteristics; Inputting the grid-level multi-source features into a trained spatiotemporal Transformer model, wherein the spatiotemporal Transformer model outputs a photovoltaic power prediction value; The spatiotemporal Transformer model includes: Input embedding layer: used to encode the meteorological features and power features in the grid-level multi-source features into a time feature vector sequence in the time dimension, encode the geographic location information features into a spatial feature vector sequence in the spatial dimension, and concatenate the time feature vector sequence and the spatial feature vector sequence to form a spatiotemporal feature vector sequence; Transformer encoder: It is used to extract the temporal dependency and spatial correlation information of the spatiotemporal feature vector sequence and generate a high-dimensional feature representation that integrates the temporal dependency and spatial correlation information; Spatiotemporal interaction module: used to generate spatiotemporal feature representations of future moments based on high-dimensional feature representations; Output layer: used to map the spatiotemporal feature representation of future moments into photovoltaic power prediction values ​​and output the photovoltaic power prediction values.

2. The distributed photovoltaic power prediction method according to claim 1, characterized in that: In the spatiotemporal Transformer model, the processing steps of the input embedding layer are: The meteorological characteristics and power characteristics in the same grid are encoded into a time feature vector sequence in the time dimension according to the time step; Embed positional encoding in the sequence of temporal feature vectors in the time dimension; Encode geographic features into a sequence of spatial feature vectors in the spatial dimension through the input embedding layer; The time feature vector sequence and the space feature vector sequence in the same grid are spliced ​​in the feature dimension to form a time-space feature vector sequence.

3. The distributed photovoltaic power prediction method according to claim 2, characterized in that: In the spatiotemporal Transformer model, the processing steps of the Transformer encoder are: Perform linear projection on the eigenvectors in the input spatiotemporal eigenvector sequence to generate query matrix, key matrix, and value matrix; Split the query matrix, key matrix, and value matrix into multiple heads and calculate the self-attention score of each head; Calculate the output of all heads based on the self-attention score, and concatenate the outputs of all heads along the time dimension and spatial dimension to obtain the concatenated result; The concatenation result is mapped to a high-dimensional feature representation as the output of the Transformer encoder.

4. The distributed photovoltaic power prediction method according to claim 3, characterized in that: In the spatiotemporal Transformer model, the processing steps of the spatiotemporal interaction module are as follows: The high-dimensional feature representation is transformed nonlinearly through the forward fully connected network FNN to obtain the nonlinear features of the high-dimensional feature representation; The nonlinear features are connected to the high-dimensional feature representation residuals and stabilized by layer normalization to obtain the spatiotemporal feature representation of future moments.

5. The distributed photovoltaic power prediction method according to claim 4, characterized in that: In the spatiotemporal Transformer model, the processing steps of the output layer are: The spatiotemporal feature representation of the future moment is mapped through the weight matrix to obtain the photovoltaic power prediction value, and the photovoltaic power prediction value is output.

6. The distributed photovoltaic power prediction method according to claim 1, characterized in that: The training method of the spatiotemporal Transformer model is: Collect historical power, historical meteorological data and geographic location information of photovoltaic power stations; Filter out normal historical power and historical meteorological data and remove abnormal data; Processing the filtered historical power, historical meteorological data and geographical data into a historical spatiotemporal feature vector sequence; Initialize the hidden state of the spatiotemporal Transformer model to 0 and randomly initialize the weights of the spatiotemporal Transformer model; Based on the historical spatiotemporal feature vector sequence, it is input into the spatiotemporal Transformer model for training to obtain the predicted output feature vector sequence, which is used to generate the power prediction result; Calculate the gap between the predicted power and the actual historical power, optimize the model based on the loss function, and adjust the model parameters through backpropagation to minimize the loss; If the loss function does not reach the predetermined convergence standard, continue training and optimizing the model and adjust the parameters; If the spatiotemporal Transformer model converges, that is, the loss function value no longer decreases significantly, it is considered that the model has achieved a good fitting effect.

7. The distributed photovoltaic power prediction method according to claim 6, characterized in that: The prediction method of the spatiotemporal Transformer model includes: After training is completed and converged, the collected real-time meteorological data, real-time power and geographic location information are used as input to predict the photovoltaic power at future moments through the trained spatiotemporal Transforme model; Continuously collect the actual power values ​​at the corresponding time in the future and calculate the mean square error between the predicted power and the actual power; If the prediction error of the spatiotemporal Transformer model increases during long-term operation, data should be collected again and the spatiotemporal Transformer model should be retrained to improve the prediction accuracy of the model.

8. A distributed photovoltaic power prediction device, characterized in that: include: A collection module, configured to collect multi-source information from multiple photovoltaic power plants, including power data, meteorological data, and corresponding geographic location information; The grid module is used to build a gridded geographic spatial model based on the collected geographic location information; the geographic location information of each photovoltaic power station is mapped to the corresponding spatial grid unit; The feature processing module integrates the multi-source information of all photovoltaic sites in each spatial grid unit to construct a grid-level multi-source feature that includes meteorological characteristics, power characteristics, and geographical location characteristics; The prediction module inputs the grid-level multi-source features into a trained spatiotemporal Transformer model, and the spatiotemporal Transformer model outputs a photovoltaic power prediction value.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the distributed photovoltaic power prediction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the distributed photovoltaic power prediction method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Photovoltaic power ultra-short-term prediction method and device, computer equipment and storage medium

    CN116523145A

Cited By

  • Photovoltaic power prediction method and device based on fine tuning meteorological large model

    CN121012017A

  • Energy storage power station production control method based on market environment

    CN121332645A

  • Regional distributed photovoltaic power prediction method and system based on multivariate data cross-modal fusion

    CN121637430A

  • Regional distributed photovoltaic power prediction method and system based on multi-element data cross-modal fusion

    CN121637430B

  • Optimized scheduling method and system considering traction network resources, and electronic equipment

    CN122118943A