A new energy station primary frequency modulation optimization system and method and medium
Patent Information
- Application Number
- CN202510033584.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2045-01-09
AI Technical Summary
[0005]本发明的目的是针对现有技术中传统的负荷预测方法及一次调频控制策略的预测精度有限,以致无法准确预测瞬时频率的问题,从而提出了一种新能源场站一次调频优化系统和方法及介质
[0063](1) This invention significantly enhances the model’s ability to express input data through PCA (principal component analysis). PCA effectively extracts the main features in the load data, reduces the dimensionality of the data, and removes noise and irrelevant features, thereby simplifying the model complexity and improving computational efficiency. This feature selection technique enables the model to maintain high prediction accuracy and stability when facing large-scale data. At the same time, simplifying the data can reduce the possibility of model overfitting and improve the model’s generalization ability and prediction accuracy.
Smart Images

Figure CN120090224B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of primary frequency regulation technology for new energy power plants in the field of electrical engineering, specifically to a primary frequency regulation optimization system, method, and medium for new energy power plants, and particularly to a primary frequency regulation optimization system, method, and medium for new energy power plants based on machine learning net load prediction. Background Technology
[0002] With the continued growth of global energy demand and increasing environmental awareness, new energy power generation technologies (such as wind and solar power) have developed rapidly. The large-scale integration of these new energy sources has increased the proportion of clean energy in the power system, effectively reducing dependence on fossil fuels. However, due to the randomness, intermittency, and volatility of new energy power generation, its output power is easily affected by weather conditions, thus posing new challenges to the stable operation of the power system.
[0003] In power systems, frequency stability is a crucial indicator of system operational quality. Primary frequency regulation, as the primary means of maintaining system frequency stability, relies on generator units automatically adjusting their active power output to balance the mismatch between load and generation capacity. Traditional primary frequency regulation strategies mainly rely on conventional power sources such as thermal and hydropower, which possess large rotational inertia and good regulation performance, enabling them to maintain frequency stability relatively well. However, with the continuous increase in the proportion of renewable energy generation, the equivalent inertia of the system decreases, and the frequency regulation capabilities of traditional power sources gradually become insufficient, making it difficult to meet the frequency stability requirements of the system under conditions of high renewable energy integration.
[0004] Currently, renewable energy power plants typically employ a primary frequency regulation control strategy with fixed parameters. This method fails to adequately consider the dynamic changes in load and the randomness of renewable energy power generation, resulting in delayed frequency regulation response and an inability to effectively offset frequency deviations, thus affecting the safe and stable operation of the system. Furthermore, traditional load forecasting methods (such as time series analysis and grey models) struggle to accurately capture the nonlinear and stochastic characteristics of load changes, leading to limited prediction accuracy and further increasing the complexity of frequency regulation. Machine learning-based forecasting schemes, on the other hand, usually only provide single-point values of the prediction results and cannot determine the range of prediction errors. Summary of the Invention
[0005] The purpose of this invention is to address the limited prediction accuracy of traditional load forecasting methods and primary frequency regulation control strategies in existing technologies, which makes it impossible to accurately predict instantaneous frequency. Therefore, this invention proposes a primary frequency regulation optimization system, method, and medium for renewable energy power plants. This invention employs the extreme gradient boosting (XGBoost) algorithm for integrated load forecasting, which can better capture the nonlinear characteristics of load changes and provide the variance of the prediction results. The prediction results are then applied to the frequency regulation strategy, thereby enabling early frequency regulation preparation and avoiding frequency exceedances. By combining advanced machine learning algorithms and improved frequency regulation control strategies, this invention effectively improves the frequency regulation response speed and frequency regulation capability of renewable energy power plants, enhancing the stability of the power system.
[0006] To achieve this objective, the first aspect of the present invention provides a primary frequency regulation optimization system for a new energy power station, which includes a feature engineering processing module, a load forecasting module, and a frequency regulation control module.
[0007] The feature engineering processing module is used to perform principal component analysis on the historical meteorological data and historical load data of the station under test to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0008] The load forecasting module is used to extract with replacement from the dimensionality-reduced historical meteorological data and historical load data to form several sample sets, and to train the corresponding XGBoost models with the sample sets to obtain several trained XGBoost models. Principal component analysis is performed on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data. The dimensionality-reduced real-time meteorological data and real-time load data are then input into the corresponding several trained XGBoost models to predict the net load for the next time step.
[0009] The frequency modulation control module obtains the expected value and standard deviation of the predicted net load at the next moment by the distribution of the predicted net load at the next moment, calculates the change in net load at the next moment based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment, calculates the frequency deviation of the system to be frequency-modulated based on the change in net load at the next moment and the equivalent inertia constant, and performs frequency modulation control by using the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment.
[0010] Preferably, the specific method for performing principal component analysis on the historical meteorological data and historical load data of the station under test to obtain dimensionality-reduced historical meteorological data and historical load data is as follows: The historical meteorological data and historical load data of the station under test are standardized to obtain standardized data. The covariance matrix of the data is calculated using the standardized data, and eigenvalue decomposition is performed on the covariance matrix to obtain the eigenvalues and corresponding eigenvectors of each principal component. The variance contribution rate of each principal component is calculated using the eigenvalues of each principal component. The eigenvalues to be calculated are sorted from largest to smallest. If the sum of the variance contribution rates of the current k principal components reaches a set threshold, then the first k principal components are selected as principal components. The standardized data is then projected onto the selected principal components to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0011] More preferably, the historical meteorological data and historical load data of the station to be measured are standardized, and the calculation formula for the standardized data is shown in the following formula:
[0012]
[0013] In the formula, Z i X is a standardized feature variable derived from historical meteorological or historical load data. i For historical meteorological data or historical load data, μ is the mean of the corresponding historical meteorological data or historical load data, and σ is the standard deviation of the corresponding historical meteorological data or historical load data.
[0014] The formula for calculating the covariance matrix of the data using standardized data is shown below:
[0015]
[0016] In the formula, Z Cov Let be the covariance matrix to be calculated, n be the total number of sample points for historical meteorological and historical load data, and matrix Z be the standardized feature variable Z. i The matrix formed, Z T Let Z be the transpose of matrix Z;
[0017] The covariance matrix of the data is decomposed into eigenvalues, and the eigenvalues and corresponding eigenvectors of each principal component are calculated using the following formulas:
[0018] Z Cov ·v=λ·v
[0019] In the formula, Z Cov Let v be the covariance matrix to be determined, v be the eigenvector to be determined, and λ be the eigenvalue to be determined.
[0020] The formula for calculating the variance contribution rate of each principal component using its eigenvalues is shown below:
[0021]
[0022] In the formula, V i The variance contribution rate of principal component i, λ i Let λ be the eigenvalue of the i-th principal component, n be the total number of principal components, and λ be the eigenvalue of the i-th principal component. j Let be the eigenvalue of the j-th principal component;
[0023] When the sum of the variance contribution rates of several principal components reaches a set threshold, the specific method for selecting these principal components is as follows: Sort the eigenvalues to be determined from largest to smallest. If the sum of the variance contribution rates of the current k principal components reaches the set threshold, then the first k principal components are selected. The formula for calculating the sum of the variance contribution rates of the first k principal components is as follows:
[0024]
[0025] In the formula, V Σ,k V represents the cumulative variance contribution rate of the first k principal components. i is the variance contribution rate of principal component i, and k is the number of principal components selected;
[0026] The standardized data are projected onto the selected principal components, and the calculation formulas for the dimensionality-reduced historical meteorological data and historical load data are as follows:
[0027] Y = Z·W
[0028] In the formula, Y represents the historical meteorological data and historical load data after dimensionality reduction, and Z represents the standardized feature variable Z. i The matrix formed by the principal components, W, is a matrix composed of the eigenvectors corresponding to the selected principal components.
[0029] Preferably, the objective function of the XGBoost model includes a loss function and a regularization term, wherein the formula for calculating the loss function is as follows:
[0030]
[0031] In the formula, L oss The loss function representing the XGBoost model, y i Let i be the actual dependent variable loading value of the i-th data point. Let be the predicted load value of the dependent variable for the i-th data point, and n be the total number of sample points for historical meteorological data and historical load data collected.
[0032] The formula for calculating the regularization term is shown below:
[0033]
[0034] In the formula, Ω represents the regularization term of the XGBoost model, γ represents the splitting penalty term, λ represents the L2 regularization term, T is the number of leaf nodes in the decision tree, and ω j Let J be the weight of the j-th leaf node;
[0035] The formula for calculating the split gain of nodes in the decision tree of the XGBoost model is as follows:
[0036]
[0037] In the formula, G represents the split gain of a node in the decision tree, g i Represents the loss function L oss Regarding the predicted value The first derivative, h i Represents the loss function L oss Regarding the predicted value The second derivative of , where γ represents the splitting penalty term, λ represents the L2 regularization term, and I represents the current sample set. L I represents the sample set of the left subtree. R The set of samples representing the right subtree.
[0038] More preferably, the load prediction module optimizes the hyperparameters of the XGBoost model using a Bayesian algorithm, and trains the corresponding XGBoost models using the several sample sets respectively, to obtain several trained XGBoost models.
[0039] More preferably, the specific method for optimizing the hyperparameters of the XGBoost model using the Bayesian algorithm is as follows: A surrogate model is constructed that is equivalent to the objective function of the XGBoost model. This surrogate model is used to select the next sampling point to continuously optimize the objective function of the XGBoost model. A Gaussian process is used as the surrogate model. The relationship between the surrogate model and the objective function of the XGBoost model is as follows:
[0040] f(x)~G(m(x),k(x,x)) x∈R d
[0041] In the formula, f(x) represents the objective function of the XGBoost model, G(m(x),k(x,x')) represents the Gaussian function, m(x) represents the mean function, k(x,x') represents the covariance function, and x and x' represent two sets of hyperparameters of the XGBoost model to be optimized, where x is the hyperparameter set of the XGBoost model being optimized, and x' is the hyperparameter set of another XGBoost model to be optimized. R dLet be the hyperparameter decision space, d be the decision dimension, and ~ represent that the random variable follows a Gaussian distribution;
[0042] In the process of continuously optimizing the objective function of the XGBoost model by selecting the next sampling point using the surrogate model, the expected boost is used as the sampling function to guide the selection of the hyperparameter sampling points of the XGBoost model, and the relationship is as follows:
[0043] EI(x)=E[max(f(x)-f(x + ),0)]
[0044] In the formula, EI(x) represents the expected boosting function, E represents the expected computation operation, and f(x) + ) represents the optimal set of hyperparameters in the XGBoost model being optimized, f(x) represents the objective function of the XGBoost model, and x is the set of hyperparameters of the XGBoost model being optimized.
[0045] Preferably, the formulas for calculating the expected value and standard deviation of the predicted net load at the next time step, obtained from the distribution of the predicted net load at the next time step, are as follows:
[0046]
[0047] In the formula, μ t Let B be the expected value of the predicted net load for the next time step, and let B be the number of bootstrap iterations, i.e., the number of trained XGBoost models. Let σ be the predicted power for the next time step obtained by the i-th trained XGBoost model. t The standard deviation of the predicted net load for the next time step.
[0048] Preferably, the formula for calculating the change in net load at the next moment based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment is as follows:
[0049] Δμ t =μ t -P t-1
[0050] In the formula, Δμ t The change in net load at the next time step, μ t To predict the expected value of the net load at the next time step, P t-1 This represents the current real-time net load.
[0051] The formula for calculating the frequency deviation of the system to be tuned based on the net load change and the equivalent inertial constant at the next moment is as follows:
[0052]
[0053] In the formula, The frequency deviation of the system to be tuned is Δμ t Let H be the net load change at the next moment, and H be the equivalent inertia constant of the system.
[0054] The calculation formula for frequency modulation control based on the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment is shown in the following formula:
[0055]
[0056] In the formula, ΔP t K represents the frequency modulation power adjustment amount, and K is the frequency modulation gain coefficient. Let σ be the frequency deviation of the system to be tuned, α be the load variance gain coefficient, and σ be the frequency deviation of the system to be tuned. t The standard deviation of the predicted net load for the next time step.
[0057] The second aspect of this invention provides a primary frequency regulation optimization method for new energy power plants, which includes the following:
[0058] Principal component analysis was performed on the historical meteorological data and historical load data of the stations to be tested to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0059] Several sample sets are formed by extracting samples with replacement from the dimensionality-reduced historical meteorological data and historical load data, and the corresponding XGBoost models are trained on the sample sets to obtain several trained XGBoost models. Principal component analysis is performed on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data. The dimensionality-reduced real-time meteorological data and real-time load data are input into the corresponding several trained XGBoost models to predict the net load for the next time step.
[0060] The expected value and standard deviation of the predicted net load at the next time moment are obtained by the distribution of the predicted net load at the next time moment. The change in net load at the next time moment is calculated based on the expected value of the predicted net load at the next time moment and the real-time net load at the current time moment. The frequency deviation of the frequency-tuning system is calculated based on the change in net load at the next time moment and the equivalent inertial constant. Frequency control is performed by using the frequency deviation of the frequency-tuning system and the standard deviation of the predicted net load at the next time moment.
[0061] The third aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0062] The beneficial effects of this invention are:
[0063] (1) This invention significantly enhances the model’s ability to express input data through PCA (principal component analysis). PCA effectively extracts the main features in the load data, reduces the dimensionality of the data, and removes noise and irrelevant features, thereby simplifying the model complexity and improving computational efficiency. This feature selection technique enables the model to maintain high prediction accuracy and stability when facing large-scale data. At the same time, simplifying the data can reduce the possibility of model overfitting and improve the model’s generalization ability and prediction accuracy.
[0064] (2) This invention employs an XGBoost ensemble prediction model based on bootstrapping inference. This model not only provides single-point load predictions for the sample under test but also outputs the variance of these predictions, thus providing a confidence interval. This feature enables the model to assess prediction uncertainty, providing richer information support for frequency regulation decisions. Through variance analysis of the prediction results, the system can effectively identify potential prediction errors, enhance its resistance to prediction uncertainty, avoid the failure of frequency regulation measures due to noise interference at a single prediction point, and ultimately avoid the problem of system frequency exceeding limits. The advantage of this model lies in improving the accuracy and robustness of predictions through ensemble learning, making new energy power plants more flexible and robust in dealing with frequency fluctuations. Attached Figure Description
[0065] Figure 1 This is a structural block diagram of a primary frequency regulation optimization system for a new energy power station according to one embodiment of the present invention;
[0066] Figure 2 This is a schematic diagram illustrating the operation of the bootstrap inference method in this invention;
[0067] Figure 3 This is a flowchart of the Bayesian optimization algorithm in this invention;
[0068] Figure 4 This is a flowchart of a primary frequency regulation optimization method for a new energy power station according to one embodiment of the present invention. Detailed Implementation
[0069] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0070] Example 1
[0071] A primary frequency regulation optimization system for a new energy power station, such as Figure 1 As shown, it includes a feature engineering processing module, a load forecasting module, and a frequency regulation control module;
[0072] The feature engineering processing module is used to perform principal component analysis on the historical meteorological data and historical load data of the station under test to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0073] The load prediction module is used to extract with replacement from the dimensionality-reduced historical meteorological data and historical load data to form several sample sets, and to train the corresponding XGBoost models with the sample sets to obtain several trained XGBoost models. It also obtains the real-time meteorological data and real-time load data of the station to be measured at the current time, performs principal component analysis on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data, and inputs the dimensionality-reduced real-time meteorological data and real-time load data into the corresponding several trained XGBoost models to predict the net load for the next time.
[0074] The frequency modulation control module obtains the expected value and standard deviation of the predicted net load at the next moment by the distribution of the predicted net load at the next moment, calculates the change in net load at the next moment based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment (obtained by telemetry), calculates the frequency deviation of the system to be frequency-modulated based on the change in net load at the next moment and the equivalent inertial constant, and performs frequency modulation control by using the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment.
[0075] The above technical solution also includes a data collection and processing module. This module collects various types of data related to load forecasting and performs data normalization. In this paper, the various types of data related to load forecasting include historical meteorological data (such as temperature, humidity, rainfall, wind speed, etc.) and historical load data (annual or longer-term historical load data for the area to be predicted, including timestamps and load values). Specifically, the historical meteorological data can be obtained from meteorological stations or archived data, reflecting the relevant situation of new energy power generation. The historical load data can be collected through smart meters, load monitoring systems, etc., covering historical load changes over a time range.
[0076] During the data collection process, to ensure data integrity and continuity, linear interpolation was used to complete missing data, and its expression is as follows:
[0077]
[0078] In the formula, X t X represents the missing data at time t. t-1 For data at time t-1, X t+1 This is the data at time t+1.
[0079] After data completion, outliers are detected and removed using the 3σ principle. A data point should be removed if and only if the following expression is satisfied:
[0080] |Xt -μ X ||>3σ X
[0081] In the formula, X t For data missing at time t, μ X σ is the mean of the data. X denoted as the standard deviation of the data.
[0082] After collecting the data, to ensure data consistency and reduce model bias, min-max normalization is used for data standardization, also known as data normalization, and its expression is as follows:
[0083]
[0084] In the formula, X norm These are the normalized data points, X min X max Let X be the minimum and maximum values in the original data, respectively. Standardization helps maintain the relative relationships between data points by scaling all data points to between 0 and 1. This process can also effectively prevent inefficient or unstable model training caused by excessive differences in variable scale.
[0085] In the above technical solution, the feature engineering processing module further includes smoothing periodic transformation of the periodic variables in the time series of historical meteorological data and historical load data. The specific method typically uses a sine function, as shown in the following expression:
[0086]
[0087] In the formula, Y sin Y represents the sine value of the transformed data points, signifying the periodicity of the original data. Y is the periodic data to be transformed, such as time or month. max This represents the maximum value of the data to be transformed, such as 23h or December. Smoothing the periodic variables of the time series allows the model to better understand and utilize the periodic characteristics in the data, avoiding the adverse effects of numerical jumps, such as from 23h to 0h, on the model's predictive ability.
[0088] In the above technical solution, in order to reduce the dimensionality of the data and decrease the model complexity and the possibility of overfitting, it is necessary to use PCA technology to reduce the dimensionality of the data. Specifically, the historical meteorological data and historical load data of the station to be tested are subjected to principal component analysis to obtain the dimensionality-reduced historical meteorological data and historical load data. The specific method is as follows: the historical meteorological data and historical load data of the station to be tested are standardized to obtain standardized data. The covariance matrix of the data is calculated using the standardized data, and the covariance matrix is decomposed into eigenvalues to obtain the eigenvalues and corresponding eigenvectors of each principal component. The variance contribution rate of each principal component is calculated using the eigenvalues of each principal component. When the sum of the variance contribution rates of several principal components reaches a set threshold, the several principal components are selected as principal components. The standardized data is then projected onto the selected principal components to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0089] In this paper, the original high-dimensional data is transformed into a new set of uncorrelated variables, called principal components. These principal components are ordered according to their contribution to the data variance, thereby achieving the goals of data dimensionality reduction, noise reduction, and feature extraction.
[0090] In the above technical solution, the historical meteorological data and historical load data of the station to be measured are standardized so that the mean of each feature is 1 and the standard deviation is 1. The calculation formula for the standardized data is shown in the following formula:
[0091]
[0092] In the formula, Z i X is a standardized feature variable derived from historical meteorological or historical load data. i σ represents the characteristic variable of historical meteorological data or historical load data, μ represents the mean of the corresponding historical meteorological data or historical load data, and σ represents the standard deviation of the corresponding historical meteorological data or historical load data.
[0093] In the above technical solution, after standardization, the covariance matrix of the data is calculated to understand the correlation between various features. The formula for calculating the covariance matrix of the standardized data is shown below:
[0094]
[0095] In the formula, Z Cov Let be the covariance matrix to be calculated, n be the total number of sample points for historical meteorological and historical load data, and matrix Z be the standardized feature variable Z. i The matrix formed, Z T Let Z be the transpose of matrix Z.
[0096] In the above technical solution, the covariance matrix of the data is decomposed into eigenvalues, and the calculation formulas for the eigenvalues and corresponding eigenvectors of each principal component are shown in the following formulas:
[0097] Z Cov ·v=λ·v
[0098] In the formula, Z Cov Let be the covariance matrix to be determined, v be the eigenvector to be determined, and λ be the eigenvalue to be determined. The eigenvalues represent the importance of each principal component, while the eigenvectors represent the directions of the principal components.
[0099] In the above technical solution, the formula for calculating the variance contribution rate of each principal component using the eigenvalues of each principal component is shown below:
[0100]
[0101] In the formula, V i The variance contribution rate of principal component i, λ i Let λ be the eigenvalue of the i-th principal component, n be the total number of principal components, and λ be the eigenvalue of the i-th principal component. j Let be the eigenvalue of the j-th principal component. The eigenvalue reflects the magnitude of the variance explained by the corresponding eigenvector (principal component). The larger the eigenvalue, the greater the variability of the data and the greater its role. The variance contribution rate represents the proportion of each principal component in all principal components.
[0102] In the above technical solution, to select an appropriate number of principal components, the cumulative variance contribution rate is usually calculated. The cumulative variance contribution rate refers to the sum of the variance contribution rates of the first k principal components, i.e., the prefix sum of the variance contribution rates. The specific method for selecting an appropriate number of principal components is as follows: when the sum of the variance contribution rates of several principal components reaches a set threshold, then those several principal components are selected. The specific method is as follows: sort the eigenvalues to be determined from largest to smallest; when the sum of the variance contribution rates of the current k principal components reaches the set threshold, then the first k principal components are selected. The formula for calculating the sum of the variance contribution rates of the first k principal components is as follows:
[0103]
[0104] In the formula, V Σ,k V represents the cumulative variance contribution rate of the first k principal components. i Let be the variance contribution rate of principal component i, and k be the number of principal components selected. In this paper, the threshold is typically set to 80% or 90%.
[0105] In the above technical solution, the standardized data is projected onto the selected principal components to obtain the dimensionality-reduced historical meteorological data and historical load data. The calculation formulas are as follows:
[0106] Y = Z·W
[0107] In the formula, Y represents the historical meteorological data and historical load data after dimensionality reduction, and Z represents the standardized feature variable Z. i The matrix W is composed of the eigenvectors corresponding to the selected principal components. Thus, through a linear transformation, the data is mapped from a high-dimensional space to a low-dimensional space while preserving as much of the variability of the original data as possible.
[0108] In this paper, extraction with replacement from the reduced historical meteorological data and historical load data refers to extracting a sample and then returning it to the sample set so that the sample has a chance to be extracted in the next extraction.
[0109] In this paper, the operation process of performing principal component analysis on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data is the same as the feature engineering process used in the feature engineering processing module when processing historical meteorological data and historical load data, and the same principal components are retained.
[0110] In the above technical solution, the core mechanism of the XGBoost model is to progressively build multiple decision trees, with each tree aiming to correct the prediction error of the previous tree. First, the objective function of the XGBoost algorithm needs to be defined. This function consists of a loss function and a regularization term. The specific form of the objective function of the XGBoost model is as follows:
[0111] F = L oss +Ω
[0112] In the formula, F represents the objective function of the XGBoost model, and L oss The loss function L represents the loss function of the XGBoost model. oss Used to measure the difference between the model's predicted values and the true values, Ω represents the regularization term of the XGBoost model. The regularization term Ω is used to control the complexity of the model, thereby avoiding overfitting.
[0113] In the above technical solution, the loss function L oss The calculation formula is shown below:
[0114]
[0115] In the formula, L oss The loss function representing the XGBoost model, y i Let i be the actual dependent variable loading value of the i-th data point. Let be the predicted load value of the dependent variable for the i-th data point, and n be the total number of sample points for historical meteorological data and historical load data collected.
[0116] In the above technical solution, the formula for calculating the regularization term Ω is as follows:
[0117]
[0118] In the formula, Ω represents the regularization term of the XGBoost model, γ represents the splitting penalty term, λ represents the L2 regularization term, T is the number of leaf nodes in the decision tree, and ω j Let ω be the weight of the j-th leaf node. j ^2 represents the L2 norm of the leaf output score.
[0119] Tree construction is the core of the XGBoost model. This process involves the step-by-step construction and splitting of the decision tree. At each step, the algorithm selects the optimal split point to add a new tree. This process is based on the split gain of the nodes in the decision tree. In the above technical solution, the formula for calculating the split gain of the nodes in the decision tree of the XGBoost model is as follows:
[0120]
[0121] In the formula, G represents the split gain of a node in the decision tree, g i Represents the loss function L oss Regarding the predicted value The first derivative, h i Represents the loss function L oss Regarding the predicted value The second, first, and second derivatives of the algorithm are all related to each data point i, reflecting the model's sensitivity to the prediction error of each data point at the current node; γ represents the splitting penalty term, which controls whether to split a node in the decision tree. When the splitting gain is less than γ, no split will occur. This helps avoid overfitting and control model complexity; λ represents the L2 regularization term (a penalty factor for weights), which prevents the model from becoming too complex by penalizing the weights of leaf nodes, thus acting as a regularization mechanism; I represents the current sample set. L I represents the sample set of the left subtree. R I represents the sample set of the right subtree. L and I R This is based on the splitting rules currently being considered. The core idea of this formula is to evaluate the utility of splitting by comparing the reduction in error before and after splitting, and to provide XGBoost with a standard for determining how to construct the decision tree by quantifying the actual improvement brought about by splitting.
[0122] The above technical solution uses the bootstrap inference method, such as... Figure 2As shown, several sample sets are extracted with replacement from the reduced historical meteorological data and historical load data, and several XGBoost models are trained on the corresponding sample sets to obtain several trained XGBoost models.
[0123] In this paper, the XGBoost model supports multiple optimization methods and can be updated using Newton's method, as shown in the following formula:
[0124]
[0125] In the formula, θ t+1 Let θt represent the parameter set for iteration t+1, θt represent the parameter set for iteration t, g represent the first derivative of the loss function with respect to the predicted value, h represent the second derivative of the loss function with respect to the predicted value, and λ represent the L2 regularization term.
[0126] In the above technical solution, the Bayesian optimization (BO) algorithm is used to optimize the hyperparameters of each model, such as... Figure 3 As shown, the BO algorithm is a commonly used hyperparameter tuning algorithm that effectively balances efficiency and performance, finding a better combination of hyperparameters with less computational resources and time to optimize model performance. Its core idea is to construct a surrogate model to approximate the objective function, and then use the surrogate model to select the next sampling position, thereby continuously optimizing the objective function. Since the relationship between the loss function and hyperparameters involves XGBoost prediction and is difficult to explain analytically, it is usually assumed that the objective function is a stochastic process, estimated through finite sampling. Using a Gaussian process as the surrogate model, its representation mechanism of the objective function is as follows:
[0127] f(x)~G(m(x),k(x,x')) x∈R d
[0128] In the formula, f(x) represents the objective function of the XGBoost model, G(m(x),k(x,x')) represents the Gaussian function, m(x) represents the mean function, k(x,x') represents the covariance function, and x and x' represent two sets of hyperparameters of the XGBoost model to be optimized, where x is the hyperparameter set of the XGBoost model being optimized, and x' is the hyperparameter set of another XGBoost model to be optimized. R d Let be the hyperparameter decision space, d be the decision dimension, and ~ represent that the random variable follows a Gaussian distribution.
[0129] In this paper, the statistical meanings of the mean function m(x) and the covariance function k(x,x') are shown in the following equations:
[0130] m(x) = E[f(x)]
[0131] In the formula, m(x) represents the mean function, f(x) represents the objective function of the XGBoost model, and E represents the expectation calculation operation. In this paper, the expectation calculation operation conforms to the general mathematical definition, that is:
[0132]
[0133] In the formula, p(f(x)) represents the probability distribution function of f(x), that is, in the Bayesian optimization process, the objective function f(x) follows a certain Gaussian process prior distribution G.
[0134] k(x,x')=E[(f(x)-m(x))(f(x')-m(x'))]
[0135] In the formula, k(x,x') represents the covariance function, x and x' represent two sets of hyperparameters of the XGBoost model to be optimized, where x is the set of hyperparameters of the XGBoost model being optimized and x' is the set of hyperparameters of another XGBoost model to be optimized, f(x) represents the objective function of the XGBoost model, m(x) represents the mean function, f(x') represents the value of the objective function at x', and m(x') represents the value of the mean function at x'.
[0136] In the decision-making process, expectation boosting is used as the acquisition function to guide the selection of hyperparameter sample points, balancing the exploration and development of the algorithm. Specifically, expectation boosting is used as the acquisition function to guide the selection of hyperparameter sampling points for the XGBoost model, and the relationship is as follows:
[0137] EI(x)=E[max(f(x)-f(x + ),0)]
[0138] In the formula, EI(x) represents the expected boosting function, E represents the expected computation operation, and f(x) + ) represents the optimal set of hyperparameters in the XGBoost model being optimized, f(x) represents the objective function of the XGBoost model, and x is the set of hyperparameters of the XGBoost model being optimized.
[0139] In the above technical solution, different XGBoost models predict different values. These predicted values are used to simulate and calculate the distribution, that is, to calculate the mean and variance of the predicted values. Specifically, the formulas for calculating the expected value and standard deviation of the predicted net load at the next time step, obtained from the distribution of the predicted net load at several next time steps, are as follows:
[0140]
[0141] In the formula, μ t Let B be the expected value of the predicted net load for the next time step, and let B be the number of bootstrap iterations, i.e., the number of trained XGBoost models. Let σ be the predicted power for the next time step obtained by the i-th trained XGBoost model. t The standard deviation of the predicted net load for the next time step.
[0142] In the above technical solution, the calculation formula for the change in net load at the next moment, based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment, is as follows:
[0143] Δμ t =μ t -P t-1
[0144] In the formula, Δμ t The change in net load at the next time step, μ t To predict the expected value of the net load at the next time step, P t-1 P represents the current real-time net load. t-1 It was detected by the power grid operator's telemetry.
[0145] In the above technical solution, the formula for calculating the frequency deviation of the system to be tuned based on the net load change and the equivalent inertial constant at the next moment is as follows:
[0146]
[0147] In the formula, The frequency deviation of the system to be tuned is Δμ t H represents the net load change at the next moment, and H is the system's equivalent inertia constant, which reflects the system's inertial response capability to frequency changes. The equivalent inertia constant depends on the actual setting and is an input value. In this paper, the equivalent inertia constant can be taken as 2s * rated capacity. For example, for 100MW, it is 200s * MW.
[0148] In the above technical solution, the calculation formula for frequency modulation control based on the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment is shown in the following formula:
[0149]
[0150] In the formula, ΔP t The frequency modulation power adjustment is denoted by K, which is the frequency modulation gain coefficient and determines the strength of the frequency modulation response. In this paper, the frequency modulation gain coefficient can be taken as 200s*MW. σ represents the frequency deviation of the system to be regulated, α is the load variance gain coefficient, reflecting the degree of influence of load forecast uncertainty on frequency regulation control. In this paper, the load variance gain coefficient can be set to 1 (it should be set according to the simulation settings, but is arbitrarily set here), σ t The standard deviation of the predicted net load for the next moment is used. By introducing the expected value and variance of the load, frequency regulation control can not only respond to the current frequency deviation of the system to be regulated, but also make adjustments in advance based on load forecasts, improving the timeliness and accuracy of frequency regulation response and reducing the risk of frequency overruns.
[0151] In the above technical solution, the system also includes a control and feedback module. First, the adjusted target power generation is sent as a control command to the new energy generator set via the control system interface to execute the power adjustment operation, ensuring that the generator set adjusts according to the command. Then, key parameters such as frequency, actual load, and output power are monitored in real time and feedback control is applied.
[0152] Example 2
[0153] A method for optimizing primary frequency regulation in renewable energy power plants, such as Figure 4 As shown, it includes the following steps:
[0154] Principal component analysis was performed on the historical meteorological data and historical load data of the stations to be tested to obtain the dimensionality-reduced historical meteorological data and historical load data.
[0155] Several sample sets are formed by extracting samples with replacement from the dimensionality-reduced historical meteorological data and historical load data. The sample sets are then used to train the corresponding XGBoost models to obtain several trained XGBoost models. Real-time meteorological data and real-time load data of the station to be measured at the current time are obtained. Principal component analysis is then performed on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data. The dimensionality-reduced real-time meteorological data and real-time load data are then input into several trained XGBoost models to predict the net load for the next time step.
[0156] The expected value and standard deviation of the predicted net load at the next time moment are obtained by the distribution of the predicted net load at the next time moment. The change in net load at the next time moment is calculated based on the expected value of the predicted net load at the next time moment and the real-time net load at the current time moment. The frequency deviation of the frequency-tuning system is calculated based on the change in net load at the next time moment and the equivalent inertial constant. Frequency control is performed by using the frequency deviation of the frequency-tuning system and the standard deviation of the predicted net load at the next time moment.
[0157] Example 3
[0158] A computer-readable storage medium storing a computer program, characterized in that: when the computer program is executed by a processor, it implements the steps of the method described above.
[0159] This invention employs XGBoost for high-precision load prediction, obtaining the predicted load value and confidence interval, and applying the prediction results in real time to optimize the primary frequency regulation strategy. By anticipating potential frequency fluctuations before net load changes, the system can take frequency regulation measures in advance, reducing frequency fluctuations caused by sudden changes in net load. Therefore, it allows renewable energy power plants to prepare for frequency regulation in advance. This method, by combining advanced machine learning algorithms and improved frequency regulation control strategies, enhances the frequency regulation response capability of renewable energy generating units and improves the frequency stability of the power system.
[0160] This strategy is specifically designed to address the power output fluctuations common in renewable energy generation, especially the frequency instability that may occur during power ramp-up. By adjusting the frequency in advance, the system can effectively shorten the frequency adjustment delay and avoid frequency limit violations caused by untimely power fluctuations or power ramp-up adjustments. This method greatly improves the frequency regulation response capability of renewable energy power plants, optimizes frequency regulation efficiency, and ensures the safe and stable operation of the system under large-scale renewable energy access.
[0161] The contents not described in detail in this specification are existing technologies known to those skilled in the art.
Claims
1. A primary frequency regulation optimization system for a new energy power station, characterized in that: It includes a feature engineering processing module, a load forecasting module, and a frequency regulation control module; The feature engineering processing module is used to perform principal component analysis on the historical meteorological data and historical load data of the station under test to obtain the dimensionality-reduced historical meteorological data and historical load data. The load forecasting module is used to extract with replacement from the dimensionality-reduced historical meteorological data and historical load data to form several sample sets, and to train the corresponding XGBoost models with the sample sets to obtain several trained XGBoost models. Principal component analysis is performed on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data. The dimensionality-reduced real-time meteorological data and real-time load data are then input into the corresponding several trained XGBoost models to predict the net load for the next time step. The frequency modulation control module obtains the expected value and standard deviation of the predicted net load at the next moment by the distribution of the predicted net load at the next moment, calculates the change in net load at the next moment based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment, calculates the frequency deviation of the system to be frequency-modulated based on the change in net load at the next moment and the equivalent inertia constant, and performs frequency modulation control by using the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment.
2. The primary frequency regulation optimization system for new energy power stations according to claim 1, characterized in that: The specific method for performing principal component analysis on the historical meteorological data and historical load data of the test station to obtain dimensionality-reduced historical meteorological data and historical load data is as follows: The historical meteorological data and historical load data of the test station are standardized to obtain standardized data. The covariance matrix of the data is calculated using the standardized data, and eigenvalue decomposition is performed on the covariance matrix to obtain the eigenvalues and corresponding eigenvectors of each principal component. The variance contribution rate of each principal component is calculated using the eigenvalues of each principal component. The eigenvalues are sorted from largest to smallest. If the sum of the variance contribution rates of the current k principal components reaches a set threshold, then the first k principal components are selected as principal components. The standardized data is then projected onto the selected principal components to obtain the dimensionality-reduced historical meteorological data and historical load data.
3. The primary frequency regulation optimization system for new energy power stations according to claim 2, characterized in that: The historical meteorological data and historical load data of the station to be measured are standardized, and the calculation formula for the standardized data is shown in the following formula: In the formula, Z i X is a standardized feature variable derived from historical meteorological or historical load data. i For historical meteorological data or historical load data, μ is the mean of the corresponding historical meteorological data or historical load data, and σ is the standard deviation of the corresponding historical meteorological data or historical load data. The formula for calculating the covariance matrix of the data using standardized data is shown below: In the formula, Z Cov Let be the covariance matrix to be calculated, n be the total number of sample points for historical meteorological and historical load data, and matrix Z be the standardized feature variable Z. i The matrix formed, Z T Let Z be the transpose of matrix Z; The covariance matrix of the data is decomposed into eigenvalues, and the eigenvalues and corresponding eigenvectors of each principal component are calculated using the following formulas: Z Cov ·v=λ·v (3) In the formula, Z Cov Let v be the covariance matrix to be determined, v be the eigenvector to be determined, and λ be the eigenvalue to be determined. The formula for calculating the variance contribution rate of each principal component using its eigenvalues is shown below: In the formula, V i The variance contribution rate of principal component i, λ i Let λ be the eigenvalue of the i-th principal component, n be the total number of principal components, and λ be the eigenvalue of the i-th principal component. j Let be the eigenvalue of the j-th principal component; When the sum of the variance contribution rates of several principal components reaches a set threshold, the specific method for selecting these principal components is as follows: Sort the eigenvalues to be determined from largest to smallest. If the sum of the variance contribution rates of the current k principal components reaches the set threshold, then the first k principal components are selected. The formula for calculating the sum of the variance contribution rates of the first k principal components is as follows: In the formula, V Σ,k V represents the cumulative variance contribution rate of the first k principal components. i is the variance contribution rate of principal component i, and k is the number of principal components selected; The standardized data are projected onto the selected principal components, and the calculation formulas for the dimensionality-reduced historical meteorological data and historical load data are as follows: Y = Z·W (6) In the formula, Y represents the historical meteorological data and historical load data after dimensionality reduction, and Z represents the standardized feature variable Z. i The matrix formed by the principal components, W, is a matrix composed of the eigenvectors corresponding to the selected principal components.
4. The primary frequency regulation optimization system for new energy power stations according to claim 3, characterized in that: The objective function of the XGBoost model includes a loss function and a regularization term. The formula for calculating the loss function is shown below: In the formula, L oss The loss function representing the XGBoost model, y i Let i be the actual dependent variable loading value of the i-th data point. Let be the predicted load value of the dependent variable for the i-th data point, and n be the total number of sample points for historical meteorological data and historical load data collected. The formula for calculating the regularization term is shown below: In the formula, Ω represents the regularization term of the XGBoost model, γ represents the splitting penalty term, λ represents the L2 regularization term, T is the number of leaf nodes in the decision tree, and ω j Let J be the weight of the j-th leaf node; The formula for calculating the split gain of nodes in the decision tree of the XGBoost model is as follows: In the formula, G represents the split gain of a node in the decision tree, g i Represents the loss function L oss Regarding the predicted value The first derivative, h i Represents the loss function L oss Regarding the predicted value The second derivative of , where γ represents the splitting penalty term, λ represents the L2 regularization term, and I represents the current sample set. L I represents the sample set of the left subtree. R The set of samples representing the right subtree.
5. The primary frequency regulation optimization system for new energy power stations according to claim 4, characterized in that: The load prediction module optimizes the hyperparameters of the XGBoost model using the Bayesian algorithm, and trains the corresponding XGBoost models using the several sample sets to obtain several trained XGBoost models.
6. The primary frequency regulation optimization system for new energy power stations according to claim 5, characterized in that: The specific method for optimizing the hyperparameters of the XGBoost model using the Bayesian algorithm is as follows: A surrogate model is constructed that is equivalent to the objective function of the XGBoost model. This surrogate model is used to select the next sampling point to continuously optimize the objective function of the XGBoost model. A Gaussian process is used as the surrogate model. The relationship between the surrogate model and the objective function of the XGBoost model is shown below: f(x)~G(m(x),k(x,x′)) x∈R d (10) In the formula, f(x) represents the objective function of the XGBoost model, G(m(x),k(x,x')) represents the Gaussian function, m(x) represents the mean function, k(x,x') represents the covariance function, and x and x' represent two sets of hyperparameters of the XGBoost model to be optimized, where x is the hyperparameter set of the XGBoost model being optimized, and x' is the hyperparameter set of another XGBoost model to be optimized. R d Let be the hyperparameter decision space, d be the decision dimension, and ~ represent that the random variable follows a Gaussian distribution; In the process of continuously optimizing the objective function of the XGBoost model by selecting the next sampling point using the surrogate model, the expected boost is used as the sampling function to guide the selection of the hyperparameter sampling points of the XGBoost model, and the relationship is as follows: EI(x)=E[max(f(x)-f(x + ),0)] (11) In the formula, EI(x) represents the expected boosting function, E represents the expected computation operation, and f(x) + ) represents the optimal set of hyperparameters in the XGBoost model being optimized, f(x) represents the objective function of the XGBoost model, and x is the set of hyperparameters of the XGBoost model being optimized.
7. The primary frequency regulation optimization system for new energy power stations according to claim 6, characterized in that: The formulas for calculating the expected value and standard deviation of the predicted net load at the next time step, obtained from the distribution of the predicted net load at several next time steps, are as follows: In the formula, μ t Let B be the expected value of the predicted net load for the next time step, and let B be the number of bootstrap iterations, i.e., the number of trained XGBoost models. Let σ be the predicted power for the next time step obtained by the i-th trained XGBoost model. t The standard deviation of the predicted net load for the next time step.
8. The primary frequency regulation optimization system for new energy power stations according to claim 7, characterized in that: The formula for calculating the change in net load at the next moment based on the expected value of the predicted net load at the next moment and the real-time net load at the current moment is as follows: Dm t =μ t -P t-1 (14) In the formula, Δμ t The change in net load at the next time step, μ t To predict the expected value of the net load at the next time step, P t-1 This represents the current real-time net load. The formula for calculating the frequency deviation of the system to be tuned based on the net load change and the equivalent inertial constant at the next moment is as follows: In the formula, The frequency deviation of the system to be tuned is Δμ t Let H be the net load change at the next moment, and H be the equivalent inertia constant of the system. The calculation formula for frequency modulation control based on the frequency deviation of the system to be frequency-modulated and the standard deviation of the predicted net load at the next moment is shown in the following formula: In the formula, ΔP t K represents the frequency modulation power adjustment amount, and K is the frequency modulation gain coefficient. Let σ be the frequency deviation of the system to be tuned, α be the load variance gain coefficient, and σ be the frequency deviation of the system to be tuned. t The standard deviation of the predicted net load for the next time step.
9. A method for optimizing primary frequency regulation in a new energy power station, characterized in that: It includes the following: Principal component analysis was performed on the historical meteorological data and historical load data of the stations to be tested to obtain the dimensionality-reduced historical meteorological data and historical load data. Several sample sets are formed by extracting samples with replacement from the dimensionality-reduced historical meteorological data and historical load data, and the corresponding XGBoost models are trained on the sample sets to obtain several trained XGBoost models. Principal component analysis is performed on the real-time meteorological data and real-time load data to obtain dimensionality-reduced real-time meteorological data and real-time load data. The dimensionality-reduced real-time meteorological data and real-time load data are input into the corresponding several trained XGBoost models to predict the net load for the next time step. The expected value and standard deviation of the predicted net load at the next time moment are obtained by the distribution of the predicted net load at the next time moment. The change in net load at the next time moment is calculated based on the expected value of the predicted net load at the next time moment and the real-time net load at the current time moment. The frequency deviation of the frequency-tuning system is calculated based on the change in net load at the next time moment and the equivalent inertial constant. Frequency control is performed by using the frequency deviation of the frequency-tuning system and the standard deviation of the predicted net load at the next time moment.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in claim 9.
Citation Information
Patent Citations
Frequency modulation capacity demand distribution method considering multiple frequency modulation resources
CN110994703A
New energy station primary frequency modulation optimization system and method and medium
CN120090224A