Method, device, equipment and storage medium for predicting optical power
1. A method for predicting optical power, the method comprising:
acquiring historical meteorological data and meteorological prediction data of at least two meteorological sources, and acquiring actual optical power corresponding to the historical meteorological data;
preprocessing historical meteorological data and meteorological prediction data of each meteorological source and the actual light power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources;
calling a prediction model to perform light power prediction based on each characteristic data sequence to obtain at least two candidate light powers corresponding to the at least two characteristic data sequences;
and determining a predicted light power corresponding to the meteorological prediction data based on the at least two candidate light powers.
2. The method of claim 1, wherein the prediction model comprises a multi-modal input layer, at least two coding modules, and at least two prediction modules;
the calling the prediction model to perform optical power prediction based on each characteristic data sequence to obtain at least two candidate optical powers corresponding to the at least two characteristic data sequences, including:
inputting the ith characteristic data sequence into the ith coding module through the multi-modal input layer;
performing feature coding on the ith feature data sequence through the ith coding module to obtain an ith feature coding vector;
and performing light power prediction on the basis of the ith characteristic coding vector through an ith prediction module to obtain ith candidate light power, wherein i is a positive integer.
3. The method of claim 2, wherein the prediction module comprises a first network, a second network incorporating a time-step attention mechanism;
the obtaining of the ith candidate optical power by performing optical power prediction based on the ith feature encoding vector through the ith prediction module includes:
performing time sequence feature extraction on the ith feature coding vector through the first network to obtain a hidden layer vector which implies a time sequence relation of an upper time step and a lower time step;
and predicting the optical power based on the hidden layer vector through the second network to obtain the ith candidate optical power.
4. The method of claim 2, wherein the encoding module comprises a feature pyramid network;
the feature coding the ith feature data sequence through the ith coding module to obtain an ith feature coding vector includes:
and performing feature coding on the ith feature data sequence through a feature pyramid network in the ith coding module to obtain the ith feature coding vector.
5. The method of any one of claims 1 to 3, wherein the pre-processing the historical meteorological data and meteorological predicted data for each meteorological source with the actual optical power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources comprises:
constructing an ith optical power calculation function based on historical meteorological data and actual optical power of an ith meteorological source;
calling the ith optical power calculation function to calculate theoretical optical power corresponding to meteorological prediction data of the ith meteorological source;
and combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power according to a time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source, wherein i is a positive integer.
6. The method of any one of claims 1 to 3, wherein the pre-processing the historical meteorological data and meteorological predicted data for each meteorological source with the actual optical power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources comprises:
constructing an optical power calculation function based on historical meteorological data and actual optical power of the at least two meteorological sources;
calling the optical power calculation function to calculate theoretical optical power corresponding to meteorological prediction data of the ith meteorological source;
and combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power according to a time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source, wherein i is a positive integer.
7. The method according to any one of claims 1 to 3, wherein the training process of the predictive model comprises:
acquiring first meteorological data and second meteorological data of the at least two meteorological sources, and acquiring first historical optical power corresponding to the first meteorological data, wherein the second meteorological data is marked with second historical optical power, and the weather time described by the first meteorological data is prior to the weather time described by the second meteorological data;
preprocessing the first meteorological data and the second meteorological data of each meteorological source and the first historical optical power to obtain at least two sample characteristic data sequences corresponding to the at least two meteorological sources;
calling a neural network model to carry out optical power prediction based on each sample characteristic data sequence to obtain at least two sample candidate optical powers corresponding to the at least two sample characteristic data sequences;
and training the neural network model based on the prediction loss between the at least two sample candidate optical powers and the second historical optical power to obtain the prediction model.
8. An apparatus for predicting optical power, the apparatus comprising:
the acquisition module is used for acquiring historical meteorological data and meteorological prediction data of at least two meteorological sources and acquiring actual optical power corresponding to the historical meteorological data;
the preprocessing module is used for preprocessing historical meteorological data and meteorological prediction data of each meteorological source and the actual light power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources;
the calling module is used for calling a prediction model to predict the light power based on each characteristic data sequence to obtain at least two candidate light powers corresponding to the at least two characteristic data sequences;
a determining module, configured to determine a predicted optical power corresponding to the weather prediction data based on the at least two candidate optical powers.
9. An electronic device, characterized in that the electronic device comprises:
a memory, a processor coupled to the memory;
the processor configured to load and execute executable instructions stored in the memory to implement the method of predicting optical power of any of claims 1 to 7.
10. A computer readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions; the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement a method of predicting optical power as claimed in any of claims 1 to 7.
Background
Nowadays, photovoltaic power generation technology has become a new energy power generation technology which is mature in renewable energy and has large-scale and commercial development prospect. With the rapid development of photovoltaic power generation technology, the influence of photovoltaic grid-connected power generation on a grid system is increasingly remarkable.
When solar irradiation exists, direct current of photovoltaic power generation is inverted into sinusoidal alternating current, the generated alternating current can be directly supplied to an alternating current load, and then the rest electric energy is input into a power grid, or all the generated electric energy is directly merged into the power grid; when no solar radiation exists, the load power is completely supplied by the power grid. The method is an important form for realizing large-scale efficient utilization of photovoltaic power generation, but the difficulty and complication of power grid operation scheduling can be caused when the photovoltaic power generation is connected to a power grid on a large scale, and the safe and stable operation of the power grid is influenced.
Therefore, the grid operation scheduling during photovoltaic grid-connected power generation can be coordinated through prediction of the variation trend of the light power. Illustratively, a time series method, a neural network model, a gradient lifting tree or the like is adopted for modeling, and an original data sequence of weather forecast is used as input data to predict the change trend of the light power; however, since the sunlight irradiation relied on by photovoltaic power generation has the characteristics of randomness, intermittence, uncontrollable property and the like, the short-term trend of light is difficult to capture, and further the method cannot predict the light power under the short-term trend with high precision.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for predicting optical power, which can improve the prediction precision of the optical power. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method of predicting optical power, the method including:
acquiring historical meteorological data and meteorological prediction data of at least two meteorological sources, and acquiring actual optical power corresponding to the historical meteorological data;
preprocessing historical meteorological data and meteorological prediction data of each meteorological source and the actual light power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources;
calling a prediction model to perform light power prediction based on each characteristic data sequence to obtain at least two candidate light powers corresponding to the at least two characteristic data sequences;
and determining a predicted light power corresponding to the meteorological prediction data based on the at least two candidate light powers.
According to another aspect of the present application, there is provided an optical power prediction apparatus, including:
the acquisition module is used for acquiring historical meteorological data and meteorological prediction data of at least two meteorological sources and acquiring actual optical power corresponding to the historical meteorological data;
the preprocessing module is used for preprocessing historical meteorological data and meteorological prediction data of each meteorological source and the actual light power to obtain at least two characteristic data sequences corresponding to the at least two meteorological sources;
the calling module is used for calling a prediction model to predict the light power based on each characteristic data sequence to obtain at least two candidate light powers corresponding to the at least two characteristic data sequences;
a determining module, configured to determine a predicted optical power corresponding to the weather prediction data based on the at least two candidate optical powers.
According to another aspect of the present application, there is provided an electronic device including:
a memory, a processor coupled to the memory;
a processor configured to load and execute executable instructions stored in a memory to implement the method of predicting optical power as described in the above aspect and its alternative embodiments.
According to another aspect of the present application, there is provided a computer-readable storage medium having at least one instruction, at least one program, code set, or set of instructions stored therein, which is loaded and executed by a processor to implement the method of predicting optical power according to the above one aspect and its optional embodiments.
According to another aspect of the present application, a computer program product is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method for predicting optical power according to the aspect and the optional embodiments.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the method sets a respective coding module and a respective prediction module for each mode, takes the characteristic data sequence of each meteorological source as predicted parallel mode input, combines the coding modules of the following pyramid structures, fully excavates the implicit characteristics of the characteristic data sequences under different modes, avoids the condition that the characteristic characteristics under different modes cannot be highlighted and the implicit characteristics influencing the light power prediction precision are possibly missed due to the fact that the conflicting characteristics need to be weakened or eliminated under the condition that characteristic conflicts exist when the characteristic data under different modes are fused, ensures the prediction invariance (namely the characteristic does not change along with time) of different meteorological sources under the condition of single mode input, and further improves the precision of the final output result through the characteristic extraction under multiple modes and the light power prediction.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a grid-connected photovoltaic power generation system according to an exemplary embodiment of the present application;
FIG. 2 is a flow chart of a method for predicting optical power provided by an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a predictive model provided in an exemplary embodiment of the present application;
FIG. 4 is a flow chart of a method for predicting optical power provided by another exemplary embodiment of the present application;
FIG. 5 is a block diagram illustrating a structure of a coding model in a prediction model according to an exemplary embodiment of the present application;
FIG. 6 is a schematic diagram of a structure of a prediction model in a prediction model provided in an exemplary embodiment of the present application;
FIG. 7 is a flow chart of a method for predicting optical power provided by another exemplary embodiment of the present application;
FIG. 8 is a flow chart of a method of training a predictive model provided by an exemplary embodiment of the present application;
FIG. 9 is a block diagram of an apparatus for predicting optical power provided by an exemplary embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The explanations for words involved in this application are as follows:
optical power is the work that light does per unit time. The units of optical power are often expressed in milliwatts (mw) and decibel-milliwatts (dBm). The optical power may be collected by an optical power collector. The electric power is the work that the current does in a unit time. The units of electrical power are often expressed in watts (w).
Grid connection is a behavior in which an independent power plant or a small power system is electrically connected to an adjacent power system to exchange power. For photovoltaic grid-connected power generation, a grid-connected photovoltaic power generation system receives solar radiation energy through a solar cell array, the solar radiation energy is converted into high-voltage direct current after high-frequency direct current conversion, and sinusoidal alternating current with the same frequency and phase as the voltage of a power grid is output to the power grid after inversion of an inverter.
Nowadays, grid-connected photovoltaic power generation is an important form for realizing large-scale efficient utilization of photovoltaic power generation, but the difficulty and complication of power grid operation scheduling can be caused by the fact that the photovoltaic power generation is connected to a power grid on a large scale, and the stable operation of the power grid is greatly influenced. Therefore, a prediction scheme for the light power variation trend is proposed to coordinate safe operation and economic dispatch of the power grid based on the predicted light power variation trend.
Because sunlight irradiation depended on by photovoltaic power generation has the characteristics of randomness, intermittence, uncontrollable property and the like, particularly, the light power during photovoltaic power generation is closely related to external conditions such as irradiation, temperature, peripheral shielding and the like in the area, the prediction precision of the light power change trend is difficult to improve, and particularly the light power prediction under the short-term trend. In order to solve the technical problem, the present application provides a method for predicting optical power, and please refer to the following embodiments for details of implementation of the method.
For example, the method for predicting the optical power may be applied to a grid-connected photovoltaic power generation system, please refer to fig. 1, which shows a schematic diagram of a grid-connected photovoltaic power generation system according to an embodiment of the present application. The grid-connected photovoltaic power generation system may include: a photovoltaic array (i.e., a solar cell array) 101, a combiner box 102, a dc distribution cabinet 103, an inverter 104, and a boost system 105.
The photovoltaic array 101 is composed of a plurality of solar panels, which are devices that directly convert solar energy into electrical energy using the photovoltaic effect of semiconductor materials under light conditions. The combiner box 102 connects a plurality of solar panels in series to form a photovoltaic string; then, connecting a plurality of photovoltaic series in parallel to form a photovoltaic array 101; after converting solar radiation energy into electric energy, each photovoltaic string in the photovoltaic array 101 converges in the converging box 102, then is rectified by the direct current distribution cabinet 103, then is inverted into alternating current by the inverter 104, and finally is converted into voltage by the boosting system 105, and finally is input into the power grid 106 with sinusoidal alternating current with the same frequency and phase as the voltage of the power grid 106.
For example, a dc load may be connected to the dc distribution cabinet 103, and an ac load may be connected to the inverter 104. When the sun irradiates, the photovoltaic power station can directly supply direct current and alternating current loads, and then the rest electric energy is input into the power grid 106; alternatively, all of the electrical energy may be input to the grid 106.
The grid-connected photovoltaic power generation system is further provided with a monitoring data collector 201, the inverter 104 is connected with the monitoring data collector 201, the monitoring data collector 201 is used for collecting and recording working states and operation information of the combiner box 102, the direct-current power distribution cabinet 103, the inverter 104 and other equipment in the photovoltaic power station, and monitoring information is submitted to superior monitoring equipment 202 through an Ethernet (Ethernet), or General Packet Radio Service (GPRS), or Wireless Fidelity (WiFi) network. In an exemplary embodiment, the monitoring data collector 201 is further connected to an environmental monitor, such as an irradiator 203 and a temperature meter 204, for monitoring environmental data in the photovoltaic power plant. Illustratively, the monitoring data collector 201 has a function of receiving and executing network scheduling instructions.
For example, the monitoring device 202 may further have a network connection relationship with the remote monitoring device 205, and in the process of photovoltaic grid-connected power generation, the monitoring device 202 cooperates with other photovoltaic power generation stations through information interaction with the remote monitoring device 205 to implement safe operation and economic dispatching of a power grid. For example, the remote monitoring device 205 may be a device for implementing safe operation and economic dispatch of the whole power grid; for example, the monitoring device 202 may receive a scheduling instruction sent by the remote monitoring device 205 to control a time period during which the photovoltaic power generation electric energy is merged into the power grid 106, or to control an electric quantity of the photovoltaic power generation electric energy merged into the power grid 106. For example, a storage battery may be further connected to the dc power distribution cabinet 103, and in the scheduling process, the electric energy may be temporarily stored in the storage battery; or, the remaining capacity is stored in the storage battery.
Illustratively, the monitoring device is composed of an electronic device, and the electronic device may be a server or a terminal. For example, the monitoring device may be composed of a server cluster, and the number of the server clusters may be greater or smaller. For example, the number of server clusters may be only one, or several tens or hundreds, or more. The number and the type of the server clusters are not limited in the embodiment of the application.
Referring to fig. 2, a flowchart of a method for predicting optical power according to an exemplary embodiment of the present application is shown. Taking the application of the method to the monitoring device shown in fig. 1 as an example, the method includes:
step 301, obtaining historical meteorological data and meteorological prediction data of at least two meteorological sources, and obtaining actual optical power corresponding to the historical meteorological data.
Wherein, the meteorological source refers to a source of meteorological data; the weather prediction data is obtained by predicting the earth atmospheric state of a specified place in future time by adopting a scientific and technical means. Illustratively, the historical meteorological data comprises historical meteorological predicted data or historical meteorological measured data; the historical meteorological forecast data is meteorological forecast data in the occurring time, and the historical meteorological actual measurement data is meteorological data obtained by observing the earth atmospheric layer state of a specified place in the occurring time by adopting a scientific and technical means.
Illustratively, the meteorological data includes solar irradiance. The meteorological data may also include other meteorological elements. The meteorological elements are used for representing basic physical quantities of atmospheric states and basic weather phenomena, and mainly comprise air pressure, air temperature, humidity, wind, cloud, visibility, evaporation, irradiation and weather phenomena. Weather phenomena refer to precipitation phenomena occurring in the atmosphere, ground condensation (desublimation) and freezing phenomena, visual impairment phenomena, atmospheric photopheres and other physical phenomena such as rain, snow, aragonite, ice particles, hail; fog, sand (dust) storm, sand raising, floating dust, smoke screen, haze and snow blowing; rainbow, halo, neon, bloom; thunderstorm, natural electricity, aurora, strong wind, squall, tornado, dust roll, snow accumulation, ice formation, etc. The meteorological elements change with time and space, and the observation records of the meteorological elements are basic data of weather forecast, climate analysis and related scientific research.
Illustratively, the actual optical power is the optical power collected at a specified location by the optical power collecting device, and the optical power collecting device may report the collected actual optical power to the monitoring device, and the monitoring device stores the actual optical power in its own memory or a database. Illustratively, the optical power collecting device may be an optical power collector or an optical power meter.
Illustratively, the monitoring device extracts historical weather data for the specified location over the first time period and weather forecast data for the specified location over the second time period from the third party database for each weather source, and extracts the actual light power for the specified location over the first time period from its memory or database. The historical meteorological data and the actual optical power have a corresponding relation in time.
Step 302, preprocessing the historical meteorological data and meteorological prediction data of each meteorological source and the actual light power to obtain at least two characteristic data sequences corresponding to at least two meteorological sources.
The monitoring equipment preprocesses the historical meteorological data and meteorological prediction data of the ith meteorological source and the actual optical power to obtain an ith characteristic data sequence corresponding to the ith meteorological source, and finally obtain at least two characteristic data sequences corresponding to at least two meteorological sources, wherein i is a positive integer.
Illustratively, the monitoring device generates an ith signature data sequence from historical meteorological data and meteorological predicted data of an ith meteorological source and actual optical power in time sequence.
Step 303, calling a prediction model to perform optical power prediction based on each characteristic data sequence, so as to obtain at least two candidate optical powers corresponding to at least two characteristic data sequences.
The monitoring equipment is provided with a prediction model, and the prediction model is constructed by a neural network model. And the monitoring equipment calls a prediction model to carry out optical power prediction based on the ith characteristic data sequence to obtain the ith candidate optical power corresponding to the ith characteristic data sequence and finally obtain at least two candidate optical powers corresponding to the at least two characteristic data sequences.
And step 304, determining a predicted optical power corresponding to the meteorological predicted data based on the at least two candidate optical powers.
Illustratively, the monitoring device calculates an average value of at least two candidate optical powers, and determines the average value as a predicted optical power corresponding to the weather prediction data.
Illustratively, the monitoring device is provided with a weight of each meteorological source corresponding to a specified place, and the sum of the weights of at least two meteorological sources is 1; the monitoring equipment calculates the weighted sum of at least two candidate light powers based on the weights corresponding to at least two meteorological sources, and determines the weighted sum as the predicted light power corresponding to the meteorological prediction data.
Illustratively, the monitoring device is provided with a confidence level of each meteorological source corresponding to a specified place, and the confidence level is continuously updated based on the prediction accuracy of the light power at the specified place; and the monitoring equipment determines the candidate optical power corresponding to the meteorological source with the maximum confidence coefficient from the at least two candidate optical powers to be used as the predicted optical power corresponding to the meteorological prediction data.
Optionally, the monitoring device invokes a prediction model to determine a predicted optical power corresponding to the meteorological prediction data based on the at least two candidate optical powers. Illustratively, a linear regression function is set in the prediction model, the prediction model inputs at least two candidate optical powers into the linear regression function, and finally outputs a predicted optical power corresponding to the meteorological prediction data.
In summary, in the prediction method for optical power provided in this embodiment, a meteorological source is defined as a mode, feature data sequences are respectively generated with actual optical power based on historical meteorological data and meteorological prediction data in at least two modes, then a prediction model is called to perform optical power prediction in each mode based on the feature data sequences, implicit features between the meteorological features and the optical power in different modes are fully mined, so that multiple candidate optical powers in multiple modes are obtained, a more accurate predicted optical power is finally determined based on the multiple candidate optical powers, and prediction accuracy of the optical power is improved through the implicit feature mining in multiple modes.
In some embodiments, the prediction model may include a multi-modal input layer, at least two coding modules, and at least two prediction modules, where the coding modules and the prediction modules are arranged in a one-to-one correspondence manner, as shown in fig. 3, the multi-modal input layer 402 is respectively connected to m coding modules 403, i is a positive integer greater than i, i is a coding mode 1, …, i is a coding module, … is a coding module, m is a positive integer greater than i; the coding module 1 is connected with the prediction module 1, …, the coding module i is connected with the prediction module i, …, and the coding module m is connected with the prediction module m, that is, the coding modules 403 are connected with the prediction modules 404 in a one-to-one correspondence manner.
For example, step 303 in fig. 2 can be implemented as step 3031 to step 3033 by using the above prediction model, as shown in fig. 4, as follows:
step 3031, the ith characteristic data sequence is input into the ith coding module through the multi-mode input layer.
The monitoring device realizes the distribution of the m characteristic data sequences through the multi-modal input layer. Illustratively, a one-to-one correspondence relationship exists between the ith weather source and the ith encoding module, and the monitoring equipment inputs the ith characteristic data sequence corresponding to the ith weather source into the ith encoding module.
Step 3032, the ith characteristic data sequence is subjected to characteristic coding through the ith coding module to obtain the ith characteristic coding vector.
Optionally, the encoding module includes a feature pyramid network; and the monitoring equipment performs characteristic coding on the ith characteristic data sequence through a characteristic pyramid network in the ith coding module to obtain an ith characteristic coding vector.
Exemplarily, as shown in fig. 5, the structural diagram of the ith coding module in an optional implementation manner is shown, where the ith coding module includes a first convolutional layer 501, a second convolutional layer 502, and a third convolutional layer 503, where a convolutional core of the first convolutional layer is n1The convolution kernel of the second convolution layer is n2The convolution kernel of the third convolution layer is n3,n1<n2<n3The ith characteristic data sequence sequentially passes through the first convolutional layer, the second convolutional layer and the third convolutional layer, an output vector V1 of the first convolutional layer, an output vector V2 of the second convolutional layer and an output vector V3 of the third convolutional layer are fused, for example, the fusion is carried out in a weighted sum mode, namely, the ith characteristic coding vector V is extracted, and the characteristic coding mode learns characteristics through layer-by-layer one-dimensional time sequence convolutionThe time sequence characteristic in the data sequence and the convolution kernel are increased along with the increase of the layers, so that more context information can be fused in the extracted characteristic coding vector, and the prediction precision of the optical power is further improved.
Step 3033, the light power is predicted based on the ith characteristic coding vector through the ith prediction module, and the ith candidate light power is obtained.
Optionally, the ith prediction module comprises a first network, a second network incorporating a time step attention mechanism; the monitoring equipment extracts time sequence characteristics of the ith characteristic coding vector through a first network to obtain a hidden layer vector which implies the time sequence relation of an upper time step and a lower time step; and predicting the optical power based on the hidden layer vector through a second network to obtain the ith candidate optical power.
Exemplarily, as shown in fig. 6, the ith prediction module in an alternative implementation is a schematic structural diagram, where the ith prediction module includes a first network 601 and a second network 602, the first network 601 includes a first Long-Short Term Memory (LSTM) network fused with time step attention, and in a process of extracting time sequence features of feature coding vectors by the first LSTM network, weight vectors are calculated based on intermediate extraction results through the time step attention, and intermediate vectors output by the first LSTM network are multiplied by the weight vectors, so as to obtain hidden layer vectors; the second network 602 comprises a second LSTM network, and the predicted candidate optical power is output when the hidden vector is input into the second LSTM network.
It is further noted that, as shown in fig. 3, the prediction model may further include an output layer 405; the monitoring device determines a predicted optical power corresponding to the weather prediction data based on the at least two candidate optical powers through the output layer 405.
In summary, in the method for predicting optical power provided by this embodiment, each mode is provided with its own encoding module and prediction module, the feature data sequence of each meteorological source is used as a parallel mode for prediction to be input, and the implicit features of the feature data sequences in different modes are fully mined by combining with the encoding module of the pyramid structure behind, so that the situation that the feature features in different modes cannot be highlighted due to weakening or eliminating the conflicting features when feature data in different modes are fused and the implicit features affecting the accuracy of optical power prediction may be missed is avoided, the invariance of prediction when different meteorological sources are used as a single mode for input is also ensured, and the accuracy of a final output result is further improved by feature extraction in multiple modes and optical power prediction.
In some embodiments, in order to increase the amount of information in the feature data sequence, feature derivation may also be performed based on the original data, for example, step 3021 to step 3023 may also be implemented in step 302 in fig. 2, as shown in fig. 7, and the following steps are performed:
step 3021, constructing an ith optical power calculation function based on the historical meteorological data and the actual optical power of the ith meteorological source.
Illustratively, the monitoring device takes historical meteorological data x of an ith meteorological source as an independent variable, takes actual optical power y corresponding to the historical meteorological data as a dependent variable, and constructs a regression function f (x) as an ith optical power calculation function, wherein the formula is as follows:
y=f(x)。
for example, the meteorological data may be a set of multi-dimensional meteorological data, and the argument may be (x)1,x2,……,xs) And s is a positive integer, and accordingly, the optical power calculation function is as follows:
y=f(x1,x2,……,xs)。
and step 3022, calling an ith optical power calculation function to calculate theoretical optical power corresponding to weather prediction data of the ith weather source.
And the monitoring equipment inputs the meteorological prediction data of the ith meteorological source into the ith optical power calculation function, and calculates to obtain the theoretical optical power corresponding to the meteorological prediction data of the ith meteorological source.
And step 3023, combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power in time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source.
And the monitoring equipment combines the historical meteorological data and the meteorological prediction data of the ith meteorological source and the theoretical optical power according to the time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source.
It should be noted that, the optical power calculation function may also be constructed based on historical meteorological data and actual optical power of at least two meteorological sources; calling an optical power calculation function to calculate theoretical optical power corresponding to meteorological prediction data of the ith meteorological source; and combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power according to the time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source. That is to say, a regression function can be constructed by using a plurality of meteorological sources as the optical power calculation function, and the theoretical optical power corresponding to the meteorological prediction data under each meteorological source can be calculated by using the same optical power calculation function.
Illustratively, for the construction of the characteristic data sequence, a prediction model may also be implemented, as shown in fig. 3, the constructed prediction model further includes a data preprocessing layer 401, the raw data is output to the data preprocessing layer 401, and the construction step of the characteristic data sequence is executed through the data preprocessing layer 401, that is, the characteristic data sequence corresponding to each meteorological source is obtained.
The original data comprises historical meteorological data and meteorological prediction data of at least two meteorological sources and actual optical power corresponding to the historical meteorological data.
In summary, the prediction method for optical power provided in this embodiment increases the information amount in the feature data sequence by extending the derived features, so that the prediction model can extract more feature information from the feature data sequence in the optical power prediction process, thereby improving the accuracy of optical power prediction.
Referring to fig. 8, a flowchart of a training method for a prediction model provided in an exemplary embodiment of the present application is shown, and is applied to an electronic device, where the electronic device may include a server or a terminal, and the method includes:
step 701, acquiring first meteorological data and second meteorological data of at least two meteorological sources, and acquiring first historical optical power corresponding to the first meteorological data, wherein the second meteorological data is marked with second historical optical power, and weather time described by the first meteorological data is prior to weather time described by the second meteorological data.
Illustratively, the first meteorological data comprises historical meteorological predicted data or historical meteorological measured data, and the second meteorological data comprises historical meteorological predicted data or historical meteorological measured data; the first historical optical power is the actual optical power corresponding to the first meteorological data, and the second historical optical power is the actual optical power corresponding to the second meteorological data.
Illustratively, training data are stored in the database, and the training data comprise first meteorological data and second meteorological data of the at least two meteorological sources and first historical optical power corresponding to the first meteorological data; the electronic equipment acquires the training data from the database.
Step 702, preprocessing the first meteorological data and the second meteorological data of each meteorological source and the first historical optical power to obtain at least two sample characteristic data sequences corresponding to at least two meteorological sources.
Illustratively, the electronic device constructs an ith optical power calculation function based on the first meteorological data and the first historical optical power of the ith meteorological source; calling an ith optical power calculation function to calculate the sample theoretical optical power corresponding to the second meteorological data of the ith meteorological source; combining the first meteorological data and the second meteorological data of the ith meteorological source and the theoretical optical power of the sample according to the time sequence to generate an ith sample characteristic data sequence corresponding to the ith meteorological source, and finally obtaining at least two characteristic data sequences corresponding to at least two meteorological sources.
Illustratively, the electronic device constructs an optical power calculation function based on first meteorological data and first historical optical power of at least two meteorological sources; calling an optical power calculation function to calculate the theoretical optical power of the sample corresponding to the second meteorological data of the ith meteorological source; combining the first meteorological data and the second meteorological data of the ith meteorological source and the theoretical optical power of the sample according to the time sequence to generate an ith sample characteristic data sequence corresponding to the ith meteorological data, and finally obtaining at least two characteristic data sequences corresponding to at least two meteorological sources.
Illustratively, the neural network model includes a data preprocessing layer; the electronic device may pre-process the first meteorological data and the second meteorological data for each meteorological source with the first historical optical power through the data pre-processing layer to output at least two sample characteristic data sequences corresponding to the at least two meteorological sources.
And 703, calling the neural network model to perform light power prediction based on each sample characteristic data sequence to obtain at least two sample candidate light powers corresponding to the at least two sample characteristic data sequences.
Illustratively, the neural network model includes a multi-modal input layer, at least two encoding modules, and at least two prediction modules; the electronic equipment inputs the ith sample characteristic data sequence into the ith coding module through the multi-modal input layer; performing feature coding on the ith sample feature data sequence through an ith coding module to obtain an ith sample feature coding vector; and performing light power prediction through an ith prediction module based on the ith sample characteristic coding vector to obtain ith sample candidate light power, and finally obtaining at least two sample candidate light powers corresponding to the at least two sample characteristic data sequences.
Illustratively, the encoding module comprises a feature pyramid network; the electronic equipment can perform feature coding on the ith sample feature data sequence through a feature pyramid network in the ith coding module to obtain an ith sample feature coding vector.
Illustratively, the prediction module includes a first network, a second network incorporating a time step attention mechanism; the electronic equipment extracts time sequence characteristics of the ith sample characteristic coding vector through a first network to obtain a sample hidden layer vector which implies the time sequence relation of an upper time step and a lower time step; and carrying out optical power prediction on the basis of the sample hidden layer vector through a second network to obtain the ith sample candidate optical power.
Step 704, training the neural network model based on the predicted loss between the at least two sample candidate optical powers and the second historical optical power to obtain a prediction model.
Exemplarily, the electronic device calculates a prediction loss between each sample candidate optical power and the second historical optical power to obtain at least two prediction losses corresponding to at least two sample candidate optical powers, trains the neural network model based on the at least two prediction losses, and finally obtains the prediction model through multiple training of multiple groups of sample data.
For example, the electronic device may further perform model training for the ith encoding module and the ith prediction module using an ith prediction loss, where the ith prediction loss is a prediction loss between the sample candidate optical power corresponding to the ith meteorological source and the second historical optical power.
Illustratively, the neural network model includes an output layer; the electronic device may further determine, by the output layer, a sample predicted optical power corresponding to the second meteorological data based on the at least two sample candidate optical powers; correspondingly, the electronic device can train the neural network model based on the prediction loss between the sample predicted optical power and the second historical optical power to finally obtain the prediction model.
It should be noted that, the structure of the neural network model may refer to the structure shown in fig. 3, and is not described herein again.
In summary, the training method of the prediction model provided in this embodiment enables the prediction model obtained through training to generate the feature data sequence based on the historical meteorological data and the meteorological prediction data in at least two modes and the actual optical power, then performs optical power prediction in each mode based on the feature data sequence, and fully excavates the implicit features between the meteorological features and the optical power in different modes, so as to obtain multiple candidate optical powers in multiple modes, finally determines a more accurate predicted optical power based on the multiple candidate optical powers, and improves the prediction accuracy of the optical power through the implicit feature mining in multiple modes.
Referring to fig. 9, a block diagram of an optical power prediction apparatus provided in an exemplary embodiment of the present application is shown, where the apparatus may be applied to an electronic device, and the apparatus is implemented as part of or all of the electronic device through software, hardware, or a combination of the two, and includes:
an obtaining module 801, configured to obtain historical meteorological data and meteorological prediction data of at least two meteorological sources, and obtain actual optical power corresponding to the historical meteorological data;
the preprocessing module 802 is configured to preprocess, with respect to historical meteorological data and meteorological prediction data of each meteorological source, actual optical power to obtain at least two characteristic data sequences corresponding to at least two meteorological sources;
a calling module 803, configured to call a prediction model to perform optical power prediction based on each feature data sequence, so as to obtain at least two candidate optical powers corresponding to at least two feature data sequences;
a determining module 804, configured to determine a predicted optical power corresponding to the weather prediction data based on the at least two candidate optical powers.
In some embodiments, the predictive model includes a multi-modal input layer, at least two encoding modules, and at least two prediction modules; a calling module 803, configured to:
inputting the ith characteristic data sequence into the ith coding module through the multi-modal input layer;
performing feature coding on the ith feature data sequence through the ith coding module to obtain an ith feature coding vector;
and performing light power prediction on the basis of the ith characteristic coding vector through an ith prediction module to obtain the ith candidate light power, wherein i is a positive integer.
In some embodiments, the prediction module includes a first network, a second network incorporating a time step attention mechanism; a calling module 803, configured to:
performing time sequence feature extraction on the ith feature coding vector through a first network to obtain a hidden layer vector which implies a time sequence relation of an upper time step and a lower time step;
and predicting the optical power based on the hidden layer vector through a second network to obtain the ith candidate optical power.
In some embodiments, the encoding module comprises a feature pyramid network; a calling module 803, configured to:
and performing feature coding on the ith feature data sequence through a feature pyramid network in the ith coding module to obtain an ith feature coding vector.
In some embodiments, the preprocessing module 802 is configured to:
constructing an ith optical power calculation function based on historical meteorological data and actual optical power of an ith meteorological source;
calling an ith optical power calculation function to calculate theoretical optical power corresponding to meteorological prediction data of an ith meteorological source;
combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power according to the time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source, wherein i is a positive integer.
In some embodiments, the preprocessing module 802 is configured to:
constructing an optical power calculation function based on historical meteorological data and actual optical power of at least two meteorological sources;
calling an optical power calculation function to calculate theoretical optical power corresponding to meteorological prediction data of the ith meteorological source;
combining the historical meteorological data and meteorological prediction data of the ith meteorological source and the theoretical optical power according to the time sequence to generate an ith characteristic data sequence corresponding to the ith meteorological source, wherein i is a positive integer.
In some embodiments, the apparatus further comprises a training module 805; a training module 805 to:
acquiring first meteorological data and second meteorological data of at least two meteorological sources, and acquiring first historical optical power corresponding to the first meteorological data, wherein the second meteorological data is marked with second historical optical power, and the weather time described by the first meteorological data is prior to the weather time described by the second meteorological data;
preprocessing the first meteorological data and the second meteorological data of each meteorological source and the first historical optical power to obtain at least two sample characteristic data sequences corresponding to at least two meteorological sources;
calling a neural network model to carry out optical power prediction based on each sample characteristic data sequence to obtain at least two sample candidate optical powers corresponding to at least two sample characteristic data sequences;
and training the neural network model based on the prediction loss between the candidate optical power of the at least two samples and the second historical optical power to obtain a prediction model.
In summary, in the prediction apparatus for optical power provided in this embodiment, a meteorological source is defined as a mode, feature data sequences are respectively generated with actual optical power based on historical meteorological data and meteorological prediction data in at least two modes, then a prediction model is called to perform optical power prediction in each mode based on the feature data sequences, implicit features between meteorological features and optical power in different modes are fully mined, so as to obtain multiple candidate optical powers in multiple modes, a more accurate predicted optical power is finally determined based on the multiple candidate optical powers, and prediction accuracy of optical power is improved by mining the implicit features in multiple modes.
Referring to fig. 10, a schematic structural diagram of an electronic device according to an embodiment of the present application is shown. The electronic device is used for implementing the prediction method of the optical power and/or the training method of the prediction model provided in the above embodiments. The electronic device may comprise a server or a terminal. Specifically, the method comprises the following steps:
the electronic apparatus 900 includes a CPU (Central Processing Unit) 901, a system Memory 904 including a RAM (Random Access Memory) 902 and a ROM (Read-Only Memory) 903, and a system bus 905 connecting the system Memory 904 and the Central Processing Unit 901. The electronic device 900 also includes a basic I/O (Input/Output) system 906 that facilitates transfer of information between devices within the computer, and a mass storage device 907 for storing an operating system 913, application programs 914, and other program modules 915.
The basic input/output system 906 includes a display 908 for displaying information and an input device 909 such as a mouse, keyboard, etc. for user input of information. Wherein the display 908 and the input device 909 are connected to the central processing unit 901 through an input output controller 910 connected to the system bus 905. The basic input/output system 906 may also include an input/output controller 910 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, input-output controller 910 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 907 is connected to the central processing unit 901 through a mass storage controller (not shown) connected to the system bus 905. The mass storage device 907 and its associated computer-readable media provide non-volatile storage for the electronic device 900. That is, the mass storage device 907 may include a computer-readable medium (not shown) such as a hard disk or CD-ROM (Compact disk Read-Only Memory) drive.
Without loss of generality, the computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), Flash Memory (Flash Memory) or other solid state Memory technology, CD-ROM, DVD (Digital Versatile disk), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the foregoing. The system memory 904 and mass storage device 907 described above may be collectively referred to as memory.
The electronic device 900 may also operate as a remote computer connected to a network via a network, such as the internet, in accordance with various embodiments of the present application. That is, the electronic device 900 may be connected to the network 912 through the network interface unit 911 connected to the system bus 905, or the network interface unit 911 may be used to connect to other types of networks or remote computer systems (not shown).
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.