Power grid section data generation method, device and equipment and readable storage medium
By using a unified prediction model to calculate covariate weights for photovoltaic, wind power, and load, the problem of high development and maintenance costs of multiple models in the generation of power grid cross-section data is solved, high-precision prediction under different scenarios is achieved, and the safety and reliability of power grid operation are improved.
Patent Information
- Application Number
- CN202511581573.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-01-23
AI Technical Summary
Existing methods for generating power grid cross-section data often involve high model development and maintenance costs, and fail to identify key influencing factors in different scenarios, resulting in insufficient prediction accuracy.
A unified prediction model is used to calculate covariate weights for photovoltaic, wind power and load. Through unified prediction model training and iterative optimization, covariate weights adapted to different scenarios are generated, reducing the development and maintenance costs of multiple models and improving prediction accuracy.
It reduces the development and maintenance costs of multiple models, improves the prediction accuracy of power grid section data, and enhances the safety and reliability of power grid operation.
Smart Images

Figure CN121395288A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power system dispatching, in particular to a power grid section data generation method, device and equipment and a computer readable storage medium. BACKGROUND
[0002] Power grid section simulation is the basis of power system safety analysis. The future section data generation process includes: load and new energy output prediction, unit output optimization, power flow calculation and section generation. The prediction link is the starting point of the entire section data generation process, and its accuracy directly determines the accuracy of subsequent section generation.
[0003] The commonly used power grid section data generation method is to develop independent models for photovoltaic, wind power and load respectively, which has high multi-model development and maintenance cost and cannot identify key influencing factors in different scenarios.
[0004] In summary, how to effectively solve the problems such as high multi-model development and maintenance cost of the commonly used power grid section data generation method and inability to identify key influencing factors in different scenarios is a problem that needs to be solved by the technical personnel in the field at present. SUMMARY
[0005] The purpose of the present application is to provide a power grid section data generation method which reduces the multi-model development and maintenance cost, adapts the covariate weight for different scenarios, and improves the prediction accuracy of power grid section data in different scenarios. Another purpose of the present application is to provide a power grid section data generation device, equipment and computer readable storage medium.
[0006] To solve the above technical problems, the present application provides the following technical solutions:
[0007] A power grid section data generation method, comprising:
[0008] obtaining each photovoltaic historical output, each wind power historical output, each load historical data, each historical covariate set in a historical time window length and each future covariate set in a prediction time window length;
[0009] using a unified prediction model to calculate the covariate weight for photovoltaic output, wind power output and load respectively, and predicting the photovoltaic output, wind power output and load according to the calculated covariate weight to obtain a first photovoltaic output prediction value, a first wind power output prediction value and a first load prediction value;
[0010] generating power grid section data according to the first photovoltaic output prediction value, the first wind power output prediction value and the first load prediction value.
[0011] In an embodiment of the present application, the training process of the unified prediction model is also included, and the training process of the unified prediction model comprises:
[0012] The first candidate covariate set and the first historical observation sequence are obtained, wherein the first historical observation sequence comprises a first photovoltaic historical output sub-observation sequence, a first wind power historical output sub-observation sequence and a first load historical sub-observation sequence;
[0013] The training sample set is constructed by using the first candidate covariate set and the first historical observation sequence;
[0014] The pre-constructed initial prediction model is obtained, and the initial prediction model is determined as the current prediction model;
[0015] The current prediction model is iteratively trained by using the training sample set, and the second photovoltaic output prediction value, the second wind power output prediction value and the second load prediction value corresponding to each iteration are obtained;
[0016] The photovoltaic output actual value, the wind power output actual value and the load actual value corresponding to each iteration are obtained;
[0017] The prediction loss corresponding to each iteration is calculated according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value and the load actual value corresponding to each iteration;
[0018] When the prediction loss is lower than the first preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
[0019] In an embodiment of the present application, the prediction loss corresponding to each iteration is calculated according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value and the load actual value corresponding to each iteration, comprising:
[0020] The preset time period weights are obtained, wherein the preset time period weights comprise a load peak time period weight, a photovoltaic climbing time period weight and other time period weights, and the load peak time period weight is greater than the photovoltaic climbing time period weight, and the photovoltaic climbing time period weight is greater than the other time period weight;
[0021] The prediction loss corresponding to each iteration is calculated according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value, the load actual value and the preset time period weights corresponding to each iteration.
[0022] In an embodiment of the present application, when the prediction loss is lower than a first preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model, comprising:
[0023] obtaining candidate covariate weight values respectively corresponding to each candidate covariate in the first candidate covariate set in each iteration;
[0024] calculating a regularization term respectively corresponding to each iteration according to each candidate covariate weight value;
[0025] calculating a total loss respectively corresponding to each iteration according to each prediction loss and each regularization term;
[0026] when the total loss is lower than a second preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
[0027] In an embodiment of the present application, after obtaining the first candidate covariate set and the first historical observation sequence, before constructing the training sample set by using the first candidate covariate set and the first historical observation sequence, further comprising:
[0028] performing data cleaning, time alignment and normalization processing on the first candidate covariate set and the first historical observation sequence.
[0029] In an embodiment of the present application, determining the prediction model obtained in the current iteration as the unified prediction model comprises:
[0030] obtaining a second candidate covariate set and a second historical observation sequence; wherein the second historical observation sequence comprises a second photovoltaic historical output sub-observation sequence, a second wind power historical output sub-observation sequence and a second load historical sub-observation sequence;
[0031] constructing a test sample set by using the second candidate covariate set and the second historical observation sequence;
[0032] dividing the test sample set into first test sample subsets respectively corresponding to each first scenario according to weather conditions;
[0033] calculating first covariate weights respectively corresponding to each first scenario according to each first test sample subset by using the prediction model obtained in the current iteration;
[0034] judging whether the weight distribution of each first covariate weight conforms to the physical causal relationship of the power system;
[0035] if yes, determining the prediction model obtained in the current iteration as the unified prediction model;
[0036] If not, the prediction model obtained in the current iteration is determined as a new current prediction model, and the step of iteratively training the current prediction model using the training sample set is returned to be executed.
[0037] In one specific embodiment of the present application, determining the prediction model obtained in the current iteration as the unified prediction model comprises:
[0038] The test sample set is divided into second test sample subsets corresponding to respective second scenarios according to time characteristics;
[0039] The prediction model obtained in the current iteration is used to calculate second covariate weights corresponding to respective second scenarios according to respective second test sample subsets;
[0040] It is judged whether the weight distribution of the second covariate weights conforms to the physical causality of the power system;
[0041] If yes, the prediction model obtained in the current iteration is determined as the unified prediction model;
[0042] If not, the prediction model obtained in the current iteration is determined as a new current prediction model, and the step of iteratively training the current prediction model using the training sample set is returned to be executed.
[0043] A power grid section data generation device comprises:
[0044] A data acquisition module is configured to acquire historical photovoltaic power outputs, historical wind power outputs, historical load data, historical covariate sets, and future covariate sets in a prediction time window;
[0045] A prediction value obtaining module is configured to use a unified prediction model to perform covariate weight calculation on photovoltaic power outputs, wind power outputs, and loads respectively, and perform photovoltaic power output prediction, wind power output prediction, and load prediction according to the calculated covariate weights to obtain first photovoltaic power output prediction values, first wind power output prediction values, and first load prediction values.
[0046] A power grid section data module is configured to generate power grid section data according to the first photovoltaic power output prediction values, the first wind power output prediction values, and the first load prediction values.
[0047] A power grid section data generation device comprises:
[0048] A memory is configured to store a computer program;
[0049] A processor is configured to implement the steps of the power grid section data generation method as described above when the computer program is executed.
[0050] A computer readable storage medium, the computer readable storage medium has a computer program stored thereon, the computer program is executed by a processor to implement the steps of the power grid section data generation method as described above.
[0051] The power grid section data generation method provided in the application comprises: obtaining each historical photovoltaic output, each historical wind power output, each historical load data, each historical covariate set in a historical time window length, and each future covariate set in a prediction time window length; performing covariate weight calculation on the photovoltaic output, the wind power output and the load respectively by using a unified prediction model, and performing photovoltaic output, wind power output and load prediction according to the calculated covariate weights to obtain a first photovoltaic output prediction value, a first wind power output prediction value and a first load prediction value; and generating power grid section data according to the first photovoltaic output prediction value, the first wind power output prediction value and the first load prediction value.
[0052] As can be known from the above technical solution, the unified prediction model is used to predict the photovoltaic output, the wind power output and the load, the unified model architecture does not need to develop models for different scenarios and prediction targets separately, and the development and maintenance costs of multiple models are reduced. The unified prediction model is used to perform covariate weight calculation on the photovoltaic output, the wind power output and the load respectively, so that different scenarios correspond to respective adaptive covariate weights, the prediction accuracy of the power grid section data under different scenarios is improved, and the operation safety and reliability of the power grid are improved.
[0053] Correspondingly, the application also provides a power grid section data generation device, equipment and a computer readable storage medium corresponding to the power grid section data generation method, which have the above technical effects, and will not be described here. BRIEF DESCRIPTION OF DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the application or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0055] Figure 1 An implementation flowchart of the power grid section data generation method in the embodiments of the application;
[0056] Figure 2 Another implementation flowchart of the power grid section data generation method in the embodiments of the application;
[0057] Figure 3 A structure block diagram of a power grid section data generation device in the embodiments of the application;
[0058] Figure 4A structural block diagram of an electric grid section data generation device in an embodiment of the present application is shown in the figure;
[0059] Figure 5 A specific structural schematic diagram of an electric grid section data generation device provided in an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0060] In order to make the personnel in the technical field better understand the present application, the present application will be further described in detail below in combination with the drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts fall within the scope of protection of the present application.
[0061] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.
[0062] Reference is made to Figure 1 , Figure 1 An implementation flowchart of an electric grid section data generation method in an embodiment of the present application can include the following steps:
[0063] S101: Obtain each photovoltaic historical output, each wind power historical output, each historical load data, each historical covariate set in a historical time window length, and each future covariate set in a prediction time window length.
[0064] The historical time window length corresponding to the historical data required for predicting the photovoltaic output, the wind power output and the load is set in advance, and the prediction time window length corresponding to the future covariate required for predicting the photovoltaic output, the wind power output and the load is set in advance. Obtain each photovoltaic historical output, each wind power historical output, each historical load data, each historical covariate set in a historical time window length, and each future covariate set in a prediction time window length.
[0065] S102: Calculate the covariate weight by respectively predicting the photovoltaic output, the wind power output and the load by using a unified prediction model, and predict the photovoltaic output, the wind power output and the load according to the calculated covariate weight to obtain a first photovoltaic output prediction value, a first wind power output prediction value and a first load prediction value.
[0066] The unified prediction model is pre-trained, and a time interval for updating the unified prediction model can be pre-set. The unified prediction model is iteratively trained by using historical data of a pre-set time length according to the time interval, and an updated unified prediction model is obtained.
[0067] After obtaining the historical photovoltaic power, the historical wind power, the historical load data, the historical covariate set, and the future covariate set in the prediction time window, the unified prediction model is used to calculate the covariate weights of the photovoltaic power, the wind power, and the load, respectively. That is, the unified prediction model can calculate the adaptive covariate weights for different prediction tasks, and predict the photovoltaic power, the wind power, and the load according to the calculated covariate weights, to obtain the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value.
[0068] S103: generating the power grid section data according to the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value.
[0069] After the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value are predicted, the power grid section data is generated according to the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value. For example, the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value are predicted, unit commitment optimization is performed to meet the power balance constraint, a unit output distribution scheme is solved by an optimization algorithm, and based on the unit output optimization result, the power flow of each line of the power grid is calculated, and the power grid section data such as the line power flow and the node voltage is obtained by power flow calculation.
[0070] As can be seen from the above technical solution, the unified prediction model is used to predict the photovoltaic power, the wind power, and the load, the unified model architecture does not need to develop models for different scenarios and prediction targets, and the development and maintenance costs of multiple models are reduced. The unified prediction model is used to calculate the covariate weights of the photovoltaic power, the wind power, and the load, respectively, so that different scenarios correspond to their respective adaptive covariate weights, the prediction accuracy of the power grid section data in different scenarios is improved, and the operation safety and reliability of the power grid are improved.
[0071] It should be noted that based on the above embodiments, the application embodiments also provide corresponding improvement schemes. In subsequent embodiments, the steps involved in the above embodiments or the corresponding steps can be mutually referenced, and the corresponding beneficial effects can also be mutually referenced. In the following improved embodiments, they will not be described one by one.
[0072] Referring to Figure 2 , Figure 2For another implementation flowchart of the power grid section data generation method in the embodiments of the present application, the method can include the following steps:
[0073] S201: Obtain a first candidate covariate set and a first historical observation sequence.
[0074] The first historical observation sequence includes a first photovoltaic historical output sub-observation sequence, a first wind power historical output sub-observation sequence, and a first load historical sub-observation sequence.
[0075] The first candidate covariate set and the first historical observation sequence are pre-set, and the first historical observation sequence includes a first photovoltaic historical output sub-observation sequence, a first wind power historical output sub-observation sequence, and a first load historical sub-observation sequence.
[0076] Let the candidate covariate set be , and the historical observation sequence be .
[0077] No pre-screening, but a candidate set containing all possible influencing factors is constructed.
[0078] As shown in Table 1, Table 1 is a candidate covariate table.
[0079] Table 1
[0080]
[0081] S202: Perform data cleaning, time alignment, and normalization processing on the first candidate covariate set and the first historical observation sequence.
[0082] After obtaining the first candidate covariate set and the first historical observation sequence, data cleaning, time alignment, and normalization processing are performed on the first candidate covariate set and the first historical observation sequence.
[0083] When performing data cleaning, abnormal value detection can be performed through the 3σ criterion, and missing value filling can be performed through linear interpolation or K-Nearest Neighbors Interpolation (KNN). When performing time alignment, the time granularity can be unified (15 minutes / 1 hour), and all time sequences can be aligned. When performing normalization processing, normalization processing can be performed through Min-Max normalization or Z-score standardization. In addition, feature engineering can be used for preprocessing, such as time period encoding: , , lag features: , sliding window statistics: mean, standard deviation, maximum, minimum.
[0084] S203: Construct a training sample set using the first candidate covariate set and the first historical observation sequence.
[0085] After data cleaning, time alignment and normalization processing are performed on the first candidate covariate set and the first historical observation sequence, a training sample set is constructed using the first candidate covariate set and the first historical observation sequence.
[0086] S204: Obtain a pre-constructed initial prediction model, and determine the initial prediction model as the current prediction model.
[0087] An initial prediction model is pre-constructed, and the basic framework of the model can be set as Transformer+ self-attention, including an input embedding layer, a covariate adaptive weight layer, a Transformer encoder layer, and a decoder layer. The input embedding layer can include target variable historical sequence embedding, candidate covariate full set embedding, and position encoding. The Transformer encoder layer can include multi-head self-attention (to capture temporal dependencies), a feedforward network, and residual connection+ layer normalization. The decoder layer can include a photovoltaic decoder, a wind power decoder, and a load decoder, and each encoder is decoded through dedicated attention.
[0088] The time series prediction model adopts a time series prediction architecture such as Transformer, LSTM, GRU, Chronos, Lag-Llama, etc.
[0089] After constructing the training sample set using the first candidate covariate set and the first historical observation sequence, an initial prediction model pre-constructed is obtained, and the initial prediction model is determined as the current prediction model.
[0090] S205: Iteratively train the current prediction model using the training sample set to obtain a second photovoltaic output prediction value, a second wind power output prediction value, and a second load prediction value corresponding to each iteration, respectively.
[0091] After constructing the training sample set using the first candidate covariate set and the first historical observation sequence, and determining the initial prediction model as the current prediction model, iteratively train the current prediction model using the training sample set to obtain a second photovoltaic output prediction value, a second wind power output prediction value, and a second load prediction value corresponding to each iteration, respectively.
[0092] The model prediction target is:
[0093] ;
[0094] wherein, is the length of the historical time window, is the length of the prediction time window, is a model parameter, for predicting the model, for the photovoltaic output prediction value, for the wind power output prediction value, for the load prediction value.
[0095] When predicting the photovoltaic output, The model automatically learns that the irradiance weight is high and the cloud cover weight is low (except for overcast days).
[0096] When predicting the wind power output, The model automatically learns that the wind speed and wind direction weights are high and other weights are low.
[0097] When predicting the load, The model automatically learns that the temperature and holiday weights are high.
[0098] Among them, , , are parameters special for each task, and different covariate weight patterns are automatically learned.
[0099] S206: Obtain the actual photovoltaic output value, the actual wind power output value, and the actual load value corresponding to each iteration.
[0100] After using the training sample set to iteratively train the current prediction model to obtain the second photovoltaic output prediction value, the second wind power output prediction value, and the second load prediction value corresponding to each iteration, the actual photovoltaic output value, the actual wind power output value, and the actual load value corresponding to each iteration are obtained.
[0101] S207: Calculate the prediction loss corresponding to each iteration according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the actual photovoltaic output value, the actual wind power output value, and the actual load value corresponding to each iteration.
[0102] After predicting the second photovoltaic output prediction value, the second wind power output prediction value, and the second load prediction value corresponding to each iteration, and obtaining the actual photovoltaic output value, the actual wind power output value, and the actual load value corresponding to each iteration, the prediction loss corresponding to each iteration is calculated according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the actual photovoltaic output value, the actual wind power output value, and the actual load value corresponding to each iteration.
[0103] In one specific embodiment of the present application, step S207 can include the following steps:
[0104] Step one: obtain each preset time period weight; wherein, each preset time period weight includes load peak time period weight, photovoltaic climbing time period weight and other time period weight, and the load peak time period weight is greater than the photovoltaic climbing time period weight, and the photovoltaic climbing time period weight is greater than the other time period weight;
[0105] Step two: according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value, the load actual value and each preset time period weight corresponding to each iteration, calculate the prediction loss corresponding to each iteration.
[0106] For the convenience of description, the above two steps can be combined for description.
[0107] After predicting the second photovoltaic output prediction value, the second wind power output prediction value and the second load prediction value corresponding to each iteration, and obtaining the photovoltaic output actual value, the wind power output actual value and the load actual value corresponding to each iteration, the preset time period weight is obtained, the preset time period weight includes the load peak time period weight, the photovoltaic climbing time period weight and the other time period weight, and the load peak time period weight is greater than the photovoltaic climbing time period weight, and the photovoltaic climbing time period weight is greater than the other time period weight. According to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value, the load actual value and each preset time period weight corresponding to each iteration, the prediction loss corresponding to each iteration is calculated.
[0108] The prediction loss corresponding to each iteration can be calculated by the following formula:
[0109] ;
[0110] Wherein, is the number of training samples (for example, 1000-10000), is the length of the prediction time window (for example, 24 represents predicting the next 24 hours, and the time granularity is 1 hour; or 96 represents predicting the next 24 hours, and the time granularity is 15 minutes), is the i-th training sample, is the t-th time step in the prediction window (t=1 represents the first time in the future, and t=H represents the H-th time in the future), is the weight coefficient of the t-th time step (emphasizing the importance of different time), the load peak time period (8-11 o'clock, 18-21 o'clock): (load prediction is more critical), photovoltaic climbing time period (6-9 o'clock, 15-18 o'clock): (output changes fast), other time periods: , is the true value of the i-th sample at time t, is the prediction value of the i-th sample at time t, , are the maximum and minimum values (for normalization) of the historical data of the task task, respectively, is the prediction loss.
[0111] By calculating the prediction loss corresponding to each iteration according to the weight of each preset period, the importance of different times is emphasized, and the accuracy of the calculated prediction loss is improved.
[0112] S208: When the prediction loss is lower than the first preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
[0113] The first preset loss threshold is set in advance. After the prediction loss corresponding to each iteration is calculated, when the prediction loss is lower than the first preset loss threshold, it indicates that the prediction model obtained in the current iteration has good prediction ability for photovoltaic output, wind power output and load. The prediction model obtained in the current iteration is determined as the unified prediction model.
[0114] In one specific embodiment of the present application, step S208 can include the following steps:
[0115] Step one: obtaining the candidate covariate weight value corresponding to each candidate covariate in the first candidate covariate set in each iteration;
[0116] Step two: calculating the regularization term corresponding to each iteration according to the candidate covariate weight value;
[0117] Step three: calculating the total loss corresponding to each iteration according to each prediction loss and each regularization term;
[0118] Step four: when the total loss is lower than the second preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
[0119] For convenience of description, the above four steps can be combined for description.
[0120] After the prediction loss corresponding to each iteration is calculated, the candidate covariate weight value corresponding to each candidate covariate in the first candidate covariate set in each iteration is obtained, the regularization term corresponding to each iteration is calculated according to the candidate covariate weight value, the total loss corresponding to each iteration is calculated according to each prediction loss and each regularization term, and when the total loss is lower than the second preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
[0121] The regularization term corresponding to each prediction task can be calculated by the following formula:
[0122] ;
[0123] wherein, is the total number of covariates (e.g. 20 weather + time features), is the candidate covariate weight value of the ith covariate in the task, is the photovoltaic output, wind power output, and load prediction task, is the regularization term.
[0124] The total loss corresponding to each iteration can be calculated by the following formula:
[0125] ;
[0126] wherein, is the task weight, which solves the magnitude imbalance problem by setting the task weight, (PV, typical range 0-600MW), (wind, typical range 0-500MW), (load, typical range 2000-8000MW, weight reduction to avoid leading loss function), is the regularization strength, and the regularization strength is set (reflecting the difference in physical characteristics): (PV allows weight concentration, sunny irradiance dominates), (wind power weight is slightly dispersed, wind speed + wind direction jointly affects), (load weight is more dispersed, affected by temperature, time, holidays, etc.). PV mainly looks at irradiance in sunny scenarios (weight can reach 0.7 or more), smaller weight concentration is allowed. Load is affected by multiple factors (temperature, time, holidays, etc.), larger weight dispersion is encouraged, and entropy regularization avoids the model completely ignoring some covariates, maintaining prediction robustness.
[0127] In one specific embodiment of the present application, the prediction model obtained in the current iteration is determined as the unified prediction model, which can include the following steps:
[0128] Step 1: Obtain a second candidate covariate set and a second historical observation sequence; wherein the second historical observation sequence includes a second photovoltaic historical output sub-observation sequence, a second wind power historical output sub-observation sequence, and a second load historical sub-observation sequence;
[0129] Step 2: Use the second candidate covariate set and the second historical observation sequence to construct a test sample set;
[0130] Step 3: Divide the test sample set into first test sample subsets corresponding to each first scene according to the weather conditions;
[0131] Step four: calculating each first covariate weight corresponding to each first scene respectively according to each first test sample subset by using the prediction model obtained in the current iteration;
[0132] Step five: judging whether the weight distribution of each first covariate weight conforms to the physical causal relationship of the power system, if yes, executing step six, if not, executing step seven;
[0133] Step six: determining the prediction model obtained in the current iteration as the unified prediction model;
[0134] Step seven: determining the prediction model obtained in the current iteration as the new current prediction model, and returning to execute step S205.
[0135] For convenience of description, the above seven steps can be combined for description.
[0136] When the prediction loss is lower than the first preset loss threshold, a second candidate covariate set and a second historical observation sequence are obtained, the second historical observation sequence includes a second photovoltaic historical output sub-observation sequence, a second wind power historical output sub-observation sequence and a second load historical sub-observation sequence, a test sample set is constructed by using the second candidate covariate set and the second historical observation sequence, the test sample set is divided into first test sample subsets corresponding to each first scene according to meteorological conditions, for example, sunny: cloud amount < 20% and irradiance > 600 W / m², cloudy: 20% ≤ cloud amount < 60%, overcast: cloud amount ≥ 60% or irradiance < 200 W / m².
[0137] Each first covariate weight corresponding to each first scene is calculated according to each first test sample subset by using the prediction model obtained in the current iteration, whether the weight distribution of each first covariate weight conforms to the physical causal relationship of the power system is judged, if yes, it is indicated that the prediction model has meteorological condition self-adaptation capability, the prediction model obtained in the current iteration is determined as the unified prediction model, if not, it is indicated that the prediction model does not have meteorological condition self-adaptation capability, the prediction model obtained in the current iteration is determined as the new current prediction model, and the prediction model obtained in the current iteration is further iteratively trained. By verifying the meteorological condition self-adaptation capability of the prediction model, it is ensured that the trained prediction model can have strong meteorological condition self-adaptation capability.
[0138] For each scene of the validation set , the attention weight of each covariate under the scene is extracted:
[0139] ;
[0140] Among them, The scene type (sunny day, cloudy day, peak load, etc.) For the scene The number of samples, For the scene The sample set, For the first Covariates in each sample Attention weights (automatically calculated during model inference).
[0141] As shown in Table 2, Table 2 is an example table of scene adaptation effects.
[0142] Table 2
[0143]
[0144] As shown in Table 2, the weight of irradiance automatically increases to 0.75 in sunny scenarios, becoming the dominant factor, while the weight of cloud cover automatically increases to 0.42 in cloudy scenarios, exceeding that of irradiance. The weight of the same covariate is significantly different in different scenarios, proving that the model has learned to adapt to different scenarios.
[0145] In one specific embodiment of this application, determining the prediction model obtained in the current iteration as the unified prediction model may include the following steps:
[0146] Step 1: Divide the test sample set into subsets of second test samples corresponding to each second scenario according to time characteristics;
[0147] Step 2: Using the prediction model obtained in the current iteration, calculate the weights of each second covariate corresponding to each second scenario based on each second test sample subset;
[0148] Step 3: Determine whether the weight distribution of each second covariate conforms to the physical causal relationship of the power system. If yes, proceed to step 4; otherwise, proceed to step 5.
[0149] Step 4: Determine the prediction model obtained in the current iteration as the unified prediction model;
[0150] Step 5: Determine the prediction model obtained in the current iteration as the new current prediction model, and return to execute step S205.
[0151] For ease of description, the five steps above can be combined for explanation.
[0152] After the test sample set is constructed by using the second candidate covariate set and the second historical observation sequence, the test sample set is divided into second test sample subsets corresponding to respective second scenarios according to time characteristics, for example, high load peak periods: 8-11 o'clock, 18-21 o'clock, flat load periods: 7-8 o'clock, 11-18 o'clock, 21-23 o'clock, and low load valley: 23-7 o'clock.
[0153] The prediction model obtained in the current iteration is used to calculate second covariate weights corresponding to respective second scenarios according to respective second test sample subsets, and it is determined whether the weight distribution of the second covariate weights conforms to the physical causality of the power system. If yes, it indicates that the prediction model has acquired the time period self-adaptive capability, and the prediction model obtained in the current iteration is determined as the unified prediction model. If no, it indicates that the prediction model does not have the time period self-adaptive capability, the prediction model obtained in the current iteration is determined as a new current prediction model, and the prediction model obtained in the current iteration is further iteratively trained. Through the time period self-adaptive capability verification of the prediction model, it is ensured that the trained prediction model can have strong time period self-adaptive capability.
[0154] A scene weight heat map can also be drawn to show the weight distribution of all covariates in each scenario, a covariate weight comparison chart can be drawn to compare the weight changes of a certain covariate in different scenarios, and a time series weight dynamic chart can be drawn to show the dynamic changes of the weight with time and scenarios. Physical rationality verification standards can be set, such as that the irradiance weight should be the highest in the sunny scenario, the cloud cover weight should be significantly improved in the overcast scenario, the temperature and time characteristic weights should be higher in the high load peak period, and the weight distribution conforms to the physical causality of the power system. The covariate weight visualization conforms to the physical law, which is convenient for abnormal analysis and debugging.
[0155] Evaluation indicators can also be set.
[0156] ;
[0157] wherein, is the predicted value, is the actual value, is the mean absolute percentage error, and M is the number of samples in the verification set.
[0158] S209: Obtain historical photovoltaic output, historical wind power output, historical load data, historical covariate set, and future covariate set in a prediction time window length.
[0159] For a target prediction time point , the historical data includes historical photovoltaic output , historical wind power output , and historical load data The covariate data includes historical covariates and future covariates (weather forecast, date and time).
[0160] S210: Using the unified prediction model, the covariate weight of photovoltaic output, wind power output and load is calculated respectively, and the first photovoltaic output prediction value, the first wind power output prediction value and the first load prediction value are obtained by predicting the photovoltaic output, the wind power output and the load according to the calculated covariate weight.
[0161] The model automatically calculates the covariate weight inside:
[0162] ;
[0163] wherein, represents the prediction task type, is the query vector dedicated to the task, is the key vector of the i-th covariate, is the vector dimension, is the total number of covariates, is the covariate weight of the i-th covariate. The is learned by a dedicated decoder, so the weight mode is different.
[0164] One forward propagation obtains three types of predictions:
[0165] .
[0166] As shown in Table 3, Table 3 is a prediction result example table.
[0167]
[0168] S211: Generating power grid section data according to the first photovoltaic output prediction value, the first wind power output prediction value and the first load prediction value.
[0169] Based on the prediction result, unit commitment optimization is performed to meet the power balance constraint.
[0170] The optimization target is:
[0171] ;
[0172] The power balance constraint is:
[0173] ;
[0174] wherein, is the number of units, is the output of the i-th unit, is the power generation cost function of the i-th unit, For the predicted value.
[0175] Solve the unit output allocation scheme by an optimization algorithm.
[0176] Based on the unit output optimization result, calculate the power flow of each line of the power grid.
[0177] Node power equation:
[0178] ;
[0179] wherein, is the injection power of node i, , is the node voltage amplitude, is the node voltage phase angle difference, , is the admittance matrix element, and K is the number of nodes.
[0180] Obtain the line power flow, node voltage and other power grid section data through power flow calculation.
[0181] The embodiments of the present application realize scene adaptive learning of covariate weights through an attention mechanism or a gating mechanism, input a full set of candidate covariates (without pre-screening), automatically learn the importance weights of each covariate by using the attention mechanism or the gating mechanism, dynamically adjust the weights according to different scenes (sunny day / overcast day, load peak / load flat section), and support multi-scene prediction of photovoltaic power, wind power and load under a unified model architecture.
[0182] Corresponding to the above method embodiments, the present application also provides a power grid section data generation device, and the power grid section data generation device described below can be mutually corresponding and referred to the power grid section data generation method described above.
[0183] Referring to Figure 3 , Figure 3 is a structural block diagram of a power grid section data generation device in the embodiments of the present application, and the device can include:
[0184] The data acquisition module 31 is configured to acquire each photovoltaic historical output, each wind power historical output, each load historical data, each historical covariate set and each future covariate set in a prediction time window length within a historical time window length.
[0185] The predicted value obtaining module 32 is configured to perform covariate weight calculation on photovoltaic output, wind power output and load respectively by using a unified prediction model, and perform photovoltaic output, wind power output and load prediction according to the calculated covariate weights to obtain a first photovoltaic output predicted value, a first wind power output predicted value and a first load predicted value.
[0186] The power grid section data module 33 is configured to generate power grid section data according to the first photovoltaic power prediction value, the first wind power prediction value, and the first load prediction value.
[0187] According to the technical solution, the unified prediction model is used to predict the photovoltaic power, the wind power, and the load, the unified model architecture does not need to develop models for different scenarios and prediction targets, and the development and maintenance costs of multiple models are reduced. The unified prediction model is used to calculate the covariate weights of the photovoltaic power, the wind power, and the load, respectively, so that different scenarios correspond to respective adaptive covariate weights, the prediction accuracy of the power grid section data in different scenarios is improved, and the operation safety and reliability of the power grid are improved.
[0188] In an embodiment of the present application, the device can further include a model training module, which can include:
[0189] The set and sequence acquisition submodule is configured to acquire a first candidate covariate set and a first historical observation sequence; the first historical observation sequence includes a first photovoltaic historical power sub-observation sequence, a first wind power historical power sub-observation sequence, and a first load historical sub-observation sequence.
[0190] The training sample set construction submodule is configured to construct a training sample set by using the first candidate covariate set and the first historical observation sequence.
[0191] The current prediction model determination submodule is configured to acquire a pre-constructed initial prediction model, and determine the initial prediction model as the current prediction model.
[0192] The iterative training submodule is configured to iteratively train the current prediction model by using the training sample set, to obtain a second photovoltaic power prediction value, a second wind power prediction value, and a second load prediction value corresponding to each iteration, respectively.
[0193] The actual value acquisition submodule is configured to acquire a photovoltaic power actual value, a wind power actual value, and a load actual value corresponding to each iteration, respectively.
[0194] The prediction loss calculation submodule is configured to calculate a prediction loss corresponding to each iteration, respectively, according to the second photovoltaic power prediction value, the second wind power prediction value, the second load prediction value, the photovoltaic power actual value, the wind power actual value, and the load actual value corresponding to each iteration, respectively.
[0195] The unified prediction model determination submodule is configured to determine the prediction model obtained in the current iteration as the unified prediction model when the prediction loss is lower than a first preset loss threshold.
[0196] In an embodiment of the present application, the prediction loss calculation submodule can include:
[0197] The preset time period weight acquisition unit is configured to acquire preset time period weights, wherein the preset time period weights include a load peak time period weight, a photovoltaic climbing time period weight, and other time period weights, and the load peak time period weight is greater than the photovoltaic climbing time period weight, and the photovoltaic climbing time period weight is greater than the other time period weights.
[0198] The prediction loss calculation unit is configured to calculate a prediction loss corresponding to each iteration according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the actual photovoltaic output value, the actual wind power output value, the actual load value, and the preset time period weights corresponding to each iteration.
[0199] In an embodiment of the present application, the unified prediction model determination sub-module can include:
[0200] The candidate covariate weight value acquisition unit is configured to acquire a candidate covariate weight value corresponding to each candidate covariate in the first candidate covariate set in each iteration.
[0201] The regularization term calculation unit is configured to calculate a regularization term corresponding to each iteration according to the candidate covariate weight values.
[0202] The total loss calculation unit is configured to calculate a total loss corresponding to each iteration according to the prediction loss and the regularization term.
[0203] The first unified prediction model unit is configured to determine the prediction model obtained in the current iteration as the unified prediction model when the total loss is lower than a second preset loss threshold.
[0204] In an embodiment of the present application, the device can further include:
[0205] The preprocessing module is configured to perform data cleaning, time alignment, and normalization processing on the first candidate covariate set and the first historical observation sequence after the first candidate covariate set and the first historical observation sequence are acquired and before the training sample set is constructed using the first candidate covariate set and the first historical observation sequence.
[0206] In an embodiment of the present application, the unified prediction model determination sub-module can include:
[0207] The set and sequence acquisition unit is configured to acquire a second candidate covariate set and a second historical observation sequence, wherein the second historical observation sequence includes a second photovoltaic historical output sub-observation sequence, a second wind power historical output sub-observation sequence, and a second load historical sub-observation sequence.
[0208] The test sample set construction unit is configured to construct a test sample set using the second candidate covariate set and the second historical observation sequence.
[0209] The first test sample subset division unit is configured to divide the test sample set into first test sample subsets corresponding to respective first scenes according to meteorological conditions.
[0210] The first covariate weight calculation unit is configured to calculate first covariate weights corresponding to respective first scenes according to respective first test sample subsets by using the prediction model obtained in the current iteration.
[0211] The first judgment unit is configured to judge whether the weight distribution of the first covariate weights conforms to the physical causal relationship of the power system.
[0212] The second unified prediction model determination unit is configured to determine the prediction model obtained in the current iteration as the unified prediction model when it is determined that the weight distribution of the first covariate weights conforms to the physical causal relationship of the power system.
[0213] The first return execution unit is configured to determine the prediction model obtained in the current iteration as a new current prediction model and return to execute the step of iteratively training the current prediction model by using the training sample set when it is determined that the weight distribution of the first covariate weights does not conform to the physical causal relationship of the power system.
[0214] In one specific embodiment of the present application, the unified prediction model determination sub-module can include:
[0215] The second test sample subset division unit is configured to divide the test sample set into second test sample subsets corresponding to respective second scenes according to time characteristics.
[0216] The second covariate weight calculation unit is configured to calculate second covariate weights corresponding to respective second scenes according to respective second test sample subsets by using the prediction model obtained in the current iteration.
[0217] The second judgment unit is configured to judge whether the weight distribution of the second covariate weights conforms to the physical causal relationship of the power system.
[0218] The third unified prediction model determination unit is configured to determine the prediction model obtained in the current iteration as the unified prediction model when it is determined that the weight distribution of the second covariate weights conforms to the physical causal relationship of the power system.
[0219] The second return execution unit is configured to determine the prediction model obtained in the current iteration as a new current prediction model and return to execute the step of iteratively training the current prediction model by using the training sample set when it is determined that the weight distribution of the second covariate weights does not conform to the physical causal relationship of the power system.
[0220] Corresponding to the above method embodiment, see Figure 4 , Figure 4A schematic diagram of an electrical grid section data generation device provided by the present application can include
[0221] a memory 332 for storing computer programs;
[0222] a processor 322 for executing computer programs to implement the steps of the electrical grid section data generation method of the above method embodiments.
[0223] In particular, refer to Figure 5 , Figure 5 A specific structural schematic diagram of an electrical grid section data generation device provided by the present embodiment can vary greatly due to different configurations or performances, and can include a processor (central processing units, CPU) 322 (for example, one or more processors) and a memory 332 storing one or more computer programs 342 or data 344. The memory 332 can be temporary storage or persistent storage. The programs stored in the memory 332 can include one or more modules (not shown in the figure), each of which can include a series of instruction operations in the data processing device. Further, the processor 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electrical grid section data generation device 301.
[0224] The electrical grid section data generation device 301 can also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.
[0225] The steps in the above-described electrical grid section data generation method can be implemented by the structure of the electrical grid section data generation device.
[0226] Corresponding to the above method embodiments, the present application also provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor can implement the following steps:
[0227] Obtain each historical photovoltaic output, each historical wind power output, each historical load data, each historical covariate set in a historical time window length, and each future covariate set in a prediction time window length; use a unified prediction model to calculate the covariate weights for photovoltaic output, wind power output, and load respectively, and perform photovoltaic output, wind power output, and load prediction according to the calculated covariate weights to obtain a first photovoltaic output prediction value, a first wind power output prediction value, and a first load prediction value; and generate electrical grid section data according to the first photovoltaic output prediction value, the first wind power output prediction value, and the first load prediction value.
[0228] The computer readable storage medium can include a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
[0229] For the computer readable storage medium provided in the present application, refer to the above method embodiments, which will not be repeated here.
[0230] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the apparatus, device and computer readable storage medium disclosed in the embodiments, since they correspond to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0231] The principles and implementation manners of the present application are described by using specific examples. The above embodiment description is only used to help understand the technical solutions and core ideas of the present application. It should be pointed out that, for ordinary skilled in the art, without departing from the principles of the present application, the present application can be improved and modified in several ways, and these improvements and modifications also fall within the protection scope of the present application.
Claims
1. A method of generating network section data, characterized by, The method comprises the following steps: obtaining historical photovoltaic output, historical wind power output, historical load data, a set of historical covariates, and a set of future covariates in a prediction time window; using a unified prediction model to calculate the weights of the covariates for photovoltaic output, wind power output, and load respectively, and predicting the photovoltaic output, wind power output, and load according to the calculated weights of the covariates to obtain a first photovoltaic output prediction value, a first wind power output prediction value, and a first load prediction value; generating power grid section data according to the first photovoltaic output prediction value, the first wind power output prediction value, and the first load prediction value.
2. The power grid sectional data generation method according to claim 1, characterized by, The method further comprises a training process of the unified prediction model, which comprises the following steps: obtaining a first set of candidate covariates and a first historical observation sequence; the first historical observation sequence comprises a first photovoltaic historical output sub-observation sequence, a first wind power historical output sub-observation sequence, and a first load historical sub-observation sequence; constructing a training sample set using the first set of candidate covariates and the first historical observation sequence; obtaining a pre-constructed initial prediction model and determining the initial prediction model as a current prediction model; iteratively training the current prediction model using the training sample set to obtain a second photovoltaic output prediction value, a second wind power output prediction value, and a second load prediction value corresponding to each iteration; obtaining a photovoltaic output actual value, a wind power output actual value, and a load actual value corresponding to each iteration; calculating a prediction loss corresponding to each iteration according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value, and the load actual value corresponding to each iteration; determining the prediction model obtained in the current iteration as the unified prediction model when the prediction loss is lower than a first preset loss threshold.
3. The power grid section data generation method according to claim 2, characterized by, The method for calculating the prediction loss corresponding to each iteration comprises the following steps: obtaining a preset period weight; the preset period weight comprises a load peak period weight, a photovoltaic climbing period weight, and other period weights, and the load peak period weight is greater than the photovoltaic climbing period weight, and the photovoltaic climbing period weight is greater than the other period weights; calculating the prediction loss corresponding to each iteration according to the second photovoltaic output prediction value, the second wind power output prediction value, the second load prediction value, the photovoltaic output actual value, the wind power output actual value, the load actual value, and the preset period weight corresponding to each iteration.
4. The power grid section data generation method according to claim 2 or 3, characterized by, The method for determining the prediction model obtained in the current iteration as the unified prediction model when the prediction loss is lower than the first preset loss threshold comprises the following steps: obtaining a candidate covariate weight value corresponding to each candidate covariate in the first set of candidate covariates in each iteration; calculating a regularization term corresponding to each iteration according to the candidate covariate weight value; calculating a total loss corresponding to each iteration according to the prediction loss and the regularization term; and determining the prediction model obtained in the current iteration as the unified prediction model when the total loss is lower than a second preset loss threshold. When the total loss is lower than a second preset loss threshold, the prediction model obtained in the current iteration is determined as the unified prediction model.
5. The power grid sectional data generation method according to claim 2, characterized by, After the first candidate covariate set and the first historical observation sequence are obtained, before the training sample set is constructed using the first candidate covariate set and the first historical observation sequence, the method further includes: performing data cleaning, time alignment and normalization processing on the first candidate covariate set and the first historical observation sequence.
6. The power grid section data generation method according to claim 2, characterized by, Determining the prediction model obtained in the current iteration as the unified prediction model includes: obtaining a second candidate covariate set and a second historical observation sequence; wherein the second historical observation sequence includes a second historical photovoltaic power output sub-observation sequence, a second historical wind power output sub-observation sequence and a second historical load sub-observation sequence; constructing a test sample set using the second candidate covariate set and the second historical observation sequence; dividing the test sample set into first test sample subsets corresponding to respective first scenarios according to meteorological conditions; calculating first covariate weights corresponding to respective first scenarios according to the respective first test sample subsets using the prediction model obtained in the current iteration; judging whether the weight distribution of the first covariate weights conforms to a physical causal relationship of a power system; if yes, determining the prediction model obtained in the current iteration as the unified prediction model; if no, determining the prediction model obtained in the current iteration as a new current prediction model, and returning to perform the step of iteratively training the current prediction model using the training sample set.
7. The power grid section data generation method according to claim 6, characterized by, Determining the prediction model obtained in the current iteration as the unified prediction model includes: dividing the test sample set into second test sample subsets corresponding to respective second scenarios according to time characteristics; calculating second covariate weights corresponding to respective second scenarios according to the respective second test sample subsets using the prediction model obtained in the current iteration; judging whether the weight distribution of the second covariate weights conforms to a physical causal relationship of a power system; if yes, determining the prediction model obtained in the current iteration as the unified prediction model; if no, determining the prediction model obtained in the current iteration as a new current prediction model, and returning to perform the step of iteratively training the current prediction model using the training sample set.
8. An electrical network section data generating device, characterized by The method includes: a data acquisition module configured to acquire historical photovoltaic power outputs, historical wind power outputs, historical load data, historical covariate sets in a historical time window and future covariate sets in a prediction time window; a prediction value obtaining module configured to perform covariate weight calculation on photovoltaic power output, wind power output and load by using the unified prediction model, and perform photovoltaic power output, wind power output and load prediction according to the calculated covariate weights to obtain first photovoltaic power output prediction values, first wind power output prediction values and first load prediction values; a power grid section data module configured to generate power grid section data according to the first photovoltaic power output prediction values, the first wind power output prediction values and the first load prediction values.
9. A power grid section data generating apparatus characterized by comprising: The method includes: a memory configured to store a computer program; A processor for implementing the steps of the power grid cross-section data generation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor to implement the steps of the power grid cross-section data generation method according to any one of claims 1 to 7.