Photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine tuning large model
Through the method of enhanced generation and fine-tuning of large models based on retrieval, multi-modal photovoltaic data is processed and a personalized prediction model is constructed, which solves the accuracy and reliability problems of photovoltaic power prediction in the existing technology and achieves high-precision photovoltaic power prediction. .
Patent Information
- Application Number
- CN202410647930.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-03
AI Technical Summary
Existing photovoltaic power prediction methods have limited accuracy and reliability when processing multi-modal data, cannot effectively mine nonlinear information between continuous data, and a single data source limits the accuracy of prediction.
Using a method based on retrieval enhancement to generate and fine-tune a large model, by acquiring multi-modal data, preprocessing, indexing, retrieving and generating answers, and using AdapterFusion to fine-tune the large model, a personalized photovoltaic power prediction model is constructed to handle multi-modal data and improve forecast accuracy.
Significantly improves the accuracy and reliability of photovoltaic power prediction, can handle large amounts of multi-modal data, reduces model training costs, and adjusts the model according to location characteristics to suit the photovoltaic characteristics of different locations, solving catastrophic forgetting, inter-task interference and The problem of unstable training.
Smart Images

Figure CN118586547A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of photovoltaic power prediction, and in particular relates to an artificial intelligence prediction method for photovoltaic power based on retrieval enhancement generation and fine-tuning of a large model. Background Art
[0002] Fossil energy such as coal and oil is the main energy source in my country. Excessive use will lead to problems such as energy exhaustion and greenhouse effect. Under the contradiction between the continuous growth of energy demand and the deterioration of the ecological environment, seeking efficient, clean and renewable energy is a necessary means to solve this series of problems. Solar energy has the advantages of large resources, wide distribution and zero emissions. Photovoltaic technology is an effective way to develop solar energy and reduce emissions. A large number of photovoltaics have been connected to the power grid. However, photovoltaic power generation does not have the continuous adjustable and controllable characteristics of traditional power generation technology. While using solar energy, the volatility and instability of solar energy also bring challenges to the real-time dispatching and safe operation of the power grid. Therefore, accurate and efficient prediction of photovoltaic power generation is of great significance to the safe and stable operation of the power grid system.
[0003] In recent years, many researchers have conducted extensive research on the prediction of photovoltaic power, and artificial intelligence has been increasingly applied to the field of photovoltaic power prediction. The artificial intelligence method is to establish a nonlinear relationship between photovoltaic data and external influencing factors (such as temperature, etc.), use computers to establish probability and statistical models based on data-driven methods, and then apply these models to predict photovoltaic power generation. There are mainly BP neural networks, support vector machines (SVM), radial basis function (RBF) neural networks, long short-term memory (LSTM) neural networks, etc. These methods are widely used in photovoltaic power generation prediction and have achieved good prediction results, but when there are many input data sequences, it is impossible to mine nonlinear effective information between continuous data. Due to the complexity of factors affecting photovoltaic power, the single data source and the inability to process multimodal data have certain limitations in accuracy and reliability. Summary of the invention
[0004] In view of the above problems, the purpose of the present invention is to provide a photovoltaic power artificial intelligence prediction method based on retrieval enhanced generation and fine-tuning of large models with high accuracy and capable of processing large amounts of multimodal data.
[0005] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0006] A photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning of a large model includes the following steps:
[0007] Step 1: Obtain multimodal data and construct a dataset;
[0008] Step 2: Preprocess the data;
[0009] Step 3: Use retrieval enhancement generation technology to index the data;
[0010] Step 4: Use retrieval enhancement generation technology to accept user queries and retrieve relevant data from the index;
[0011] Step 5: Use retrieval-enhanced generation technology to pass user queries and retrieved data to the big model to generate answers;
[0012] Step 6: Use the AdapterFusion method to fine-tune the large model to obtain a personalized model to make personalized predictions.
[0013] Furthermore, in Step 1, the multimodal data includes information on temperature, wind direction, wind speed, relative humidity, horizontal total radiation, horizontal diffuse radiation, photovoltaic module inclination, battery efficiency, installed capacity of the power station, inverter efficiency, location longitude and latitude, ground reflectivity, building and tree shading, and weather conditions.
[0014] Furthermore, in Step 2, the data preprocessing method includes feature selection, outlier processing, missing value filling, and normalization.
[0015] Furthermore, in Step 3, the operation flow of indexing data using the retrieval enhancement generation technology includes the following steps:
[0016] Step3-1 Load: Load the data set;
[0017] Step 3-2 Split: Split large blocks of data into small blocks;
[0018] Step 3-3 Vectorization: Convert data into vectors;
[0019] Step 3-4 Storage: Store the vector for subsequent retrieval.
[0020] Furthermore, in Step 3-3, different encoders are used for data in different forms including text and images.
[0021] Furthermore, in Step 4, the system preferentially retrieves the top k vectors with the highest similarity to the user query to enhance the context information.
[0022] Furthermore, the similarity is calculated by maximum inner product search:
[0023] p η (z|x)∝exp(d(z) T q(x))
[0024] d(z)=BERT d(z)
[0025] q(x)=BERT q (x)
[0026] Where d(z) is the data dense representation generated by the BERT encoder, q(x) is the query representation generated by the query encoder based on the BERT encoder, x is the query, z is the latent variable, and the top-k(p η (·|x)), that is, the one with the highest prior probability p η k z of (z|x).
[0027] Furthermore, in Step 5, LLaMA is used as the backbone of the large model, and the generator p θ (y i |x,z,y 1:i-1 ) is parameterized by θ, based on the first i-1 tokens, i.e., y 1:i-1 , the original query x, the retrieved z generates the current token, and the final output is:
[0028]
[0029] Furthermore, the operation process of Step 6 includes the following steps:
[0030] Step 6-1 Knowledge extraction: Train different adapter modules for different tasks to learn specific knowledge. For each task, use parameter Θ0 to initialize the model. In addition, introduce a new set of randomly initialized parameters Φ n , fixed parameter Θ0, only training parameter Φ n ;
[0031] Step 6-2 Knowledge combination: fix the pre-trained model parameters and adapter parameters, and introduce new parameters to combine different adapter modules:
[0032]
[0033] Ψ m are the newly learned parameters for task m.
[0034] Furthermore, in Step 6-1, the objective function of each task is as follows:
[0035]
[0036] Compared with the prior art, the present invention has the following advantages:
[0037] The present invention is based on a large model and uses retrieval enhancement generation technology to construct a photovoltaic power prediction expert model. The powerful computing power of the large model can handle large amounts of data and multimodal data. The fine-tuning method is used to reduce the model training cost, and the model is adjusted according to the characteristics of the model deployment location to build a personalized model that is more suitable for the photovoltaic characteristics of different locations and improves the prediction accuracy. In addition, AdapterFusion can solve the problems of catastrophic forgetting, interference between tasks, and unstable training by separating the two stages of knowledge extraction and knowledge combination. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a flow chart of the photovoltaic power prediction method based on retrieval enhancement generation and fine-tuning of a large model in the present invention.
[0039] Figure 2 It is the index flow chart of the present invention.
[0040] Figure 3 It is a flowchart of search enhancement generation of the present invention.
[0041] Figure 4 This is the AdapterFusion architecture diagram of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0043] like Figure 1 As shown, a photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning of a large model includes the following steps:
[0044] Step 1: Obtain multimodal data, including temperature, wind direction, wind speed, relative humidity, horizontal total radiation, horizontal diffuse radiation, photovoltaic module inclination, battery efficiency, installed capacity of the power station, inverter efficiency, location longitude and latitude, ground reflectivity, building and tree shading, weather conditions and other text information and satellite cloud images, photovoltaic array images and other image information to build a data set.
[0045] Step 2: Preprocess the data, including feature selection, outlier processing, missing value filling, and normalization.
[0046] Step 3: Use retrieval enhancement generation technology to index the data, such as Figure 2 As shown, the specific steps are as follows:
[0047] Step3-1 Load: Load the dataset.
[0048] Step 3-2 Split: Split large chunks of data into smaller chunks. This is useful for both indexing data and passing data to models, because large chunks of data are harder to search and don’t fit into the limited context window of the model.
[0049] Step 3-3 Vectorization: Convert data into vectors. Use different encoders for different forms of data such as text and images.
[0050] Step 3-4 Storage: Store the vectors so that they can be retrieved later.
[0051] Step 4: Using the retrieval enhancement generation technology, accept the user query and retrieve relevant data from the index. The system first retrieves the top k vectors with the highest similarity to the user query to enhance the context information. The similarity is calculated by the maximum inner product search:
[0052] p η (z|x)∝exp(d(z) T q(x))
[0053] d(z)=BERT d (z)
[0054] q(x)=BERT q (x)
[0055] Where d(z) is the sum of the BASE The encoder generates a dense representation of the data, q(x), which is based on BERT BASE The query representation generated by the encoder is BERT. BASE It refers to the BERT model with 12 Transformer blocks, 768 hidden layers, and 12 self-attention heads. x is the query and z is the latent variable. Calculate the top-k(p η (·|x)), that is, the one with the highest prior probability p η k z of (z|x).
[0056] Step 5: See Figure 3 , using retrieval enhancement generation technology, passing user queries and retrieved data to the large model to generate answers. Using LLaMA as the backbone of the large model, the generator p θ (y i |x,z,y 1:i-1 ) is parameterized by θ, based on the first i-1 tokens, i.e., y 1:i-1 , original query x, retrieved z generate current token. The final output is:
[0057]
[0058] Step 6: Use AdapterFusion (see Figure 4 ) method to fine-tune the large model and obtain a personalized model to make personalized predictions. The specific operation process is as follows:
[0059] Step 6-1 Knowledge extraction: Train different adapter modules for different tasks to learn specific knowledge. For each task, use the parameter Θ0 to initialize the model. In addition, introduce a new set of randomly initialized parameters Φ n . Fixed parameter Θ0, only training parameter Φ n , the objective function of each task is as follows:
[0060]
[0061] Step 6-2 Knowledge combination: fix the pre-trained model parameters and adapter parameters, and introduce new parameters to combine different adapter modules:
[0062]
[0063] Ψ m are the newly learned parameters for task m.
[0064] Compared with the prior art, the present invention is based on a pre-trained large model and uses the Retrieval-Augmented Generation (RAG) technology to build a photovoltaic power prediction expert model. After the system is deployed, the AdapterFusion fine-tuning technology is used to obtain a personalized prediction model, significantly reduce training costs, and improve prediction accuracy. In addition, AdapterFusion can effectively solve the problems of catastrophic forgetting, interference between tasks, and unstable training by separating the two stages of knowledge extraction and knowledge combination, highlighting that the technology of the present invention has significant progress over the prior art.
[0065] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning of large models, characterized in that: The following steps are involved: Step 1: Obtain multimodal data and construct a dataset; Step 2: Preprocess the data; Step 3: Use retrieval enhancement generation technology to index the data; Step 4: Use retrieval enhancement generation technology to accept user queries and retrieve relevant data from the index; Step 5: Use retrieval-enhanced generation technology to pass user queries and retrieved data to the big model to generate answers; Step 6: Use the AdapterFusion method to fine-tune the large model to obtain a personalized model to make personalized predictions.
2. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning of a large model according to claim 1 is characterized in that: In Step 1, the multimodal data includes information on temperature, wind direction, wind speed, relative humidity, horizontal total radiation, horizontal diffuse radiation, photovoltaic module inclination, battery efficiency, installed capacity of the power station, inverter efficiency, location longitude and latitude, ground reflectivity, building and tree shading, and weather conditions.
3. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: In Step 2, the data preprocessing method includes feature selection, outlier processing, missing value filling, and normalization.
4. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: In Step 3, the operation process of indexing data using retrieval enhancement generation technology includes the following steps: Step3-1 Load: Load the data set; Step 3-2 Split: Split large blocks of data into small blocks; Step 3-3 Vectorization: Convert data into vectors; Step 3-4 Storage: Store the vector for subsequent retrieval.
5. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 4 is characterized in that: In Step 3-3, different encoders are used for different forms of data including text and images.
6. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: In Step 4, the system preferentially retrieves the top k vectors with the highest similarity to the user query to enhance the context information.
7. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 6 is characterized in that: Calculate similarity via maximum inner product search: d(z)=BERT d (from) q(x)=BERT q (x) Where d(z) is the data dense representation generated by the BERT encoder, q(x) is the query representation generated by the query encoder based on the BERT encoder, x is the query, z is the latent variable, and the top-k(p η (·|x)), that is, the one with the highest prior probability p η k z of (z|x).
8. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: In Step 5, LLaMA is used as the backbone of the large model, and the generator p θ (y i |x,z,y 1:i-1 ) is parameterized by θ, based on the first i-1 tokens, i.e., y 1:i-1 , the original query x, the retrieved z generates the current token, and the final output is:
9. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: The operation process of Step 6 includes the following steps: Step 6-1 Knowledge extraction: Train different adapter modules for different tasks to learn specific knowledge. For each task, use parameter Θ0 to initialize the model. In addition, introduce a new set of randomly initialized parameters Φ n , fixed parameter Θ0, only training parameter Φ n ; Step 6-2 Knowledge combination: fix the pre-trained model parameters and adapter parameters, and introduce new parameters to combine different adapter modules: Ψ m are the newly learned parameters for task m.
10. The photovoltaic power artificial intelligence prediction method based on retrieval enhancement generation and fine-tuning large model according to claim 1 is characterized in that: In Step 6-1, the objective function of each task is as follows:
Citation Information
Cited By
Distributed photovoltaic power prediction method and device, electronic equipment and storage medium
CN119721323A
Large-scale battery health degree prediction method for energy storage power station
CN119885678A
