Photovoltaic data prediction method, system and equipment

By constructing and optimizing the photovoltaic data prediction model, it can adjust parameters based on recent photovoltaic data, solving the problem that existing models are difficult to adapt to the rapid changes in meteorological data and improving the prediction accuracy.

CN119397287AActive Publication Date: 2025-02-07SHENYANG INST OF ENG
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411261149.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-02-07
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Existing photovoltaic data prediction models are difficult to adapt to the rapid changes in recent meteorological data, resulting in low prediction accuracy.

Method used

By constructing the first training set and the second training set, using the transformer model for training, the photovoltaic data prediction model is optimized so that it can adjust model parameters based on recent photovoltaic data.

Benefits of technology

The accuracy of photovoltaic data prediction is improved, so that the model can continuously learn the timing characteristics of the location and adapt to local meteorological changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119397287A_ABST
    Figure CN119397287A_ABST
Patent Text Reader

Abstract

The invention discloses a photovoltaic data prediction method, system and device, and relates to the technical field of photovoltaic power generation prediction, and the method comprises the steps: constructing a first training set, training a transformer model through the first training set, and obtaining a photovoltaic data prediction model, and processing the first training set and the second training set through an encoder in the photovoltaic data prediction model to obtain an updated training set, and optimizing the photovoltaic data prediction model through the updated training set to obtain an optimized photovoltaic data prediction model. And inputting the photovoltaic data of the current time period into an encoder in the optimized photovoltaic data prediction model, obtaining a time sequence characteristic prediction value of the photovoltaic data of the current time period, and realizing prediction of the photovoltaic data of the next time period, and according to the application, the model parameters can be adjusted according to the recent photovoltaic data, and the photovoltaic data prediction precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of photovoltaic power generation prediction, and in particular to a photovoltaic data prediction method, system and device. Background Art

[0002] At present, photovoltaic prediction models mostly use machine learning or deep learning algorithms to establish the mapping relationship between input variables (such as weather data, time information, etc.) and output variables by training a large amount of historical data. However, photovoltaic data is a complex time series data with strong randomness and volatility, that is, its characteristics will change over time. Most of the photovoltaic prediction algorithms in the past were based on historical photovoltaic data, analyzing the time series characteristics of historical photovoltaic data to achieve photovoltaic data prediction. However, with the recent frequent occurrence of extreme climate and the rapid change of meteorological data, there are few studies on the impact of recent changes in photovoltaic data on the accuracy of photovoltaic data prediction. In addition, ignoring the recent changes in photovoltaic data makes it difficult for photovoltaic data prediction to adapt to the current situation of rapid changes in meteorological data, and the prediction accuracy is low. Summary of the invention

[0003] The purpose of this application is to provide a photovoltaic data prediction method, system and device, which can enable a photovoltaic prediction model to adjust model parameters according to recent photovoltaic data and improve the prediction accuracy of photovoltaic data.

[0004] To achieve the above objectives, this application provides the following solutions:

[0005] In a first aspect, the present application provides a photovoltaic data prediction method, the photovoltaic data prediction method comprising:

[0006] Constructing a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data;

[0007] The transformer model is trained using the first training set to obtain a photovoltaic data prediction model;

[0008] The first training set and the second training set are processed by an encoder in the photovoltaic data prediction model to obtain an updated training set, and the photovoltaic data prediction model is optimized by the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes sample photovoltaic data within a plurality of recent preset time periods;

[0009] The photovoltaic data of the current period is input into the encoder in the optimized photovoltaic data prediction model to obtain the time series feature prediction value of the photovoltaic data of the current period, so as to realize the prediction of the photovoltaic data of the next period.

[0010] Optionally, training the transformer model using the first training set to obtain a photovoltaic data prediction model specifically includes:

[0011] Input the first training set into the transformer model and output the predicted value of the time series characteristics of the photovoltaic data;

[0012] A first loss function is constructed according to the predicted value of the time series characteristics of the photovoltaic data and the sample value of the time series characteristics of the photovoltaic data, and the network parameters of the transformer model are adjusted according to the first loss function to obtain a photovoltaic data prediction model.

[0013] Optionally, the first training set and the second training set are processed by an encoder in the photovoltaic data prediction model to obtain an updated training set, specifically including:

[0014] Inputting the first training set into an encoder in the photovoltaic data prediction model, outputting a first prediction value of the time series feature of the sample photovoltaic data, and using the first prediction value of the time series feature of the sample photovoltaic data as a first feature, and constructing a first feature set based on the first feature;

[0015] Inputting the second training set into an encoder in the photovoltaic data prediction model, outputting a second prediction value of the time series feature of the sample photovoltaic data, and constructing a second feature set according to the second prediction value of the time series feature of the sample photovoltaic data;

[0016] Based on the second feature set, a plurality of second features are determined using an encoder in a photovoltaic data prediction model;

[0017] For each second feature, calculate the similarity between the second feature and the first feature, and construct a similar feature set;

[0018] The mean and variance of the similar feature sets are calculated, and an updated training set is determined based on the mean and variance of the similar feature sets.

[0019] Optionally, the calculation formula for calculating the similarity between the second feature and the first feature is:

[0020]

[0021] Among them, d i represents the similarity between the second feature and the i-th first feature; represents the mean of the jth second feature set; c ij Represents the j-th data of the i-th first feature.

[0022] Optionally, determining an updated training set based on the mean and variance of similar feature sets specifically includes:

[0023] Determine whether the similar features are all located within the intersection range of the similar feature set and the second feature set;

[0024] If not, the second feature set is used as the updated training set;

[0025] If yes, then counting the number of similar features within the intersection range, and determining the cross data ratio according to the number of similar features within the intersection range;

[0026] Determine whether the cross-data ratio is less than a preset ratio threshold;

[0027] If yes, then update the second training set to obtain an updated training set;

[0028] If not, the second training set is used as the updated training set.

[0029] Optionally, the expression for judging whether all similar features are located within the intersection range of the similar feature set and the second feature set is:

[0030]

[0031] in, represents the jth value in the i-th similar feature set; represents the mean of the jth second feature set; represents the variance of the j-th second feature set; represents the mean of the j-th similar feature set; represents the variance of the j-th similar feature set.

[0032] Optionally, updating the second training set to obtain an updated training set specifically includes:

[0033] Data are randomly extracted from the similar data set and the second training set according to different extraction ratios to obtain a test data set, and the data not extracted from the similar data set and the second training set are used as a verification data set; the similar data set is sample photovoltaic data corresponding to the similar feature set;

[0034] For the test data set and validation data set obtained by any extraction ratio:

[0035] Input the test data set into the encoder in the photovoltaic data prediction model to obtain the time series characteristic test value of the sample photovoltaic data;

[0036] A second loss function is constructed according to the time series feature test value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data, and a network parameter of a decoder in the photovoltaic data prediction model is adjusted according to the second loss function to obtain a fine-tuned photovoltaic data prediction model;

[0037] Input the verification data set into the fine-tuned photovoltaic data prediction model, output the time series feature verification value of the sample photovoltaic data, and calculate the corresponding prediction error according to the time series feature verification value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data;

[0038] Based on the test data sets corresponding to different extraction ratios, corresponding prediction errors are obtained, and based on each of the prediction errors, alternative data sets are determined, and an updated training set is obtained based on the alternative data sets.

[0039] Optionally, determining a replaceable data set based on each of the prediction errors, and obtaining an updated training set based on the replaceable data set specifically includes:

[0040] Based on the prediction errors, determining a minimum prediction error;

[0041] The extraction ratio corresponding to the minimum prediction error is taken as the optimal extraction ratio, and data is extracted from the similar data set and the second training set according to the optimal extraction ratio to obtain a replaceable data set;

[0042] The replaceable data set is used to replace the similar data set from the first training set until the proportion of the same sample photovoltaic data in the replaced training set and the first training set is less than or equal to 80% of the replaced training set, and then the updating is stopped to obtain the updated training set.

[0043] In a second aspect, the present application provides a photovoltaic data prediction system, the photovoltaic data prediction system is implemented based on the photovoltaic data prediction method, and the photovoltaic data prediction system includes:

[0044] A first training set construction unit, used to construct a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data;

[0045] A photovoltaic data prediction model determination unit, configured to train a transformer model using the first training set to obtain a photovoltaic data prediction model;

[0046] A training set updating and photovoltaic data prediction model optimization unit, configured to process the first training set and the second training set through an encoder in the photovoltaic data prediction model to obtain an updated training set, and optimize the photovoltaic data prediction model through the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes sample photovoltaic data within a plurality of recent preset time periods;

[0047] The photovoltaic data prediction unit is used to input the photovoltaic data of the current period into the encoder in the optimized photovoltaic data prediction model to obtain the time series feature prediction value of the photovoltaic data of the current period and realize the prediction of the photovoltaic data of the next period.

[0048] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the photovoltaic data prediction methods described above.

[0049] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0050] The present application provides a photovoltaic data prediction method, system and device, which trains a photovoltaic data prediction model through a first training set, processes the first training set and the second training set through a trained encoder to obtain an updated training set, and adjusts the parameters of the trained photovoltaic data prediction model through the updated training set to ensure that the photovoltaic data prediction model can continuously learn the time series characteristics of the location as the use time increases, thereby continuously improving the prediction accuracy and adapting to local meteorological changes. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A schematic diagram of a process flow of a photovoltaic data prediction method provided in one embodiment of the present application;

[0053] Figure 2 A schematic diagram of the structure of a transformer model provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of functional modules of a photovoltaic data prediction system provided in one embodiment of the present application;

[0055] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application.

[0056] Reference numerals:

[0057] A first training set construction unit 1, a photovoltaic data prediction model determination unit 2, a training set update and photovoltaic data prediction model optimization unit 3, and a photovoltaic data prediction unit 4. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0059] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0060] In an exemplary embodiment, Figure 1 As shown, a photovoltaic data prediction method is provided, which is executed by a computer device, specifically, it can be executed by a computer device such as a terminal or a server alone, or it can be executed by a terminal and a server together. In the embodiment of the present application, the method is applied to a server as an example for explanation, including the following steps S1 to S4. Among them:

[0061] Step S1, constructing a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data.

[0062] Step S2, training the transformer model with the first training set to obtain a photovoltaic data prediction model. The transformer model includes an encoder and a decoder. The structural diagram of the transformer model is as follows: Figure 2 As shown, the left side is the encoder of the Transformer model, which includes convolutional layers, multi-head attention layers, addition and layer normalization, feedforward network layers, and addition and layer normalization; the right side is the decoder, which includes convolutional layers, mask and multi-head attention layers, addition and layer normalization, multi-head attention layers, addition and layer normalization, feedforward network layers, addition and layer normalization, and fully connected layers; the encoder is responsible for extracting the temporal features of the data, supporting decoding training, and achieving high-precision prediction; the network parameters of the encoder are saved and stored in the server.

[0063] Step S3, the first training set and the second training set are processed by the encoder in the photovoltaic data prediction model to obtain an updated training set, and the photovoltaic data prediction model is optimized by the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes a plurality of sample photovoltaic data within a recent preset time period, that is, after accumulating N new sample photovoltaic data within a recent preset time period, the N new sample photovoltaic data are used as the second training set

[0064] Step S4, inputting the photovoltaic data of the current period into the encoder in the optimized photovoltaic data prediction model, obtaining the time series characteristic prediction value of the photovoltaic data of the current period, and realizing the prediction of the photovoltaic data of the next period.

[0065] By implementing the above-mentioned steps S1 to S4, the present application adjusts the parameters of the photovoltaic data prediction model through the updated training set to ensure that the photovoltaic data prediction model can continuously learn the temporal characteristics of the location as the usage time increases, achieve continuous improvement in prediction accuracy, and adapt to local meteorological changes.

[0066] As an optional implementation, step S2 specifically includes:

[0067] Step S21, inputting the first training set into the transformer model, and outputting the predicted value of the time series characteristics of the photovoltaic data.

[0068] Step S22, constructing a first loss function according to the predicted value of the time series characteristics of the photovoltaic data and the sample value of the time series characteristics of the photovoltaic data, and adjusting the network parameters of the transformer model according to the first loss function to obtain a photovoltaic data prediction model.

[0069] As an optional implementation, in step S3, the first training set and the second training set are processed by an encoder in the photovoltaic data prediction model to obtain an updated training set, which specifically includes:

[0070] Step S31, input the first training set into the encoder in the photovoltaic data prediction model, output the first prediction value of the time series feature of the sample photovoltaic data, and use the first prediction value of the time series feature of the sample photovoltaic data as the first feature, and construct a first feature set based on the first feature.

[0071] Specifically, the encoder is used to process the sample photovoltaic data in the first training set to obtain the first feature set corresponding to the sample photovoltaic data in the first training set:

[0072] C i =E(X i )(1)

[0073] C i =(c i1 ,c i2 ,…,c il )(2)

[0074] Among them, E(X i) is the function corresponding to the encoder; X i is the first training set data input; C i is the temporal feature extracted by the encoder, and the data length is l; c ijis the jth data of the ith feature; the first feature set C composed of the time series features is stored in the server.

[0075] Step S42, inputting the second training set into the encoder in the photovoltaic data prediction model, outputting the second prediction value of the time series feature of the sample photovoltaic data, and constructing the second feature set according to the second prediction value of the time series feature of the sample photovoltaic data.

[0076] Specifically, the encoder is used to extract the feature set corresponding to the second training set as the second feature set The specific steps are the same as those of S41.

[0077] Step S43: Based on the second feature set, a plurality of second features are determined using an encoder in the photovoltaic data prediction model.

[0078] Specifically, calculate the mean of the second feature set and variance And the mean As the second feature, the calculation formula is as follows:

[0079]

[0080]

[0081] in, The i-th time series feature in the second training set extracted by the encoder; is the mean of the second feature set; is the variance of the second feature set; is the mean of the jth second feature set; is the value of the position of the i-th row and j-th column of the second feature set; is the variance of the jth second feature set;

[0082] Step S44: For each second feature, calculate the similarity between the second feature and the first feature, and construct a similar feature set. Use the Euclidean distance formula to calculate the similarity between the second feature and the first feature. The smaller the Euclidean distance, the higher the similarity between the first feature and the second feature. Sort the similar features from high to low by similarity, select the top N similar features, and construct a similar feature set. The corresponding sample photovoltaic data is a similar data set Evaluate the similarity between the first feature and the second feature. The smaller the similarity, the more it means that the second feature set contains different feature distributions. If the photovoltaic data prediction model is still trained according to the first training set, the prediction accuracy will decrease. The higher the similarity, the less it means that the prediction accuracy of the prediction model trained according to the first training set does not change much. Therefore, the results of the similarity evaluation can guide the frequency of model parameter adjustment to adapt to the changing photovoltaic data and improve the prediction accuracy.

[0083] Specifically, the calculation formula for calculating the similarity between the second feature and the first feature is:

[0084]

[0085] Among them, d i represents the similarity between the second feature and the i-th first feature; represents the mean of the jth second feature set; c ij Represents the j-th data of the i-th first feature.

[0086] Step S45, calculate the mean and variance of the similar feature set, and determine the updated training set based on the mean and variance of the similar feature set. Calculation method, calculation of similar feature sets The mean and variance of and Named similar feature distribution.

[0087] As an optional implementation, in step S45, determining an updated training set based on the mean and variance of the similar feature set specifically includes:

[0088] Step S451, determine whether the similar features are all located within the intersection of the similar feature set and the second feature set; if not, execute step S452; if yes, execute step S453. The jth similar feature in If the following conditions are met, similar features are determined Located at the intersection, for similar feature sets Each similar feature in is judged. If Each similar feature in is located in the intersection, then it is determined Located at the intersection of the similar feature set and the second feature set. The expression of the judgment condition is:

[0089]

[0090] in, represents the jth value in the i-th similar feature set; represents the mean of the jth second feature set; represents the variance of the j-th second feature set; represents the mean of the j-th similar feature set; represents the variance of the j-th similar feature set.

[0091] Step S452: Use the second feature set as an updated training set.

[0092] Step S453, counting the number of similar features within the intersection range, and determining the cross data ratio according to the number of similar features within the intersection range. The number of similar features within the intersection range is divided by the total number of similar feature set data to obtain the cross data ratio P, where the value range of P is 0 to 1.

[0093] Step S454, determine whether the cross data ratio is less than a preset ratio threshold; if so, execute step S455, if not, execute step S456. Here, the preset ratio threshold is 0.8.

[0094] Step S455, updating the second training set to obtain an updated training set. When P is less than 0.8, the second training set needs to be updated.

[0095] Step S456: Use the second training set as the updated training set.

[0096] As an optional implementation, in step S455, updating the second training set to obtain an updated training set specifically includes:

[0097] Step S4551, randomly extract data from the similar data set and the second training set according to different extraction ratios to obtain a test data set with a data volume of M, and use the data not extracted from the similar data set and the second training set as a verification data set with a data volume of M; the similar data set is the sample photovoltaic data corresponding to the similar feature set. The extraction ratio is shown in Table 1:

[0098] Table 1 Extraction ratio table

[0099] Data extraction ratio of similar data sets 90% 80% 70% 60% 50% The second training set data extraction ratio 10% 20% 30% 40% 50%

[0100] For the test data set and validation data set obtained by any extraction ratio:

[0101] Step S4552, input the test data set into the encoder in the photovoltaic data prediction model to obtain the time series characteristic test value of the sample photovoltaic data.

[0102] Step S4553, construct a second loss function based on the time series feature test value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data, and adjust the network parameters of the decoder in the photovoltaic data prediction model according to the second loss function to obtain the fine-tuned photovoltaic data prediction model; at this time, in order to compare the impact of different data sets on the prediction rate, it is necessary to use the same encoder to extract features for easy comparison and evaluation, therefore, the network parameters of the encoder are not adjusted at this time.

[0103] Step S4554, input the verification data set into the fine-tuned photovoltaic data prediction model, output the time series feature verification value of the sample photovoltaic data, and calculate the corresponding prediction error according to the time series feature verification value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data.

[0104] Specifically, the prediction error of the fine-tuned photovoltaic data prediction model is evaluated using the validation data set. The prediction error is calculated as follows:

[0105]

[0106] Where L is the prediction error; is the time series characteristic verification value of the sample photovoltaic data; y i It is the time series characteristic sample value corresponding to the sample photovoltaic data, that is, the actual value.

[0107] Step S4555, based on the test data sets corresponding to different extraction ratios, obtain corresponding prediction errors, determine replaceable data sets based on each of the prediction errors, and obtain an updated training set based on the replaceable data sets.

[0108] As an optional implementation, in step S4555, determining a replaceable data set based on each of the prediction errors, and obtaining an updated training set based on the replaceable data set specifically includes:

[0109] Step S45551, based on each of the prediction errors, determine the minimum prediction error.

[0110] Step S45552: The extraction ratio corresponding to the minimum prediction error is used as the optimal extraction ratio, and data is extracted from the similar data set and the second training set according to the optimal extraction ratio to obtain a replaceable data set. That is, data is extracted and mixed from the similar data set and the second training set according to the optimal extraction ratio to form a replaceable data set.

[0111] Step S45553, use the replaceable data set to replace the similar data set from the first training set, until the proportion of sample photovoltaic data in the replaced training set that is the same as that in the first training set is less than or equal to 80% of the replaced training set (20% or more of the sample photovoltaic data have been updated), stop updating, and obtain the updated training set.

[0112] By using the above-mentioned method of mixing data of different proportions to determine the optimal extraction ratio, a replaceable data set is formed to reduce the impact of the addition of new data (i.e., the second training set) on the distribution characteristics of the original data (i.e., the first training set). Because the prediction model is trained using the first training set, the time series features in the first training set will affect each other. If the first training set is blindly replaced with the second training set, the model after parameter update may be too different from the new data features (i.e., the second features) and the old data features (i.e., the first features), and the original model parameters may not match, causing a sharp drop in prediction accuracy.

[0113] Based on the same inventive concept, the embodiment of the present application also provides a photovoltaic data prediction system for implementing the photovoltaic data prediction method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more photovoltaic data prediction system embodiments provided below can refer to the limitations of the photovoltaic data prediction method above, and will not be repeated here.

[0114] In an exemplary embodiment, Figure 3 As shown, a photovoltaic data prediction system is provided, including: a first training set construction unit 1, a photovoltaic data prediction model determination unit 2, a training set update and photovoltaic data prediction model optimization unit 3 and a photovoltaic data prediction unit 4.

[0115] A first training set construction unit, used to construct a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data;

[0116] A photovoltaic data prediction model determination unit, configured to train a transformer model using the first training set to obtain a photovoltaic data prediction model;

[0117] A training set updating and photovoltaic data prediction model optimization unit, configured to process the first training set and the second training set through an encoder in the photovoltaic data prediction model to obtain an updated training set, and optimize the photovoltaic data prediction model through the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes sample photovoltaic data within a plurality of recent preset time periods;

[0118] The photovoltaic data prediction unit is used to input the photovoltaic data of the current period into the encoder in the optimized photovoltaic data prediction model to obtain the time series characteristic prediction value of the photovoltaic data of the current period and realize the prediction of the photovoltaic data of the next period.

[0119] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a photovoltaic data prediction method is implemented.

[0120] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0122] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0123] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0124] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0125] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A photovoltaic data prediction method, characterized in that: The photovoltaic data prediction method comprises: Constructing a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data; The transformer model is trained using the first training set to obtain a photovoltaic data prediction model; The first training set and the second training set are processed by an encoder in the photovoltaic data prediction model to obtain an updated training set, and the photovoltaic data prediction model is optimized by the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes sample photovoltaic data within a plurality of recent preset time periods; The photovoltaic data of the current period is input into the encoder in the optimized photovoltaic data prediction model to obtain the time series feature prediction value of the photovoltaic data of the current period, so as to realize the prediction of the photovoltaic data of the next period.

2. The photovoltaic data prediction method according to claim 1, characterized in that: The transformer model is trained using the first training set to obtain a photovoltaic data prediction model, which specifically includes: Input the first training set into the transformer model and output the predicted value of the time series characteristics of the photovoltaic data; A first loss function is constructed according to the predicted value of the time series characteristics of the photovoltaic data and the sample value of the time series characteristics of the photovoltaic data, and the network parameters of the transformer model are adjusted according to the first loss function to obtain a photovoltaic data prediction model.

3. The photovoltaic data prediction method according to claim 1, characterized in that: The first training set and the second training set are processed by the encoder in the photovoltaic data prediction model to obtain an updated training set, specifically including: Inputting the first training set into an encoder in the photovoltaic data prediction model, outputting a first prediction value of the time series feature of the sample photovoltaic data, and using the first prediction value of the time series feature of the sample photovoltaic data as a first feature, and constructing a first feature set based on the first feature; Inputting the second training set into an encoder in the photovoltaic data prediction model, outputting a second prediction value of the time series feature of the sample photovoltaic data, and constructing a second feature set according to the second prediction value of the time series feature of the sample photovoltaic data; Based on the second feature set, a plurality of second features are determined using an encoder in a photovoltaic data prediction model; For each second feature, calculate the similarity between the second feature and the first feature, and construct a similar feature set; The mean and variance of the similar feature sets are calculated, and an updated training set is determined based on the mean and variance of the similar feature sets.

4. The photovoltaic data prediction method according to claim 3, characterized in that: The calculation formula for calculating the similarity between the second feature and the first feature is: Among them, d i represents the similarity between the second feature and the i-th first feature; represents the mean of the jth second feature set; c ij Represents the jth value of the i-th first feature.

5. The photovoltaic data prediction method according to claim 3, characterized in that: The updated training set is determined based on the mean and variance of similar feature sets, including: Determine whether the similar features are all located within the intersection range of the similar feature set and the second feature set; If not, the second feature set is used as the updated training set; If yes, then counting the number of similar features within the intersection range, and determining the cross data ratio according to the number of similar features within the intersection range; Determine whether the cross-data ratio is less than a preset ratio threshold; If yes, then update the second training set to obtain an updated training set; If not, the second training set is used as the updated training set.

6. The photovoltaic data prediction method according to claim 5, characterized in that: The expression for judging whether similar features are all within the intersection range of the similar feature set and the second feature set is: in, represents the jth value in the i-th similar feature set; represents the mean of the jth second feature set; represents the variance of the j-th second feature set; represents the mean of the jth similar feature set; represents the variance of the j-th similar feature set.

7. The photovoltaic data prediction method according to claim 5, characterized in that: Updating the second training set to obtain an updated training set specifically includes: Data are randomly extracted from the similar data set and the second training set according to different extraction ratios to obtain a test data set, and the data not extracted from the similar data set and the second training set are used as a verification data set; the similar data set is sample photovoltaic data corresponding to the similar feature set; For the test data set and validation data set obtained by any extraction ratio: Input the test data set into the encoder in the photovoltaic data prediction model to obtain the time series characteristic test value of the sample photovoltaic data; A second loss function is constructed according to the time series feature test value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data, and a network parameter of a decoder in the photovoltaic data prediction model is adjusted according to the second loss function to obtain a fine-tuned photovoltaic data prediction model; Input the verification data set into the fine-tuned photovoltaic data prediction model, output the time series feature verification value of the sample photovoltaic data, and calculate the corresponding prediction error according to the time series feature verification value of the sample photovoltaic data and the time series feature sample value corresponding to the sample photovoltaic data; Based on the test data sets corresponding to different extraction ratios, corresponding prediction errors are obtained, and based on each of the prediction errors, alternative data sets are determined, and an updated training set is obtained based on the alternative data sets.

8. The photovoltaic data prediction method according to claim 7, characterized in that: Determining a replaceable data set based on each of the prediction errors, and obtaining an updated training set based on the replaceable data set specifically includes: Based on the prediction errors, determining a minimum prediction error; The extraction ratio corresponding to the minimum prediction error is taken as the optimal extraction ratio, and data is extracted from the similar data set and the second training set according to the optimal extraction ratio to obtain a replaceable data set; The replaceable data set is used to replace the similar data set from the first training set until the proportion of the same sample photovoltaic data in the replaced training set and the first training set is less than or equal to 80% of the replaced training set, and then the updating is stopped to obtain the updated training set.

9. A photovoltaic data prediction system, characterized in that: The photovoltaic data prediction system is implemented based on the photovoltaic data prediction method according to any one of claims 1 to 8, and the photovoltaic data prediction system comprises: A first training set construction unit, used to construct a first training set; the first training set includes sample photovoltaic data and time series feature sample values ​​corresponding to the sample photovoltaic data; A photovoltaic data prediction model determination unit, configured to train a transformer model using the first training set to obtain a photovoltaic data prediction model; A training set updating and photovoltaic data prediction model optimization unit, configured to process the first training set and the second training set through an encoder in the photovoltaic data prediction model to obtain an updated training set, and optimize the photovoltaic data prediction model through the updated training set to obtain an optimized photovoltaic data prediction model; the second training set includes sample photovoltaic data within a plurality of recent preset time periods; The photovoltaic data prediction unit is used to input the photovoltaic data of the current period into the encoder in the optimized photovoltaic data prediction model to obtain the time series characteristic prediction value of the photovoltaic data of the current period and realize the prediction of the photovoltaic data of the next period.

10. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the photovoltaic data prediction method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Multi-stage deep transfer learning method for multi-source data mining

    CN108846444A

  • Commodity category prediction model training and application method and electronic equipment

    CN117312856A

  • Learning device, learning method, and learning program

    JP7100737B1