Method and system for predicting generated power, electronic equipment and medium
Through improved variational mode decomposition model, attention mechanism and long-term memory neural network, a model that can accurately predict photovoltaic power generation is built, solving the problem of uncontrollable photovoltaic power generation, improving prediction accuracy and power system management efficiency.
Patent Information
- Application Number
- CN202411189581.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-13
AI Technical Summary
Because the photovoltaic power generation power depends on uncontrollable weather conditions, its short-term prediction is difficult to accurately, affecting the efficiency and stability of power grid scheduling and market transactions.
The improved variational modal decomposition model is used to combine attention mechanisms and long-term memory neural networks to build prediction models and process meteorological and photovoltaic module information data to achieve accurate prediction of power generation power.
It improves the accuracy of power generation prediction, provides strong technical support for the scheduling and management of power systems, reduces market risks, and improves economic benefits.
Smart Images

Figure CN119134294A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power generation prediction, and in particular to a method and system for predicting power generation, electronic equipment, and a medium for accurately predicting power generation. Background Art
[0002] Photovoltaic power generation has achieved rapid development in China. However, since it relies heavily on unpredictable and difficult-to-control weather conditions, it often experiences irregular fluctuations and is therefore highly uncontrollable. By conducting short-term photovoltaic power forecasts, we can provide a more flexible and accurate control strategy for the power system, thereby reducing the uncertainty of photovoltaic power generation and its negative impact on the power grid. This forecast not only helps the grid dispatching department to better plan and manage power resources, but also improves the overall operating efficiency of the power system while ensuring the stability of power supply. By predicting the output power of photovoltaic power generation, the power grid can more accurately arrange the output of other power generation methods, such as thermal power generation, hydropower generation, etc., to achieve a balance between power supply and demand.
[0003] In addition, the short-term forecast of photovoltaic power generation can also provide important reference information for the power market. With the gradual opening of the power market and the intensification of competition, accurate forecast data is crucial for power traders, power users and power producers. They can formulate more reasonable power trading strategies based on the forecast results, reduce market risks and improve economic benefits. Summary of the invention
[0004] The present invention provides a method and system, electronic device, and medium for predicting power generation. An improved variational mode decomposition model is used to process data, and a prediction model is constructed by combining an attention mechanism with a long short-term memory neural network, thereby achieving accurate prediction of power generation.
[0005] The present invention is achieved through the following technical solutions.
[0006] In a first aspect, a method for predicting power generation comprises the following steps:
[0007] Step S1, collecting and calculating the relevant data of power generation and historical power generation data, processing the relevant data of historical power generation through the improved VMD model, and obtaining the power generation data set;
[0008] Step S2, constructing a prediction model;
[0009] Step S3, guiding the prediction model learning and outputting the trained prediction model;
[0010] Step S4, collecting relevant data of power generation in real time, and inputting the relevant data of power generation into a prediction model to obtain predicted power generation;
[0011] Step S5: using the evaluation index to determine the accuracy of the power generation prediction.
[0012] In order to better implement the present invention, further, the relevant data for calculating the power generation in step S1 includes meteorological data and photovoltaic module information data.
[0013] In order to better implement the present invention, further, the method for constructing the VMD model optimized in step S1 includes: improving the VMD model by minimizing the decomposition loss.
[0014] In order to better implement the present invention, further, improving the VMD model by decomposing the minimum loss includes the following steps:
[0015] Step a, VMD decomposes the input signal into K sub-signals u k (K=1, 2, ..., K), and expressed as:
[0016]
[0017] Where k represents the modal number, and u k and ω k Respectively represent the kth component and the center frequency of the kth component after decomposition, t represents the time, δ(t) represents the Dirac distribution function, ∑ k represents the sum of all modes, and f represents the reconstructed signal;
[0018] Step b, introduce Lagrange multipliers in VMD, expressed as:
[0019]
[0020] Among them, u k and ω k They represent the Kth component and the center frequency of the Kth component after decomposition, t represents the time, λ represents the Lagrange multiplier coefficient, k represents the mode number, and α is the balance parameter;
[0021] Step c, taking the minimum decomposition loss as the improvement and guidance standard of VDM, the decomposition loss is expressed as:
[0022]
[0023]
[0024] Among them, L represents the decomposition loss, f * (t) represents the original signal, and T represents the time required for the whole process;
[0025] Step d, the decomposition loss is minimized as
[0026] Among them, f * (t) represents the original signal, f(t) represents the reconstructed signal, T represents the time required for the whole process, and k represents the number of modes.
[0027] In order to better implement the present invention, further, step S2 includes: building a prediction model based on attention mechanism and long-short term neural network.
[0028] In order to better implement the present invention, further, step S3 includes: dividing the power generation data set into a training set, a validation set and a test set in a ratio of 7:1:2; setting the learning rate of the adaptive method; using the training set in combination with the loss function and the learning rate to guide the learning of the prediction model, and outputting the trained prediction model.
[0029] In order to better implement the present invention, further, step S5 includes: using root mean square error evaluation, accuracy evaluation, mean absolute error evaluation and determination coefficient evaluation as evaluation indicators of the prediction model to judge the accuracy of the obtained predicted power generation power.
[0030] In a second aspect, the present invention further provides a system for predicting power generation, including a data acquisition unit, a model building unit, a power generation prediction unit and a judgment unit, wherein:
[0031] A data acquisition unit is used to collect and calculate the relevant data of power generation and historical power generation data, process the relevant data of historical power generation through the improved VMD model, and obtain the power generation data set;
[0032] A model building unit is used to build a prediction model; it is used to guide the prediction model learning and output the trained prediction model;
[0033] A power generation prediction unit, used for collecting power generation related data in real time, and inputting the power generation related data into a prediction model to obtain predicted power generation;
[0034] The judgment unit is used to judge the accuracy of the power generation prediction using the evaluation index.
[0035] In a third aspect, the present invention further provides an electronic device, which includes a processor and a memory; the processor includes the system for predicting generated power as described in the second aspect above.
[0036] In a fourth aspect, the present invention further provides a computer-readable storage medium, which includes instructions; when the instructions are executed on the electronic device described in the third aspect, the electronic device executes the method described in the first aspect.
[0037] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0038] The present invention provides a method and system, electronic device, and medium for predicting power generation. By adopting an improved variational mode decomposition model to process data and combining an attention mechanism with a long short-term memory neural network, a prediction model capable of realizing accurate power generation prediction is constructed, which not only improves the accuracy of the prediction, but also provides strong technical support for the optimal scheduling and management of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The present invention is further described in conjunction with the following drawings and embodiments, and all the concepts and innovations of the present invention should be regarded as the disclosed contents and the protection scope of the present invention.
[0040] Figure 1 A method and system for predicting power generation, an electronic device, and a method flow chart in a medium provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and therefore should not be regarded as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without making creative work are within the scope of protection of the present invention.
[0042] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "disposed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0043] Embodiment 1:
[0044] A method and system for predicting power generation, an electronic device, and a medium of this embodiment, such as Figure 1 As shown in Figure 1, we use an improved variational mode decomposition (VMD) model to process and analyze the data. This improved VMD model can more effectively extract key features from the data, thereby providing a more accurate basis for subsequent predictions. On this basis, we further combine the attention mechanism and the long short-term memory (LSTM) neural network to build a prediction model.
[0045] The attention mechanism enables the model to pay more attention to the important parts of the input data, thereby improving the accuracy and reliability of the prediction. Long short-term memory neural networks are particularly good at capturing and processing long-term dependencies in time series data, which is particularly important for power generation prediction. Through this combination, our model can better understand and predict the changing trend of power generation, thereby achieving accurate prediction of power generation. The attention mechanism gives different weights to data at different time points, allowing the model to pay more attention to those data points that have a greater impact on the prediction results when predicting. The LSTM neural network, through its unique gating mechanism, can effectively process and memorize long-term dependencies in time series data, thereby overcoming the limitations of traditional neural networks in dealing with such problems.
[0046] By using an improved variational mode decomposition model to process data and combining the attention mechanism with long short-term memory neural network, a prediction model that can achieve accurate power generation prediction is constructed. This not only improves the accuracy of the prediction, but also provides strong technical support for the optimal scheduling and management of the power system.
[0047] Embodiment 2:
[0048] This embodiment is further optimized on the basis of Embodiment 1. Variational mode decomposition (VMD) decomposes the physical signal into different intrinsic mode functions (IMFs) according to different center frequencies. In the field of short-term photovoltaic power generation, due to the excessive number of features, the photovoltaic power generation sequence can only be decomposed into K IMFs through VMD.
[0049] VMD decomposes the input signal into K sub-signals u k (K=1,2,...,K), the frequencies of these sub-signals are close to their respective center frequencies, and these signals are generally called IMFs:
[0050]
[0051] Among them, u k and ω k They represent the Kth component and the center frequency of the Kth component after decomposition, t represents time, δ(t) represents the Dirac distribution function, ∑ k represents the sum of all modes, and f represents the reconstructed signal.
[0052] By introducing the Lagrange multiplier, equation (1) is transformed into:
[0053]
[0054] Among them, u k and ω kThey represent the Kth component and the center frequency of the Kth component after decomposition, t represents the time, λ represents the Lagrange multiplier coefficient, k represents the mode number, and α is the balance parameter.
[0055] The other parts of this embodiment are the same as those of Embodiment 1, and thus will not be described in detail.
[0056] Embodiment 3:
[0057] This embodiment further optimizes the VMD based on the above-mentioned embodiment 1 or 2. We have improved the VMD with minimizing the decomposition loss as the guiding principle. In the data set used in the present invention, although there are many feature sequences, not all decomposed intrinsic mode functions (IMFs) have significant correlation with each feature sequence. Therefore, those feature sequences with low correlation must be eliminated to improve the accuracy of prediction.
[0058] The decomposition loss refers to the mean absolute error between the reconstructed signal and the original signal. The smaller the error value, the lower the loss in the decomposition process. The present invention uses the minimum decomposition loss as the improvement and guidance standard of VDM.
[0059] The decomposition loss L can be expressed as:
[0060]
[0061]
[0062] Among them, f * (t) represents the original signal, and T represents the time required for the whole process;
[0063] The minimum decomposition loss is expressed as
[0064] Among them, f * (t) represents the original signal; f(t) represents the reconstructed signal; T represents the time required for the whole process; k represents the number of modes, which determines the number of IMFs.
[0065] The relevant data of calculated power generation based on the improved VMD and the historical power generation data are constructed into a power generation data set, and the training set, validation set and test set are divided into training set, validation set and test set in a ratio of 7:1:2 based on data clustering.
[0066] The other parts of this embodiment are the same as any of the above embodiments 1-2, so they are not repeated here.
[0067] Embodiment 4:
[0068] This embodiment is further optimized on the basis of any one of the above embodiments 1-3. After the historical power generation power sequence is processed by optimized VMD, a prediction model based on attention mechanism and long short-term neural network (LSTM) is constructed, and the historical power generation power data processed by optimized VMD is input into it.
[0069] In the prediction model, the hidden state of the LSTM is used as input, and then the context vector that captures the information set is needed to predict the target together with the hidden state.
[0070] Based on the established prediction model, the predicted value of photovoltaic power generation is obtained through a multi-layer LSTM neural network combined with an attention mechanism. For the local minimum problem, the present invention uses a random initialization method, and the learning rate uses adaptive adjustment to adapt to the needs of different training stages, which not only avoids the local minimum but also speeds up the convergence speed. For the problem of model overfitting, the present invention uses dropout technology to prevent overfitting, and through the earlystop method, by comparing the prediction effect of the verification set, continuously store the prediction model with the best effect.
[0071] The other parts of this embodiment are the same as any one of the above embodiments 1-3, so they are not repeated here.
[0072] Embodiment 5:
[0073] This embodiment is further optimized on the basis of any one of the above embodiments 1-4. The present invention uses root mean square error (RMSE), accuracy (Accuracy), mean absolute error (MAE) and determination coefficient (R2) as evaluation indicators of the model to measure the accuracy and stability of photovoltaic power generation prediction.
[0074] Its expression is:
[0075]
[0076]
[0077]
[0078]
[0079] Where n is the number of data; is the predicted value of the i-th data; yi is the i-th data; It is the average value of the data. RMSE measures the deviation between the predicted value and the true value. It is sensitive to outliers in the data. It can evaluate the overall prediction accuracy in photovoltaic power generation prediction. The unit is kW.
[0080] MAE represents the average of the absolute errors between the predicted and observed values. MAE is a linear score. All individual differences are equally weighted on the average value, and there is no problem of magnifying the error by adding squares. Therefore, as a loss function, it is more robust to outliers than RMSE. The unit is kW.
[0081] The accuracy measures the deviation between the predicted result at the 4th hour and the true value, and has no unit;
[0082] R 2 Indicates the correlation between the predicted value and the actual value, unitless.
[0083] The other parts of this embodiment are the same as any one of the above embodiments 1-4, so they are not repeated here.
[0084] Embodiment 6:
[0085] The present invention also provides a system for predicting power generation that matches the method, comprising a data acquisition unit, a model building unit, a power generation prediction unit and a judgment unit.
[0086] Embodiment 7:
[0087] The present invention also provides an electronic device, which includes a processor and a memory; the processor includes the system for predicting generated power as described above.
[0088] Embodiment 8:
[0089] The present invention also provides a computer-readable storage medium, which includes instructions; when the instructions are executed on the electronic device described in the above embodiment, the electronic device executes the method described in the above embodiment. Optionally, the computer-readable storage medium may be a memory.
[0090] The processor involved in the embodiments of the present application may be a chip. For example, it may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips.
[0091] The memory involved in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may 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), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0092] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0093] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0094] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0095] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0096] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one device or distributed on multiple devices. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0097] In addition, each functional module in each embodiment of the present application may be integrated into one device, or each module may exist physically separately, or two or more modules may be integrated into one device.
[0098] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or may contain one or more servers, data centers and other data storage devices that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0099] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for predicting power generation, characterized in that: The following steps are involved: Step S1, collecting and calculating the relevant data of power generation and historical power generation data, processing the relevant data of historical power generation through the improved VMD model, and obtaining the power generation data set; Step S2, constructing a prediction model; Step S3, guiding the prediction model to learn and outputting the trained prediction model; Step S4, collecting relevant data of power generation in real time, and inputting the relevant data of power generation into the trained prediction model to obtain predicted power generation; Step S5: using the evaluation index to determine the accuracy of the power generation prediction.
2. A method for predicting power generation according to claim 1, characterized in that: The relevant data for calculating the power generation in step S1 include meteorological data and photovoltaic module information data.
3. A method for predicting power generation according to claim 1, characterized in that: The method for constructing the optimized VMD model in step S1 includes: improving the VMD model by minimizing the decomposition loss.
4. A method for predicting power generation according to claim 3, characterized in that: Improving the VMD model by minimizing the decomposition loss includes the following steps: Step a, VMD decomposes the input signal into K sub-signals u k (K=1,2,...,K), and expressed as: Where k represents the modal number, and u k and ω k They represent the kth component and the center frequency of the kth component after decomposition, t represents the time, δ(t) represents the Dirac distribution function, ∑k represents the sum of all modes, and f represents the reconstructed signal; Step b, introduce Lagrange multipliers in VMD, expressed as: Among them, u k and ω k They represent the Kth component and the center frequency of the Kth component after decomposition, t represents the time, λ represents the Lagrange multiplier coefficient, k represents the mode number, and α is the balance parameter; Step c, taking the minimum decomposition loss as the improvement and guidance standard of VDM, the decomposition loss is expressed as: Among them, L represents the decomposition loss, f * (t) represents the original signal, and T represents the time required for the whole process; Step d, the decomposition loss is minimized as Among them, f * (t) represents the original signal, f(t) represents the reconstructed signal, T represents the time required for the whole process, and k represents the number of modes.
5. A method for predicting power generation according to claim 1, characterized in that: The step S2 comprises: Construct a prediction model based on attention mechanism and long-short term neural network.
6. A method for predicting power generation according to claim 1, characterized in that: The step S3 comprises: The power generation data set is divided into a training set, a validation set and a test set in a ratio of 7:1:2; Set the learning rate for the adaptive method; The training set is used in combination with a loss function and a learning rate to guide the prediction model learning, and a trained prediction model is output.
7. A method for predicting power generation according to claim 1, characterized in that: The step S5 comprises: The root mean square error evaluation, accuracy evaluation, mean absolute error evaluation and determination coefficient evaluation are used as evaluation indicators of the prediction model to judge the accuracy of the obtained predicted power generation.
8. A system for predicting power generation, used for implementing the method according to any one of claims 1 to 7, characterized in that: The system includes a data acquisition unit, a model building unit, a power generation prediction unit and a judgment unit, wherein: A data acquisition unit is used to collect and calculate the relevant data of power generation and historical power generation data, process the relevant data of historical power generation through the improved VMD model, and obtain the power generation data set; A model building unit, used to build a prediction model; used to guide the prediction model learning and output the trained prediction model; A power generation prediction unit, used for collecting power generation related data in real time, and inputting the power generation related data into the trained prediction model to obtain predicted power generation; The judgment unit is used to judge the accuracy of the power generation prediction using the evaluation index.
9. An electronic device, characterized in that: It comprises a processor and a memory; the processor comprises the system for predicting power generation as claimed in claim 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes instructions; when the instructions are executed on the electronic device as claimed in claim 9, the electronic device is caused to execute the method as claimed in any one of claims 1 to 7.
Citation Information
Cited By
New energy station power interval prediction method
CN120879569A
