Method and device for predicting photovoltaic power generation capacity and nonvolatile storage medium
By acquiring and encoding the recent operation data and environmental parameters of the photovoltaic power generation system, and using neural network models for prediction, the problems of slow prediction speed and high computing resource consumption caused by relying on a large amount of historical data in the existing technology are solved, and efficient short-term photovoltaic power generation prediction is achieved.
Patent Information
- Application Number
- CN202411666181.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, when predicting photovoltaic power generation, all historical power generation data generated before the current moment are relied on, resulting in problems such as large data volume, slow processing speed, and high computing resources consumption.
By obtaining the operation data and environmental parameters of multiple detection moments before the current time of the area to be detected, performing encoding processing, and processing and analysis of the operation data and encoding results using the photovoltaic power generation prediction model, and only relying on a small amount of historical power generation data and related environmental parameters generated by the power grid in a period close to the current time is predicted.
The prediction capability of the photovoltaic power generation prediction model for short-term photovoltaic power generation is improved, the data processing volume when predicting photovoltaic power generation is reduced, and the technical effect of improving prediction speed and saving computing resources is achieved.
Smart Images

Figure CN119721747A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for predicting photovoltaic power generation, and a non-volatile storage medium. Background Art
[0002] With the development and promotion of renewable energy, the installed capacity of photovoltaic power generation systems in suburban distribution networks has continued to increase. However, the output of photovoltaic power generation is affected by many factors such as meteorological conditions and seasonal changes, which makes photovoltaic power highly uncertain. In related technologies, when predicting photovoltaic power generation, it relies on all historical power generation data generated before the current moment, resulting in a large amount of data to be processed when predicting photovoltaic power generation. Therefore, there are problems such as slow data processing speed and high consumption of computing resources.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method and device for predicting photovoltaic power generation, and a non-volatile storage medium, so as to at least solve the technical problems of a large amount of data to be processed and a long prediction time caused by using all historical power generation data generated before the current moment to predict photovoltaic power generation in the related technology.
[0005] According to one aspect of an embodiment of the present application, a method for predicting photovoltaic power generation is provided, comprising: obtaining operating data and environmental parameters of a to-be-detected area at multiple detection moments before a current moment, wherein the operating data is data generated when a target power grid in the to-be-detected area generates electricity, and the time difference between two adjacent detection moments is a preset duration; encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; using a photovoltaic power generation prediction model to process and analyze the operating data and the encoding result to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using historical operating data and historical environmental parameters of the to-be-detected area as training data.
[0006] Optionally, the environmental parameters are encoded to obtain encoding results, including: classifying environmental parameters of the same type to generate a data set, wherein the types include at least: a first type for describing weather conditions, a second type for describing seasons, and a third type for describing meteorological information, where meteorological information is information for describing the physical state of the atmosphere; constructing a coding matrix corresponding to each data set; and encoding the environmental parameters according to the coding matrix to obtain encoding results.
[0007] Optionally, constructing a coding matrix corresponding to each data set, including: for each data set, determining the number of types and the amount of data corresponding to the data set, wherein the number of types is the number of categories of environmental parameters contained in the data set, each type contains multiple categories, and the amount of data is the number of environmental parameters contained in the data set; determining the number of types and the amount of data as row information and column information, respectively, and constructing the coding matrix corresponding to the data set based on the row information and column information.
[0008] Optionally, the environmental parameters are encoded according to the encoding matrix to obtain encoding results, including: for each environmental parameter, determining the category to which the environmental parameter belongs, wherein the multiple first categories contained in the first type correspond to multiple weather conditions, and the weather conditions include at least: sunny, rainy, and cloudy days, the multiple second categories contained in the second type correspond to multiple seasons, and the multiple third categories contained in the third type correspond to multiple meteorological information, and the meteorological information includes at least: solar radiation intensity, temperature, humidity, and wind speed; determining the target element corresponding to the environmental parameter in the encoding matrix according to the category, assigning the target element to a first preset value, and assigning other elements in the encoding matrix except the target element to a second preset value different from the first preset value; converting the target encoding matrix with the first preset value and the second preset value as elements into a row vector, wherein the row vector is the encoding result of the environmental parameter.
[0009] Optionally, a photovoltaic power generation prediction model is used to process and analyze the operation data and the coding results to obtain a prediction result, including: determining the detection time corresponding to each operation data and coding result, and arranging the operation data and the coding results into a data sequence in order of the detection time from early to late, wherein the detection time corresponding to the coding result is determined according to the environmental parameters corresponding to the coding result; splitting the data sequence into multiple subsequences, wherein the lengths of the multiple subsequences are the same and the length of each subsequence is less than the length of the data sequence; determining a target subsequence among the multiple subsequences, wherein the time difference between the earliest detection time among the multiple detection times corresponding to the target subsequence and the current time is less than a preset time difference; and processing and analyzing the target subsequence using the photovoltaic power generation prediction model to obtain a prediction result.
[0010] Optionally, determining a target subsequence among multiple subsequences includes: determining a latest detection moment among multiple detection moments corresponding to each subsequence, and comparing the multiple latest detection moments; determining the latest detection moment among the multiple latest detection moments that is closest to the current moment as the target detection moment, and determining the subsequence corresponding to the target detection moment as the target subsequence.
[0011] Optionally, a photovoltaic power generation prediction model is used to process and analyze the target subsequence to obtain a prediction result, including: arranging the data in the target subsequence in reverse order to obtain a target reverse subsequence corresponding to the target subsequence; processing the target subsequence in the forward neural network layer of the photovoltaic power generation prediction model to obtain a first eigenvector, and processing the target reverse subsequence in the reverse neural network layer of the photovoltaic power generation prediction model to obtain a second eigenvector; processing the first eigenvector, the second eigenvector and a weight matrix to obtain a prediction result, wherein the weight matrix is generated during the training process, and each element in the weight matrix is used to indicate the degree of influence of the operating data and environmental parameters on the photovoltaic power generation at each detection moment.
[0012] According to another aspect of an embodiment of the present application, a device for predicting photovoltaic power generation is also provided, including: an acquisition module, used to obtain operating data and environmental parameters of a to-be-detected area at multiple detection moments before the current moment, wherein the operating data is data generated when a target power grid in the to-be-detected area generates electricity, and the time difference between two adjacent detection moments is a preset duration; an encoding module, used to encode the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; a prediction module, used to process and analyze the operating data and the encoding result using a photovoltaic power generation prediction model to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using historical operating data and historical environmental parameters of the to-be-detected area as training data.
[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a computer program is stored, wherein a device where the non-volatile storage medium is located executes the above-mentioned method for predicting photovoltaic power generation by running the computer program.
[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above-mentioned method for predicting photovoltaic power generation through the computer program.
[0015] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, which implement the above-mentioned method for predicting photovoltaic power generation when executed by a processor.
[0016] In an embodiment of the present application, the following method is adopted: obtaining the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected is generating electricity, and the time difference between two adjacent detection moments is a preset duration; encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; using a photovoltaic power generation prediction model to process and analyze the operating data and the encoding result to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data, and by using the historical operating data of the power grid The power generation (i.e. historical operation data) and historical environmental parameters are used as training data, and a neural network model is trained based on the attention mechanism to obtain a photovoltaic power generation prediction model; the photovoltaic power generation prediction model can be used to predict the power generation of the power grid in the future by relying only on a small amount of historical power generation data generated by the power grid in a period close to the current moment and related environmental parameters, thereby improving the photovoltaic power generation prediction model's prediction ability for short-term photovoltaic power generation, achieving the purpose of reducing the amount of data processing when predicting photovoltaic power generation, thereby achieving the technical effect of improving the prediction speed and saving computing resources, and further solving the technical problems of a large amount of data to be processed and a long prediction time caused by using all historical power generation data generated before the current moment to predict photovoltaic power generation in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 is a hardware structure block diagram of a computer terminal for implementing a method for predicting photovoltaic power generation according to an embodiment of the present application;
[0019] Figure 2 is a flowchart of the steps of a method for predicting photovoltaic power generation according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of data processing according to a photovoltaic power generation prediction model of an embodiment of the present application;
[0021] Figure 4 is a network structure diagram of a photovoltaic power generation prediction model according to an embodiment of the present application;
[0022] Figure 5 is a structural diagram of a device for predicting photovoltaic power generation according to an embodiment of the present application;
[0023] Figure 6 is a graph showing a change trend of prediction accuracy of a photovoltaic power generation prediction model during training according to an embodiment of the present application;
[0024] Figure 7 It is an error comparison value when different models according to an embodiment of the present application make predictions for the same data set. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] In the related art, statistical models or time series models are usually used to predict photovoltaic power generation. The above models are not effective in dealing with nonlinear and non-stationary problems, and there is a problem of low accuracy of prediction results. At the same time, the related art often ignores the influence of environmental factors when predicting photovoltaic power generation, which will also reduce the accuracy of the prediction results. In addition, the data collected by each monitoring point in the suburban distribution network is scattered, and the collected data is discrete data. The above model cannot perform real-time photovoltaic power generation prediction for complex regional power grids based on discrete data, and there is a problem of non-universality. In order to solve this problem, a relevant solution is provided in the embodiment of the present application, which is described in detail below.
[0028] According to an embodiment of the present application, a method embodiment for predicting photovoltaic power generation is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a method for predicting photovoltaic power generation. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method for predicting photovoltaic power generation in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned method for predicting photovoltaic power generation. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0033] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0034] The embodiment of the present application provides a method for predicting photovoltaic power generation that can be operated in the above operating environment. Figure 2 is a flowchart of the steps of the method for predicting photovoltaic power generation provided in an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0035] Step S202, obtaining the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected generates electricity, and the time difference between two adjacent detection moments is a preset duration.
[0036] The method provided in the embodiment of the present application can be applied to suburban power distribution networks, and the data used for predicting photovoltaic power generation is updated by periodically collecting relevant data of the power grid to be tested and the area where it is located, so as to ensure that the data used in the prediction are data at multiple moments close to the current moment, so as to improve the accuracy of the prediction results; in step S202, the purpose of periodic collection is achieved by collecting relevant data of the power grid to be tested (and the target power grid) and the area where it is located (i.e., the area to be detected) at multiple detection moments with equal time differences (for example, all equal to a preset duration); wherein the collected relevant data includes operating data (for example, photovoltaic power generation) generated when the power grid to be tested (i.e., the target power grid) is generating electricity, and also includes environmental parameters of the area where the power grid to be tested (and the area to be detected) is located.
[0037] Step S204, encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data.
[0038] Among the data collected in step S202, the operation data of the power grid to be tested can be the photovoltaic power generation and photovoltaic power generation of the power grid to be tested, which are all numerical data; while the environmental parameters of the area to be tested, such as weather and season, are not numerical data. Therefore, in step S204, before using the acquired data to predict the photovoltaic power generation of the power grid to be tested, the environmental parameters need to be converted into numerical data. For example, each environmental parameter can be converted into a corresponding encoding result by encoding, wherein the encoding result can be a sequence composed of multiple numbers or a single number, but the encoding results are all numerical data. When encoding the environmental parameters, the Unicode encoding method can be adopted, and other encoding methods can also be adopted. When the Unicode encoding is adopted to encode the environmental parameters, the environmental parameters are converted into numerical data by querying the encoding corresponding to the text description information of the environmental parameters in the character set.
[0039] According to an optional embodiment of the present application, the environmental parameters are encoded to obtain encoding results, including: classifying the environmental parameters of the same type to generate a data set, wherein the types include at least: a first type for describing weather conditions, a second type for describing seasons, and a third type for describing meteorological information, where meteorological information is information for describing the physical state of the atmosphere; constructing a coding matrix corresponding to each data set; and encoding the environmental parameters according to the coding matrix to obtain encoding results.
[0040] As mentioned in step S204, other encoding methods other than Unicode encoding can also be used to convert environmental parameters into numerical data. For example, in this embodiment, environmental parameters are converted into numerical data by constructing an encoding matrix. Specifically, in this embodiment, the encoding matrix is constructed according to the type of environmental parameters and the amount of data of each type of environmental parameters. As mentioned in the above embodiment, the environmental parameters of the area to be measured include weather, season, etc., wherein the environmental parameters used to describe the weather state all belong to parameters of one type (i.e., the first type), the environmental parameters used to describe the season all belong to parameters of another type (i.e., the second type) different from the previous type (i.e., the first type), and the environmental parameters used to describe meteorological information all belong to environmental parameters of other types (i.e., the third type) different from the previous two types (the first type and the second type); for example, environmental parameters such as "sunny", "cloudy", "overcast", "rainy", "snowy", "thunderstorm" all belong to environmental parameters of the first type; environmental parameters such as "spring", "summer", "autumn", "winter" all belong to environmental parameters of the second type, and environmental parameters such as "wind direction", "temperature", "humidity", "air pressure" and the like that describe the atmospheric state all belong to environmental parameters of the third type. Therefore, the obtained environmental parameters can be classified into different types. When converting the environmental parameters into numerical data, the environmental parameters of the same type are first classified to generate a data set; further, a coding matrix corresponding to each data set is constructed; finally, the corresponding environmental parameters are encoded using the constructed coding matrix to obtain the numerical form corresponding to the environmental parameters (i.e., the coding result).
[0041] Optionally, constructing a coding matrix corresponding to each data set, including: for each data set, determining the number of types and the amount of data corresponding to the data set, wherein the number of types is the number of categories of environmental parameters contained in the data set, each type contains multiple categories, and the amount of data is the number of environmental parameters contained in the data set; determining the number of types and the amount of data as row information and column information, respectively, and constructing the coding matrix corresponding to the data set based on the row information and column information.
[0042] As mentioned in the above embodiment, when the environmental parameters are converted into numerical data by constructing a coding matrix, the coding matrix is first constructed according to the type of environmental parameters and the data amount of each type of environmental parameters, wherein each type of environmental parameters contains multiple different categories of environmental parameters, for example, the environmental parameters of the weather type (i.e., the first type) respectively contain multiple categories such as "sunny", "rainy", and "cloudy", the environmental parameters of the season type (i.e., the second type) respectively contain multiple categories such as "spring", "summer", "autumn", and "winter", and the environmental parameters of the meteorological type (i.e., the third type) respectively contain multiple categories such as "wind direction", "temperature", and "humidity"; then, after the same type of environmental parameters are classified to generate a data set, it is necessary to further determine the number of categories of environmental parameters contained in each data set (i.e., the number of types), and then use the number of types of the data set and the number of environmental parameters contained in the data set (i.e., the amount of data) as the row information and column information of the matrix to construct the coding matrix; wherein, when constructing the coding matrix, the number of types can be used as the row information and the amount of data can be used as the column information; or the amount of data can be used as the row information and the number of types can be used as the column information. For example, the number of categories corresponding to the data set composed of seasonal type (i.e., the third type) environmental parameters is 4. Then, using the number of categories as row information, a coding matrix with 4 rows and 1 column will be generated. Each row of the coding matrix represents a different category of environmental parameters, and each column of the coding matrix represents the number of environmental parameters of that category. Each element in the coding matrix is the number of data representing "spring", the number of data representing "summer", and the number of data representing "autumn", respectively.
[0043] Optionally, the environmental parameters are encoded according to the encoding matrix to obtain encoding results, including: for each environmental parameter, determining the category to which the environmental parameter belongs, wherein the multiple first categories contained in the first type correspond to multiple weather conditions, and the weather conditions include at least: sunny, rainy, and cloudy days, the multiple second categories contained in the second type correspond to multiple seasons, and the multiple third categories contained in the third type correspond to multiple meteorological information, and the meteorological information includes at least: solar radiation intensity, temperature, humidity, and wind speed; determining the target element corresponding to the environmental parameter in the encoding matrix according to the category, assigning the target element to a first preset value, and assigning other elements in the encoding matrix except the target element to a second preset value different from the first preset value; converting the target encoding matrix with the first preset value and the second preset value as elements into a row vector, wherein the row vector is the encoding result of the environmental parameter.
[0044] Further, in the present embodiment, for each type of environmental parameter, it is encoded by means of a constructed coding matrix. In the present embodiment, the environmental parameters of the weather type (i.e., the first type) are respectively identified as environmental parameters of the categories of "sunny", "rainy" and "cloudy"; the environmental parameters of the season type (i.e., the second type) are respectively identified as environmental parameters of the categories of "spring", "summer", "autumn" and "winter"; the environmental parameters of the meteorological type (i.e., the third type) are respectively identified as environmental parameters of the categories of "solar radiation intensity", "temperature", "humidity" and "wind speed"; for a row / column in the coding matrix corresponding to the weather type (i.e., the first type), the value of the element (i.e., the target element) representing the category of "sunny" is assigned to a first preset value (e.g., 1), and the values of the elements (i.e., other elements) representing the categories of "rainy" and "cloudy" in the same row / column are assigned to a second preset value (e.g., 0), that is, each row (or each column) in the coding matrix is only used to represent one category. Through the above method, the elements in the coding matrix will be converted into a matrix containing only the first preset value and the second preset value (i.e., the target coding matrix), and each category of environmental parameters corresponds to a row or a column of the target coding matrix (if the number of categories is used as row information when constructing the coding matrix, each category of environmental parameters corresponds to a row of the target coding matrix; otherwise, if the number of categories is used as column information when constructing the coding matrix, each category of environmental parameters corresponds to a column of the target coding matrix). In this embodiment, a row / column corresponding to each category of environmental parameters in the target coding matrix is converted into the form of a row vector, and the encoding result of the environmental parameters of the category is obtained. For example, the classification label representing the environmental parameters of the category "Spring" is IV. After encoding using the above method, the encoding result of "Spring" can be expressed as [1, 0, 0, 0].
[0045] Step S206, using a photovoltaic power generation prediction model to process and analyze the operating data and the encoding results to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment. The photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data.
[0046] After the environmental parameters are converted into numerical data in step S204, the numerical form corresponding to the environmental parameters (i.e., the encoding result) and the operating data of the power grid to be tested obtained in step S202 are used as input data. In step S206, the pre-trained photovoltaic power generation prediction model is used to process and analyze the above input data to obtain a predicted value (i.e., a prediction result) output by the photovoltaic power generation prediction model for indicating the photovoltaic power generation output by the power grid to be tested at a future moment (such as the next detection moment); wherein the photovoltaic power generation prediction model is essentially a neural network model, and the environmental parameters of the area to be tested at multiple moments before the current moment (i.e., historical environmental parameters) and the operating data of the power grid to be tested at multiple detection moments before the current moment (i.e., historical operating data) are used as training data, and the above photovoltaic power generation prediction model can be obtained by training the neural network model based on the attention mechanism; it should be noted that the number of historical environmental parameters and historical operating data used as training data is much larger than the historical environmental parameters and historical operating data obtained in step S202 for predicting photovoltaic power generation.
[0047] In step S206, the photovoltaic power generation prediction model may be loaded into the memory, for example, the raw data of the photovoltaic power generation prediction model may be loaded from the non-volatile memory into the volatile memory, so that the processor runs the photovoltaic power generation prediction model. The raw data of the photovoltaic power generation prediction model refers to unprocessed data, and generally includes parameters and structural data of the photovoltaic power generation prediction model. The structural data may be a calculation relationship based on the parameters, such as a forward propagation calculation relationship between intermediate layers and neurons. Specifically, the structural data may include code related to the structure of the photovoltaic power generation prediction model, such as code for performing related calculations between intermediate layers and neurons.
[0048] In one embodiment, an area for loading the photovoltaic power generation prediction model can be divided in the memory, which can include a structure data storage area and a parameter storage area. The structure data storage area is used to store structure-related codes, and the parameters referenced by it can point to the address of a specific parameter in the parameter storage area through a pointer. During the training process of the photovoltaic power generation prediction model, it may be necessary to frequently update the parameters, and the parameter values in the parameter storage area can be updated.
[0049] According to another optional embodiment of the present application, a photovoltaic power generation prediction model is used to process and analyze the operation data and the encoding results to obtain a prediction result, including: determining the detection time corresponding to each operation data and the encoding result, and arranging the operation data and the encoding results into a data sequence in order of the detection time from early to late, wherein the detection time corresponding to the encoding result is determined according to the environmental parameters corresponding to the encoding result; splitting the data sequence into multiple subsequences, wherein the lengths of the multiple subsequences are the same and the length of each subsequence is less than the length of the data sequence; determining a target subsequence among the multiple subsequences, wherein the time difference between the earliest detection time among the multiple detection times corresponding to the target subsequence and the current time is less than a preset time difference; and processing and analyzing the target subsequence using the photovoltaic power generation prediction model to obtain a prediction result.
[0050] Figure 3 It is a schematic diagram of data processing of photovoltaic power generation prediction model, such as Figure 3 As shown in Figure 1, the photovoltaic power generation prediction model uses the operating data (power generation) and environmental parameters (meteorological factors, weather type, season) at multiple moments before the current moment as input, where the meteorological factors mainly include solar radiation intensity, temperature, humidity, wind speed, etc. The data processing process includes data normalization and denormalization, as well as the use of sliding windows to collect data sets, etc. Among them, data normalization is mainly for operating data normalization. For example, according to the formula Normalize the running data, where x represents the data to be normalized (i.e., a data in the running data), x min Represents the data with the smallest value in the running data, x maxRepresents the data with the largest value in the operation data. The operation data is normalized in the above manner, and the values of the operation data are unified into a numerical range, for example, unified into [0,1]. It should be noted that in this embodiment, the operation data may not be normalized. Non-normalization refers to the process of converting environmental parameters into numerical data. In this embodiment, after the environmental parameters are converted into numerical data (i.e., encoding results), a sliding window acquisition process is performed. First, the detection time corresponding to each data (operation data and encoding results) is arranged from early to late into a data sequence, wherein the detection time corresponding to the encoding result is the detection time corresponding to the environmental parameter corresponding to the encoding result; further, the data sequence generated by the above arrangement is split into multiple subsequences of equal length and smaller than the original data sequence through a sliding window, wherein the size of the sliding window is the length of each subsequence; for example, if the size of the sliding window is 5, each subsequence contains operation data and environmental parameters at 5 consecutive detection times. Since the photovoltaic power generation prediction model provided by the embodiment of the present application can realize short-term photovoltaic power generation prediction, it only needs to use the operating data and environmental parameters at multiple historical detection moments closest to the current moment as the data for prediction. Therefore, it is necessary to determine the subsequence (i.e., the target subsequence) composed of the operating data and environmental parameters at multiple historical detection moments closest to the current moment in the multiple sequences generated by splitting, and then analyze the target subsequence to obtain the photovoltaic power generation prediction value (i.e., the prediction result).
[0051] Optionally, determining a target subsequence among multiple subsequences includes: determining a latest detection moment among multiple detection moments corresponding to each subsequence, and comparing the multiple latest detection moments; determining the latest detection moment among the multiple latest detection moments that is closest to the current moment as the target detection moment, and determining the subsequence corresponding to the target detection moment as the target subsequence.
[0052] In this embodiment, a subsequence (i.e., a target subsequence) consisting of the operating data and environmental parameters at multiple historical detection moments closest to the current moment is determined according to the time difference between the detection moment corresponding to the data (operating data and environmental parameters) contained in each subsequence and the current moment. Specifically, for each subsequence, its corresponding latest detection moment (i.e., the latest detection moment corresponding to the multiple detection moments corresponding to the multiple operating data and environmental parameters contained in the subsequence) is determined to obtain the latest detection moment corresponding to each subsequence. Next, by comparing the latest detection moment corresponding to each subsequence, a detection moment (i.e., the target detection moment) having the smallest time difference with the current moment is determined among the multiple latest detection moments. The subsequence (i.e., the subsequence corresponding to the target detection moment) containing the data (operating data or environmental parameters) is the sequence (i.e., the target subsequence) to be used when the photovoltaic power generation prediction model is used for prediction.
[0053] Optionally, a photovoltaic power generation prediction model is used to process and analyze the target subsequence to obtain a prediction result, including: arranging the data in the target subsequence in reverse order to obtain a target reverse subsequence corresponding to the target subsequence; processing the target subsequence in the forward neural network layer of the photovoltaic power generation prediction model to obtain a first eigenvector, and processing the target reverse subsequence in the reverse neural network layer of the photovoltaic power generation prediction model to obtain a second eigenvector; processing the first eigenvector, the second eigenvector and a weight matrix to obtain a prediction result, wherein the weight matrix is generated during the training process, and each element in the weight matrix is used to indicate the degree of influence of the operating data and environmental parameters on the photovoltaic power generation at each detection moment.
[0054] Figure 4 It is the network structure diagram of the photovoltaic power generation prediction model, such as Figure 4 As shown in Figure 1, the photovoltaic power generation prediction model consists of an input layer, a backbone layer, and an output layer, where the data processing process is mainly concentrated in the backbone layer; Figure 4 As shown, the backbone layer includes a bidirectional long short-term attention (BiLSTM-Attention) model. The BiLSTM-Attention model includes two neural network layers, a forward neural network layer and a reverse neural network layer. In this embodiment, after screening out a subsequence (i.e., a target subsequence) composed of operating data and environmental parameters at multiple historical detection moments closest to the current moment, when the photovoltaic power generation prediction model is used to process it, the target subsequence is analyzed and processed in the forward network layer of the BiLSTM-Attention model to obtain a feature vector H p(i.e., the first eigenvector). At the same time, the target reverse subsequence generated by reversing the target subsequence is analyzed and processed in the reverse network layer of the BiLSTM-Attention model to obtain another eigenvector H n (i.e., the second eigenvector), and obtain the weight matrix generated during the training process of the photovoltaic power generation prediction model, based on the eigenvector H p , eigenvector H n And the weight matrix are processed together to obtain the final prediction result, where the feature vector H p , eigenvector H n When processing with the weight matrix, first transform the eigenvector H p and the eigenvector H n For example, by combining the feature vector H p and the eigenvector H n The fusion is performed by adding them one by one to generate a new feature vector H. The above fusion process can be expressed as the formula H = H n +H p ; Next, multiply each element in the new feature vector by each element corresponding to it in the weight matrix to obtain multiple products, add the multiple products and input them into the output layer for calculation and processing to obtain the final prediction result. The above-mentioned weight matrix contains multiple weight values (i.e., elements), each weight value corresponds to one of the multiple detection moments corresponding to the target subsequence, and is used to indicate the influence of the operating data and environmental parameters at this detection moment on the prediction result. The larger the weight value corresponding to a certain detection moment, the greater the influence of the operating data and environmental parameters at this detection moment on the prediction result.
[0055] In the training process of the photovoltaic power generation prediction model, the weight matrix is generated in the following way. The Attention mechanism calculates the weight of each time step respectively, and then emphasizes and highlights the role of high-weight time steps in the data information of transmission power prediction. The Attention layer takes the feature vector (the fused feature vector) output by BiLSTM as the processing object, and according to the formula Calculate and normalize the Attention weight for each time step, where h T represents the feature vector output at the previous detection time at time i, h i represents the feature vector output at the detection time i, W, U, b are the network parameters of the neural network model, S ti represents the Attention weight value corresponding to the detection time i, a ti is the normalized result, T x represents the total number of detection moments contained in the sequence, S tjrepresents the attention weight value corresponding to the detection time i, j is the starting detection time in the sequence, and is also the earliest detection time among the multiple detection times corresponding to the sequence. The processing of outputting the final prediction result during training and the processing of outputting the final prediction result during application are the same, both based on the formula The calculation is based on the principle represented by i ) and its corresponding weight (a ti ) are multiplied, and then all the products are added together to obtain the characteristic vector (C). The photovoltaic power generation prediction model analyzes and processes the characteristic vector C to obtain the final result.
[0056] Through the above steps, it is possible to provide a model that can perform photovoltaic power generation based on short-term historical data, taking into account the impact of power grid operation data and environmental parameters of the area where the power grid is located on power generation. The photovoltaic power generation of the distribution network at future times can be predicted based on less historical operation data and environmental parameters, thereby improving the accuracy of the prediction results and having a higher prediction accuracy in different weather and seasons.
[0057] Figure 5 is a structural diagram of a device for predicting photovoltaic power generation provided according to an embodiment of the present application, such as Figure 5 As shown, the device for predicting photovoltaic power generation includes: an acquisition module 50, which is used to obtain the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected is generating electricity, and the time difference between two adjacent detection moments is a preset duration; an encoding module 52, which is used to encode the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; a prediction module 54, which is used to process and analyze the operating data and the encoding result using a photovoltaic power generation prediction model to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data.
[0058] It should be noted that Figure 5 The preferred implementation of the illustrated embodiment can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.
[0059] Figure 6It is a trend chart of the change in the prediction accuracy of the photovoltaic power generation prediction model during the training process. In order to verify the method provided in the embodiment of the present application, the data generated by the distribution network between month B and month C in year A, as well as the environmental parameters of the area where the distribution network is located during this period, are collected. During the test, the sensor collects meteorological data every two minutes, such as solar radiation intensity, temperature, humidity and wind speed, and the average value is recorded in the meteorological database every 30 minutes; all data in the meteorological database except the test day are used as training sets to train the prediction model, and X month Y day (light rain, 4.3-12.6℃), M month N day (cloudy, 6.5-27.4℃) and Z month W day (sunny, 12-30.3℃) are selected as test days for verification. During the experiment, the total number of samples is set to 4500, the number of training times is 64, the number of iterations is 600, the time step is 801, the learning rate is 0.05, and the loss rate is 0.4 to train the neural network model, such as Figure 6 As shown, the horizontal axis is the number of iterations, and the vertical axis is the accuracy of the prediction results. Figure 6 It can be seen that with the continuous increase in the number of iterations, the training loss of the BiLSTM-Attention network model continues to decrease, while the accuracy of power generation prediction continues to improve.
[0060] Figure 7 It is the error comparison value when different models predict the same data set, such as Figure 7 As shown in the figure, the mean absolute error (MAE) is used as the evaluation indicator to evaluate the experimental prediction results. The average error of the four seasons predicted by the BiLSTM-Attention model reaches 2.86KW, and the absolute error of the prediction results (y MAE ) is 2.34%, which is significantly improved in error and accuracy indicators compared to the LSTM-Attention model, LSTM model and convolutional neural network model.
[0061] An embodiment of the present application further provides a non-volatile storage medium, in which a computer program is stored, wherein a device where the non-volatile storage medium is located executes the above method for predicting photovoltaic power generation by running the computer program.
[0062] The above-mentioned non-volatile storage medium is used to store programs that perform the following functions: obtaining operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is data generated when the target power grid in the area to be detected is generating electricity, and the time difference between two adjacent detection moments is a preset duration; encoding the environmental parameters to obtain encoding results, wherein the encoding results are numerical data; using a photovoltaic power generation prediction model to process and analyze the operating data and the encoding results to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using historical operating data and historical environmental parameters of the area to be detected as training data.
[0063] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the above method for predicting photovoltaic power generation through the computer program.
[0064] The processor in the above-mentioned electronic device is used to run a program that performs the following functions: obtaining the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected is generating electricity, and the time difference between two adjacent detection moments is a preset duration; encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; using a photovoltaic power generation prediction model to process and analyze the operating data and the encoding result to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data.
[0065] The embodiment of the present application also provides a computer program product, including computer instructions, which implement the above method for predicting photovoltaic power generation when executed by a processor.
[0066] It should be noted that the various modules in the above-mentioned device for predicting photovoltaic power generation can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0067] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0068] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0069] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, 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 units or modules, which can be electrical or other forms.
[0070] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0071] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0072] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0073] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for predicting photovoltaic power generation, characterized in that: include: Acquire the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected generates electricity, and the time difference between two adjacent detection moments is a preset duration; Encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; A photovoltaic power generation prediction model is used to process and analyze the operating data and the encoding result to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment. The photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data.
2. The method according to claim 1, characterized in that The environmental parameters are encoded to obtain an encoding result, including: Classifying the environmental parameters of the same type to generate a data set, wherein the types at least include: a first type for describing weather conditions, a second type for describing seasons, and a third type for describing meteorological information, wherein the meteorological information is information for describing the physical state of the atmosphere; Constructing a coding matrix corresponding to each of the data sets; The environmental parameters are encoded according to the encoding matrix to obtain an encoding result.
3. The method according to claim 2, characterized in that Constructing a coding matrix corresponding to each of the data sets, including: For each of the data sets, determine the number of types and the amount of data corresponding to the data set, wherein the number of types is the number of categories of environmental parameters included in the data set, each type includes a plurality of the categories, and the amount of data is the number of environmental parameters included in the data set; The number of categories and the amount of data are determined as row information and column information respectively, and a coding matrix corresponding to the data set is constructed according to the row information and the column information.
4. The method according to claim 2, characterized in that: The environmental parameters are encoded according to the encoding matrix to obtain an encoding result, including: For each of the environmental parameters, determine the category to which the environmental parameter belongs, wherein the multiple first categories contained in the first type correspond to multiple weather conditions, and the weather conditions at least include: sunny day, rainy day, cloudy day, the multiple second categories contained in the second type correspond to multiple seasons, and the multiple third categories contained in the third type correspond to multiple meteorological information, and the meteorological information at least includes: solar radiation intensity, temperature, humidity, wind speed; Determine a target element corresponding to the environmental parameter in the coding matrix according to the category, assign the target element to a first preset value, and assign other elements in the coding matrix except the target element to a second preset value different from the first preset value; A target coding matrix having the first preset value and the second preset value as elements is converted into a row vector, wherein the row vector is a coding result of the environmental parameter.
5. The method according to claim 1, characterized in that The photovoltaic power generation prediction model is used to process and analyze the operation data and the encoding result to obtain a prediction result, including: Determine the detection time corresponding to each of the operation data and the encoding result, and arrange the operation data and the encoding result into a data sequence in the order of the detection time from early to late, wherein the detection time corresponding to the encoding result is determined according to the environmental parameter corresponding to the encoding result; Splitting the data sequence into multiple subsequences, wherein the lengths of the multiple subsequences are the same and the length of each subsequence is smaller than the length of the data sequence; Determine a target subsequence from the multiple subsequences, wherein a time difference between an earliest detection moment among the multiple detection moments corresponding to the target subsequence and the current moment is less than a preset time difference; The photovoltaic power generation prediction model is used to process and analyze the target subsequence to obtain the prediction result.
6. The method according to claim 5, characterized in that Determining a target subsequence among the plurality of subsequences comprises: Determine the latest detection time among the multiple detection times corresponding to each of the subsequences, and compare the multiple latest detection times; The latest detection time closest to the current time among the multiple latest detection times is determined as the target detection time, and the subsequence corresponding to the target detection time is determined as the target subsequence.
7. The method according to claim 5, characterized in that The photovoltaic power generation prediction model is used to process and analyze the target subsequence to obtain the prediction result, including: Arrange the data in the target subsequence in reverse order to obtain a target reverse subsequence corresponding to the target subsequence; Processing the target subsequence in the forward neural network layer of the photovoltaic power generation prediction model to obtain a first feature vector, and processing the target reverse subsequence in the reverse neural network layer of the photovoltaic power generation prediction model to obtain a second feature vector; The first eigenvector, the second eigenvector and the weight matrix are processed to obtain the prediction result, wherein the weight matrix is generated during the training process, and each element in the weight matrix is used to indicate the degree of influence of the operating data and the environmental parameters on the photovoltaic power generation at each detection moment.
8. A device for predicting photovoltaic power generation, characterized in that: include: An acquisition module is used to acquire the operating data and environmental parameters of the area to be detected at multiple detection moments before the current moment, wherein the operating data is the data generated when the target power grid in the area to be detected generates electricity, and the time difference between two adjacent detection moments is a preset duration; An encoding module, used for encoding the environmental parameters to obtain an encoding result, wherein the encoding result is numerical data; A prediction module is used to process and analyze the operating data and the encoding result using a photovoltaic power generation prediction model to obtain a prediction result, wherein the prediction result is used to indicate the photovoltaic power generation of the target power grid at the next detection moment, and the photovoltaic power generation prediction model is obtained by training a neural network model using the historical operating data and historical environmental parameters of the area to be detected as training data.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, wherein the device where the non-volatile storage medium is located executes the method for predicting photovoltaic power generation according to any one of claims 1 to 7 by running the computer program.
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores a computer program, and the processor is configured to execute the method for predicting photovoltaic power generation according to any one of claims 1 to 7 through the computer program.
11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the method for predicting photovoltaic power generation according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Ultra-short-term photovoltaic power generation power prediction method based on time sequence dynamic regression
CN112070319A
Short-term photovoltaic power prediction method
CN113627070A
Hybrid deep learning short-term irradiance prediction method
CN115409258A
Photovoltaic power generation short-term prediction method and system based on neural network
CN117556958A
Cited By
Abnormality detection method and related device, electronic equipment and storage medium
CN121644243A