A small sample transferable prediction method for photovoltaic power generation based on large language model

Through the method of migratory prediction of photovoltaic power generation with few samples based on large language model, the problems of insufficient generalization and limited feature expression capabilities of photovoltaic power generation prediction in the scarce data scenario are solved, and high precision, stability and adaptive prediction across the site are achieved.

CN120045943BActive Publication Date: 2025-08-29TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510529749.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-29
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

The existing photovoltaic power generation prediction method has insufficient historical data of the target station, and the prediction accuracy is reduced and the generalization ability is limited, making it difficult to adapt to the migration application of multiple regions and multiple stations. In the process of feature extraction, traditional methods are difficult to fully capture space-time dependence and complex nonlinear relationships.

Method used

Using a photovoltaic power generation with a small sample transferable prediction method based on a large language model, an end-to-end automated prediction framework is built through steps such as input segmentation, feature extraction, semantic alignment, prompt generation and output projection, and the context understanding ability and transfer learning technology of pre-trained large language models are used to integrate the spatiotemporal dependence and nonlinear correlation characteristics of multi-source heterogeneous data.

Benefits of technology

In extremely short-term data and cross-site migration scenarios, the prediction accuracy is significantly improved, the dependence on the local data volume of the target site is reduced, high-fidelity migration prediction is achieved, and the universality and practicality of photovoltaic power generation prediction is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045943B_ABST
    Figure CN120045943B_ABST
Patent Text Reader

Abstract

A small-sample, transferable prediction method for photovoltaic power generation based on a large language model includes: performing extreme value normalization and block segmentation on photovoltaic time series data to generate an embedding module adapted to the large language model input; fusing high-order partial correlation analysis with a gated residual network to dynamically assign feature weights and extract spatiotemporal dependencies and nonlinear correlation features from multidimensional data; mapping structured time series features to the semantic space of the large language model and utilizing a masked multi-head attention mechanism to achieve high-fidelity alignment with a pre-trained corpus; generating prompt word prefixes containing data context, domain patterns, and statistical features based on preset templates to guide the large language model in accurately parsing time series semantics; generating natural language prediction results using a pre-trained large language model with frozen parameters, and ultimately de-interpreting them into numerical power generation prediction values ​​through linear projection. This invention can effectively address the problems of traditional models' insufficient generalization capabilities in data-scarce scenarios and poor stability in cross-site migration predictions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to photovoltaic power generation prediction technology, and in particular to a photovoltaic power generation small sample transferable prediction method based on a large language model. Background Art

[0002] Photovoltaic power generation, as a key component of the new power system, offers advantages such as being green, low-carbon, and resource-rich. However, PV power generation is characterized by significant intermittency and randomness, and its output is easily affected by factors such as weather changes and environmental conditions, posing significant challenges to grid dispatch and system operation. In this context, improving the forecast accuracy of PV output has become a key technical approach to enhance the capacity to absorb new energy and support flexible system regulation in order to ensure the safe and stable operation of the power system.

[0003] The core challenge of photovoltaic power generation forecasting lies in fully exploiting the deep relationships between multi-source heterogeneous data, such as historical power data and meteorological information, to construct accurate forecasting models. Currently, mainstream forecasting methods can be categorized into two categories: modeling methods based on physical mechanisms and statistical learning methods based on historical data. With the rapid development of artificial intelligence (AI) technology, particularly the emerging advantages of deep learning in pattern recognition and feature extraction, data-driven deep learning methods have become a key research direction in the field of photovoltaic forecasting. These methods can efficiently process large amounts of data and automatically extract complex nonlinear features, significantly improving forecasting accuracy and model efficiency, and driving the development of forecasting technology towards real-time and intelligent applications. Although deep learning models have been widely used in photovoltaic forecasting, the widespread geographical distribution of PV power plants and the significant differences in data distribution between sites still pose significant challenges to the generalization and adaptability of traditional models, particularly in newly built or small power plants with limited data.

[0004] To address data insufficiency and improve model transfer performance, transfer learning technology has been gradually introduced into the field of photovoltaic power generation forecasting, leveraging the modeling experience of existing sites to support predictive modeling for new sites. However, existing transfer methods still have limitations in addressing source-target differences and improving transfer stability.

[0005] Specifically, existing photovoltaic power generation prediction methods often face the problem of reduced prediction accuracy or even failure when historical data from the target site is insufficient. Traditional models usually need to be retrained or adjusted for each power station, with limited generalization capabilities, making it difficult to adapt to multi-regional and multi-site migration application scenarios. Therefore, the most critical technical issue at present is how to build a highly transferable prediction framework that can use data from existing source power stations for generalization training and migrate to target power stations, maintaining high prediction performance in the absence of local data, thereby improving the universality and practicality of photovoltaic power generation prediction. In addition, due to factors such as geographical location, weather conditions, and component types, different photovoltaic power stations have significant heterogeneity in data. How to design a highly adaptable model structure that can effectively integrate heterogeneous data from multiple source power stations and improve its feature expression capabilities is a key challenge in achieving generalized prediction. In addition, existing methods often rely on manual construction or shallow neural networks in the feature extraction process, which makes it difficult to fully capture spatiotemporal dependencies and complex nonlinear relationships.

[0006] It should be noted that the information disclosed in the above background technology section is only used to understand the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention

[0007] The main purpose of the present invention is to overcome the defects existing in the above-mentioned background technology and provide a small-sample transferable prediction method for photovoltaic power generation based on a large language model.

[0008] To achieve the above object, the present invention adopts the following technical solutions:

[0009] A small sample transferable prediction method for photovoltaic power generation based on a large language model includes the following steps:

[0010] S1. Input segmentation: Normalize and segment the original photovoltaic time series data to generate an embedding module that is suitable for the input of the large language model;

[0011] S2. Feature extraction: Dynamically assign feature weights through high-order partial correlation analysis and gated residual networks to extract nonlinear correlation features of multidimensional data;

[0012] S3, semantic alignment: Mapping temporal features to the semantic space of a large language model corpus to complete natural language alignment;

[0013] S4, prompt generation: generating a prompt word prefix containing background, domain, instruction and statistical information based on a preset prompt word template;

[0014] S5, Natural Language Prediction: Input the semantically aligned data and the prompt word into the large language model with frozen parameters, and output the natural language prediction result;

[0015] S6. Output projection: Decode the natural language response into a numerical power generation prediction value through linear projection.

[0016] Furthermore, in step S1, the input segmentation specifically includes:

[0017] Perform extreme value normalization on the original photovoltaic time series data;

[0018] The normalized data is divided into blocks according to the preset step size to generate multiple embedding modules;

[0019] The segmented data is mapped to a feature space that matches the input dimension of the large language model through linear transformation.

[0020] Furthermore, in step S2, the feature extraction specifically includes:

[0021] Dynamically evaluate the strength of association between variables based on high-order partial correlation analysis to eliminate multicollinearity interference;

[0022] A gated residual network is used to combine gating mechanism and residual connection to extract nonlinear features of multidimensional data;

[0023] The statistical analysis and deep learning results are integrated through a two-layer feature selection mechanism to generate a weighted normalized feature vector.

[0024] Furthermore, in step S3, the semantic alignment specifically includes:

[0025] Perform dimensionality reduction and compression on large language model corpora to reduce the complexity of matching calculations;

[0026] A masked multi-head self-attention mechanism is used to match time series data with corpus tokens to ensure that only historical information is focused on.

[0027] The token sequence of power generation data and external feature data is combined to generate an input format suitable for large language models.

[0028] Furthermore, in step S4, the prompt word template specifically includes:

[0029] Data background information describing the geographical location, time range, and external characteristics of the PV plant;

[0030] Define typical timing patterns and domain knowledge of photovoltaic power generation;

[0031] Determine the historical step size and prediction step size instructions for the prediction task;

[0032] Provide statistical features of historical power generation data to enhance semantic expression.

[0033] Furthermore, in step S6, the output projection specifically includes:

[0034] Flatten the natural language sequence output by the large language model into a one-dimensional vector;

[0035] The flattened vector is mapped to the target prediction dimension through linear transformation to restore the numerical result.

[0036] Furthermore, the large language model keeps pre-trained parameters fixed during the prediction process and only optimizes the parameters of the input segmentation, feature extraction, semantic alignment, prompt generation and output projection modules.

[0037] Furthermore, the evaluation indicators of the prediction results include:

[0038] Symmetric mean absolute percentage error, which measures the relative deviation between the predicted value and the true value;

[0039] Normalized root mean square error quantifies the global accuracy of the prediction results.

[0040] Furthermore, the method is applicable to any of the following data scenarios:

[0041] Only very short-term historical data of the target PV plant is used for training;

[0042] Cross-scenario migration prediction based on similar power plant data;

[0043] Cross-scenario migration prediction based on non-similar power station data.

[0044] A computer program product includes a computer program, which, when executed by a processor, implements the photovoltaic power generation small-sample transferable prediction method based on a large language model.

[0045] The present invention has the following beneficial effects:

[0046] The present invention proposes a small-sample transferable prediction method for photovoltaic power generation based on a large language model. By integrating the generalization ability of the large language model with transfer learning technology, it effectively solves the key problems of the traditional photovoltaic prediction model in data-scarce scenarios, such as insufficient generalization and limited feature expression ability. The method of the present invention innovatively maps time series data to the natural language semantic space, utilizes the context understanding ability of the pre-trained large language model, combines the normalized block processing of data by the input segmentation layer, the high-order partial correlation analysis and dynamic weight allocation of the gated residual network by the feature extraction layer, the masked multi-head attention mechanism matching by the semantic alignment layer, the structured template guidance by the prompt generation layer, and the linear inverse mapping by the output projection layer, to construct an end-to-end automated prediction framework. The present invention can achieve high-fidelity transfer prediction across stations without fine-tuning the parameters of the large language model ontology, significantly reducing the dependence on the amount of local data at the target station. At the same time, through the feature modeling mechanism that integrates statistics and deep learning, it fully mines the spatiotemporal dependency and nonlinear correlation characteristics of multi-source heterogeneous data, solving the limitations of traditional methods in artificial feature construction and shallow network expression. Experimental verification shows that the symmetric mean absolute percentage error (SMAPE) and normalized root mean square error (NRMSE) of this method are significantly better than those of mainstream comparison models in extremely short-term data and similar and non-similar site migration scenarios, demonstrating its excellent prediction accuracy, stability and cross-scenario adaptability under few sample conditions, and providing an innovative solution for the intelligence and generalization of photovoltaic power generation prediction technology.

[0047] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A flowchart of a method for migrating photovoltaic power generation with a small number of samples based on a large language model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope of the present invention and its application.

[0050] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0051] See Figure 1 The embodiment of the present invention provides a method for migrating photovoltaic power generation prediction based on a large language model using a small number of samples, including the following steps:

[0052] S1. Input segmentation: Normalize and segment the original photovoltaic time series data to generate an embedding module that is suitable for the input of the large language model.

[0053] In some embodiments, in step S1, the input segmentation specifically includes: performing extreme value normalization processing on the original photovoltaic time series data; dividing the normalized data into blocks according to a preset step size to generate multiple embedding modules; and mapping the segmented data to a feature space that matches the input dimension of the large language model through linear transformation.

[0054] S2. Feature extraction: Dynamically assign feature weights through high-order partial correlation analysis and gated residual networks to extract nonlinear correlation features of multidimensional data.

[0055] In some embodiments, in step S2, the feature extraction specifically includes: dynamically evaluating the correlation strength between variables based on high-order partial correlation analysis to eliminate multicollinearity interference; using a gated residual network combined with a gating mechanism and residual connections to extract nonlinear features of multidimensional data; and fusing statistical analysis and deep learning results through a two-layer feature selection mechanism to generate a weighted normalized feature vector.

[0056] S3. Semantic alignment: Map temporal features to the semantic space of a large language model corpus to complete natural language alignment.

[0057] In some embodiments, in step S3, the semantic alignment specifically includes: performing dimensionality reduction compression on the large language model corpus to reduce the complexity of matching calculations; using a masked multi-head self-attention mechanism to match time series data with corpus tokens to ensure that only historical information is focused on; combining the token sequence of power generation data and external feature data to generate an input format suitable for the large language model.

[0058] S4. Prompt generation: Generate a prompt word prefix containing background, field, instruction and statistical information based on a preset prompt word template.

[0059] In some embodiments, in step S4, the prompt word template specifically includes: data background information describing the geographical location, time range and external characteristics of the photovoltaic power station; defining the typical timing pattern and domain knowledge of photovoltaic power generation; determining the historical step size and prediction step size instructions of the prediction task; and providing statistical features of historical power generation data to enhance semantic expression.

[0060] S5. Natural language prediction: The semantically aligned data and the prompt word are input into a large language model with frozen parameters to output the natural language prediction result.

[0061] S6. Output projection: Decode the natural language response into a numerical power generation prediction value through linear projection.

[0062] In some embodiments, in step S6, the output projection specifically includes: flattening the natural language sequence output by the large language model into a one-dimensional vector; mapping the flattened vector to the target prediction dimension through linear transformation, and restoring the numerical result.

[0063] In some embodiments, the large language model keeps pre-trained parameters fixed during the prediction process and only optimizes parameters of the input segmentation, feature extraction, semantic alignment, hint generation, and output projection modules.

[0064] In some embodiments, the evaluation metrics of the prediction results include: symmetric mean absolute percentage error, which measures the relative deviation between the predicted value and the true value; and normalized root mean square error, which quantifies the global accuracy of the prediction results.

[0065] In some embodiments, the method is adapted to any of the following data scenarios: training using only very short-term historical data of the target photovoltaic power plant; performing cross-scenario migration prediction based on similar power plant data; performing cross-scenario migration prediction based on non-similar power plant data.

[0066] The following further describes specific embodiments of the present invention, its algorithm examples and experimental verification.

[0067] A small-sample transferable prediction method for photovoltaic power generation based on a large language model (LLM) is implemented primarily through five functional modules: an input segmentation layer, a feature extraction layer, a semantic alignment layer, a prompt word generation layer, and an output projection layer. The input segmentation layer divides raw photovoltaic power generation time series data into multiple embedding modules (patches) to adapt to the large language model's processing requirements for structured language input and enhance the data's ability to express local features. The feature extraction layer integrates deep learning and statistical knowledge to extract key dynamic features of power generation data and external factors such as the environment, improving the model's ability to characterize complex driving factors. The semantic alignment layer maps structured time series features to the semantic space of the large language model's pre-trained corpus, achieving high-fidelity data-to-natural language conversion. The prompt word generation layer automatically generates context-relevant prompt words based on the raw time series information to guide the large language model (LLM) in-depth understanding and feature mining of the target time series segment. The output projection layer reverse-parses the natural language responses generated by the LLM, extracting the power generation prediction information contained therein and converting it into numerical form. This method overcomes the expression bottleneck of traditional time series modeling approaches and enables natural language-driven transferable prediction of photovoltaic power generation data. Specifically, the embodiment of the present invention includes the following processing steps:

[0068] (1) Input segmentation layer processing.

[0069] To enable large models to understand time series data without fine-tuning or modifying them, we first segment large amounts of time series data. This facilitates the subsequent semantic alignment of each segmented patch. The core of the input segmentation layer consists of two steps: normalization and patch segmentation.

[0070] For a given time series data sample , first normalize it:

[0071]

[0072] Where, and are the maximum and minimum values ​​in the time series data, respectively. is the normalized time series data.

[0073] Next, the normalized training samples are divided into several small blocks, thereby grouping the original time series data into patches to maximize the preservation of the original semantic information. The length of each patch is set to , then the number of patches It can be calculated by the following formula:

[0074]

[0075] Where, For source data length, is the horizontal sliding stride of the split window, is the floor function.

[0076] Through the above steps, we get the shape of Sample Finally, to make the input dimension consistent with the column input size of the large language model To match, the present invention introduces a linear layer to map the segmented samples:

[0077]

[0078] Where, The dimension is , is the bias term, is the output of the final input segmentation layer, and its dimension is .

[0079] (2) Feature extraction layer processing.

[0080] In the photovoltaic power generation prediction, the power generation is affected by many factors such as solar radiation, cloud cover and solar radiation angle, which leads to the source input sample Usually multidimensional data. When conducting power generation forecasts, the impact of each input variable on the forecast result is often unclear, and the contribution of different features may vary greatly.

[0081] To address this issue, the present invention proposes a two-layer feature enhancement model that assigns weights to individual variables through feature engineering. This model combines statistics and machine learning, incorporating high-order partial correlation analysis as prior knowledge. High-order partial correlation coefficients between variables are calculated before each round of machine learning training. This allows the model to dynamically adjust feature weights while eliminating feature correlations. Furthermore, the present invention introduces a gated residual network (GRN) to measure the correlation between external inputs and the target variable. Combining a gating mechanism with residual connections, the GRN can flexibly capture nonlinear correlations and enhance the model's expressive power.

[0082] (2-1) High-order partial correlation analysis.

[0083] First, the present invention introduces high-order partial correlation analysis. If the number of variables is , for any two orders of Variables and , and its high-order partial correlation coefficient calculation formula is:

[0084] ,

[0085] Where, Representing variables and The higher-order partial correlation coefficients between them are The high-order partial correlation coefficient of the order is . The criteria for judging the strength of the correlation are as follows: is irrelevant when When is weakly correlated, The correlation is moderate when When is strongly correlated.

[0086] (2-2) Gated residual network.

[0087] Considering the large number of nonlinear relationships between photovoltaic power generation and its influencing factors, the present invention introduces a gated residual network model. The preprocessed data is first compared with the context vector Combined, through Generate middle layer :

[0088] ,

[0089]

[0090] Where, is the weight matrix, is the bias term, ELU is When it acts as a feature recognition function, It acts as an activation function producing a constant output when , thus exhibiting linear layer behavior.

[0091] Then, yes Apply weight transformation and add bias term , get the middle layer . Input it into the gated linear unit (GLU), combined with the initial features , and through the regularization layer Perform normalization to obtain the output of GRN:

[0092] ,

[0093]

[0094] Where, Is an index representing weight sharing. The calculation formula of GLU's gating mechanism is as follows:

[0095] ,

[0096] Where, is the sigmoid activation function, is the Hadamard product.

[0097] GLU enables the prediction model to dynamically control the GRN's initial features contribution and has the ability to self-adapt.

[0098] When GRN finds that no additional transformation is needed in processing nonlinear contributions, GLU can output approximately zero, allowing the model to skip this layer directly. In addition, for instances without context vectors, GRN will Treated as zero.

[0099] (2-3) First-level feature selection.

[0100] Higher-order partial correlation coefficients calculated by higher-order partial correlation analysis and GRN And the feature input after GRN nonlinear transformation is normalized to Softmax:

[0101] ,

[0102] ,

[0103] Where, is the weight matrix after the first layer feature selection mechanism.

[0104] (2-4) Second-level feature selection.

[0105] At each time step, each original feature Send it to the corresponding GRN for nonlinear feature extraction:

[0106] ,

[0107] Then, based on the weight matrix calculated in the first layer For the feature matrix Perform weighted summation to obtain the final normalized eigenvector :

[0108]

[0109] Where, The dimension is , The dimension is ,final The dimension is The feature vector converts the external features of each time step into a unified influence feature through weighted summation.

[0110] (2-5) Feature mapping and output.

[0111] Finally, in order to transform the feature vector Matching the input dimension of the large language model, performing segmentation and linear transformation, and obtaining the shape through formula (x) Sample , and mapped to the final output through linear transformation:

[0112]

[0113] Where, The dimension is , is the bias term, and the final output The dimension is .

[0114] (3) Semantic alignment layer processing.

[0115] (3-1) Corpus dimensionality reduction.

[0116] The LLM corpus typically contains hundreds of millions of tokens. Directly matching time series data would result in significant memory and computational overhead. Therefore, the corpus is dimensionality reduced before matching each data patch.

[0117] Assume that the original corpus of LLM is , among which Token, using a random Boolean matrix (Dimensions are ), reduce its dimension and get a new corpus :

[0118]

[0119] Where, Contains only Tokens, and , effectively reducing the computational complexity

[0120] (3-2) Token matching mechanism.

[0121] This paper proposes to use an improved multi-head self-attention mechanism to combine each patch with the corpus The common attention mechanism uses the key ( ) and query ( ) to compare the values ​​( ) for scaling, in Token matching, is the time series data Patch to be matched, The corpus after dimension reduction , For the end Matched Token sequence The matching process is completed through the self-attention mechanism, and its core calculation method is as follows:

[0122] ,

[0123] Where, is a normalization function. The traditional attention mechanism may see future data when calculating the match of the current patch, causing "distraction". To this end, the present invention introduces the mask matrix , ensuring that only historical information is focused on at the current moment:

[0124] ,

[0125] Where, Yes Key The dimension is used for scaling calculation to prevent the inner product value from being too large and causing the gradient to disappear. When Not paying attention ;when When focus on .

[0126] In order to reduce the time and memory consumption during the matching process, the self-attention mechanism is extended to the multi-head attention mechanism. Specifically, the value weight matrix is ​​shared among all attention heads. , and uses additive aggregation instead of splicing operations to reduce computational complexity:

[0127] ,

[0128] ,

[0129] Where, is the aggregated attention output, Is the shared value weight matrix. Improved attention weight is calculated as follows:

[0130] ,

[0131] Where, is the number of attention heads, and It is The weight matrix of the query and key corresponding to each attention head.

[0132] Finally, based on the improved self-attention mechanism, the data patch can be matched to the corpus token to form a token sequence:

[0133] .

[0134] (3-3) Token combination.

[0135] Through the above matching process, the Token sequence of power generation data is obtained respectively and the Token sequence of external feature data Finally, the sequences are combined to obtain the input converted from power generation data into tokens that can be embedded in the LLM model:

[0136]

[0137] This process completes the conversion of time series data into natural language, allowing LLM to directly understand and use it for prediction.

[0138] (4) Prompt generation layer processing.

[0139] Prompts are a simple and efficient method for activating the LLM. However, in the photovoltaic power generation forecasting task, converting time series data into a "black box" token limits the LLM's ability to understand semantics without being informed, hindering its ability to analyze tokens and predict outputs. Therefore, before inputting the converted natural language data, a set of prompt words is designed as input prefixes to guide the LLM in correctly understanding the data and embedding the corresponding tokens into the appropriate structure.

[0140] For this purpose, the following prompt word template is designed:

[0141] [Description] This dataset is for photovoltaic power generation in the xx region, with a time range of xx-xx and a sampling interval of xx. The dataset includes power generation values ​​and xx external features, including xx and xx.

[0142] [Domain] The power generation data in this scenario usually starts at 6:00 am, stops at 7:00 pm, and reaches a peak at noon.

[0143] [Instruction] Based on history <x>step-by-step data to predict the future <x>The power generation value of the step.

[0144] [Statistics] The minimum value of historical power generation data is xx, the maximum value is xx, and the median is xx. The overall trend is xx, which has strong time series characteristics.

[0145] The above prompt words are used as prefixes and embedded before the patch input. [Description] and [Domain] provide the LLM with contextual information about the input time series, helping it understand the data source and characteristics. [Instruction] clarifies the LLM's role in the prediction task and guides its proper transformation of patches. [Statistics] enhances the semantic representation of time series data, providing key pattern recognition and reasoning cues for the LLM.

[0146] (5) Output projection layer processing.

[0147] After completing the token combination obtained by remapping the prompt word and photovoltaic power generation data, it is input into the frozen LLM for forward propagation to obtain the predicted output expressed in natural language . Then, it is flattened and linearly projected to obtain the prediction results of the time series data:

[0148]

[0149] Where, For samples The corresponding photovoltaic power generation forecast value, For the flattening operation, Convert to a format suitable for fully connected layers, is the weight matrix of linear projection, is the bias term.

[0150] This layer regresses the natural language output by LLM into time series data, thereby completing the photovoltaic power generation prediction task.

[0151] (6) Establish a prediction result evaluation indicator system.

[0152] This method uses the symmetric mean absolute percentage error (SMAPE) and normalized root mean square error (NRMSE) to evaluate the accuracy of the prediction results. The definition and calculation of the evaluation indicators are as follows:

[0153] ,

[0154] ,

[0155] in, is the predicted value, is the true value, is the mean of the true values.

[0156] To evaluate the performance of the proposed method, we conducted experiments under three different data-scarce scenarios: (F1) training using only the last seven days of historical data from the target PV plant; (F2) training using the last 30 days of data from a PV plant similar to the target plant; and (F3) training using the last 30 days of data from a PV plant dissimilar to the target plant. All models were ultimately validated on a single, unified 5-day test data set from the target PV plant.

[0157] The method of the present invention introduces a pre-trained large language model Qwen-7B as a plug-in and embeds it into the prediction framework. Qwen-7B receives input from the semantic alignment layer and the prompt word generation layer, and maps the natural language results generated by them into photovoltaic power generation prediction values ​​through the output projection layer. Qwen-7B is built based on an improved Transformer architecture, contains 7 billion parameters, a vocabulary size of 153K, and a maximum input length of 4096. It should be noted that during all experimental processes, the parameters of Qwen-7B remain frozen, and only the parameters of the remaining modules in the proposed method are trained.

[0158] To fully validate the effectiveness of the proposed method, the inventors conducted comparative experiments using four mainstream prediction models: ConvTrans, TFT, Seq2Seq, and STGCN. The experimental results, shown in Table 1, show that the proposed large language model-based transferable photovoltaic power generation prediction method achieved optimal performance in the three data-scarce scenarios of F1, F2, and F3, fully demonstrating its accuracy and generalization capabilities under small sample conditions.

[0159] Table 1 Evaluation indicators of the proposed method and the comparison model in different scenarios

[0160]

[0161] In summary, the present invention proposes a small-sample transferable prediction method for photovoltaic power generation based on a large language model, which embeds the pre-trained large language model as a plug-in into the photovoltaic power generation prediction, making full use of its powerful generalization ability and language modeling ability to maximize the potential features of photovoltaic power generation data under the condition of data scarcity, thereby significantly improving the migration ability of the prediction model. The proposed semantic alignment layer can remap structured time series data into natural language expression, achieve alignment with the large language model corpus space, and thus efficiently complete the prediction task without the need to adjust the parameters of the large language model ontology. In addition, the proposed feature extraction layer integrates the deep learning mechanism on the basis of fully isolating the correlation between different features, realizes end-to-end automatic feature extraction, and constructs an efficient and scalable feature modeling framework. The present invention constructs a new photovoltaic prediction framework with low data adaptability, strong semantic understanding ability, and high transferability, thereby promoting photovoltaic prediction technology to have a higher level of intelligence and universality.

[0162] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.

[0163] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.

[0164] An embodiment of the present invention further provides a processor, which executes a computer program and at least performs the method described above.

[0165] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a magnetic disk memory or a magnetic tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0166] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0167] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0168] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0169] Those skilled in the art will appreciate that all or part of the steps of the above-mentioned method embodiments may be implemented by hardware associated with program instructions, and the aforementioned program may be stored in a computer-readable storage medium. When the program is executed, the program executes the steps of the above-mentioned method embodiments. The aforementioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0170] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0171] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0172] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0173] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0174] The above is a further detailed description of the present invention in conjunction with specific preferred embodiments, and the specific implementation of the present invention should not be considered to be limited to these descriptions. Those skilled in the art will recognize that, without departing from the scope of the present invention, several equivalent substitutions or obvious variations can be made, and the performance or use of the same should be considered to fall within the scope of protection of the present invention.< / x> < / x>

Claims

1. A small sample transferable prediction method for photovoltaic power generation based on a large language model, characterized by: The following steps are involved: S1. Input segmentation: Normalize and segment the original photovoltaic time series data to generate an embedding module that is suitable for the input of the large language model; S2. Feature Extraction: Dynamically assigning feature weights through high-order partial correlation analysis and gated residual networks to extract nonlinear correlation features from multidimensional data. Specifically, this includes: dynamically evaluating the strength of associations between variables based on high-order partial correlation analysis to eliminate multicollinearity interference; using gated residual networks combined with gating mechanisms and residual connections to extract nonlinear features from multidimensional data; and generating weighted normalized feature vectors through a two-layer feature selection mechanism that integrates statistical analysis and deep learning results. S3, Semantic Alignment: Mapping temporal features to the semantic space of a large language model corpus to complete natural language alignment; specifically, this includes: Perform dimensionality reduction and compression on large language model corpora; A masked multi-head self-attention mechanism is used to match time series data with tokens in the corpus. Among them, the following multi-head self-attention mechanism is used to match each patch with the token in the corpus: In the token matching, is the time series data Patch to be matched, is the corpus after dimension reduction, For the end Matched Token sequence ; The matching process is completed through the self-attention mechanism, and the calculation method is as follows: , Where, is the normalization function, is the result of the self-attention mechanism calculation; among them, the mask matrix is ​​introduced , calculated as follows: , Where, is the dimension of the key; Share the value weight matrix across all attention heads , and using additive aggregation, the calculation method is as follows: , Where, is the aggregated attention output, is the shared value weight matrix, is the attention weight, which is calculated as follows: , Where, is the number of attention heads, and It is The weight matrix of the query and key corresponding to each attention head; Based on the self-attention mechanism, the data patch is matched to the corpus token to form a token sequence: ; Extending the self-attention mechanism to the multi-head attention mechanism, the calculation method is as follows: , in, Represents the calculation results of the multi-head attention mechanism; Combine the token sequence of power generation data generated by the above masked multi-head self-attention mechanism with the token sequence of external feature data to generate an input format suitable for the large language model; S4, prompt generation: generating a prompt word prefix containing background, domain, instruction and statistical information based on a preset prompt word template; S5, Natural Language Prediction: Input the semantically aligned data and the prompt word into the large language model with frozen parameters, and output the natural language prediction result; S6. Output projection: Decode the natural language response into a numerical power generation prediction value through linear projection.

2. The method according to claim 1, characterized in that In step S1, the input segmentation specifically includes: Perform extreme value normalization on the original photovoltaic time series data; The normalized data is divided into blocks according to the preset step size to generate multiple embedding modules; The segmented data is mapped to a feature space that matches the input dimension of the large language model through linear transformation.

3. The method according to claim 1, characterized in that In step S4, the prompt word template specifically includes: Data background information describing the geographical location, time range, and external characteristics of the PV plant; Define typical timing patterns and domain knowledge of photovoltaic power generation; Determine the historical step size and prediction step size instructions for the prediction task; Provide statistical features of historical power generation data to enhance semantic expression.

4. The method according to claim 1, wherein In step S6, the output projection specifically includes: Flatten the natural language sequence output by the large language model into a one-dimensional vector; The flattened vector is mapped to the target prediction dimension through linear transformation to restore the numerical result.

5. The method according to claim 1, wherein The large language model keeps pre-trained parameters fixed during the prediction process and only optimizes the parameters of the input segmentation, feature extraction, semantic alignment, prompt generation, and output projection modules.

6. The method according to claim 1, characterized in that The evaluation indicators of the prediction results include: Symmetric mean absolute percentage error, which measures the relative deviation between the predicted value and the true value; Normalized root mean square error quantifies the global accuracy of the prediction results.

7. The method according to claim 1, characterized in that The method is applicable to any of the following data scenarios: Only very short-term historical data of the target PV plant is used for training; Cross-scenario migration prediction based on similar power plant data; Cross-scenario migration prediction based on non-similar power station data.

Citation Information

Patent Citations

  • Electric vehicle charging load prediction method and device

    CN117526307A

  • Airport short-term load prediction method based on large language model migration

    CN118966422A