New energy generation power proportion prediction method and device in power system based on xLSTM and XGBoost, and computer readable storage medium
By combining xLSTM and XGBoost models and using HEOA to optimize weights, the problem of low accuracy in the prediction of new energy generation proportion is solved, and more efficient and accurate prediction effects are achieved.
Patent Information
- Application Number
- CN202510185607.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-02-20
AI Technical Summary
In the prior art, linear models have limited effects and low accuracy when predicting the proportion of new energy power generation.
Using a combined prediction method based on xLSTM and XGBoost, the xLSTM and XGBoost models are trained through the training set, and the combined weights of the model are optimized using HEOA, and finally weighted fusion is performed on the test set to generate the prediction results.
It improves the accuracy and effect of predicting the proportion of new energy power generation, enhances the model's processing ability of nonlinear relationships and high-dimensional features, and is robust to noise data.
Smart Images

Figure CN120124848A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and more specifically, relates to a method, device, and computer-readable storage medium for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost. Background Art
[0002] To address the challenges of energy shortage and environmental pollution, scientists and engineers worldwide are actively committed to developing and promoting sustainable new energy technologies, which has led to a gradual increase in the proportion of new energy power generation in the global energy structure. Against the backdrop of the increasing penetration of unstable renewable energy sources (such as wind energy and solar energy), in order to better achieve the economic and flexible planning, scheduling, and management of various power generation units, energy storage units, compensation units, and power consumption units in the power system, obtain a more accurate safety boundary for the operation and dispatch of the new power system, and ensure the reliability and stability of the power system, how to accurately predict the proportion of new energy power generation has become a key issue.
[0003] Chinese patent document CN116739118A discloses a power load prediction method based on LSTM-XGBoost to implement an error correction mechanism, including: decomposing the original power data into different components using seasonal decomposition of local weighted regression and performing feature selection on the component sequences using the Pearson Correlation Coefficient (PCC); using a Long Short-Term Memory (LSTM) network to complete the first-step prediction of the components; adopting the idea of stacked integration, using the LSTM component prediction results as new features and inputting them into extreme gradient boosting for the second-step component prediction with error correction; reconstructing the component prediction results into a complete time series to obtain the power load prediction value.
[0004] In summary, existing time series prediction methods usually rely on linear models, such as the autoregressive moving average (ARMA) model, to establish a regression equation based on the relationship between historical data to predict future target values. However, the prediction of the proportion of new energy power generation is complex and non-linear, and these linear models have limited effectiveness and low accuracy in dealing with the prediction of the proportion of new energy power generation. Summary of the Invention
[0005] The present invention aims to overcome at least one defect of the above-mentioned prior art and provides a method for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost to solve the problems of limited effectiveness and low accuracy of linear models in dealing with the prediction of the proportion of new energy power generation.
[0006] In another aspect of the present invention, an apparatus for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost is provided.
[0007] In another aspect of the present invention, a computer-readable storage medium is also provided to carry a method for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost.
[0008] The present invention proposes a prediction method based on the combination of xLSTM and XGBoost. First, the xLSTM and XGBoost models are trained using the training set, and the trained xLSTM model and XGBoost model are applied to the validation set to optimize the combined weights of the two models using the Human Evolutionary Optimization Algorithm (HEOA). Finally, on the test set, the xLSTM and XGBoost models are weighted and fused using the obtained optimal weights to generate the final prediction result.
[0009] The detailed technical solution of the present invention is as follows:
[0010] A method for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost, the method comprising:
[0011] S1. Collect new energy power generation data of the power grid and preprocess the data to obtain a data set. The preprocessing includes removing outliers and interpolating missing values with splines to improve data quality;
[0012] S2. After data preprocessing, perform feature screening on the data set through the maximum information coefficient to screen out features that have an important predictive effect on the new energy proportion, and obtain a preprocessed data set. The preprocessed data set includes a feature column and a target column, providing effective input features for the xLSTM and XGBoost models;
[0013] Further, features that have an important predictive effect on the new energy proportion are screened out. A total of 13 features with important predictive effects are screened out, including the measured value of the bus voltage, the estimated value of the phase angle of the bus voltage, the reactive power of new energy and conventional energy at the current moment, the reactive power measured at the compensator, the active power and reactive power of the total load at the current moment, and the measured values of the active and reactive powers at the high, middle, and low ends of the transformer;
[0014] The maximum information coefficient MIC adopted includes:
[0015] S21. Mutual information MI:
[0016]
[0017] In formula (1), Y represents the proportion of new energy, and X represents the characteristics related to the proportion of new energy; m and n represent the value ranges of variables X and Y, which are divided into m columns and n rows of grids respectively; X r , Y s is the specific value of the random variables X and Y, the rth value of the discretized X variable and the sth value of the discretized Y variable; D(X r ) represents the variable X r The probability distribution of D(Y s ) represents the variable Y s The probability distribution of D(X r ,Y s ) represents the variable X r and Y s The joint probability distribution of
[0018] S22, Maximum Information Coefficient MIC:
[0019]
[0020] Where a and b represent the number of grid divisions in the X and Y directions, respectively; B is a variable parameter set to the 0.6th power of the data volume.
[0021] S3. Based on the preprocessed data set, the data is divided into training set, validation set and test set in chronological order. The first 60% of the data is used for training, the next 20% is used for validation set to optimize the model weight, and the last 20% of the data is used as the test set to evaluate the generalization performance of the model in the online prediction scenario.
[0022] S4. Perform incremental principal component analysis dimensionality reduction processing on the preprocessed data set in S3 to achieve dimensionality reduction processing, select principal components with cumulative contribution exceeding 99% to train the IPCA model, and retain the important information features of the data to the greatest extent. Principal component is a term used in principal component analysis, which refers to new variables obtained by linearly combining the original features. These new variables, namely principal components, are sorted by variance size, reflecting the most important direction of change in the data;
[0023] Subsequently, the trained IPCA model is used to reduce the dimension of the training set, validation set, and test set to simulate the online data stream processing process. This dimensionality reduction process helps to reduce the data dimension while retaining the main information features, thereby improving the efficiency of subsequent model training and prediction accuracy.
[0024] Furthermore, the IPCA model adopted is:
[0025] Dataset:
[0026] A centered =A-μ (3);
[0027] Covariance matrix:
[0028]
[0029] Update the covariance matrix:
[0030]
[0031] Eigendecomposition:
[0032] ∑=QAQ T (6);
[0033] projection:
[0034] A reduced =A reduced W (7);
[0035] In formulas (3) to (7), A is the original data matrix, i.e., the data of the preprocessed data set, including feature columns and target columns; μ is the mean vector of each feature, indicating that each column of data is averaged; A centered is the centered data matrix (each feature minus the mean); ∑ new is the updated covariance matrix, which represents the comprehensive covariance of the current data batch and the existing data; ∑ old is the covariance matrix of historical data, i.e. the first N old The covariance of samples; batch is the covariance matrix of the current batch of data, calculated in the same way as in standard PCA, N old is the number of samples of historical data; N new is the number of samples in the current batch of data; N is the number of samples; Q is the eigenvector matrix of the covariance matrix; Λ refers to the diagonal matrix, containing the eigenvalues; Q T is the transposed matrix of Q; X reduced is the data matrix after dimensionality reduction; W is the projection matrix composed of the first k principal component eigenvectors; the superscript T represents the transpose of the matrix.
[0036] S5. Based on the training set after dimensionality reduction, the xLSTM and XGBoost models are established and trained. For the xLSTM model, the appropriate hyperparameters are determined by manual tuning, and the xLSTM model is trained to achieve prediction. The XGBoost model uses the grid search method to optimize its hyperparameters, and finally the XGBoost model is trained and predicted.
[0037] Furthermore, the xLSTM is formed by stacking an sLSTM followed by an mLSTM in series:
[0038] The sLSTM (scalar LSTM) used is:
[0039] Cell state: c t =f t ⊙c t-1 +i t ⊙z t ;
[0040] Normalized state: n t =f t ⊙n t-1 +i t ;
[0041] Hidden state:
[0042] Candidate cell states:
[0043] Input Gate:
[0044] Forget Gate: or
[0045] Output Gate:
[0046] x t is the input data of the current time step, t is the current time step; h t-1 is the hidden state of the previous time step; c t , c t-1 is the cell state at the current and previous time steps; n t , n t-1 is the normalized state of the current and previous time steps; f t ,i t , o t is the output of the forget gate, input gate, and output gate; z t is the candidate cell state; w i , w f , w o , w z is the weight matrix of the input gate, forget gate, output gate and candidate cell state; r i , r f , r o , r z is the recursive weight matrix of the input gate, forget gate, output gate, and candidate cell state; b i , b f , b o , b z are the bias terms of the input gate, forget gate, output gate and candidate cell state; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; the superscript T indicates the transpose of the matrix.
[0047] The mLSTM used is:
[0048] Cell Status:
[0049] Normalized state: n t =f t ⊙n t-1 +i t ;
[0050] Hidden state:
[0051] The attention mechanism of mLSTM includes:
[0052] Query vector: q t =W q x t +b q ;
[0053] Key vector:
[0054] Value vector: v t =W v x t +b v ;
[0055] Input gate: i t =exp(w i T x t +b i );
[0056] Forget Gate: or
[0057] Output Gate:
[0058] x t is the input data of the current time step; h t ,h t-1 is the hidden state of the current and previous time step; c t , c t-1 is the cell state at the current and previous time steps; n t , n t-1 is the normalized state of the current and previous time steps; q t , k t , v t are the query, key, and value of the attention mechanism; W q , W k , W v , w i , w f , wo is the weight matrix of query vector, key vector, value vector, input gate, forget gate and output gate; b q , b k ,b v , b i , b f , b o is the bias term of the query vector, key vector, value vector, input gate, forget gate, and output gate; f t ,i t , o t is the output of the forget gate, input gate and output gate; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; the superscript T indicates the transpose of the matrix.
[0059] Furthermore, the XGBoost model used is:
[0060]
[0061]
[0062] In formulas (8) to (11), is the loss function, y i refers to the true value of the i-th sample, refers to the predicted value of the i-th sample, Ω(f k ) refers to the regularization term, T refers to the number of leaf nodes, and w j The jth leaf node weight, γ leaf node penalty coefficient, limit the complexity of the tree, λ regularization coefficient, The predicted value of the τth round, f τ (ξ i ) The output of the decision tree constructed in the τth round, ξ i is the input feature vector of the i-th sample.
[0063] S6. Based on the validation set after dimensionality reduction, HEOA is used to optimize the weights of the xLSTM and XGBoost models. Through the automated search strategy, the optimal weight combination of the two base models is determined, and the objective function, namely the mean square error MSE, is optimized to improve the prediction accuracy; finally, the prediction results of the xLSTM test set and the XGBoost test set are weighted and fused by weight on the test set after dimensionality reduction through the optimal weight combination, so as to obtain the final prediction and the final combined prediction results.
[0064] Furthermore, the HEOA model adopted is:
[0065]
[0066] In formula (12), W λIndicates the weight of the λth model. When λ=1, it represents the xLSTM model, and when λ=2, it represents the XGBoost model. is the position of the λth individual in the ω+1 generation; β is the adaptive factor; ω is the number of current iterations; Max iter is the maximum number of iterations; represents the average position of the population in the ωth generation; W best is the current optimal solution; Levy(dim) represents the Levy flight distribution, which introduces randomness; f jump is the jump factor rand is a random number between [0, 1].
[0067] Furthermore, the missing values are supplemented by spline interpolation, specifically including:
[0068] 1. Spline function:
[0069] S p (u) = a p +b p (uu p )+c p (uu p ) 2 +d p (uu p ) 3 (13);
[0070] 2. Interpolation point consistency:
[0071] S p (u p+Δp )=S p+Δp (u p+Δp ) (14);
[0072] 3. First-order derivative continuity:
[0073] S p ′(u p+Δp )=S p+Δp ′(u p+Δp ) (15);
[0074] 4. Second-order derivative continuity:
[0075] S p ″(u p+Δp )=S p+Δp ″(u p+Δp ) (16);
[0076] In formulas (13) to (16), u is the independent variable of interpolation, [u p ,u p+Δp ] are two data points in the missing interval, u p and up+Δp is the horizontal coordinate of two adjacent known data points, S p (u) is the corresponding interval [u p ,u p+Δp ] interpolation function, a p , b p , c p , d p These are the unknown coefficients to be found; S p (u p+Δp ) is the pth spline function S p (u) at node u p+Δp The value at S p+Δp (u p+Δp ) is the p+Δpth spline function S p+Δp (u) at node u p+Δp The value at .
[0077] In another aspect of the present invention, a device for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost is provided, the device comprising:
[0078] at least one processor; and
[0079] A memory storing instructions, which, when executed by the at least one processor, enables the at least one processor to execute a method for predicting the proportion of renewable energy power generation in an electric power system based on xLSTM and XGBoost as described above.
[0080] In another aspect of the present invention, a computer-readable storage medium is provided, which stores executable instructions. When the instructions are executed, the machine executes the method for predicting the proportion of new energy power generation in the power system based on xLSTM and XGBoost as described above.
[0081] Compared with the prior art, the present invention has the following beneficial effects:
[0082] (1) The present invention provides a method, device and computer-readable storage medium for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, and a combined prediction method of xLSTM and XGBoost based on IPCA data dimensionality reduction. xLSTM is good at capturing long-term dependencies in time series data, while XGBoost performs well in processing nonlinear relationships and high-dimensional features, is efficient in training and robust to noisy data. The two models are combined through HEOA to further improve the prediction effect and accuracy.
[0083] (2) The present invention provides a method, device and computer-readable storage medium for predicting the proportion of renewable energy power generation in an electric power system based on xLSTM and XGBoost. The method uses MIC to screen features and then uses the IPCA method to reduce the dimensionality of high-dimensional data. This not only reduces the complexity of model training, but also reduces the impact of data noise on prediction accuracy, thereby providing subsequent models with more streamlined and reliable feature inputs, greatly improving prediction efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 It is the MIC correlation coefficient heat map between the proportion of new energy and the characteristics in the present invention;
[0085] Figure 2 This is the original percentage data of renewable energy in a certain power grid in China for a whole year;
[0086] Figure 3 This is the new energy proportion test data set after data preprocessing;
[0087] Figure 4 Design a flow chart for the xLSTM and XGBoost new energy share combination prediction method based on IPCA data dimensionality reduction;
[0088] Figure 5 This is a diagram of the prediction effect using traditional LSTM as a model training;
[0089] Figure 6 This is a graph showing the prediction effect of training a combined model of xLSTM and XGBoost. DETAILED DESCRIPTION
[0090] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0091] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0092] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0093] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0094] Example 1
[0095] Ginseng Figure 1 This embodiment provides a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, the method comprising:
[0096] S1. Obtaining data: Collecting renewable energy power generation data of the power grid, which is time series data; then preprocessing the data to obtain a data set, which includes the proportion of renewable energy and related features of the proportion of renewable energy; the preprocessing includes removing abnormal values in the data, then checking whether the data contains missing values and supplementing the missing values with spline interpolation;
[0097] Preferably, the outlier removal refers to:
[0098] Abnormal data (17);
[0099] Normal data (18);
[0100] In formulas (17) to (18), V meas is the voltage measurement, V volt is the voltage rated value. When the voltage measurement value deviates from the voltage rated value by more than 8%, the data is considered to be abnormal data.
[0101] Preferably, the present invention adopts the spline interpolation method to fill the missing values, thereby ensuring the integrity and reliability of the data;
[0102] In this embodiment, the spline interpolation method used is specifically:
[0103] S11, spline function:
[0104] S p (u) = a p +b p (uu p )+c p (uu p ) 2 +d p (uu p ) 3 (13);
[0105] S12, interpolation point consistency:
[0106] S p (u p+Δp )=S p+Δp (u p+Δp ) (14);
[0107] S13, first-order derivative continuity:
[0108] S p ′(u p+Δp )=S p+Δp ′(u p+Δp ) (15);
[0109] S14, Second-order derivative continuity:
[0110] S p ″(u p+Δp )=S p+Δp ″(u p+Δp ) (16);
[0111] In formulas (13) to (16), u is the independent variable of interpolation, [u p ,u p+Δp ] are two data points in the missing interval, u p and u p+Δp is the horizontal coordinate of two adjacent known data points, S p (u) is the corresponding interval [u p ,u p+Δp ] interpolation function, a p , b p , c p , d p is the unknown coefficient to be determined, S p (u p+Δp ) is the pth spline function S p (u) at node u p+Δp The value at S p+Δp (u p+Δp ) is the p+Δpth spline function S p+Δp (u) at node u p+Δp The value at .
[0112] S2, feature screening of the data set to obtain a preprocessed data set;
[0113] After data preprocessing, the maximum information coefficient (MIC) is used to screen the features of the data set, and the features that have an important predictive effect on the proportion of new energy are screened out to obtain the preprocessed data set. The preprocessed data set includes feature columns and target columns, which provide effective input features for the xLSTM and XGBoost models, where the feature columns are features that have an important predictive effect on the proportion of new energy.
[0114] Preferably, the maximum information coefficient MIC is a statistic used to measure the association between two variables, and is particularly suitable for evaluating complex, nonlinear data relationships.
[0115] In this embodiment, the maximum information coefficient MIC used is:
[0116] S21, mutual information MI:
[0117]
[0118] In formula (1), Y represents the proportion of new energy, and X represents the characteristics related to the proportion of new energy; m and n represent the value ranges of variables X and Y, which are divided into m columns and n rows of grids respectively; X r , Y s is the specific value of the random variables X and Y, the rth value of the discretized X variable and the sth value of the discretized Y variable; D(X r ) represents the variable X r The probability distribution of D(Y s ) represents the variable Y s The probability distribution of D(X r ,Y s ) represents the variable X r and Y s The joint probability distribution of
[0119] S22, Maximum Information Coefficient MIC:
[0120]
[0121] In formula (2), a and b represent the number of grid divisions in the X and Y directions respectively; B is a variable parameter set to the 0.6th power of the data amount.
[0122] After the above processing, in this embodiment, a total of 13 features with important predictive effects were screened out, such as Figure 4 As shown, including the measured value of bus voltage (V meas ), the estimated phase angle of bus voltage (A v ), the reactive power of new energy and conventional energy at the current moment (Q N , Q T ), the reactive power measured at the compensator (CQ), the total load active power and reactive power (LP, LQ) at the current moment, and the measured values of active (GP, ZP, DP) and reactive power (GQ, ZQ, DQ) at the high, middle and low ends of the transformer.
[0123] S3. Based on the preprocessed data set, it is divided into training set, validation set and test set in chronological order, where the first 60% of the data is used for training, the next 20% of the data is used as the validation set, and the last 20% is used as the test set for online prediction scenarios. Figure 2 The figure shows the entire data target value of new energy. Figure 3 Shown are the target values of the divided test set.
[0124] For time series data, the order of time is the key factor and the order cannot be disrupted. Sequential division can preserve the time correlation of the data, and can retain the long-term trends and cyclical characteristics in the data. In particular, time series data with seasonal fluctuations can avoid the leakage of future information into the past.
[0125] S4. IPCA data dimensionality reduction:
[0126] Perform incremental principal component analysis (IPCA) dimensionality reduction on the preprocessed data set in S3, and select principal components with cumulative contributions exceeding 99% to build the IPCA model, so as to retain the important information characteristics of the data to the greatest extent;
[0127] Subsequently, the trained IPCA model is used to reduce the dimension of the training set, validation set, and test set to simulate the online data stream processing process. This dimensionality reduction process helps to reduce the data dimension while retaining the main information features, thereby improving the efficiency of subsequent model training and prediction accuracy.
[0128] Preferably, the IPCA model used in this embodiment is:
[0129] Dataset:
[0130] A centered =A-μ (3);
[0131] Covariance matrix:
[0132]
[0133] Update the covariance matrix:
[0134]
[0135] Eigendecomposition:
[0136] ∑=QAQ T (6);
[0137] projection:
[0138] A reduced =A reduced W (7);
[0139] In formulas (3) to (7), A is the original data matrix, i.e., the data of the preprocessed data set, including feature columns and target columns; μ is the mean vector of each feature, indicating that each column of data is averaged; A centered is the centralized data matrix, with the mean value subtracted from each feature; ∑ newis the updated covariance matrix, which represents the comprehensive covariance of the current data batch and the existing data; ∑ old is the covariance matrix of historical data, i.e. the first N old The covariance of samples; batch is the covariance matrix of the current batch of data, calculated in the same way as in standard PCA, N old is the number of samples of historical data; N new is the number of samples in the current batch of data; N is the number of samples; Q is the eigenvector matrix of the covariance matrix; Λ refers to the diagonal matrix, containing the eigenvalues; Q T is the transposed matrix of Q; X reduced is the data matrix after dimensionality reduction; W is the projection matrix composed of the first k principal component eigenvectors; the superscript T represents the transpose of the matrix.
[0140] S5. Establish xLSTM prediction model and XGBoost prediction model:
[0141] Based on the training set after dimensionality reduction, the xLSTM and XGBoost models were established and trained. For the xLSTM model, the hyperparameters were determined by manual tuning, and the xLSTM model was trained to achieve prediction. For the XGBoost model, the hyperparameters were optimized by the Grid Search method, and the XGBoost model was trained to achieve prediction.
[0142] Preferably, the xLSTM model used in this embodiment is composed of an sLSTM followed by an mLSTM stacked in series:
[0143] The sLSTM (scalar LSTM) used is:
[0144] Cell state: c t =f t ⊙c t-1 +i t ⊙z t ;
[0145] Normalized state: n t =f t ⊙n t-1 +i t ;
[0146] Hidden state:
[0147] Candidate cell states:
[0148] Input Gate:
[0149] Forget Gate: or
[0150] Output Gate:
[0151] x t is the input data of the current time step; h t-1 is the hidden state of the previous time step; c t , c t-1 is the cell state at the current and previous time steps; n t , n t-1 is the normalized state of the current and previous time steps; f t ,i t , o t is the output of the forget gate, input gate, and output gate; z t is the candidate cell state; w i , w f ,w o , w z is the weight matrix of the input gate, forget gate, output gate and candidate cell state; r i , r f , r o , r z is the recursive weight matrix of the input gate, forget gate, output gate, and candidate cell state; b i , b f , b o , b z are the bias terms of the input gate, forget gate, output gate and candidate cell state; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; T represents the transpose of the matrix.
[0152] The mLSTM (Matrix LSTM) used is:
[0153] Cell Status:
[0154] Normalized state: n t =f t ⊙n t-1 +i t ;
[0155] Hidden state:
[0156] The attention mechanism of mLSTM includes:
[0157] Query vector: q t =W q x t +b q ;
[0158] Key vector:
[0159] Value vector: v t =W v x t +b v ;
[0160] Input gate: i t =exp(w i T x t +b i );
[0161] Forget Gate: or
[0162] Output Gate:
[0163] x t is the input data of the current time step; h t ,h t-1 is the hidden state of the current and previous time step; c t , c t-1 is the cell state at the current and previous time steps; n t , n t-1 is the normalized state of the current and previous time steps; q t , k t , v t are the query, key, and value of the attention mechanism; W q , W k ,W v ,w i , w f ,w o is the weight matrix of query vector, key vector, value vector, input gate, forget gate and output gate; b q , b k ,b v , b i , b f , b o is the bias term of the query vector, key vector, value vector, input gate, forget gate, and output gate; f t ,i t , o t is the output of the forget gate, input gate and output gate; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; T represents the transpose of the matrix.
[0164] Preferably, the XGBoost model used in this embodiment is:
[0165]
[0166] In formulas (8) to (11), is the loss function, y i refers to the true value of the i-th sample, refers to the predicted value of the i-th sample, Ω(f k ) refers to the regularization term, T refers to the number of leaf nodes, and w j The jth leaf node weight, γ leaf node penalty coefficient, limit the complexity of the tree, λ regularization coefficient, The predicted value of the τth round, f τ (ξ i ) The output of the decision tree constructed in the τth round, ξ i is the input feature vector of the i-th sample.
[0167] S6. HEOA searches for optimal weights: Based on the validation set after dimensionality reduction, HEOA is used to optimize the weights of the xLSTM and XGBoost models. Through an automated search strategy, the optimal weight combination of the two base models is determined, and the objective function, namely the mean square error (MSE), is optimized to improve prediction accuracy.
[0168] Finally, the prediction results of the xLSTM test set and the XGBoost test set are weighted and fused by the optimal weight combination on the test set after dimensionality reduction to obtain the final prediction and the final combined prediction results.
[0169] This fusion strategy effectively combines the advantages of the two base models and further improves the prediction accuracy and generalization ability. The prediction results of the combined model in the present invention are as follows: Figure 5 As shown, the traditional LSTM prediction results are as follows Figure 6 shown.
[0170] Preferably, the HEOA model used in this embodiment is:
[0171]
[0172] In formula (12), W λ Indicates the weight of the λth model. When λ=1, it represents the xLSTM model, and when λ=2, it represents the XGBoost model. is the position of the λth individual in the ω+1 generation; β is the adaptive factor; ω is the number of current iterations; Max iter is the maximum number of iterations; represents the average position of the population in the ωth generation; W best is the current optimal solution; Levy(dim) represents the Levy flight distribution, which introduces randomness; f jump is the jump factor rand is a random number between [0, 1].
[0173] On the other hand, this embodiment uses indicators such as mean square error MSE, mean absolute error MAE and determination coefficient R2 to evaluate the prediction results of the combined model in S6, and comprehensively measures the prediction accuracy and reliability of each model;
[0174] The evaluation indicators of the traditional model and the combined model are compared. The comparison of the evaluation indicators of the traditional model and the combined model is shown in Table 1. It can be seen from the results that the combined model in this embodiment has a good performance in multiple evaluation indicators (R 2 , MSE, and MAE) are better than the traditional model, namely the LSTM model, which verifies the feasibility of the proposed combined model in terms of prediction accuracy and practicality, and provides theoretical support and practical basis for the application of the model.
[0175] Table 1 Evaluation index table of traditional model and combined model
[0176]
[0177] Example 2
[0178] This embodiment provides a device for implementing a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost. The device includes:
[0179] at least one processor; and
[0180] A memory, wherein the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes as described above. This embodiment provides a method for predicting the proportion of new energy power generation in an electric power system based on xLSTM and XGBoost.
[0181] In this embodiment, electronic devices include but are not limited to: personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile computing devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable computing devices, consumer electronic devices, etc.
[0182] Example 3
[0183] The present embodiment also provides a computer-readable storage medium storing executable instructions, which, when executed, enable the machine to perform the above-mentioned embodiment. A method for predicting the proportion of renewable energy power generation in an electric power system based on xLSTM and XGBoost is provided.
[0184] Specifically, a system or device equipped with a readable storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer or processor of the system or device can read and execute instructions stored in the readable storage medium.
[0185] In this case, the program code itself read from the computer-readable medium can realize the function of any one of the above embodiments, and thus the computer-readable code and the computer-readable storage medium storing the computer-readable code constitute part of this specification.
[0186] Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code may be downloaded from a server computer or a cloud via a communication network.
[0187] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0188] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation methods of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, characterized in that: The method comprises: S1. Collect the renewable energy power generation data of the power grid and preprocess the data to obtain a data set. The preprocessing includes removing outliers and processing missing values with spline interpolation to improve data quality. S2. After data preprocessing, the data set is feature screened by the maximum information coefficient to screen out features that have important predictive effects on the proportion of new energy, and a preprocessed data set is obtained. The preprocessed data set includes a feature column and a target column; S3. Based on the preprocessed data set, divide the data into training set, validation set and test set in chronological order; S4, performing incremental principal component analysis dimensionality reduction processing on the preprocessed data set in S3, selecting principal components with cumulative contribution exceeding 99% to train the IPCA model, and then using the trained IPCA model to perform dimensionality reduction processing on the training set, validation set and test set; S5. Based on the training set after dimensionality reduction, xLSTM and XGBoost models are established and trained. For the xLSTM model, the hyperparameters are determined by manual tuning, and the xLSTM model is trained to achieve prediction. For the XGBoost model, the hyperparameters are optimized by the grid search method, and the XGBoost model is trained to achieve prediction. S6. Based on the validation set after dimensionality reduction, HEOA is used to optimize the weights of the xLSTM and XGBoost models. Through an automated search strategy, the optimal weight combination of the two base models is determined to optimize the objective function. Finally, the prediction results of the xLSTM test set and the XGBoost test set are weightedly fused on the test set after dimensionality reduction through the optimal weight combination to obtain the final combined prediction result.
2. According to claim 1, a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, characterized in that: The maximum information coefficients used include: S21, mutual information MI: In formula (1), Y represents the proportion of new energy, and X represents the characteristics related to the proportion of new energy; m and n represent the value ranges of variables X and Y, which are divided into m columns and n rows of grids respectively; X r , Y s is the specific value of the random variables X and Y, the rth value of the discretized X variable and the sth value of the discretized Y variable; D(X r ) represents the variable X r The probability distribution of D(Y s ) represents the variable Y s The probability distribution of D(X r ,Y s ) represents the variable X r and Y s The joint probability distribution of S22, Maximum Information Coefficient MIC: In formula (2), a and b represent the number of grid divisions in the X and Y directions respectively; B is a variable parameter set to the 0.6th power of the data amount.
3. According to claim 2, a method for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost is characterized in that: The features selected as having an important predictive role in the proportion of new energy include: the measured value of the bus voltage, the estimated value of the phase angle of the bus voltage, the reactive power of new energy and conventional energy at the current moment, the reactive power measured at the compensator, the total load active power and reactive power at the current moment, and the measured values of active and reactive power at the high, medium and low ends of the transformer.
4. According to claim 3, a method for predicting the proportion of new energy power generation in a power system based on xLSTM and XGBoost is characterized in that: The IPCA model used is: Dataset: A centered =A-μ (3); Covariance matrix: Update the covariance matrix: Eigendecomposition: S=QΛQ T (6); projection: A reduced =A reduced W (7); In formulas (3) to (7), A is the original data matrix, i.e., the data of the preprocessed data set, including feature columns and new energy proportion columns; μ is the mean vector of each feature, indicating that each column of data is averaged; A centered is the centered data matrix, with the mean value subtracted from each feature; Σ new is the updated covariance matrix, which represents the comprehensive covariance of the current data batch and the existing data; Σ old is the covariance matrix of historical data, i.e. the first N old The covariance of samples; Σ batch is the covariance matrix of the current batch of data, calculated in the same way as in standard PCA, N old is the number of samples of historical data; N new is the number of samples in the current batch of data; N is the number of samples; Q is the eigenvector matrix of the covariance matrix; Λ refers to the diagonal matrix, containing the eigenvalues; Q T is the transposed matrix of Q; X reduced is the data matrix after dimensionality reduction; W is the projection matrix composed of the first k principal component eigenvectors, and the superscript T represents the transpose of the matrix.
5. According to claim 4, a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost is characterized in that: The xLSTM is composed of an sLSTM followed by an mLSTM stacked in series: The sLSTM used is: Cell state: c t =f t ⊙c t-1 +i t ⊙z t ; Normalized state: n t =f t ⊙n t-1 +i t ; Hidden state: Candidate cell states: Input Gate: Forget Gate: or Output Gate: x t is the input data of the current time step, t is the current time step; h t-1 is the hidden state of the previous time step; c t ,c t-1 is the cell state at the current and previous time steps; n t ,n t-1 is the normalized state of the current and previous time steps; f t ,i t ,o t is the output of the forget gate, input gate, and output gate; z t is the candidate cell state; w i ,w f ,w o ,w z is the weight matrix of the input gate, forget gate, output gate and candidate cell state; r i ,r f ,r o ,r z is the recursive weight matrix of the input gate, forget gate, output gate, and candidate cell state; b i ,b f ,b o ,b z is the bias term of the input gate, forget gate, output gate and candidate cell state; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; the superscript T indicates the transpose of the matrix; The mLSTM used is: Cell Status: Normalized state: n t =f t ⊙n t-1 +i t ; Hidden state: The attention mechanism of mLSTM includes: Query vector: q t =W q x t +b q ; Key vector: Value vector: v t =W v x t +b v ; Input gate: i t =exp(w i T x t +b i ); Forget Gate: or Output Gate: x t is the input data of the current time step; h t ,h t-1 is the hidden state of the current and previous time step; c t ,c t-1 is the cell state at the current and previous time steps; n t ,n t-1 is the normalized state of the current and previous time steps; q t ,k t ,v t are the query, key, and value of the attention mechanism; W q ,W k ,W v ,w i ,w f ,w o is the weight matrix of query vector, key vector, value vector, input gate, forget gate and output gate; b q ,b k ,b v ,b i ,b f ,b o is the bias term of the query vector, key vector, value vector, input gate, forget gate, and output gate; f t ,i t ,o t is the output of the forget gate, input gate and output gate; σ, φ, exp are activation functions; ⊙ is the Hadamard product, which means element-wise multiplication; the superscript T represents the transpose of the matrix; The XGBoost model used is: In formulas (8) to (11), is the loss function, y i refers to the true value of the i-th sample, refers to the predicted value of the i-th sample, Ω(f k ) refers to the regularization term, T refers to the number of leaf nodes, and w j The jth leaf node weight, γ leaf node penalty coefficient, limit the complexity of the tree, λ regularization coefficient, The predicted value of the τth round, f τ (ξ i ) The output of the decision tree constructed in the τth round, ξ i is the input feature vector of the i-th sample.
6. According to claim 5, a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost is characterized in that: The HEOA model used is: In formula (12), W λ Indicates the weight of the λth model. When λ=1, it represents the xLSTM model, and when λ=2, it represents the XGBoost model. is the position of the λth individual in the ω+1 generation; β is the adaptive factor; ω is the number of current iterations; Max iter is the maximum number of iterations; represents the average position of the population in the ωth generation; W best is the current optimal solution; Levy(dim) represents the Levy flight distribution, which introduces randomness; f jump is the jump factor rand is a random number between [0,1].
7. According to claim 1, a method for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, characterized in that: The method of processing missing values by spline interpolation includes: S11, spline function: S p (u)=a p +b p (u-u p )+c p (u-u p ) 2 +d p (u-u p ) 3 (13); S12, interpolation point consistency: WITH p (in p+Δp )=S p+Δp (in p+Δp ) (14); S13, first-order derivative continuity: WITH p '(in p+Δp )=S p+Δp '(in p+Δp ) (15); S14, Second-order derivative continuity: WITH p "(in p+Δp )=S p+Δp "(in p+Δp ) (16); In formulas (13) to (16), u is the independent variable of interpolation, [u p ,u p+Δp ] are two data points in the missing interval, u p and u p+Δp is the horizontal coordinate of two adjacent known data points, S p (u) is the corresponding interval [u p ,u p+Δp ] interpolation function, a p ,b p ,c p ,d p is the unknown coefficient to be determined, S p (u p+Δp ) is the pth spline function S p (u) at node u p+Δp The value at S p+Δp (u p+Δp ) is the p+Δpth spline function S p+Δp (u) at node u p+Δp The value at .
8. A device for predicting the proportion of renewable energy power generation in a power system based on xLSTM and XGBoost, characterized in that: The device comprises: processor; a memory having stored thereon a computer program executable on the processor; Wherein, when the computer program is executed by the processor, the steps of a method for predicting the proportion of new energy power generation in an electric power system based on xLSTM and XGBoost as described in any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Power load prediction method for realizing error correction mechanism based on LSTM-XGBoost
CN116739118A
Construction and prediction method of carbon emission prediction model based on Stacking algorithm and medium
CN115860173A
Hybrid deep learning-based photovoltaic power generation prediction method and device, and storage medium
CN118554433A
Cited By
Bearing bush gap regulation and control method based on LSTM-XGB integrated prediction model
CN121743856A