Distributed photovoltaic power prediction method, device and system, and storage medium
Through the Solar-LLM distributed photovoltaic power prediction model, using historical data and correlation analysis, the limitations of traditional prediction methods in dealing with long sequence relationships and multi-dimensional data correlation are solved, and more accurate distributed photovoltaic power prediction is achieved, supporting more scientific power system scheduling.
Patent Information
- Application Number
- CN202411425011.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-28
AI Technical Summary
The accuracy of distributed photovoltaic power prediction is affected by uncertain factors such as real-time illumination and cloud density. Traditional prediction methods have limitations in dealing with the correlation between long-sequence relationships and multi-dimensional data, making it difficult to provide more accurate power prediction.
The Solar-LLM distributed photovoltaic power prediction model is adopted. This model uses the historical data set of photovoltaic power stations, performs preprocessing and correlation analysis, and uses data slicing, data embedding, prompt prefix, large model prediction and output mapping units to build a distributed photovoltaic power prediction model to realize the prediction of future photovoltaic output data.
Through the Solar-LLM model, distributed photovoltaic power can be predicted more accurately, helping power system scheduling and resource regulation, and improving prediction accuracy and reliability.
Smart Images

Figure CN119543100A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of load forecasting, and in particular relates to a distributed photovoltaic power forecasting method and device, a system, and a storage medium. Background Art
[0002] With the transformation of the global energy structure and the rapid development of renewable energy, distributed photovoltaic power generation, as a clean and sustainable form of energy, is gaining increasing attention. While the large-scale grid connection of photovoltaic power promotes the goal of "carbon peak and carbon neutrality" and improves energy efficiency, it also brings challenges to the stable operation of the power grid. In this context, the research and application of photovoltaic prediction technology is of great significance.
[0003] The goal of distributed photovoltaic forecasting is to use historical data, light intensity, site data and other related data to predict future photovoltaic output power. For short-term forecasts, the time step is usually within the next few hours to a few days. Accurate power forecasts help power market players make better decisions, including adjusting bidding strategies and making spare capacity arrangements. However, the accuracy of distributed photovoltaic forecasts is affected by uncertain factors such as real-time light and cloud density. Traditional forecasting methods often rely on physical modeling or algorithmic prediction, which are limited in dealing with the correlation between long sequence relationships and multi-dimensional data. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a distributed photovoltaic power prediction method and device, system, and storage medium to provide more accurate power prediction, which is helpful for more scientific power system scheduling and resource regulation.
[0005] To achieve the above object, the present invention adopts the following technical solution:
[0006] A distributed photovoltaic power prediction method, comprising:
[0007] Step S1, obtaining a historical data set of a photovoltaic power station, the historical data set including historical light intensity, wind speed, humidity, and historical photovoltaic power data;
[0008] Step S2, preprocessing the historical data set of the photovoltaic power station to obtain a new data set;
[0009] Step S3: Obtaining a Solar-LLM distributed photovoltaic power prediction model based on the new data set;
[0010] Step S4: input the past photovoltaic power station data set into the Solar-LLM distributed photovoltaic power prediction model to predict future photovoltaic output data.
[0011] Preferably, in step S2, the regional factors and sequential factors of the historical data set of the photovoltaic power station are subjected to correlation analysis by using the Pearson correlation coefficient method to obtain a new data set.
[0012] Preferably, the Solar-LLM distributed photovoltaic power prediction model includes: a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit; wherein, through the data slicing unit, the data set after correlation analysis is sliced; through the data embedding unit, the time series sliced data is reconstructed and mapped to a high-dimensional feature space; through the large model prediction unit, the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit are spliced and input into the pre-trained LLM for prediction; through the output mapping unit, the LLM output result is mapped to the time series data output.
[0013] The present invention also provides a distributed photovoltaic power prediction device, comprising:
[0014] An acquisition module is used to acquire historical data sets of photovoltaic power plants, including historical light intensity, wind speed, humidity, and historical photovoltaic power data;
[0015] A preprocessing module is used to preprocess the historical data set of the photovoltaic power station to obtain a new data set;
[0016] A construction module is used to obtain a Solar-LLM distributed photovoltaic power prediction model based on a new data set;
[0017] The prediction module is used to input past photovoltaic power station data sets into the Solar-LLM distributed photovoltaic power prediction model to predict future photovoltaic output data.
[0018] Preferably, the preprocessing module performs correlation analysis on the regional factors and sequential factors of the historical data set of the photovoltaic power station by using the Pearson correlation coefficient method to obtain a new data set.
[0019] Preferably, the Solar-LLM distributed photovoltaic power prediction model includes: a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit; wherein, through the data slicing unit, the data set after correlation analysis is sliced; through the data embedding unit, the time series sliced data is reconstructed and mapped to a high-dimensional feature space; through the large model prediction unit, the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit are spliced and input into the pre-trained LLM for prediction; through the output mapping unit, the LLM output result is mapped to the time series data output.
[0020] The embodiment of the present invention performs distributed photovoltaic power prediction based on a large language model (Solar-LLM), specifically: first, the photovoltaic output time series data is subjected to correlation analysis according to regional factors and sequential factors to capture the relationship pattern of multivariate coupling in the data. Secondly, a Solar-LLM distributed photovoltaic prediction model is constructed, including: 1) constructing a data processing module to label and slice the input multivariate time series after normalization, and divide the multivariate time series into several univariate time series; 2) in the model embedding layer, the segmented time series data is converted into a continuous vector representation, and combined with the corresponding words in the frozen LLM corpus to form a vectorized small data set; 3) the vectorized data is input into a multi-head cross-attention mechanism to capture the features of different positions in the input data, realize modal alignment, and convert the prediction task into a language task that is easy for the large model to understand; 4) constructing a prompt prefix module to optimize the prompt words from three aspects: data set context, task instructions, and statistical description, and induce the model prediction ability. Finally, the distributed photovoltaic prediction value is output through the large model prediction technology, and the training data is used to train the Solar-LLM large model distributed photovoltaic prediction task to obtain a large model of distributed photovoltaic power prediction at a specific time scale. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0022] Figure 1 This is a flow chart of a distributed photovoltaic power prediction method according to an embodiment of the present invention;
[0023] Figure 2 A flowchart of the steps of data correlation analysis provided by an embodiment of the present invention;
[0024] Figure 3 A flow chart of the processing steps of a data slicing unit provided in an embodiment of the present invention;
[0025] Figure 4 A flow chart of the processing steps of a data embedding unit provided in an embodiment of the present invention;
[0026] Figure 5 A flow chart of the processing steps of the output mapping unit provided by an embodiment of the present invention;
[0027] Figure 6 A graph showing the prediction results for the next 15 minutes provided by an embodiment of the present invention;
[0028] Figure 7 A result graph of the prediction result for the next 1 hour period provided by an embodiment of the present invention;
[0029] Figure 8 This is a graph of the prediction results for the next 4 hours provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Embodiment 1:
[0033] like Figure 1 As shown, the present invention implements a distributed photovoltaic power prediction method, comprising:
[0034] Step S1: Obtain historical data sets of photovoltaic power plants
[0035] The original data set is constructed based on the data collected by the data collection device, including historical light intensity, wind speed, humidity, historical photovoltaic power and other data. The data selected in the embodiment of the present invention are derived from the real data set of five photovoltaic power stations in Hebei Province, China. The sampling time granularity of the distributed photovoltaic output data and other characteristic data from July 1, 2022 to November 30, 2022 is 15 minutes.
[0036] Step S2: Preprocessing the historical data set of the photovoltaic power station
[0037] According to the regional and sequential factors of the elements in the original data set, including regional factors such as meteorological factors (M) and geographical location (L), and historical data factors (H) and time factors (T), M includes air visibility (AV), temperature (T), humidity (H), light intensity (SI) and wind speed (WS); H includes historical photovoltaic power (HPV), historical electric power (HEP) and historical grid exchange power (HGEP), the Pearson correlation coefficient method is used to perform correlation analysis and obtain a new data set.
[0038] According to the Pearson correlation coefficient, each factor has a corresponding weight, and finally the prediction model is constructed by weighted summation:
[0039] Y initial =f(M,H,L,T)
[0040] Y final =ω 1 ·M+ω 2 ·H+ω 3 ·X+ω 4 ·T+ε
[0041] Among them, ω i is the weight of the corresponding factor, determined based on the Pearson correlation coefficient, and ∈ is the error term.
[0042] The Pearson correlation coefficient calculation formula is as follows:
[0043]
[0044] Table 1 shows the correlation of different influencing factors.
[0045] Table 1
[0046] Influencing factors <![CDATA[R i ]]> Influencing factors <![CDATA[R i ]]> temperature 0.536 Distance between adjacent sites 0.712 humidity -0.423 Historical photovoltaic power 0.793 Light intensity 0.921 Historical power consumption 0.217 Wind speed 0.161 Inverter efficiency 0.255 Air visibility 0.143 Historical grid exchange power 0.402
[0047] After correlation analysis, temperature, light intensity, distance to adjacent sites, and historical photovoltaic power data were selected as new data sets.
[0048] Step S3: Constructing Solar-LLM distributed photovoltaic power prediction model
[0049] The Solar-LLM distributed photovoltaic power prediction model includes a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit. The data slicing unit slices the data set after correlation analysis; the data embedding unit reconstructs the time series slice data and maps it to a high-dimensional feature space; the large model prediction unit splices the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit, and inputs them into the pre-trained LLM for prediction; the output mapping unit maps the LLM output result to the time series data output.
[0050] In the data slice unit, such as Figure 3 As shown, each input channel is instance normalized so that the time series data of each channel in each sample has zero mean and unit standard deviation, thereby alleviating the distribution shift problem of time series data in different time periods.
[0051] Specifically, define the input historical data X∈R N×T Contains T time step data of N-dimensional features, where R represents the real number domain; the time series data on each dimension of X is normalized, and the formula is as follows:
[0052]
[0053] Among them, x (i) ∈R 1×T represents the i-th dimension time series data, μ (i) and σ (i) They represent the mean and unit standard deviation of the time series data respectively, and γ and β are learnable normalization parameters.
[0054] After normalization, the sliding window technique is used to convert x (i) Divide into several time series slices The length of each time series slice is L. The time series data of each dimension is sliced and aligned to obtain the sliced data set X p ∈R N×P×L .
[0055] Data is embedded in cells, such as Figure 4 As shown, each time series block after slicing is passed through a multi-head cross-attention mechanism to find the corresponding mapping in the text set subset of LLM, capturing its features at different levels, and then reprogramming it to map it to the high-dimensional hidden layer features of LLM to align the modalities of time series data and natural language, thereby activating the understanding and reasoning ability of LLM.
[0056] Specifically, the time series slice data X p Mapping to high-dimensional space via linear layers where d m is the hidden feature dimension of the cross attention mechanism. For each head K = {1.....k}, define the query matrix
[0057] Key Matrix Sum Matrix in
[0058] d LLM is the hidden dimension of the LLM base model, K is the number of attention heads, Indicates rounding down; the time series slices are reconstructed using the cross attention mechanism. For the kth attention head, the calculation method is:
[0059]
[0060] Each head Splice and get Then Z is mapped through the linear layer to obtain the reconstructed data So that the feature dimension is equal to the LLM base model dimension d LLMBe consistent.
[0061] In the prompt prefix unit, the prompt prefix optimization technology is used to guide Solar-LLM to focus on specific tasks and data characteristics, and decompose the relevant data into context background, specific instructions, and statistical descriptions. Specifically, (1) Context background: including background information related to distributed photovoltaic power prediction, such as data source, collection frequency, geographical location and environmental conditions, etc. In the embodiment of the present invention, the following example can be made: "This data set comes from the historical power generation records of a photovoltaic power station in Hebei Province, China. The geographical location is 111.5 degrees east longitude and 38 degrees north latitude. The data collection frequency is every 15 minutes, and the power generation and corresponding meteorological factors in the past 5 months are recorded." (2) Task instructions: clarify the specific goals and requirements of LLM in the current task. In this embodiment, the following example can be made: "Please predict the photovoltaic power generation power in the next 4 hours based on the historical power data and meteorological factors of the past 24 hours." (3) Statistical description: including data trends, periodic characteristics, fluctuation ranges and delays, etc. In the embodiment of the present invention, the following example can be given: "The daily power generation has obvious fluctuations, close to 0 at night, and gradually increases during the day as the solar radiation increases. The power usually reaches a peak between 13:00 and 15:00 in the afternoon." Then, based on the above information, the text-based prompt word prefix is encoded through the text embedding module of the pre-trained LLM, and each word is encoded as a d LLM dimensional vector, thus obtaining the prompt prefix data Where L S The length of the prompt text.
[0062] Will prompt for prefix data Reconstructing data with time series The splicing is performed on the second dimension, and the spliced data [S prompt ,S data ] As the input of the pre-trained LLM, the pre-trained LLM can directly perform inference to obtain the corresponding output data
[0063] In the output mapping unit, such as Figure 5 As shown, the output of the pre-trained LLM needs to be flattened and linearly projected to convert it into the required time series data format. Specifically, flattening is to flatten the multidimensional data structure into a one-dimensional data structure, that is:
[0064]
[0065] That is, the last two dimensional features are concatenated into one dimension.
[0066] Linear projection uses a weight matrix W and a bias vector b to transform the flattened O fMap it to the target feature space and output the final prediction result y. The linear projection process is as follows:
[0067]
[0068] in, is a weight matrix, where τ is the length of the predicted time series; b∈R N×τ is the offset.
[0069] After flattening and linear projection, the LLM output is mapped into a predicted time series.
[0070] Step S4: Output the distributed photovoltaic power prediction value through Solar-LLM prediction
[0071] Furthermore, the training set, validation set, and test set are divided into training set, validation set, and test set in a ratio of 3:1:1. Based on the photovoltaic output data of the past 24 hours (i.e., 96 steps), each sample predicts the photovoltaic output at the 15th minute, 1 hour, and 4 hours in the next 4 hours (i.e., 16 steps). The prediction results are as follows: Figure 6 , 7 , 8. Specifically, the frozen pre-trained LLM selected is the 8-layer Llama-2-7b, whose feature dimension is 4096. For the time series data segmentation part, patch = 32, stride = 8; for the reconstruction part, the hidden layer feature dimension is 32, and the number of attention heads is 8. The mean absolute error (MAE) and root mean square error (RMSE) are used to evaluate the model prediction performance:
[0072]
[0073] Where N is the number of test samples, T pred is the number of forecast periods, y i,t is the true value of sample i at time t, is the predicted value of sample i at time t.
[0074] Table 2
[0075]
[0076] Table 3
[0077]
[0078] Among them, MAE and RMSE are used as evaluation indicators of prediction results, and the smaller the value, the smaller the prediction error of the model. It can be seen that the method of the embodiment of the present invention has lower values of various indicators than the single deep learning methods of GRU, LSTM, TCN, Transformer and Informer in different prediction time periods, and has higher prediction accuracy. It can effectively understand the photovoltaic prediction task and maintain consistent high performance in various prediction time periods.
[0079] Embodiment 2:
[0080] The embodiment of the present invention further provides a distributed photovoltaic power prediction device, comprising:
[0081] An acquisition module is used to acquire historical data sets of photovoltaic power plants, including historical light intensity, wind speed, humidity, and historical photovoltaic power data;
[0082] A preprocessing module is used to preprocess the historical data set of the photovoltaic power station to obtain a new data set;
[0083] A construction module is used to obtain a Solar-LLM distributed photovoltaic power prediction model based on a new data set;
[0084] The prediction module is used to input past photovoltaic power station data sets into the Solar-LLM distributed photovoltaic power prediction model to predict future photovoltaic output data.
[0085] As an implementation method of the embodiment of the present invention, the preprocessing module performs correlation analysis on the regional factors and sequential factors of the historical data set of the photovoltaic power station by using the Pearson correlation coefficient method to obtain a new data set.
[0086] As an implementation method of an embodiment of the present invention, the Solar-LLM distributed photovoltaic power prediction model includes: a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit; wherein, through the data slicing unit, the data set after correlation analysis is sliced; through the data embedding unit, the time series sliced data is reconstructed and mapped to a high-dimensional feature space; through the large model prediction unit, the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit are spliced and input into the pre-trained LLM for prediction; through the output mapping unit, the LLM output result is mapped to the time series data output.
[0087] Embodiment 3:
[0088] An embodiment of the present invention further provides a distributed photovoltaic power prediction system, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a distributed photovoltaic power prediction method when executed by the processor.
[0089] Embodiment 4:
[0090] An embodiment of the present invention further provides a storage medium, on which a computer program is stored, and the computer program executes a distributed photovoltaic power prediction method when running.
[0091] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A distributed photovoltaic power prediction method, characterized in that: include: Step S1, obtaining a historical data set of a photovoltaic power station, the historical data set including historical light intensity, wind speed, humidity, and historical photovoltaic power data; Step S2, preprocessing the historical data set of the photovoltaic power station to obtain a new data set; Step S3: Obtaining a Solar-LLM distributed photovoltaic power prediction model based on the new data set; Step S4: input the past photovoltaic power station data set into the Solar-LLM distributed photovoltaic power prediction model to predict future photovoltaic output data.
2. The distributed photovoltaic power prediction method according to claim 1, characterized in that: In step S2, the regional factors and sequential factors of the historical data set of the photovoltaic power station are subjected to correlation analysis by using the Pearson correlation coefficient method to obtain a new data set.
3. The distributed photovoltaic power prediction method according to claim 2, characterized in that: The Solar-LLM distributed photovoltaic power prediction model includes: a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit; wherein, the data slicing unit is used to slice the data set after correlation analysis; the data embedding unit is used to reconstruct the time series slice data and map it to a high-dimensional feature space; the large model prediction unit is used to splice the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit, and input them into the pre-trained LLM for prediction; the output mapping unit is used to map the LLM output result to the time series data output.
4. A distributed photovoltaic power prediction device, characterized in that: include: An acquisition module is used to acquire historical data sets of photovoltaic power plants, including historical light intensity, wind speed, humidity, and historical photovoltaic power data; A preprocessing module is used to preprocess the historical data set of the photovoltaic power station to obtain a new data set; A construction module is used to obtain a Solar-LLM distributed photovoltaic power prediction model based on a new data set; The prediction module is used to input past photovoltaic power station data sets into the Solar-LLM distributed photovoltaic power prediction model to predict future photovoltaic output data.
5. The distributed photovoltaic power prediction device according to claim 4, characterized in that: The preprocessing module performs correlation analysis on the regional factors and sequential factors of the historical data set of photovoltaic power plants through the Pearson correlation coefficient method to obtain a new data set.
6. The distributed photovoltaic power prediction device according to claim 5, characterized in that: The Solar-LLM distributed photovoltaic power prediction model includes: a data slicing unit, a data embedding unit, a prompt prefix unit, a large model prediction unit, and an output mapping unit; wherein, the data slicing unit is used to slice the data set after correlation analysis; the data embedding unit is used to reconstruct the time series slice data and map it to a high-dimensional feature space; the large model prediction unit is used to splice the prompt word data designed by the prompt prefix unit and the time series reconstructed data of the data embedding unit, and input them into the pre-trained LLM for prediction; the output mapping unit is used to map the LLM output result to the time series data output.
7. A distributed photovoltaic power prediction system, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executed by the processor, and when the computer program is executed by the processor, the distributed photovoltaic power prediction method according to any one of claims 1 to 3 is executed.
8. A storage medium, characterized in that: The storage medium stores a computer program, which, when running, executes the distributed photovoltaic power prediction method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Power load prediction method based on large language model
CN117634740A
Power load prediction method and device, electronic equipment and storage medium
CN117994083A
New energy power prediction question-answering system
CN118689971A
Photovoltaic power station regulation and operation optimization method, device, equipment and medium
CN118748538A
Cited By
Photovoltaic optical power prediction method and system based on large model, and medium
CN120804807A