Photovoltaic power prediction method and device, electronic equipment, storage medium and chip

By obtaining the true value and temporal characteristics of photovoltaic power, and combining the LSTM model and the dual-label loss function, the problem of accuracy in photovoltaic power prediction after distributed photovoltaic power generation equipment is connected to the grid is solved, and high-precision photovoltaic power prediction is achieved.

CN119944637BActive Publication Date: 2026-02-06BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510008825.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2026-02-06
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

After large-scale distributed photovoltaic power generation equipment is connected to the grid, the randomness, intermittency and volatility of photovoltaic power generation pose challenges to power system dispatch and stable operation, and there is an urgent need for high-precision photovoltaic power prediction solutions.

Method used

By acquiring the true value of photovoltaic power and its temporal characteristics at historical moments, a pre-trained Long Short-Term Memory (LSTM) network model is used for prediction to fill in data gaps. A dual-label loss function is also used for model training to improve prediction accuracy.

Benefits of technology

It achieves high-precision prediction of photovoltaic power data under various environments, effectively reduces the impact of missing data on prediction, and improves the accuracy of prediction models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119944637B_ABST
    Figure CN119944637B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of photovoltaic power generation, and particularly relates to a photovoltaic power prediction method and device, electronic equipment, storage medium and chip. The method comprises the following steps: obtaining photovoltaic power true values of multiple historical time points before a prediction time point; extracting time characteristics corresponding to the photovoltaic power true values from the photovoltaic power true values of the multiple historical time points; inputting the photovoltaic power true values of the multiple historical time points and the time characteristics corresponding thereto into a prediction model trained in advance, executing the prediction model, and obtaining photovoltaic power prediction values and change trend prediction values of the prediction time point output by the prediction model. The technical solution can accurately predict photovoltaic power in a short term, and is mainly used for short-term prediction of photovoltaic power.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of photovoltaic power generation, and in particular to a photovoltaic power prediction method and device, an electronic device, a storage medium, and a chip. BACKGROUND

[0002] With the access of large-scale distributed photovoltaic power generation equipment, the current power system is undergoing a revolutionary change in the fields of generation, transmission, distribution and use. Specifically, in the field of power distribution, distributed power sources mainly based on whole-county rooftop photovoltaic development will experience explosive growth. The access of large-scale distributed photovoltaic power generation equipment to the power grid not only meets the demand of power-deficient areas, but also brings many adverse effects to the operation of the power system. Due to the randomness, intermittency and volatility of photovoltaic power generation, the large-scale access of distributed photovoltaic power generation equipment brings severe challenges to the reasonable dispatching, safe and stable operation and power quality of the power system. Therefore, in order to reduce the adverse effects of the access of distributed photovoltaic equipment to the power system and assist the power grid to achieve power balance and reasonable planning and dispatching, there is an urgent need for a scheme capable of high-precision short-term prediction of power generation. SUMMARY

[0003] To solve the problems in the related art, the embodiments of the present disclosure provide a photovoltaic power prediction method and device, an electronic device, a storage medium and a chip.

[0004] In a first aspect, the embodiments of the present disclosure provide a photovoltaic power prediction method, comprising:

[0005] obtaining photovoltaic power true values at a plurality of historical time points before a prediction time point;

[0006] extracting time features corresponding to the photovoltaic power true values from the photovoltaic power true values at the plurality of historical time points;

[0007] inputting the photovoltaic power true values at the plurality of historical time points and the time features corresponding thereto into a pre-trained prediction model, executing the prediction model, and obtaining photovoltaic power prediction values and change trend prediction values at the prediction time point output by the prediction model.

[0008] In a possible implementation, the obtaining of the photovoltaic power true values at the plurality of historical time points before the prediction time point comprises: if true value missing occurs when the photovoltaic power true values at the plurality of historical time points before the prediction time point are obtained, determining a missing time point at which the photovoltaic power true value is missing.

[0009] filling the photovoltaic power true value at the missing time point based on the photovoltaic power true values at sampling time points before the missing time point.

[0010] In a possible implementation, the filling the photovoltaic power true value at the missing time point based on the photovoltaic power true values at the sampling time points before the missing time point comprises:

[0011] obtaining the photovoltaic power true values at k continuous sampling time points before the missing time point;

[0012] obtaining the photovoltaic power true values at each sampling time point in multiple days before the missing time point;

[0013] from the photovoltaic power true values at each sampling time point in multiple days before the missing time point, obtaining the photovoltaic power true values at k continuous sampling time points most similar to the photovoltaic power true values at the k continuous sampling time points before the missing time point;

[0014] determining the photovoltaic power true value at the first sampling time point after the k continuous sampling time points most similar as the photovoltaic power true value at the missing time point;

[0015] wherein the k is a positive integer.

[0016] In a possible implementation, the extracting the time feature corresponding to the photovoltaic power true value from the photovoltaic power true values at the multiple historical time points comprises:

[0017] based on m historical time points, obtaining a first time feature T cos and a second time feature T sin corresponding to the photovoltaic power true value according to the following formula:

[0018]

[0019] wherein, is an hour value of the mth historical time point, is a minute value of the mth historical time point, the hour value adopts 24-hour system, and the m is a positive integer.

[0020] In a possible implementation, the method further comprises:

[0021] obtaining multiple training samples, wherein the input variable in each training sample comprises photovoltaic power true values at multiple sample time points and time features corresponding thereto, and the label data in each training sample comprises a photovoltaic power true value and a change trend true value at a next time point of the multiple sample time points;

[0022] training the prediction model by using the multiple training samples.

[0023] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0024]

[0025] Where N is the total number of training samples, Y[i][0] is the true value of photovoltaic power in the i-th training sample, Y[i][1] is the true value of the trend in the i-th training sample, y[i][0] is the predicted value of photovoltaic power corresponding to the i-th training sample, and y[i][1] is the predicted value of the trend corresponding to the i-th training sample.

[0026] Secondly, this disclosure provides a method for training a prediction model, the training method comprising:

[0027] Multiple training samples are obtained. The input variables in each training sample include the true value of photovoltaic power at multiple sample times and its corresponding time features. The label data in each training sample includes the true value of photovoltaic power at the next time and the true value of the change trend at the next time.

[0028] The prediction model is trained using the multiple training samples.

[0029] In one possible implementation, acquiring multiple training samples includes:

[0030] Obtain the true values ​​of photovoltaic power p1, p2, ... p at n sample times. n ;

[0031] Based on the true values ​​of photovoltaic power p1, p2, ... p at the n sample times... n The photovoltaic power variable P of the nm group was obtained. train and its corresponding nm group label data Y label :

[0032] P train =[[p1, ..., p m ],[p2,…,p m+1 ]..., [p n-m , ..., p n-1 ]];

[0033]

[0034] Based on the n sample times, the photovoltaic power variable P of the nm group is obtained according to the following formula. train The corresponding nm group first time features Second time features

[0035]

[0036] in, It is the hourly value at the m-th sample time. is the minute value at the mth sample moment, and the hour value adopts a 24-hour system;

[0037] obtain a set of photovoltaic power variables and a corresponding set of first time characteristics, a set of second time characteristics, and a set of label data as a training sample;

[0038] Both m and n are positive integers.

[0039] In a possible implementation, the obtaining of the photovoltaic power true value at the n sample moments comprises:

[0040] If a true value is missing when the photovoltaic power true value at the n sample moments is obtained, a sample missing moment at which the photovoltaic power true value is missing is determined.

[0041] Based on the photovoltaic power true value at the sampling moment before the sample missing moment, the photovoltaic power true value at the sample missing moment is filled.

[0042] In a possible implementation, the filling of the photovoltaic power true value at the sample missing moment based on the photovoltaic power true value at the sampling moment before the sample missing moment comprises:

[0043] Obtaining the photovoltaic power true value at s continuous sampling moments before the sample missing moment;

[0044] Obtaining the photovoltaic power true value at each sampling moment in multiple days before the sample missing moment;

[0045] From the photovoltaic power true value at each sampling moment in multiple days before the sample missing moment, obtaining the photovoltaic power true value at s continuous sampling moments most similar to the photovoltaic power true value at the s continuous sampling moments before the sample missing moment; and determining the photovoltaic power true value at the first sampling moment after the most similar s continuous sampling moments as the photovoltaic power true value at the sample missing moment.

[0046] Wherein, s is a positive integer.

[0047] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0048]

[0049] Wherein, N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the ith training sample, Y[i][1] is the change trend true value in the ith training sample, y[i][0] is the photovoltaic power prediction value corresponding to the ith training sample, and y[i][1] is the change trend prediction value corresponding to the ith training sample.

[0050] In a third aspect, the embodiments of the present disclosure provide a photovoltaic power prediction device, comprising:

[0051] a true value acquisition module configured to acquire photovoltaic power true values at a plurality of historical time points before a prediction time point;

[0052] a feature extraction module configured to extract time features corresponding to the photovoltaic power true values from the photovoltaic power true values at the plurality of historical time points;

[0053] a prediction module configured to input the photovoltaic power true values at the plurality of historical time points and the time features corresponding thereto into a pre-trained prediction model, execute the prediction model, and obtain photovoltaic power prediction values and variation trend prediction values at the prediction time point output by the prediction model.

[0054] In a possible implementation, the true value acquisition module is configured to:

[0055] if a true value missing situation occurs when acquiring the photovoltaic power true values at the plurality of historical time points before the prediction time point, determine a missing time point at which the photovoltaic power true value is missing;

[0056] fill the photovoltaic power true value at the missing time point based on the photovoltaic power true values at sampling time points before the missing time point.

[0057] In a possible implementation, the part of the true value acquisition module that fills the photovoltaic power true value at the missing time point based on the photovoltaic power true values at sampling time points before the missing time point is configured to:

[0058] acquire photovoltaic power true values at k continuous sampling time points before the missing time point;

[0059] acquire photovoltaic power true values at sampling time points in multiple days before the missing time point;

[0060] from the photovoltaic power true values at sampling time points in each of the multiple days before the missing time point, acquire photovoltaic power true values at k continuous sampling time points that are most similar to the photovoltaic power true values at the k continuous sampling time points before the missing time point;

[0061] determine, as the photovoltaic power true value at the missing time point, a photovoltaic power true value at a first sampling time point after the k continuous sampling time points that are most similar;

[0062] wherein the k is a positive integer.

[0063] In a possible implementation, the feature extraction module is configured to:

[0064] Based on m historical time points, the first time feature T corresponding to the photovoltaic power true value is obtained according to the following formula cos And the second time feature T sin :

[0065]

[0066] Wherein, is the hour value of the mth historical time point, is the minute value of the mth historical time point, the hour value adopts 24 hour system, and m is a positive integer.

[0067] In a possible implementation, the device further comprises:

[0068] The model training module is configured to obtain a plurality of training samples, the input variables in each training sample comprising photovoltaic power true values and corresponding time features of a plurality of sample time points, and the label data comprising photovoltaic power true values and change trend true values of the next time point of the plurality of sample time points; and the prediction model is trained using the training samples.

[0069] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0070]

[0071] Wherein, N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the ith training sample, Y[i][1] is the change trend true value in the ith training sample, y[i][0] is the photovoltaic power prediction value corresponding to the ith training sample, and y[i][1] is the change trend prediction value corresponding to the ith training sample.

[0072] In a fourth aspect, the disclosure provides a training device of a prediction model, which comprises:

[0073] The sample acquisition module is configured to obtain a plurality of training samples, the input variables in each training sample comprising photovoltaic power true values and corresponding time features of a plurality of sample time points, and the label data in each training sample comprising photovoltaic power true values and change trend true values of the next time point of the plurality of sample time points.

[0074] The training module is configured to train the prediction model using the plurality of training samples.

[0075] In a possible implementation, the sample acquisition module is configured to:

[0076] Obtain photovoltaic power true values p1, p2,..., pn of n sample time pointsn ;

[0077] Based on the n sample time true value of photovoltaic power p1, p2, ··· p n , get n-m group photovoltaic power variable P train And its corresponding n-m group of label data Y label :

[0078] P train = [[p1, …, p m ], [p2, …, p m+1 ] …, [p n-m , …, p n-1 ]];

[0079]

[0080] Based on the n sample time, according to the following formula to obtain n-m group photovoltaic power variable P train Corresponding n-m group of first time characteristics And the second time characteristics

[0081]

[0082] Wherein, Is the hour value of the mth sample time, Is the minute value of the mth sample time, the hour value adopts 24 hour system;

[0083] Get a group of photovoltaic power variable and its corresponding a group of first time characteristics, a group of second time characteristics and a group of label data for a training sample;

[0084] The m and n are positive integers.

[0085] In a possible implementation, the part of the sample acquisition module that acquires the true value of photovoltaic power of n sample time is configured to:

[0086] If the true value of photovoltaic power of n sample time is missing, it is determined that the true value of photovoltaic power has missing sample missing time;

[0087] Based on the true value of photovoltaic power of the sampling time before the sample missing time, fill in the true value of photovoltaic power of the sample missing time.

[0088] In a possible implementation, the part of the sample acquisition module that fills in the true value of photovoltaic power of the sample missing time based on the true value of photovoltaic power of the sampling time before the sample missing time is configured to:

[0089] acquire the photovoltaic power true values of the s continuous sampling time points before the sample missing time point;

[0090] acquire the photovoltaic power true values of each sampling time point in multiple days before the sample missing time point;

[0091] acquire the photovoltaic power true values of the s continuous sampling time points most similar to the photovoltaic power true values of the s continuous sampling time points before the sample missing time point from the photovoltaic power true values of each sampling time point in each day in multiple days before the sample missing time point; and determine the photovoltaic power true value of the first sampling time point after the photovoltaic power true values of the s continuous sampling time points most similar as the photovoltaic power true value of the sample missing time point;

[0092] wherein the s is a positive integer.

[0093] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is as follows:

[0094]

[0095] wherein N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the i th training sample, Y[i][1] is the change trend true value in the i th training sample, y[i][0] is the photovoltaic power prediction value corresponding to the i th training sample, and y[i][1] is the change trend prediction value corresponding to the i th training sample.

[0096] In a fifth aspect, an electronic device is provided in the embodiments of the present disclosure, and the electronic device comprises a memory and a processor, the memory is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method in any one of the first aspect or the second aspect.

[0097] In a sixth aspect, a readable storage medium is provided in the embodiments of the present disclosure, and the readable storage medium stores computer instructions, and the computer instructions are executed by a processor to implement the method steps in any one of the first aspect or the second aspect.

[0098] In a seventh aspect, a chip is provided in the embodiments of the present disclosure, and the chip comprises the device in any one of the third aspect or the fourth aspect.

[0099] According to the technical scheme provided by the embodiment of the present disclosure, the true values of photovoltaic power at a plurality of historical time points before a prediction time point can be obtained; the photovoltaic power features and time features are obtained based on the true values of photovoltaic power at the plurality of historical time points; the photovoltaic power features and time features are input into a pre-trained prediction model, the prediction model is executed, and the predicted value and the change trend prediction value of the photovoltaic power at the prediction time point output by the prediction model are obtained. In this way, the feature information of the photovoltaic power data itself and the time feature information are fused, and a double-label prediction model is proposed, so that the double loss correction during data training is realized. Through the combination of the fused data features and the improved prediction model, the model prediction accuracy of the photovoltaic power data under various environments is effectively improved.

[0100] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0101] Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of the non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:

[0102] Figure 1 A flow chart of a photovoltaic power prediction method according to an embodiment of the present disclosure is shown.

[0103] Figure 2 A flow chart of a training method of a prediction model according to an embodiment of the present disclosure is shown.

[0104] Figure 3 A structural block diagram of a photovoltaic power prediction device according to an embodiment of the present disclosure is shown.

[0105] Figure 4 A structural block diagram of a training device of a prediction model according to an embodiment of the present disclosure is shown.

[0106] Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0107] Figure 6 A structural diagram of a computer system suitable for implementing the method of the embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0108] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, so that those skilled in the art can easily implement them. In addition, parts irrelevant to the description of the exemplary embodiments are omitted in the drawings for the sake of clarity.

[0109] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate that there are features, numbers, steps, actions, components, parts or combinations thereof disclosed in the specification, and do not exclude the possibility of one or more other features, numbers, steps, actions, components, parts or combinations thereof existing or being added.

[0110] It should also be noted that the embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with embodiments.

[0111] Figure 1 A flowchart of a photovoltaic power prediction method according to an embodiment of the present disclosure is shown. As shown, the photovoltaic power prediction method comprises the following steps S101-S103: Figure 1

[0112] In step S101, photovoltaic power true values at a plurality of historical time points before a prediction time point are acquired;

[0113] In step S102, time features corresponding to the photovoltaic power true values are extracted from the photovoltaic power true values at the plurality of historical time points;

[0114] In step S103, the photovoltaic power true values at the plurality of historical time points and the time features corresponding thereto are input into a pre-trained prediction model, the prediction model is executed, and photovoltaic power prediction values and change trend prediction values of the prediction time point output by the prediction model are obtained.

[0115] In a possible implementation, the photovoltaic power prediction method is applicable to various electronic devices that can perform photovoltaic power prediction. In a possible implementation, the prediction time point refers to a time point at which photovoltaic power prediction needs to be performed. For example, the prediction time point can be a future time point after the current time point, such as a future time point 20 minutes or half an hour later, etc. The plurality of historical time points can be spaced tens of minutes apart.

[0116] In a possible implementation, the photovoltaic power true values at the plurality of historical time points can be power values of photovoltaic power generation of a certain photovoltaic power generation site acquired by a related acquisition device at historical time points.

[0117] In a possible implementation, time features can be extracted from the photovoltaic power true values at the plurality of historical time points. The time features refer to features that can reflect acquisition time points of the photovoltaic power.

[0118] ​In a possible implementation, the prediction model can be an improved LSTM (Long Short-Term Memory) network model, the input of the prediction model is the photovoltaic power true value at a plurality of historical time points and the corresponding time features, and the output of the prediction model has two, which are the photovoltaic power prediction value at the prediction time point and the change trend prediction value. The prediction model is a pre-trained model, and since there are two output labels, double loss correction can be performed for the two output labels during model training, thereby improving the prediction accuracy of the model.

[0119] In a possible implementation, when performing photovoltaic power prediction, the photovoltaic power true value at a plurality of historical time points and the corresponding time features can be input into a pre-trained prediction model, the prediction model is executed, and two prediction results output by the prediction model are obtained, that is, the photovoltaic power prediction value at the prediction time point and the change trend prediction value.

[0120] The embodiment obtains the photovoltaic power true value at a plurality of historical time points before the prediction time point, obtains the photovoltaic power feature and the time feature based on the photovoltaic power true value at the plurality of historical time points, inputs the photovoltaic power feature and the time feature into a pre-trained prediction model, executes the prediction model, and obtains the photovoltaic power prediction value at the prediction time point and the change trend prediction value output by the prediction model. In this way, the feature information of the photovoltaic power data itself and the time feature information are fused, a double-label prediction model is proposed, double loss correction during data training is realized, the fused data features are combined with the improved prediction model, and the model prediction accuracy of the photovoltaic power data under various environments is effectively improved.

[0121] In a possible implementation, the obtaining of the photovoltaic power true value at a plurality of historical time points before the prediction time point includes: if the photovoltaic power true value at a plurality of historical time points before the prediction time point is obtained, and the true value is missing, determining a missing time point at which the photovoltaic power true value is missing.

[0122] Fill the photovoltaic power true value of the missing time point based on the photovoltaic power true value of the sampling time point before the missing time point. In some cases, such as failure of the acquisition device, etc., the photovoltaic power true value of the sampling time point cannot be acquired, and the problem of data missing occurs. Especially for distributed photovoltaic, due to the small single capacity of photovoltaic power station, scattered installation, small investment, etc., high-precision photovoltaic metering table is not specially equipped, resulting in serious data missing problem of historical power data. In order to solve the problem of data missing, when the photovoltaic power true value of multiple historical time points before the prediction time point is missing, the photovoltaic power true value of the missing time point can be filled based on the photovoltaic power true value of the sampling time point before the missing time point. For example, a curve function of photovoltaic power changing with time can be fitted based on the photovoltaic power true value of multiple sampling time points before the missing time point, and the photovoltaic power true value of the missing time point is determined based on the curve function, etc.

[0123] In a possible implementation, the filling of the photovoltaic power true value of the missing time point based on the photovoltaic power true value of the historical time point before the missing time point comprises:

[0124] Obtaining the photovoltaic power true value of k continuous sampling time points before the missing time point;

[0125] Obtaining the photovoltaic power true value of each sampling time point in multiple days before the missing time point;

[0126] From the photovoltaic power true value of each sampling time point in each day before the missing time point, obtaining the photovoltaic power true value of k continuous sampling time points most similar to the photovoltaic power true value of k continuous sampling time points before the missing time point;

[0127] Determining the photovoltaic power true value of the first sampling time point after the most similar k continuous sampling time points as the photovoltaic power true value of the missing time point.

[0128] In this implementation, assuming that the missing time point is 18:10 before the prediction time point, and k is 50, the photovoltaic power true value of k=50 continuous sampling time points before the missing time point can be denoted as The photovoltaic power true value of each sampling time point in 20 days before the missing time point Wherein, d is the number of days before the missing time point, which can take values 1, 2, …, 20; t is the tth sampling time point of each day, which can take values 1, 2, …, q, q is the total amount of sampling time points of each day, is the photovoltaic power true value of the tth sampling time point of the dth day before the missing time point. The photovoltaic power true value of k=50 continuous sampling time points of each day in the 20 days can be traversed The calculation is The calculation is the similarity between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant, for example, the Euclidean distance between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant can be calculated the Euclidean distance between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant the similarity between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant; thus the k = 50 consecutive sampling time instants of photovoltaic power true value with the minimum Euclidean distance between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant, i.e. the most similar k = 50 consecutive sampling time instants, can be found Assuming that the k = 50 consecutive sampling time instants of photovoltaic power true value with the minimum Euclidean distance between the k consecutive sampling time instants before the missing time instant and the k consecutive sampling time instants after the missing time instant are found If the k = 50 consecutive sampling time instants of photovoltaic power true value before the missing time instant are the k = 50 consecutive sampling time instants of photovoltaic power true value between 7:00 and 15:20 on the second day, then the photovoltaic power true value of the first sampling time instant 15:30 after 15:20 on the second day can be obtained as the photovoltaic power true value at the missing time instant 18:10.

[0129] The embodiment can more accurately fill the photovoltaic power true value at the missing time instant by determining the photovoltaic power true value at the first sampling time instant after the k consecutive sampling time instants of photovoltaic power true value most similar to the k consecutive sampling time instants before the missing time instant as the photovoltaic power true value at the missing time instant, and thus making the subsequent photovoltaic power prediction more accurate.

[0130] In a possible implementation, the extracting the time feature corresponding to the photovoltaic power true value from the plurality of historical time instants of photovoltaic power true value can be implemented as the following steps:

[0131] Based on the m historical time instants, the first time feature T cos and the second time feature T sin corresponding to the photovoltaic power true value can be obtained according to the following formula:

[0132]

[0133] wherein, is the hour value of the mth historical time instant, is the minute value of the mth historical time instant, the hour value adopts the 24-hour system, and m is a positive integer. In this embodiment, assuming that the m = 20th historical time instant is 15:30, then

[0134] The sin and cos encoding features of the plurality of historical time instants of photovoltaic power true value extracted by the embodiment can accurately reflect the time features of the historical time instants, effectively reduce the case of misjudging the sudden reduction of photovoltaic power generation on cloudy days as night and the case of burr of photovoltaic power generation at night, and thus better fuse the plurality of historical time instants of photovoltaic power true value to make accurate photovoltaic power prediction.

[0135] ​​​In a possible implementation, the method can further include the following steps:

[0136] a plurality of training samples are obtained, the input variables in each training sample including photovoltaic power true values at a plurality of sample moments and time features corresponding to the photovoltaic power true values, and the label data in each training sample including the photovoltaic power true values at the next moment of the plurality of sample moments and change trend true values;

[0137] the training sample is used to train the prediction model.

[0138] In this implementation, the input variables in the ith training sample can be denoted as wherein, including the photovoltaic power true values at a plurality of sample moments in the ith training sample, including time features corresponding to the photovoltaic power true values at a plurality of sample moments in the ith training sample; the label data in the training sample can include Y label [i] and Y label [i] = [Y[i][0], Y[i][1]], where Y[i][0] is the photovoltaic power true value at the next moment corresponding to the ith training sample, and Y[i][1] is the change trend true value of the photovoltaic power true value at the next moment corresponding to the ith training sample, that is, the change trend true value corresponding to the ith training sample can be set as Y[i][1] = 0 when the photovoltaic power true value at the next moment increases, and Y[i][1]_1 when the photovoltaic power true value at the next moment decreases.

[0139] In this implementation, the input variables of the ith training sample are input into the prediction model to be trained to obtain the prediction data y[i] = [y[i][0], y[i][1]] of the ith training sample predicted by the prediction model, where y[i][0] is the photovoltaic power prediction value at the next moment corresponding to the ith training sample, and y[i][1] is the change trend prediction value of the photovoltaic power true value at the next moment corresponding to the ith training sample; the label data Y label [i] = [Y[i][0], Y[i][1]] of the ith training sample is compared with the prediction data y[i] = [y[i][0], y[i][1]] of the ith training sample, so that the gap between the label data and the prediction data of all training samples can be obtained, and the prediction accuracy of the prediction model is calculated, the model parameters of the prediction model are continuously adjusted until the accuracy of the prediction data (the photovoltaic power prediction value at the next moment and the change trend prediction value) predicted by the prediction model reaches a predetermined value, and the trained prediction model is obtained.

[0140] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0141]

[0142] wherein N is a total number of training samples, Y[i][0] is a true value of photovoltaic power in the ith training sample, Y[i][1] is a true value of a change trend in the ith training sample, y[i][0] is a predicted value of photovoltaic power corresponding to the ith training sample, and y[i][1] is a predicted value of a change trend corresponding to the ith training sample.

[0143] In this implementation, the prediction model can be an LSTM model with m cells, and the specific structure of the cells can be the cell structure in an existing LSTM model, which is known to those skilled in the art and will not be described here in detail.

[0144] In this implementation, the input variable of the ith training sample is input into the prediction model to be trained, to obtain predicted data y[i] = [y[i][0], y[i][1]] of the ith training sample predicted by the prediction model, wherein y[i][0] is a predicted value of photovoltaic power at a next time corresponding to the ith training sample, and y[i][1] is a predicted value of a change trend of the true value of photovoltaic power at the next time corresponding to the ith training sample. For each training sample, the predicted data corresponding to the training sample can be obtained, and the label data Y[i] = [Y[i][0], Y[i][1]] of the ith training sample is compared with the predicted data y[i] = [y[i][0], y[i][1] of the ith training sample. The mean square error of the label data and the predicted data is calculated as the loss function L of the prediction model, the model parameters of the prediction model are continuously adjusted until the loss function L is minimized, and a trained prediction model is obtained. label

[0145] The present disclosure also provides a training method of the prediction model, Figure 2 a flowchart of the training method of the prediction model according to an embodiment of the present disclosure is shown, as Figure 2 shown, the method comprises the following steps:

[0146] In step S201, a plurality of training samples are obtained, the input variable in each training sample comprises photovoltaic power true values at a plurality of sample time points and corresponding time features, and the label data in each training sample comprises photovoltaic power true values at a next time of the plurality of sample time points and change trend true values.

[0147] In step S202, the prediction model is trained using the plurality of training samples.​

[0148] In a possible implementation, the training method of the prediction model is applicable to various electronic devices that can perform prediction model training, which can be the above-mentioned electronic devices for photovoltaic power prediction, or other electronic devices that train the prediction model and upload it to the electronic devices for photovoltaic power prediction for use.

[0149] In a possible implementation, the input variables in the i-th training sample can be denoted as wherein, including the true values of the photovoltaic power at multiple sample moments in the i-th training sample, including the time characteristics corresponding to the true values of the photovoltaic power at multiple sample moments in the i-th training sample; the label data in the training sample can include Y lael [i],Y label [i]=[Y[i][0],Y[i][1]] wherein Y[i][0] is the true value of the photovoltaic power at the next moment corresponding to the i-th training sample, Y[i][1] is the true value of the trend of the true value of the photovoltaic power at the next moment corresponding to the i-th training sample, i.e., the trend true value corresponding to the i-th training sample, which can be set as Y[i][1]=0 when the true value of the photovoltaic power at the next moment increases, and Y[i][1]=1 when the true value of the photovoltaic power at the next moment decreases. In a possible implementation, the input variables of the i-th training sample are input into the prediction model to be trained to obtain the prediction data y[i]=[y[i][0],y[i][1]] of the i-th training sample predicted by the prediction model, wherein y[i][0] is the predicted value of the photovoltaic power at the next moment corresponding to the i-th training sample, and y[i][1] is the predicted value of the trend of the true value of the photovoltaic power at the next moment corresponding to the i-th training sample; the label data Y label [i]=[Y[i][0],Y[i][1] of the i-th training sample is compared with the prediction data y[i]=[y[i][0],y[i][1] of the i-th training sample, so as to obtain the gap between the label data and the prediction data of all training samples, and then the prediction accuracy of the prediction model is calculated, the model parameters of the prediction model are continuously adjusted, until the accuracy of the prediction data (the predicted value of the photovoltaic power at the next moment and the predicted value of the trend) predicted by the prediction model reaches a predetermined value, i.e., the trained prediction model is obtained.

[0150] This implementation method can fuse the feature information of photovoltaic power data itself with time feature information, and propose a dual-label prediction model to achieve dual loss correction during data training. By combining the fused data features with the improved prediction model, the trained prediction model can effectively improve the accuracy of photovoltaic power prediction.

[0151] In one possible implementation, acquiring multiple training samples includes:

[0152] Obtain the true values ​​of photovoltaic power p1, p2, ... p at n sample times. n ;

[0153] Based on the true values ​​of photovoltaic power p1, p2, ... p at the n sample times... n The photovoltaic power variable P of the nm group was obtained. train and its corresponding nm group label data Y label :

[0154] P train =[[p1,…,p m ],[p2,…,p m+1 ]..., [p n-m , ..., p n-1 ]];

[0155]

[0156] Based on the n sample times, the photovoltaic power variable P of the nm group is obtained according to the following formula. train The corresponding nm group first time features Second time features

[0157]

[0158] in, It is the hourly value at the m-th sample time. This is the minute value for the m-th sample time, and the hour value uses the 24-hour time system.

[0159] A set of photovoltaic power variables and their corresponding set of first-time features, a set of second-time features, and a set of label data are obtained as a training sample.

[0160] Both m and n are positive integers.

[0161] In this embodiment, nm sets of photovoltaic power variables P can be obtained based on the true values ​​of photovoltaic power at n sample times. train and its corresponding nm group label data Y label First time features of nm group Second time features Each set of photovoltaic power variables and its corresponding set of label data, a set of first time features and a set of second time features can form a training sample.

[0162] In this embodiment, the input variables in the ith training sample wherein, That is, the input variables The label data corresponding to the ith training sample Thus, the ith training sample is:

[0163]

[0164] Thus, based on the true values of photovoltaic power p1, p2, ··· pn of the n sample moments, the n-m training samples can be obtained. Assuming that n = 1000 and m = 20, n-m = 980 training samples can be obtained, wherein the first training sample is: n Assuming that the m = 20th sample moment is 16:50, then

[0165] The embodiment can effectively reduce the misjudgment of sudden reduction of photovoltaic power on cloudy days as night and the occurrence of burr of photovoltaic power at night, improve the ability of the network model to deal with data mutation, and effectively improve the accuracy of data prediction.

[0166] In a possible embodiment, the true values of photovoltaic power of the n sample moments are obtained, comprising:

[0167] If the true values of photovoltaic power of the n sample moments are missing, the sample missing moment of the missing photovoltaic power true value is determined.

[0168] Based on the true values of photovoltaic power of the sampling moments before the sample missing moment, the true values of photovoltaic power of the sample missing moment are filled.

[0169] ​​In some cases, such as the failure of the acquisition device, etc., the true value of the photovoltaic power at the sampling time cannot be collected, and the data missing problem occurs, especially for distributed photovoltaic, due to the small capacity of the photovoltaic power station itself, the scattered installation, the small investment and other reasons, a high-precision photovoltaic meter is not specially equipped, resulting in a serious data missing problem in the historical power data. In order to solve the data missing problem, if the true value of the photovoltaic power at the sampling time is missing when n samples are obtained, the true value of the photovoltaic power at the sample missing time is filled based on the true value of the photovoltaic power at the sampling time before the sample missing time, for example, a curve function of the photovoltaic power changing with time can be fitted based on the true value of the photovoltaic power at multiple sampling times before the sample missing time, and the true value of the photovoltaic power at the sample missing time is determined based on the curve function, etc. In a possible implementation, filling the true value of the photovoltaic power at the sample missing time based on the true value of the photovoltaic power at the historical time before the sample missing time can include the following steps:

[0170] Obtaining the true value of the photovoltaic power at s consecutive sampling times before the sample missing time;

[0171] Obtaining the true value of the photovoltaic power at each sampling time in multiple days before the sample missing time;

[0172] From the true value of the photovoltaic power at each sampling time in each day before the sample missing time, obtaining the true value of the photovoltaic power at s consecutive sampling times most similar to the true value of the photovoltaic power at s consecutive sampling times before the sample missing time; determining the true value of the photovoltaic power at the first sampling time after the most similar s consecutive sampling times as the true value of the photovoltaic power at the sample missing time;

[0173] Wherein, s is a positive integer.

[0174] In this implementation, it is assumed that the sample missing time is 18:30 on XX day, s is 40, and the true value of the photovoltaic power at s=40 consecutive sampling times before the sample missing time can be denoted as The true value of the photovoltaic power at each sampling time in 15 days before the sample missing time Wherein, d is the number of days before XX day, which can take values 1, 2, …, 15; t is the tth sampling time of each day, which can take values 1, 2, …, q, q is the total amount of sampling times of each day, is the true value of the photovoltaic power at the tth sampling time of the dth day before XX day. The true value of the photovoltaic power at s=40 consecutive sampling times in each of the 15 days can be traversed The similarity between is calculated, for example, the similarity between ​the Euclidean distance between and the similarity between ; thus the s=40 continuous sampling time photovoltaic power true values with the minimum Euclidean distance between and the s=40 continuous sampling time photovoltaic power true values can be found Assuming that the s=40 continuous sampling time photovoltaic power true values with the minimum Euclidean distance between are the s=40 continuous sampling time photovoltaic power true values between 12:00 and 18:40 on the second day before the missing time, then the photovoltaic power true value at the first sampling time 18:50 after 18:40 on the second day can be obtained as the photovoltaic power true value at the missing time 18:30.

[0175] The embodiment can more accurately fill the photovoltaic power true value at the sample missing time by determining the photovoltaic power true value at the first sampling time after the s=40 continuous sampling time photovoltaic power true values with the minimum Euclidean distance between the s=40 continuous sampling time photovoltaic power true values before the sample missing time as the photovoltaic power true value at the sample missing time, so that the lemniscate sample for model training is more accurate, and thus the prediction performance of the trained prediction model is better.

[0176] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0177]

[0178] wherein N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the ith training sample, Y[i][1] is the change trend true value in the ith training sample, y[i][0] is the photovoltaic power prediction value corresponding to the ith training sample, and y[i][1] is the change trend prediction value corresponding to the ith training sample.

[0179] In the embodiment, the input variable of the ith training sample is input into the prediction model to be trained to obtain the prediction data y[i]=[y[i][0], y[i][1]] predicted by the prediction model, wherein y[i][0] is the photovoltaic power prediction value at the next time corresponding to the ith training sample, and y[i][1] is the change trend prediction value of the photovoltaic power true value at the next time corresponding to the ith training sample; for each training sample, the prediction data corresponding to the training sample can be obtained, and the label data Y label[i] = [Y[i][0], Y[i][1]], and the prediction data y[i] = [y[i][0], y[i][1]] of the ith training sample, the mean square error of the label data and the prediction data is calculated as a loss function L of the prediction model, the model parameters of the prediction model are constantly adjusted until the loss function L is minimum, and a trained prediction model is obtained.

[0180] The present disclosure also provides a photovoltaic power prediction device, Figure 3 A structural block diagram of a photovoltaic power prediction device according to an embodiment of the present disclosure is shown, which can be realized by software, hardware, or a combination of the two to become part or all of an electronic device. As shown in Figure 3 The photovoltaic power prediction device includes:

[0181] The true value acquisition module 301 is configured to acquire photovoltaic power true values at a plurality of historical time points before a prediction time point;

[0182] The feature extraction module 302 is configured to extract time features corresponding to the photovoltaic power true values from the photovoltaic power true values at the plurality of historical time points;

[0183] The prediction module 303 is configured to input the photovoltaic power true values at the plurality of historical time points and the time features corresponding thereto into a pre-trained prediction model, execute the prediction model, and obtain photovoltaic power prediction values and change trend prediction values at the prediction time point output by the prediction model.

[0184] In a possible implementation, the photovoltaic power prediction device is applicable to various electronic devices that can perform photovoltaic power prediction. In a possible implementation, the prediction time point refers to a time point at which photovoltaic power prediction needs to be performed. For example, the prediction time point can be a future time point after the current time point, such as a future time point 20 minutes or half an hour later, etc. The adjacent historical time points among the plurality of historical time points before the prediction time point can be separated by tens of minutes.

[0185] In a possible implementation, the photovoltaic power true values at the plurality of historical time points can be power values of photovoltaic power generation of a certain photovoltaic power station collected by a related collection device at historical time points.

[0186] In a possible implementation, the feature extraction module 302 can extract time features from the photovoltaic power true values at the plurality of historical time points, and the time features refer to features that can reflect the collection time points of the collected photovoltaic power.

[0187] In a possible implementation, the prediction model can be an improved LSTM (Long Short-Term Memory) network model, the input of the prediction model is the photovoltaic power true value at a plurality of historical time points and the corresponding time features, and the output of the prediction model has two, which are the photovoltaic power prediction value at the prediction time point and the change trend prediction value. The prediction model is a pre-trained model, and since there are two output labels, double loss correction can be performed for the two output labels during model training, so as to improve the prediction accuracy of the model.

[0188] In a possible implementation, when performing photovoltaic power prediction, the prediction module 303 can input the photovoltaic power true value at a plurality of historical time points and the corresponding time features into a pre-trained prediction model, execute the prediction model, and obtain two prediction results output by the prediction model, that is, the photovoltaic power prediction value at the prediction time point and the change trend prediction value. In this embodiment, the photovoltaic power true value at a plurality of historical time points before the prediction time point is obtained; the photovoltaic power feature and the time feature are obtained based on the photovoltaic power true value at the plurality of historical time points; the photovoltaic power feature and the time feature are input into a pre-trained prediction model, the prediction model is executed, and the photovoltaic power prediction value at the prediction time point and the change trend prediction value output by the prediction model are obtained. In this way, the feature information of the photovoltaic power data itself and the time feature information are fused, a double-label prediction model is proposed, double loss correction during data training is realized, the model prediction accuracy of the photovoltaic power data under various environments is effectively improved by combining the fused data features and the improved prediction model.

[0189] In a possible implementation, the true value acquisition module 301 is configured to:

[0190] If the photovoltaic power true value at a plurality of historical time points before the prediction time point is missing, a missing time point at which the photovoltaic power true value is missing is determined.

[0191] Fill the photovoltaic power true value at the missing time based on the photovoltaic power true value at the sampling time before the missing time. In some cases, such as failure of the acquisition device, etc., the photovoltaic power true value at the sampling time cannot be acquired, and the data missing problem occurs. Especially for distributed photovoltaic, due to the reasons such as small single capacity of photovoltaic power station, scattered installation, small investment, etc., high-precision photovoltaic metering meter will not be specially equipped, resulting in serious data missing problem of historical power data. In order to solve the data missing problem, when the photovoltaic power true value at multiple historical times before the prediction time is missing, the photovoltaic power true value at the missing time can be filled based on the photovoltaic power true value at the sampling time before the missing time, for example, a photovoltaic power curve function changing with time can be fitted based on the photovoltaic power true value at multiple sampling times before the missing time, and the photovoltaic power true value at the missing time is determined based on the curve function, etc.

[0192] In a possible implementation, the part of the true value acquisition module that fills the photovoltaic power true value at the missing time based on the photovoltaic power true value at the sampling time before the missing time is configured to:

[0193] Obtain the photovoltaic power true value at k consecutive sampling times before the missing time;

[0194] Obtain the photovoltaic power true value at each sampling time in multiple days before the missing time;

[0195] From the photovoltaic power true value at each sampling time in each of the multiple days before the missing time, obtain the photovoltaic power true value at k consecutive sampling times most similar to the photovoltaic power true value at k consecutive sampling times before the missing time;

[0196] Determine the photovoltaic power true value at the first sampling time after the k most similar consecutive sampling times as the photovoltaic power true value at the missing time;

[0197] Wherein, the k is a positive integer.

[0198] In this implementation, assuming that the missing time is 18:10 before the prediction time, and the value of k is 50, the photovoltaic power true value at k=50 consecutive sampling times before the missing time can be denoted as Photovoltaic power true value at each sampling time in 20 days before the missing time Wherein, d is the number of days before the missing time, which can take values 1, 2, …, 20; t is the tth sampling time of each day, which can take values 1, 2, …, q, q is the total amount of sampling times of each day, is the true value of photovoltaic power at the t-th sampling time on the d-th day before the missing time. The true values of photovoltaic power at k=50 continuous sampling times on each of the 20 days can be traversed is calculated The similarity between is calculated, for example, the Euclidean distance between and is calculated as the similarity between and ; thus, the k=50 continuous sampling time true values of photovoltaic power with the minimum Euclidean distance between and can be found, that is, the most similar k=50 continuous sampling time true values of photovoltaic power is the true value of photovoltaic power at the first sampling time 15:30 after 15:20 on the second day, which is obtained as the true value of photovoltaic power at the missing time 18:10.

[0199] The embodiment determines the true value of photovoltaic power at the first sampling time after the k continuous sampling time true values of photovoltaic power most similar to the k continuous sampling time true values of photovoltaic power before the missing time as the true value of photovoltaic power at the missing time, which can more accurately fill the true value of photovoltaic power at the missing time, and further makes the subsequent photovoltaic power prediction more accurate.

[0200] In a possible implementation, the feature extraction module 302 is configured to:

[0201] Based on m historical time points, the first time feature T cos and the second time feature T sin corresponding to the true value of photovoltaic power are obtained according to the following formula:

[0202]

[0203] wherein, is the hour value of the m-th historical time point, is the minute value of the m-th historical time point, the hour value adopts a 24-hour system, and m is a positive integer. In the embodiment, assuming that the m=20-th historical time point is 15:30,

[0204] The sin and cos encoded features corresponding to the photovoltaic power true values of the plurality of historical time points extracted by the embodiment can accurately reflect the time characteristics of the historical time points, effectively reduce the misjudgment of sudden reduction of photovoltaic power generation power as night on cloudy days and the burr of photovoltaic power generation power at night, and thus better fuse the photovoltaic power true values of the plurality of historical time points to perform accurate photovoltaic power prediction.

[0205] In a possible implementation, the method can further include the following steps:

[0206] Obtaining a plurality of training samples, the input variables in each training sample including photovoltaic power true values of a plurality of sample time points and corresponding time characteristics, and the label data in each training sample including photovoltaic power true values of next time points of the plurality of sample time points and change trend true values;

[0207] Training the prediction model using the training samples.

[0208] In the embodiment, the input variables in the ith training sample can be denoted as wherein, including photovoltaic power true values of a plurality of sample time points in the ith training sample, including time characteristics corresponding to the photovoltaic power true values of the plurality of sample time points in the ith training sample; the label data in the training sample can be denoted as Y label [i],Y label [i]=[Y[i][0],Y[i][1]] wherein Y[i][0] is the photovoltaic power true value of the next time point corresponding to the ith training sample, and Y[i][1] is the change trend true value of the photovoltaic power true value of the next time point corresponding to the ith training sample, that is, the change trend true value corresponding to the ith training sample can be set as Y[i][1]_0 when the photovoltaic power true value of the next time point increases, and Y[i][1]_1 when the photovoltaic power true value of the next time point decreases.

[0209] In the embodiment, the input variables of the ith training sample can be denoted as input into the prediction model to be trained to obtain the prediction data y[i]=[y[i][0],y[i][1]] of the ith training sample predicted by the prediction model, wherein y[i][0] is the photovoltaic power prediction value of the next time point corresponding to the ith training sample, and y[i][1] is the change trend prediction value of the photovoltaic power true value of the next time point corresponding to the ith training sample; and the label data Y label[i] = [Y[i][0], Y[i][1]] and the predicted data y[i] = [y[i][0], y[i][1]] of the i-th training sample can be used to obtain the difference between the label data and the predicted data of all training samples. Then, the prediction accuracy of the prediction model can be calculated. The model parameters of the prediction model are continuously adjusted until the accuracy of the predicted data (the predicted value of photovoltaic power and the predicted value of the change trend at the next moment) reaches the predetermined value, and the trained prediction model can be obtained.

[0210] In one possible implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model, and the loss function L of the prediction model is:

[0211]

[0212] Where N is the total number of training samples, Y[i][0] is the true value of photovoltaic power in the i-th training sample, Y[i][1] is the true value of the trend in the i-th training sample, y[i][0] is the predicted value of photovoltaic power corresponding to the i-th training sample, and y[i][1] is the predicted value of the trend corresponding to the i-th training sample.

[0213] In this embodiment, the prediction model can be an LSTM model with m neurons (cel], and the specific structure of the neurons can be the neuron structure in the existing LSTM model, which is known to those skilled in the art and will not be described in detail here.

[0214] In this implementation, the input variables of the i-th training sample can be... The input is fed into the prediction model to be trained, and the predicted data y[i] = [y[i][0], y[i][1]] corresponding to the i-th training sample is obtained, where y[i][0] is the predicted value of photovoltaic power at the next moment corresponding to the i-th training sample, and y[i][1] is the predicted value of the change trend of the true value of photovoltaic power at the next moment corresponding to the i-th training sample. For each training sample, the predicted data corresponding to the training sample can be obtained, and the label data Y of the i-th training sample is compared. label [i] = [Y[i][0], Y[i][1]], and the predicted data y[i] = [y[i][0], y[i][1]] of the i-th training sample. The mean squared error between the label data and the predicted data is used as the loss function L of the prediction model. The model parameters of the prediction model are continuously adjusted until the loss function L is minimized, and the trained prediction model can be obtained.

[0215] This disclosure also provides a training apparatus for a prediction model. Figure 4A structural block diagram of a training apparatus of a prediction model according to an embodiment of the present disclosure is shown, which can be implemented by software, hardware or a combination of both as part or all of an electronic device. As shown in Figure 4 The training apparatus of the prediction model comprises:

[0216] The sample acquisition module 401 is configured to acquire a plurality of training samples, the input variables in each training sample comprising photovoltaic power true values at a plurality of sample moments and corresponding time features, and the label data in each training sample comprising a next-moment photovoltaic power true value and a change trend true value at the plurality of sample moments;

[0217] The training module 402 is configured to train the prediction model using the plurality of training samples.

[0218] In a possible implementation, the training apparatus of the prediction model is applicable to various electronic devices that can perform prediction model training, which can be the above-mentioned electronic devices for photovoltaic power prediction, or other electronic devices that train prediction models and upload them to the electronic devices for photovoltaic power prediction for use.

[0219] In a possible implementation, the input variables in the i-th training sample can be denoted as wherein, comprises photovoltaic power true values at a plurality of sample moments in the i-th training sample, comprises time features corresponding to the photovoltaic power true values at a plurality of sample moments in the i-th training sample; the label data in the training sample can be denoted as Y label [i] and Y label [i] = [Y[i][0], Y[i][1]], where Y[i][0] is a next-moment photovoltaic power true value corresponding to the i-th training sample, and Y[i][1] is a change trend true value of the next-moment photovoltaic power true value corresponding to the i-th training sample, i.e., the change trend true value corresponding to the i-th training sample, which can be set as Y[i][1] = 0 when the next-moment photovoltaic power true value increases, and Y[i][1] = 1 when the next-moment photovoltaic power true value decreases. In a possible implementation, the input variables of the i-th training sample are input into the prediction model to be trained to obtain prediction data y[i] = [y[i][0], y[i][1]] of the i-th training sample predicted by the prediction model, where y[i][0] is a next-moment photovoltaic power prediction value corresponding to the i-th training sample, and y[i][1] is a change trend prediction value of the next-moment photovoltaic power true value corresponding to the i-th training sample; the label data Y label[i] = [Y[i][0], Y[i][1]] and the predicted data y[i] = [y[i][0], y[i][1]] of the i-th training sample can be used to obtain the difference between the label data and the predicted data of all training samples. Then, the prediction accuracy of the prediction model can be calculated. The model parameters of the prediction model are continuously adjusted until the accuracy of the predicted data (the predicted value of photovoltaic power and the predicted value of the change trend at the next moment) reaches the predetermined value, and the trained prediction model can be obtained.

[0220] This implementation method can fuse the feature information of photovoltaic power data itself with time feature information, and propose a dual-label prediction model to achieve dual loss correction during data training. By combining the fused data features with the improved prediction model, the trained prediction model can effectively improve the accuracy of photovoltaic power prediction.

[0221] In one possible implementation, the sample acquisition module is configured as follows:

[0222] Obtain the true values ​​of photovoltaic power p1, p2, ... p at n sample times. n ;

[0223] Based on the true values ​​of photovoltaic power p1, p2, ... p at the n sample times... n The photovoltaic power variable P of the nm group was obtained. train and its corresponding nm group label data Y label :

[0224] P train =[[p1, ..., p m ],[p2,…,p m+1 ]..., [p n-m , ..., p n-1 ]];

[0225]

[0226] Based on the n sample times, the photovoltaic power variable P of the nm group is obtained according to the following formula. train The corresponding nm group first time features Second time features

[0227]

[0228] in, It is the hourly value at the m-th sample time. This is the minute value for the m-th sample time, and the hour value uses the 24-hour time system.

[0229] A set of photovoltaic power variables and their corresponding set of first-time features, a set of second-time features, and a set of label data are obtained as a training sample.

[0230] Both m and n are positive integers.

[0231] In this embodiment, nm sets of photovoltaic power variables P can be obtained based on the true values ​​of photovoltaic power at n sample times. train and its corresponding nm group label data Y label First time features of nm group Second time features Each set of photovoltaic power variables, along with its corresponding set of label data, a set of first-time features, and a set of second-time features, can form a training sample.

[0232] In this implementation, the input variables in the i-th training sample In in, That is, the input variable The label data corresponding to the i-th training sample Thus, the i-th training sample is:

[0233]

[0234] Thus, based on the true values ​​of photovoltaic power p1, p2, ... p at the n sample times, n We can obtain nm training samples. Assuming n = 1000 and m = 20, we can obtain nm = 980 training samples, where the i = 1st training sample is: Assuming the m=20th sample time is 16:50, then

[0235] This implementation method, by incorporating sin and cosine encoding features at sample times, can effectively reduce the misjudgment of sudden decreases in photovoltaic power generation on cloudy days as nighttime, as well as the occurrence of spikes in photovoltaic power generation at nighttime. This enhances the network model's ability to cope with data mutations and can effectively improve the accuracy of data prediction.

[0236] In one possible implementation, the portion of the sample acquisition module that acquires the true photovoltaic power values ​​at n sample times is configured as follows:

[0237] If the true value of photovoltaic power is missing when obtaining the true value of photovoltaic power at n sample times, then the sample times where the true value of photovoltaic power is missing are determined.

[0238] Fill the photovoltaic power true value of the sample missing moment based on the photovoltaic power true value of the sampling moment before the sample missing moment.

[0239] In some cases, such as the failure of the acquisition device, etc., the photovoltaic power true value of the sampling moment cannot be acquired, and the data missing problem occurs. Especially for distributed photovoltaic, due to the small single capacity of photovoltaic power station, scattered installation, small investment and other reasons, high-precision photovoltaic metering meter will not be specially equipped, which leads to serious data missing problem of historical power data. In order to solve the data missing problem, if the photovoltaic power true value of n sampling moments is obtained, and the true value is missing, the photovoltaic power true value of the sample missing moment is filled based on the photovoltaic power true value of the sampling moment before the sample missing moment. For example, a photovoltaic power curve function changing with time can be fitted based on the photovoltaic power true value of multiple sampling moments before the sample missing moment, and the photovoltaic power true value of the sample missing moment is determined based on the curve function, etc. In a possible implementation, the filling of the photovoltaic power true value of the sample missing moment based on the photovoltaic power true value of the historical moment before the sample missing moment can include the following steps:

[0240] Obtain the photovoltaic power true value of s continuous sampling moments before the sample missing moment;

[0241] Obtain the photovoltaic power true value of each sampling moment in multiple days before the sample missing moment;

[0242] Obtain the photovoltaic power true value of s continuous sampling moments most similar to the photovoltaic power true value of s continuous sampling moments before the sample missing moment from the photovoltaic power true value of each sampling moment in multiple days before the sample missing moment; the photovoltaic power true value of the first sampling moment after the most similar s continuous sampling moments is determined as the photovoltaic power true value of the sample missing moment;

[0243] Wherein, s is a positive integer.

[0244] In this embodiment, it is assumed that the sample missing moment is 18:30 on XX day, s is 40, and the photovoltaic power true value of s=40 continuous sampling moments before the sample missing moment can be denoted as The photovoltaic power true value of each sampling moment in 15 days before the sample missing moment Wherein, d is the number of days before XX day, which can be 1, 2, …, 15; t is the tth sampling moment of each day, which can be 1, 2, …, q, q is the total amount of sampling moments of each day, is the photovoltaic power true value of the tth sampling moment of the dth day before XX day. The photovoltaic power true value of s=40 continuous sampling moments of each day in the 15 days can be traversed calculate and The similarity between them, for example, can be calculated. and The Euclidean distance between them is used as and The similarity between them; thus, we can find the similarity with that. The closest Euclidean distance between them, i.e., the most similar true photovoltaic power values ​​at s = 40 consecutive sampling times. Assume we need to find the most similar true photovoltaic power values ​​at s = 40 consecutive sampling times. If the true value of photovoltaic power is obtained from 40 consecutive sampling times between 12:00 and 18:40 on the second day before the missing time, then the true value of photovoltaic power at 18:50, the first sampling time after 18:40 on the second day, can be used as the true value of photovoltaic power at the missing time of 18:30.

[0245] This implementation method determines the photovoltaic power true value at the time of sample loss by identifying the photovoltaic power true value at the first sampling time after the photovoltaic power true value at the s consecutive sampling times most similar to the photovoltaic power true value at the s consecutive sampling times before the time of sample loss. This allows for more accurate filling of the photovoltaic power true value at the time of sample loss, thus making the catenary samples used for model training more accurate and improving the prediction performance of the trained prediction model.

[0246] In one possible implementation, the prediction model includes a Long Short-Term Memory (LSTM) network model, and the loss function L of the prediction model is:

[0247]

[0248] Where N is the total number of training samples, Y[i][0] is the true value of photovoltaic power in the i-th training sample, Y[i][1] is the true value of the trend in the i-th training sample, y[i][0] is the predicted value of photovoltaic power corresponding to the i-th training sample, and y[i][1] is the predicted value of the trend corresponding to the i-th training sample.

[0249] In this implementation, the input variables of the i-th training sample can be... The input is fed into the prediction model to be trained, and the predicted data y[i] = [y[i][0], y[i][1]] corresponding to the i-th training sample is obtained, where y[i][0] is the predicted value of photovoltaic power at the next moment corresponding to the i-th training sample, and y[i][1] is the predicted value of the change trend of the true value of photovoltaic power at the next moment corresponding to the i-th training sample. For each training sample, the predicted data corresponding to the training sample can be obtained, and the label data Y of the i-th training sample is compared.label [i] = [Y[i][0], Y[i][1]], and the prediction data y[i] = [y[i][0], y[i][1]] of the ith training sample, calculating the mean square error of the label data and the prediction data as a loss function L of the prediction model, constantly adjusting the model parameters of the prediction model until the loss function L is minimized, and a trained prediction model is obtained.

[0250] The embodiment can fuse the feature information of the photovoltaic power data itself and the time feature information, and propose a double-label prediction model to realize double loss correction during data training. Through the combination of the fused data features and the improved prediction model, the trained prediction model can effectively improve the accuracy of photovoltaic power prediction.

[0251] The present disclosure also discloses an electronic device, Figure 5 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. As Figure 5 shown, the electronic device 500 includes a memory 501 and a processor 502, wherein the memory 501 is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor 502 to implement the method according to the embodiment of the present disclosure.

[0252] The present disclosure provides a photovoltaic power prediction method, comprising:

[0253] Obtaining the photovoltaic power true values of a plurality of historical time points before a prediction time point;

[0254] Extracting the time features corresponding to the photovoltaic power true values from the photovoltaic power true values of the plurality of historical time points;

[0255] Inputting the photovoltaic power true values of the plurality of historical time points and the corresponding time features into a pre-trained prediction model, executing the prediction model, and obtaining the photovoltaic power prediction value and the change trend prediction value of the prediction time point output by the prediction model.

[0256] In a possible implementation, the obtaining of the photovoltaic power true values of a plurality of historical time points before a prediction time point comprises: if the photovoltaic power true values of a plurality of historical time points before a prediction time point are missing, determining a missing time point where the photovoltaic power true value is missing.

[0257] Filling the photovoltaic power true value of the missing time point based on the photovoltaic power true values of the sampling time points before the missing time point.

[0258] In a possible implementation, the filling of the photovoltaic power true value of the missing time point based on the photovoltaic power true values of the sampling time points before the missing time point comprises:

[0259] obtaining the photovoltaic power true value at the k continuous sampling time points before the missing time point;

[0260] obtaining the photovoltaic power true value at each sampling time point in multiple days before the missing time point;

[0261] from the photovoltaic power true value at each sampling time point in each day in multiple days before the missing time point, obtaining the photovoltaic power true value at the k continuous sampling time points most similar to the photovoltaic power true value at the k continuous sampling time points before the missing time point;

[0262] determining the photovoltaic power true value at the first sampling time point after the k continuous sampling time points most similar as the photovoltaic power true value at the missing time point;

[0263] wherein the k is a positive integer.

[0264] In a possible implementation, the extracting the time feature corresponding to the photovoltaic power true value from the photovoltaic power true value at the multiple historical time points comprises:

[0265] obtaining the first time feature T cos and the second time feature T sin corresponding to the photovoltaic power true value based on the m historical time points according to the following formula:

[0266]

[0267] wherein, is the hour value of the mth historical time point, is the minute value of the mth historical time point, the hour value adopts 24-hour system, and the m is a positive integer.

[0268] In a possible implementation, the method further comprises:

[0269] obtaining multiple training samples, the input variable in each training sample comprising the photovoltaic power true value at multiple sample time points and the time feature corresponding thereto, and the label data in each training sample comprising the photovoltaic power true value and the change trend true value at the next time point of the multiple sample time points;

[0270] training the prediction model using the multiple training samples.

[0271] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and the loss function L of the prediction model is:

[0272]

[0273] Where N is the total number of training samples, Y[i][0] is the true value of photovoltaic power in the i-th training sample, Y[i][1] is the true value of the trend in the i-th training sample, y[i][0] is the predicted value of photovoltaic power corresponding to the i-th training sample, and y[i][1] is the predicted value of the trend corresponding to the i-th training sample.

[0274] This disclosure also provides a method for training a prediction model, the training method comprising:

[0275] Multiple training samples are obtained. The input variables in each training sample include the true value of photovoltaic power at multiple sample times and its corresponding time features. The label data in each training sample includes the true value of photovoltaic power at the next time and the true value of the change trend at the next time.

[0276] The prediction model is trained using the multiple training samples.

[0277] In one possible implementation, acquiring multiple training samples includes:

[0278] Obtain the true values ​​of photovoltaic power p1, p2, ... p at n sample times. n ;

[0279] Based on the true values ​​of photovoltaic power p1, p2, ... p at the n sample times... n The photovoltaic power variable P of the nm group was obtained. train and its corresponding nm group label data Ylabel :

[0280] P train =[[p1, ..., p m ],[p2,…,p m+1 ]..., [p n-m , ..., p n-1 ]];

[0281]

[0282] Based on the n sample times, the photovoltaic power variable P of the nm group is obtained according to the following formula. train The corresponding nm group first time features Second time features

[0283]

[0284] in, It is the hourly value at the m-th sample time. This is the minute value for the m-th sample time, and the hour value uses the 24-hour time system.

[0285] obtain a set of photovoltaic power variables and a corresponding set of first time characteristics, a set of second time characteristics and a set of label data as a training sample;

[0286] Both m and n are positive integers.

[0287] In a possible implementation, the obtaining of the photovoltaic power true value at the n sample moments comprises:

[0288] If the photovoltaic power true value at the n sample moments is missing, a sample missing moment at which the photovoltaic power true value is missing is determined.

[0289] Based on the photovoltaic power true value at the sampling moment before the sample missing moment, the photovoltaic power true value at the sample missing moment is filled.

[0290] In a possible implementation, the filling of the photovoltaic power true value at the sample missing moment based on the photovoltaic power true value at the sampling moment before the sample missing moment comprises:

[0291] Obtaining the photovoltaic power true value at s continuous sampling moments before the sample missing moment;

[0292] Obtaining the photovoltaic power true value at each sampling moment in multiple days before the sample missing moment;

[0293] From the photovoltaic power true value at each sampling moment in multiple days before the sample missing moment, obtaining the photovoltaic power true value at s continuous sampling moments most similar to the photovoltaic power true value at s continuous sampling moments before the sample missing moment; and determining the photovoltaic power true value at the first sampling moment after the most similar s continuous sampling moments as the photovoltaic power true value at the sample missing moment.

[0294] Wherein, s is a positive integer.

[0295] In a possible implementation, the prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is:

[0296]

[0297] Wherein, N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the ith training sample, Y[i][1] is the change trend true value in the ith training sample, y[i][0] is the photovoltaic power prediction value corresponding to the ith training sample, and y[i][1] is the change trend prediction value corresponding to the ith training sample.

[0298] In a possible implementation, the one or more computer instructions are executed by the processor 502 to implement a photovoltaic power prediction method according to an embodiment of the present disclosure, which comprises:

[0299] In a possible implementation, the electronic device can be a network configuration device such as an FTU (Feeder Terminal Unit, feeder switch monitoring terminal), a DTU (Distribution Terminal Unit, terminal device of a switching station), a smart fusion terminal, or the like, or the electronic device can also be a power distribution master station or a device on a power distribution substation.

[0300] The present disclosure further provides a chip comprising the photovoltaic power prediction device, which can be any chip that can implement the photovoltaic power prediction device, or the chip comprises the training device of the prediction model, which can be a chip of the training device of the prediction model, and the device can be implemented by software, hardware, or a combination of both to become part or all of the chip.

[0301] Figure 6 A structural schematic diagram of a computer system suitable for implementing the method of the embodiments of the present disclosure is shown.

[0302] As shown in Figure 6 , the computer system 600 includes a processing unit 601 that can perform various processes in the above embodiments according to programs stored in a read-only memory (ROM) 602 or loaded from a storage portion 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the computer system 600 are also stored in the RAM 603. The processing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0303] The following components are connected to the I / O interface 605: an input portion 606 including keys and the like; an output portion 607 including a display and the like; a storage portion 608 including a hard disk and the like; and a communication portion 609 including a network interface card such as a LAN card, a modem, and the like. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is mounted on the drive 610 as needed, so that a computer program read therefrom is installed in the storage portion 608 as needed. Among them, the processing unit 601 can be implemented as a CPU, a GPU, a TPU, a FPGA, an NPU, and the like.

[0304] In particular, the method described above can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising computer instructions which, when executed by a processor, implement the method steps described above. In such embodiments, the computer program product can be downloaded and installed from a network via the communication section 609, and / or installed from the removable media 611.

[0305] The flow and block diagrams in the drawings represent possible architectural, functional, and operational architectures of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, a segment, or a portion of code which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by special purpose hardware-based systems which perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.

[0306] As another aspect, the present disclosure also provides a computer readable storage medium, which can be the computer readable storage medium included in the electronic device or the computer system in the above embodiments; or can be a computer readable storage medium which exists separately and is not assembled into the device. The computer readable storage medium stores one or more programs which are executed by one or more processors to perform the method described in the present disclosure.

[0307] The above description is merely exemplary of preferred embodiments of the present disclosure and of the application of the principles of the technology. It is understood that the scope of the application of the present disclosure is not limited to the specific combinations of technical features described above, but also covers other technical solutions formed by any combination of the technical features described above or equivalent features, without departing from the inventive concept. For example, the technical solutions formed by mutual replacement of the above-described features and the technical features disclosed in the present disclosure (but not limited to) having similar functions.

Claims

1. A photovoltaic power prediction method, characterized in that, The method comprises: obtaining photovoltaic power true values at a plurality of historical time points before a prediction time point; extracting time features corresponding to the photovoltaic power true values from the photovoltaic power true values at the plurality of historical time points, wherein the time features corresponding to the photovoltaic power true values comprise sin and cos encoding features of time corresponding to the photovoltaic power true values; inputting the photovoltaic power true values at the plurality of historical time points and the time features corresponding to the photovoltaic power true values into a pre-trained prediction model, executing the prediction model, and obtaining photovoltaic power prediction values and change trend prediction values at the prediction time point output by the prediction model; wherein, when training the prediction model, double loss correction is performed for two outputs of the prediction model.

2. The method of claim 1, wherein, The method comprises: if a true value is missing when obtaining the photovoltaic power true values at the plurality of historical time points before the prediction time point, determining a missing time point at which the photovoltaic power true value is missing; filling the photovoltaic power true value at the missing time point based on the photovoltaic power true values at sampling time points before the missing time point.

3. The method of claim 2, wherein, The method comprises: obtaining photovoltaic power true values at k consecutive sampling time points before the missing time point; obtaining photovoltaic power true values at sampling time points in multiple days before the missing time point; obtaining k photovoltaic power true values at k consecutive sampling time points most similar to the photovoltaic power true values at the k consecutive sampling time points before the missing time point from the photovoltaic power true values at the sampling time points in each of the multiple days before the missing time point; determining the photovoltaic power true value at the first sampling time point after the k photovoltaic power true values at the k consecutive sampling time points most similar as the photovoltaic power true value at the missing time point; wherein k is a positive integer.

4. The method of claim 1, wherein, The method comprises: Based on m historical moments, the first time characteristic T corresponding to the true value of the photovoltaic power is obtained according to the following formula cos And the second time characteristic T sin : wherein is an hour value of the mth historical time instant, is a minute value of the mth historical time instant, the hour value being measured in a 24-hour system, m being a positive integer.

5. The method of claim 1, wherein, The method further comprises: obtaining a plurality of training samples, wherein an input variable in each training sample comprises photovoltaic power true values at a plurality of sample time points and time features corresponding to the photovoltaic power true values, and label data in each training sample comprises photovoltaic power true values and change trend true values at a next time point of the plurality of sample time points; training the prediction model using the plurality of training samples.

6. The method of claim 5, wherein, The prediction model comprises a long short-term memory (LSTM) model, and a loss function L of the prediction model is: wherein N is a total number of training samples, Y[i][0] is a photovoltaic power true value in an i-th training sample, Y[i][1] is a change trend true value in the i-th training sample, y[i][0] is a photovoltaic power prediction value corresponding to the i-th training sample, and y[i][1] is a change trend prediction value corresponding to the i-th training sample.

7. A method for training a prediction model, characterized in that, The training method comprises: The plurality of training samples are obtained, and the input variable in each training sample includes the photovoltaic power true value and the corresponding time feature of a plurality of sample moments, and the label data in each training sample includes the photovoltaic power true value and the change trend true value of the next moment of the plurality of sample moments, and the time feature includes the sin and cos encoding features of the time corresponding to the photovoltaic power true value. The prediction model is trained using the plurality of training samples, and the prediction model is double-loss corrected for two outputs.

8. The training method of claim 7, wherein, The plurality of training samples are obtained, and the plurality of training samples include: Obtain the true value of photovoltaic power p1, p2,.... pn at n sample moments n ; based on the n sample instants of true photovoltaic power p1, p2,.... pn n , obtaining n-m groups of photovoltaic power variables P train and their corresponding n-m groups of label data Y label : P train = [[p1,...,p m ],[p2,...,p m+1 ]...,[p n-m ,...,p n-1 ]]; Based on the n sample instants, n-m groups of photovoltaic power variables P are obtained according to the following formula train Corresponding n-m groups of first time characteristics And second time characteristics wherein, is the hour value at the mth sample time, is the minute value at the mth sample time, the hour value being measured on a 24-hour basis; A set of photovoltaic power variables and a corresponding set of first time features, a set of second time features and a set of label data are obtained as a training sample. The m and n are positive integers.

9. The training method of claim 8, wherein, The n photovoltaic power true values of the sample moments are obtained, and the method includes: If the photovoltaic power true value is missing when the n photovoltaic power true values of the sample moments are obtained, a sample missing moment in which the photovoltaic power true value is missing is determined. The photovoltaic power true value of the sample missing moment is filled based on the photovoltaic power true value of the sampling moment before the sample missing moment.

10. The training method of claim 9, wherein, The photovoltaic power true value of the sample missing moment is filled based on the photovoltaic power true value of the sampling moment before the sample missing moment, and the method includes: The s continuous photovoltaic power true values of the sampling moments before the sample missing moment are obtained. The photovoltaic power true values of the sampling moments in multiple days before the sample missing moment are obtained. The s continuous photovoltaic power true values of the sampling moments most similar to the s continuous photovoltaic power true values of the sampling moments before the sample missing moment are obtained from the photovoltaic power true values of the sampling moments in each day of the multiple days before the sample missing moment. The photovoltaic power true value of the first sampling moment after the s continuous photovoltaic power true values of the most similar sampling moments is determined as the photovoltaic power true value of the sample missing moment. The s is a positive integer.

11. The training method of claim 7, wherein, The prediction model includes a long short-term memory (LSTM) model, and a loss function L of the prediction model is: Wherein, N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the i th training sample, Y[i][1] is the change trend true value in the i th training sample, y[i][0] is the photovoltaic power prediction value corresponding to the i th training sample, and y[i][1] is the change trend prediction value corresponding to the i th training sample.

12. A photovoltaic power prediction device, characterized by, The method includes: The true value acquisition module is configured to obtain the photovoltaic power true value of a plurality of historical moments before the prediction moment; The feature extraction module is configured to extract the time feature corresponding to the photovoltaic power true value from the photovoltaic power true value of the plurality of historical moments, and the time feature corresponding to the photovoltaic power true value includes the sin and cos encoding features of the time corresponding to the photovoltaic power true value. The prediction module is configured to input the photovoltaic power true values of the plurality of historical time points and the corresponding time characteristics into a pre-trained prediction model, execute the prediction model, and obtain the predicted photovoltaic power values and the change trend prediction values of the prediction time point output by the prediction model; wherein, when training the prediction model, double loss correction is performed for the two outputs of the prediction model.

13. The apparatus of claim 12, wherein, The true value acquisition module is configured to: If the true value of the photovoltaic power at the prediction time point is missing, a missing time point at which the true value of the photovoltaic power is missing is determined; Based on the true value of the photovoltaic power at the sampling time point before the missing time point, the true value of the photovoltaic power at the missing time point is filled.

14. The apparatus of claim 13, wherein, The part of the true value acquisition module that fills the true value of the photovoltaic power at the missing time point based on the true value of the photovoltaic power at the sampling time point before the missing time point is configured to: Obtain the true values of the photovoltaic power at k consecutive sampling time points before the missing time point; Obtain the true values of the photovoltaic power at each sampling time point in multiple days before the missing time point; From the true values of the photovoltaic power at each sampling time point in each of the multiple days before the missing time point, obtain the true values of the photovoltaic power at k consecutive sampling time points that are most similar to the true values of the photovoltaic power at the k consecutive sampling time points before the missing time point; Determine the true value of the photovoltaic power at the first sampling time point after the k consecutive sampling time points that are most similar as the true value of the photovoltaic power at the missing time point; Wherein, k is a positive integer.

15. The apparatus of claim 14, wherein, The feature extraction module is configured to: Based on m historical moments, the first time characteristic T corresponding to the true value of the photovoltaic power is obtained according to the following formula cos And the second time characteristic T sin : wherein is an hour value of the mth historical time instant, is a minute value of the mth historical time instant, the hour value being measured in a 24-hour system.

16. The apparatus of claim 12, wherein, The device further comprises: A model training module configured to obtain a plurality of training samples, the input variables in each training sample including true values of photovoltaic power at a plurality of sample time points and corresponding time characteristics, and label data including true values of photovoltaic power at a next time point of the plurality of sample time points and change trend true values; using the training samples, the prediction model is trained.

17. The apparatus of claim 16, wherein, The prediction model includes a long short-term memory network (LSTM) model, and a loss function L of the prediction model is: Wherein, N is the total number of training samples, Y[i][0] is the true value of photovoltaic power in the i-th training sample, Y[i][1] is the change trend true value in the i-th training sample, y[i][0] is the photovoltaic power prediction value corresponding to the i-th training sample, and y[i][1] is the change trend prediction value corresponding to the i-th training sample.

18. A training device for a prediction model, characterized in that, The training device comprises: A sample acquisition module configured to obtain a plurality of training samples, the input variables in each training sample including true values of photovoltaic power at a plurality of sample time points and corresponding time characteristics, and label data including true values of photovoltaic power at a next time point of the plurality of sample time points and change trend true values, and the time characteristics including sin and cos encoding characteristics of the time corresponding to the true values of photovoltaic power; A training module configured to use the plurality of training samples to train the prediction model; wherein, when training the prediction model, double loss correction is performed for the two outputs of the prediction model.

19. The exercise device of claim 18, wherein, The sample acquisition module is configured to: Obtain true values of photovoltaic power at n sample time points; based on the n sample instants of true photovoltaic power p1, p2,.... pn n , obtaining n-m groups of photovoltaic power variables P train and their corresponding n-m groups of label data Y label : P train = [[p1,...,p m ],[p2,...,p m+1 ]...,[p n-m ,...,p n-1 ]]; Based on the n sample instants, n-m groups of photovoltaic power variables P are obtained according to the following formula train Corresponding n-m groups of first time characteristics And second time characteristics is the hour value at the mth sample moment, is the minute value at the mth sample moment, the hour value adopts 24-hour system; A set of photovoltaic power variables and a corresponding set of first time characteristics, a set of second time characteristics and a set of label data are obtained as a training sample; Both m and n are positive integers.

20. The exercise device of claim 19, wherein, The part of the sample acquisition module that acquires the photovoltaic power true value at the n sample moments is configured to: If the photovoltaic power true value at the n sample moments is missing, a sample missing moment is determined in which the photovoltaic power true value is missing. Based on the photovoltaic power true value at the sampling moments before the sample missing moment, the photovoltaic power true value at the sample missing moment is filled.

21. The exercise device of claim 20, wherein, The part of the sample acquisition module that fills the photovoltaic power true value at the sample missing moment based on the photovoltaic power true value at the sampling moments before the sample missing moment is configured to: Obtain the photovoltaic power true value at s consecutive sampling moments before the sample missing moment; Obtain the photovoltaic power true value at each sampling moment in multiple days before the sample missing moment; From the photovoltaic power true value at each sampling moment in each of the multiple days before the sample missing moment, obtain the photovoltaic power true value at s consecutive sampling moments most similar to the photovoltaic power true value at the s consecutive sampling moments before the sample missing moment; Determine the photovoltaic power true value at the first sampling moment after the s most similar consecutive sampling moments as the photovoltaic power true value at the sample missing moment; Wherein, s is a positive integer.

22. The exercise device of claim 18, wherein, The prediction model includes a long short-term memory network (LSTM) model, and a loss function L of the prediction model is: Wherein, N is the total number of training samples, Y[i][0] is the photovoltaic power true value in the i-th training sample, Y[i][1] is the change trend true value in the i-th training sample, y[i][0] is the photovoltaic power prediction value corresponding to the i-th training sample, and y[i][1] is the change trend prediction value corresponding to the i-th training sample.

23. An electronic device, comprising: A memory and a processor are included, the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method of any one of claims 1 to 11.

24. A readable storage medium characterized by, A computer instruction is stored thereon, and the computer instruction is executed by a processor to implement the method of any one of claims 1 to 11.

25. A chip, characterized by The chip includes the device of any one of claims 12-22. The chip includes the device of any one of claims 12-22.

Citation Information

Patent Citations

  • Short-term fine-grained photovoltaic power station power probability prediction method

    CN114330660A

  • Photovoltaic power prediction method, device, feeder terminal, system, medium and chip

    CN118659360A

  • Distributed photovoltaic power station reverse power control system and method

    CN119030022A