Pumped storage attribution method and system based on dynamic constraint and composite LSTM model
By combining dynamic constraints and a composite LSTM model with switching expert and coefficient regression expert models, the problem of high-precision quantitative attribution of pumped storage power sources was solved, realizing dynamic and quantitative analysis and physical constraints of pumped power, and supporting the carbon footprint assessment of pumped storage power stations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-03
AI Technical Summary
Existing technologies cannot provide a pumped storage power source attribution scheme that can simultaneously meet the requirements of high accuracy and quantitative interpretability. Traditional methods have unstable regression coefficients, machine learning models cannot provide quantitative attribution, and pumping behavior data is sparse and the model is prone to producing false attributions.
We employ a dynamic constraint and composite LSTM model, including a switching expert model and a coefficient regression expert model, and use a dynamic masking mechanism to address the problems of undertraining and spurious attribution, thereby achieving dynamic coefficient regression.
It enables dynamic and quantitative attribution of the sources of pumped hydro power generation, meets physical constraints and interpretability, accurately assesses the carbon footprint of pumped storage power stations, and supports full life cycle carbon footprint assessment.
Smart Images

Figure CN121786787A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of energy system modeling and artificial intelligence algorithm technology, and relates to a pumped storage energy attribution method and system based on dynamic constraints and composite LSTM model. Background Technology
[0002] The penetration rate of new energy sources, such as wind, solar, and hydropower, in the power grid is rapidly increasing. Pumped storage power stations, as the most mature and economical large-scale energy storage technology currently available, are key to building new power systems. Pumped storage power stations utilize surplus grid power to pump water during off-peak hours and release it to generate electricity during peak hours. However, their carbon footprint depends to some extent on the source of the electricity used for pumping. If the pumping primarily consumes surplus renewable energy power, the carbon footprint of the pumping portion is very low; conversely, if it consumes thermal power, the carbon footprint of the pumping portion is higher. Therefore, to accurately assess the true carbon footprint of pumped storage power stations, a technical method capable of dynamically and quantitatively analyzing the source of the pumping power is urgently needed.
[0003] However, there is currently a lack of dynamic and quantitative analysis methods for the sources of pumped hydro power in this field. Existing related research mainly focuses on power consumption prediction, but when these methods are applied to the specific goal of quantitative analysis, the following technical defects exist: (1) Traditional statistical methods, represented by multiple linear regression and its derivatives, can formally establish a linear relationship between the output of each energy source and the pumping power to provide regression coefficients. However, the power dispatch system is a highly complex system, which leads to the instability of the regression coefficients of the multiple linear regression model, making it impossible to use for accurate source attribution. (2) Although models represented by machine learning and deep learning can show good results in power prediction, they are essentially "black box" models. The design goal of these models is prediction, and they cannot provide quantitative attribution coefficients in terms of interpretability, that is, they cannot quantitatively give the specific contribution value or contribution rate of each energy source to the pumping power. This series of models can only give vague feature importance, which is ineffective for the carbon footprint accounting goal that requires quantitative calculation. (3) Pumped storage pumping behavior data is sparse and highly scarce in the annual data, exhibiting zero expansion characteristics. Pumped storage pumping data is generated by two different mechanisms: pumping decision and pumping volume, two heterogeneous tasks. Existing standard regression models are prone to undertraining on this type of data, resulting in overlapping model capabilities and lack of practical value. (4) Existing model architectures are difficult to meet the physical constraint of "zero output and zero contribution". The models are prone to producing false attribution phenomena that violate physical reality, that is, incorrectly attributing a non-zero contribution coefficient to an energy source with zero output.
[0004] In summary, existing technologies cannot provide a pumped storage power source attribution scheme that can simultaneously satisfy high accuracy and quantitative interpretability. There is an urgent need in this field for a new data-driven modeling architecture to fill this technological gap. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a pumped storage attribution method and system based on dynamic constraints and a composite LSTM model. By designing a composite LSTM model to perform dynamic coefficient regression of pumped power composition, the composite network includes two expert models: coefficient regression and switching prediction. The knowledge of the switching expert model is used to solve the problem of insufficient training of the coefficient regression expert model on zero-inflation data, thereby improving the regression accuracy. In addition, a dynamic masking mechanism is introduced to specify the physical constraint of "zero output and zero contribution".
[0006] To achieve the above objectives, the present invention provides the following technical solution: A pumped storage attribution method based on dynamic constraints and a composite LSTM model, the method specifically includes the following steps: S1. Constructing a dataset: Obtain historical operating data of the power grid where the target pumped storage power station is located. This operating data includes at least the output time series of multiple energy sources and the pumping power time series of the pumped storage power station. (The last sentence appears to be incomplete and possibly refers to a separate step.) The multi-energy output vector is denoted as The pumping power at the corresponding moment is recorded as The form obtained is The dataset was cleaned and standardized, and then divided into training and testing sets in chronological order. S2. Constructing a Composite LSTM Model: Using a Long Short-Term Memory (LSTM) network as the backbone, construct a switching expert model and a coefficient regression expert model. The backbone includes at least one layer of LSTM network for temporal encoding of the historical state sequence input in the form of a time window, and outputs a hidden temporal tensor representation. A parallel configuration is set on top of the hidden time-series tensor: a switch classifier is used to determine pump start / stop, which outputs the probability of pump start. As a regressor for analyzing the source of electricity, it is used to output the time of each energy source. Contribution coefficient vector The coefficient regression expert model incorporates a dynamic masking mechanism. S3. Training the switch expert model: The input feature sequence constructed according to the time window is fed into the LSTM backbone network to obtain the hidden temporal tensor representation. This is then mapped by a multilayer perceptron (MLP) to the logarithmic probability of starting pumping. During the training phase, a binary cross-entropy loss function based on log odds is used. Pump start / stop label Supervised learning was conducted to obtain an expert model of the pumping system that can characterize when the pumping starts and stops. S4. Train a coefficient regression expert model and introduce dynamic constraints: in the dataset In this process, only samples satisfying the condition that the pumped power is greater than zero are selected to form a coefficient regression training subset. This training subset is then fed into a Long Short-Term Memory (DM-LSTM) network with a dynamic masking mechanism and its subsequent MLP regression head, outputting the original contribution coefficient vectors of each energy source. And obtain the nonnegative coefficient vector through a nonnegative activation function. During the forward propagation process, a multi-energy real-time output vector is introduced. The dynamic masking mechanism for input is based on a preset physical threshold. Determine the output of each energy source and construct a mask matrix. And perform element-wise operations to obtain the masked contribution coefficient vector, and then use... L The 2-norm penalizes "zero output and non-zero contribution", thereby adjusting the energy contribution coefficient of zero output to zero during the training and inference phases to meet the physical constraint of "zero output and zero contribution". S5. Attribution of pumping power sources based on two expert models: During the testing phase, the time window features of the test set are fed into the switch expert model via the LSTM backbone to obtain the pumping start probability. The pumping gating factor is obtained by threshold discrimination. Simultaneously, the test set features are fed into a coefficient regression expert model and a dynamic masking mechanism to obtain the masked contribution coefficients. And the corresponding multi-energy output vector at that moment A linear combination is performed to obtain the predicted pumping power; then, the combination is further enhanced by the gating factor of the switching expert to obtain the final predicted pumping power, and the contribution of each energy source to the pumping power is determined accordingly. Or, the contribution rate can be dynamically and quantitatively attributed.
[0007] Furthermore, in step S1, the cleaning of the dataset includes: outlier detection on the multi-energy output time series and the pumping power time series, and correction and imputation of outliers and missing values using linear interpolation; the standardization adopts the Z-Score standardization method, applying Z-Score to each feature dimension of the dataset. Transform using the following formula:
[0008] in This is the mean of the feature on the training set. denoted as the standard deviation of this feature on the training set.
[0009] Furthermore, in step S1, the training set and the test set are divided according to time order, with a sample size ratio of 8:2, and the time order is not disrupted to avoid leakage of future information in the prediction of pumping behavior.
[0010] Furthermore, in step S2, the dynamic masking mechanism includes a dynamic mask vector. The Each component Defined by the following formula:
[0011] in, For a moment No. The output value of this energy source A preset physical threshold close to zero is used to define the state of "zero output" or "near-zero output".
[0012] Furthermore, in step S2, the last layer of the coefficient regression expert model uses the Sigmoid function to normalize the original coefficients, thus normalizing the contribution coefficients of each energy source. Falling Within the range, to improve the physical interpretability of the attribution results.
[0013] Furthermore, in step S3, the switch expert model uses a weighted binary cross-entropy loss function with log-odds input as the loss function during the training phase. Supervised training is performed on the pumping start and stop samples; during the inference phase, the logarithmic odds of the output are transformed into the pumping start probability using the Sigmoid function, which is then used for subsequent gating.
[0014] .
[0015] Furthermore, in step S4, the coefficient regression expert model is trained only on a subset of samples where the pumping power or pumping electricity is greater than zero, in order to avoid interference from a large number of "zero pumping" samples on the learning of regression coefficients, thereby alleviating the zero expansion characteristic of pumping behavior data and improving regression accuracy and stability.
[0016] Furthermore, the DM-LSTM of the coefficient regression expert model incorporates a dynamic masking mechanism in the forward propagation, which ensures that during training and inference, the contribution coefficient of energy with output below a threshold is suppressed to zero in the network output in real time. In addition, L2 regularization is introduced during the training process, thereby enabling the neural network to learn the physical constraint of "zero output and zero contribution" and avoid spurious attribution.
[0017] Furthermore, in step S4, during the inference phase, the time window features of the period to be predicted are input into the shared LSTM and the switching expert model to obtain the time. The pumping start probability is determined and a pumping gating factor is formed by thresholding. Simultaneously, the characteristics of the same time window and the output vectors of multiple energy sources are input into the coefficient regression expert model and dynamic masking mechanism to obtain the masked contribution coefficients that meet the "zero output, zero contribution" constraint. These coefficients are then linearly combined with the output of various energy sources to obtain the sub-predicted pumping power. Subsequently, the pumping gating factor modulates the sub-predicted quantity to form the final predicted pumping power. The predicted quantity is then broken down by energy source to obtain the pumping power contribution and contribution rate of each energy source in the target time period, thereby achieving dynamic and quantitative attribution of the source of pumping power.
[0018] This invention also provides a pumped storage attribution system based on dynamic constraints and a composite LSTM model.
[0019] The beneficial effects of this invention are as follows: This invention provides a novel end-to-end dynamic coefficient regression model. This architecture uses the dynamic attribution coefficients themselves as the core regression variable, with coefficients as the target and power as the supervision, fundamentally solving the problem of "black box" models' inability to quantitatively attribute factors. Secondly, this invention decouples the tasks of whether to pump water and how much water to pump using a composite LSTM model, overcoming the accuracy problem of single LSTM regression models due to data scarcity, and enabling the model to accurately simulate the discontinuous behavior of pumping start-up and shutdown. Finally, this model introduces a dynamic masking mechanism into the coefficient regression expert model, imposing a "zero output, zero contribution" physical constraint on the neural network, effectively solving the spurious attribution problem of standard neural networks and ensuring the physical authenticity of the power contribution coefficients. The model designed in this invention provides dynamic power contribution coefficients that simultaneously satisfy physical constraints and quantitative interpretability, helping to accurately assess the true carbon footprint of pumped storage power stations. It provides data support for the full life-cycle carbon footprint assessment of pumped storage power stations and has certain academic value and application prospects.
[0020] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1This is a flowchart of the pumped storage attribution method and system based on dynamic constraints and composite LSTM model in this invention. Figure 2 This is a flowchart of the data preprocessing and feature engineering process in this invention; Figure 3 This is a structural diagram of the dynamic constraint and composite LSTM model in this invention; Figure 4 This is a schematic diagram of the dynamic masking mechanism in this invention; Figure 5 This is a partial time attribution result diagram using the Shandong pumped storage power station as an example in this invention. Detailed Implementation
[0022] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0024] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0025] The technical solution provided by this invention relates to a method and system for dynamically and quantitatively attributing the sources of pumped power in pumped storage power stations using artificial intelligence algorithms. More specifically, this invention relates to a data-driven composite LSTM deep learning model, used to effectively solve the technical problems of traditional models in the process of analyzing the sources of power in pumped storage power stations, such as the difficulty in explicitly embedding physical constraints, the sparsity of pumping behavior data, and the difficulty in quantitatively and interpretably analyzing the sources of power. The solution mainly includes the following steps: (1) Collect power data, including the output of wind power, photovoltaic power, hydropower, thermal power, etc., and the electricity used for pumping. After cleaning the raw data, including using linear interpolation to correct outliers and fill missing values, and standardizing the data, the dataset is divided into training and testing sets according to time, with a ratio of 8:2. The dataset D can be represented as: (1) in x T for T Real-time output data of each energy source y T for T The amount of electricity used for pumping water at all times.
[0026] Data standardization uses the Z-Score method, and the calculation formula is as follows: (2) in The mean, Let Variance be the variance.
[0027] (2) Construct a composite LSTM model based on dynamic constraints. The composite LSTM model consists of a switch expert LSTM model and a coefficient regression expert LSTM model. The coefficient regression expert LSTM model needs to introduce a dynamic masking mechanism for physical constraints.
[0028] (3) The switch expert model is used to learn from the data when to turn on and off pumping. The model structure consists of a long short-term memory network (LSTM) and a multilayer perceptron (MLP). LSTM extracts time features, and MLP integrates features to output the log odds logits at the pumping switch time. During training, the log odds logits directly participate in the weighted binary cross-entropy loss function. During inference, the log odds first pass through the Sigmoid layer to obtain a non-negative probability between 0 and 1, which participates in the subsequent prediction of pumping power.
[0029] (4) The coefficient expert model is used to learn the physical contribution coefficients of each energy source at time t from the data. To solve the problem of uneven data distribution, the model is only trained on data with pumping power greater than zero, avoiding contamination by the majority of zero data. The model structure consists of a Long Short-Term Memory Network (DM-LSTM) based on a dynamic masking mechanism and a Multilayer Perceptron (MLP). To output the contribution ratio, a Sigmoid function is introduced in the last layer of the model, allowing the model to output the energy contribution coefficients. The dynamic masking mechanism identifies zero-output energy and adjusts zero-output energy to zero contribution during training.
[0030] (5) After the two expert models are trained, the energy output contribution rate is regressed using the test set data, and the pumping start probability is obtained based on the switch expert. The pumping gating factor is obtained by threshold discrimination. Energy contribution rate predicted by coefficient experts C i The final pumping power can be obtained, and its calculation formula is as follows.
[0031] (3) in, For a moment t Predicted pumping power, For a moment t The energy contribution coefficient obtained from the expert model regression. For a moment t No. i Energy output.
[0032] In this embodiment, Figure 1 This is a flowchart illustrating the pumped storage attribution method and system flow based on dynamic constraints and a composite LSTM model, as shown below. Figure 1 As shown, this method specifically includes the following: S1. Obtain raw hourly data on pumping power, wind power, photovoltaic power, hydropower, thermal power, etc., and preprocess the power data.
[0033] In step S1, the power data undergoes preprocessing and feature engineering construction. See the detailed process below. Figure 2 The process includes the following steps: For missing values in the data, linear interpolation is used to fill in the missing values by using data points from adjacent time points. The calculation formula is shown in equation (4). For outliers in the data, the Z-Score method is used. When the absolute value of the Z-Score is... If the value is greater than 3, the data point is considered an outlier and is removed.
[0034] (4) In the formula For a moment t The i Input variables x .
[0035] To enable subsequent expert models to capture temporal features, feature engineering is performed on the input data, including time feature extraction and window feature extraction. The time features extract the month, day, and hour data, and use sine and cosine coding to encode the time, eliminating false boundaries caused by numerical jumps. This helps the subsequent expert LSTM model understand the cyclical features of time. The sine and cosine coding is shown in equations (5) and (6). In window feature extraction, a sliding time window is used, and the historical window length is set to... w , will be the moment t Previous w Historical data is reconstructed into a feature matrix. , used as the dynamic contribution coefficient for predicting time t, can be represented by equation (7).
[0036] (5) (6) (7) In the formula, express Moment f 3D feature vectors f This represents the number of input features after preprocessing. Indicates time t The feature variables used as input to the model have a dimension of [dimensionality missing]. w × f .
[0037] To stabilize the training process and prevent the model from producing unstable outputs due to certain extreme variables, the preprocessed data is standardized for all input variables. Z-Score standardization is performed, and the formula is shown in Equation (8). After preprocessing and standardization, in order to objectively evaluate the generalization ability of the model, the preprocessed time series samples are divided into training set and test set according to time order, of which 80% is used for model training and 20% is used for model evaluation.
[0038] (8) S2. Constructing a composite LSTM model: This model decouples the dynamic coefficient regression problem into two independent tasks: pumping station prediction and contribution coefficient regression. Two expert models are used to model these two tasks. Specifically, both expert models use LSTM as the feature extraction backbone, and a classification MLP network is used to complete the station prediction task, while a regression MLP is used to complete the coefficient regression task. LSTM is designed to solve the gradient vanishing and gradient explosion problems inherent in standard recurrent neural networks when processing long sequences. It can capture long-term dependencies in time series data and can be used to simulate the scheduling analysis of pumped storage power stations with strong time inertia. An LSTM unit consists of a forget gate, an input gate, and an output gate. The input gate determines how much information is updated at the current time t, the forget gate controls the proportion of information to be retained or discarded in the memory of the previous time step, and the output gate determines which information of the current state is passed to the next time step. Its calculation process is shown in Equation (9).
[0039] (9) In the formula, , , These represent the input gate, forget gate, and output gate, respectively. This represents the Sigmoid function. , For learnable weight matrix, For bias.
[0040] An LSTM network consists of multiple LSTM units, and its output is a feature vector containing time series information. Then the feature vector The data will be processed through a task header network composed of a multilayer perceptron (MLP) to complete the pump switch classification and contribution factor regression tasks, as shown in Equation (10). Specifically, for the regressed contribution factors... It will then be used to calculate the pumping power consumption, and then compared with the actual pumping power consumption to calculate the loss.
[0041] (10) S3. Introducing a Dynamic Masking Mechanism: After constructing the composite LSTM model, a dynamic masking mechanism is introduced into the coefficient regression expert model to impose physical constraints on the model, ensuring "zero output and zero contribution," thereby eliminating spurious attributions caused by model free fitting. See [link / reference] Figure 3 The coefficient regression expert model accepts two inputs. and , The input feature variables are obtained through feature engineering. For a moment t The real-time energy output vector is used for mask generation. First, based on... Construct a mask : (11) in A near-zero physical threshold is used to define near-zero output. Then, a mask is applied element-wise to the output of the coefficient expert regression model to obtain the masked contribution factor at time [time value missing]. t The output of a certain energy source is less than a threshold. When the corresponding contribution is forced to 0, the output will then participate in the LOSS calculation, allowing the coefficient expert model to gradually learn the physical constraint rules.
[0042] (12) In the formula, The contribution factor after applying physical constraints. Figure 4 This is a schematic diagram of the dynamic masking mechanism in this invention.
[0043] S4. Training and Evaluation of the Composite Expert Model. In step S4, the switch expert model and the coefficient expert model are trained under supervision. Both models use the Adam optimizer and mini-batch gradient descent to update their parameters. The input is the representation vector obtained from the historical state window in step S1.2 through feature engineering. and real-time output for physical constraints. .
[0044] The switch expert model outputs log odds. Water pump switch probability The loss is calculated using weighted BCE to address class imbalance, and the formula is shown in equation (13).
[0045] (13) In the formula, For switch labels, and B represents the class weights, and B represents the number of training batches.
[0046] Coefficient experts output raw coefficients and after applying physical constraints The predicted pumping power can be obtained from and get See Equation (14). The main loss adopts Huber loss, see Equation (15), which can effectively suppress the influence of outliers on model training; in order to enable the model to learn physical consistency, physical consistency regularization Loss is introduced, see Equation (16), and L2 norm is used to penalize "zero output contributes", so that the model learns the physical constraint.
[0047] (14) (15) (16) In the formula, , These represent the predicted pumping power and the actual pumping power, respectively. For the balance threshold, , These represent the main Huber loss and the physical consistency loss, respectively.
[0048] In step S4, after training is complete, the test set needs to be evaluated using both expert models. The evaluation metric is Ri. 2 MAE and MSE measure the difference between the pumping power calculated from the regression coefficients and the actual pumping power, thus judging the generalization ability of the model. The final pumping power predicted by the combined two models is: Then, based on the actual amount of water pumped... For reference, relevant evaluation indicators are calculated, and the specific formulas are shown in equations (18), (19), and (20).
[0049] (17) (18) (19) (20) In the formula, N For the total time step, This represents the average amount of electricity actually used for pumping water. MAE, MSE, R 2 The three are used together to determine the generalization ability of composite experts to unseen samples and the numerical stability under physical consistency.
[0050] In this embodiment, to better explain the model construction method described herein, the following uses the 2024 dispatch data of the Shandong power grid as an example to illustrate the specific implementation of the present invention. This example constructs a composite LSTM network model to analyze the source of pumped power generation from pumped storage power stations, providing data reference for the full life-cycle carbon emissions of pumped storage power stations in Shandong.
[0051] The implementation process of this invention is as follows: (1) Data collection and division: Collect pumping power on a 1-hour scale and the active power output time series of wind power, photovoltaic power, hydropower, thermal power, etc. of Shandong power grid during the same period to form an energy output vector. First, all types of data are aligned according to time. For obviously missing values, linear interpolation is used. The Z-Score method is used to identify and propose outliers. On this basis, a complete unified data table for 2024 is constructed and standardized. The training set and test set are divided in an 8:2 ratio. (2) Feature engineering and sample construction: First, the time features of year, month, day and hour are extracted and sine and cosine coding is performed. Then, a historical state sliding window with a time step of W=6 is set. The sliding window slides point by point on the training set according to time to form a sample set. Among them, the pump switch status label The pumping power label is obtained by checking if the pumping power is greater than zero. Assuming that the power remains constant within 1 hour, the result is obtained through integration. (3) Construction of the composite LSTM model: The composite LSTM model consists of a switching expert model and a coefficient expert model. The feature extraction backbone network uses 4 layers of LSTM units, and the number of hidden units is set to 64. After the feature input is given, the LSTM will output the hidden state vector at the prediction time. h t The switch expert model uses a two-layer linear unit MLP network as the classification head, and stores the hidden state vectors... h t The probability of pumping starting is mapped to the logarithmic probability of pumping starting, and the probability of pumping starting is obtained through the Sigmoid function. The coefficient expert model uses a 4-level linear unit MLP regression head to... h t The data is mapped to a multi-energy contribution coefficient vector, and then processed by Sigmoid to obtain non-negative contribution factors. Subsequently, during the forward propagation, the real-time output vectors of various power sources in the Shandong power grid are combined. Apply dynamic mask physical constraints and calculate the coefficients after masking. (4) Model Training and Parameter Selection: During the training phase, supervised learning was conducted for both the switch expert and the coefficient expert in this embodiment. The loss function for the switch expert was weighted BCE. To address the imbalance in the proportion of pumping operation / shutdown samples in the Shandong power grid, a class weight factor was introduced to correct the class imbalance. The main loss for the coefficient expert was Huber loss to enhance robustness to abnormal samples; a physical consistency regularization term was also introduced. Applying a residual coefficient to the masked power Norm penalty causes the coefficient of zero-output energy to shrink to zero during training. Both experts are trained using the Adam optimizer and mini-batch gradient descent, with an initial learning rate of 0.001. (5) Test set evaluation and analysis of pumping power source: After training, the composite expert model is evaluated using an independent test set. For each test sample time... The probability of pumping operation is obtained through switch experts. Select a threshold based on the validation set. Achieve hard gating and obtain the opening decision. The coefficient vector after masking is obtained through coefficient experts. and with real-time energy output vector Calculate the inner product to obtain the predicted pumping power. By combining decision-making and coefficient prediction, the final composite predicted pumping power is obtained. .Will Compared with the measured pumping power Compare and calculate the coefficient of determination. The generalization performance of the model in the Shandong power grid scenario is quantitatively evaluated using metrics such as mean absolute error (MAE) and mean square error (MSE).
[0052] The prediction and attribution results are shown below. Figure 5 , Figure 5 The data shows the attribution of power generation for pumped storage power stations in Shandong Province from November 1st to November 8th, 2024. The pumped power generated by these stations primarily comes from renewable energy sources such as wind and solar power, while hydropower output was zero during the indicated period, resulting in an attribution of zero and strictly adhering to the physical constraint of "zero output and zero contribution." This result indicates that the pumped storage power stations' operational strategy prioritizes utilizing surplus renewable energy from the grid for pumping, which helps reduce wind and solar power curtailment.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A pumped storage energy attribution method based on dynamic constraints and a composite LSTM model, characterized in that, The method specifically includes the following steps: S1. Constructing a dataset: Obtain historical operating data of the power grid where the target pumped storage power station is located. This operating data includes at least the output time series of multiple energy sources and the pumping power time series of the pumped storage power station. (The last sentence appears to be incomplete and possibly refers to a separate step.) The multi-energy output vector is denoted as The pumping power at the corresponding moment is recorded as The form obtained is The dataset was cleaned and standardized, and then divided into training and testing sets in chronological order. S2. Constructing a Composite LSTM Model: Using a Long Short-Term Memory (LSTM) network as the backbone, construct a switching expert model and a coefficient regression expert model. The backbone includes at least one layer of LSTM network for temporal encoding of the historical state sequence input in the form of a time window, and outputs a hidden temporal tensor representation. A parallel configuration is set on top of the hidden time-series tensor: a switch classifier is used to determine pump start / stop, which outputs the probability of pump start. As a regressor for analyzing the source of electricity, it is used to output the time of each energy source. Contribution coefficient vector The coefficient regression expert model incorporates a dynamic masking mechanism. S3. Training the switch expert model: The input feature sequence constructed according to the time window is fed into the LSTM backbone network to obtain the hidden temporal tensor representation. This is then mapped by a multilayer perceptron (MLP) to the logarithmic probability of starting pumping. During the training phase, a binary cross-entropy loss function based on log odds is used. Pump start / stop label Supervised learning was conducted to obtain an expert model of the pumping system that can characterize when the pumping starts and stops. S4. Train a coefficient regression expert model and introduce dynamic constraints: in the dataset In this process, only samples satisfying the condition that the pumped power is greater than zero are selected to form a coefficient regression training subset. This training subset is then fed into a Long Short-Term Memory (DM-LSTM) network with a dynamic masking mechanism and its subsequent MLP regression head, outputting the original contribution coefficient vectors of each energy source. And obtain the nonnegative coefficient vector through a nonnegative activation function. During the forward propagation process, a multi-energy real-time output vector is introduced. The dynamic masking mechanism for input is based on a preset physical threshold. Determine the output of each energy source and construct a mask matrix. And perform element-wise operations to obtain the masked contribution coefficient vector, and then use... L The 2-norm penalizes "zero output and non-zero contribution", thereby adjusting the energy contribution coefficient of zero output to zero during the training and inference phases to meet the physical constraint of "zero output and zero contribution". S5. Attribution of pumping power sources based on two expert models: During the testing phase, the time window features of the test set are fed into the switch expert model via the LSTM backbone to obtain the pumping start probability. The pumping gating factor is obtained by threshold discrimination. Simultaneously, the test set features are fed into a coefficient regression expert model and a dynamic masking mechanism to obtain the masked contribution coefficients. And the corresponding multi-energy output vector at that moment A linear combination is performed to obtain the predicted pumping power; then, the combination is further refined using the gating factor of a switching expert to obtain the final predicted pumping power, and the contribution of each energy source to the pumping power is determined accordingly. Or, the contribution rate can be dynamically and quantitatively attributed.
2. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 1, characterized in that, In step S1, the cleaning of the dataset includes: outlier detection on the multi-energy output time series and pumping power time series, and correction and imputation of outliers and missing values using linear interpolation; the standardization adopts Z-Score standardization, applying Z-Score to each feature dimension of the dataset. Transform using the following formula: in This is the mean of the feature on the training set. denoted as the standard deviation of this feature on the training set.
3. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 2, characterized in that, In step S1, the training set and the test set are divided in chronological order, with a sample size ratio of 8:2, and the chronological order is not disrupted to avoid leakage of future information in the prediction of pumping behavior.
4. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 3, characterized in that, In step S2, the dynamic masking mechanism includes a dynamic mask vector. The Each component Defined by the following formula: in, For a moment No. The output value of this energy source A preset physical threshold close to zero is used to define the "zero output" or "near-zero output" state.
5. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 4, characterized in that, In step S2, the last layer of the coefficient regression expert model uses the Sigmoid function to normalize the original coefficients, thus normalizing the contribution coefficients of each energy source. Falling Within the range, to improve the physical interpretability of the attribution results.
6. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 5, characterized in that, In step S3, the switch expert model uses a weighted binary cross-entropy loss function with log odds input as the loss function during the training phase. Supervised training is performed on the pumping start and stop samples; during the inference phase, the logarithmic odds of the output are transformed into the pumping start probability using the Sigmoid function, which is then used for subsequent gating. In the formula, For switch labels, and B represents the class weights, and B represents the number of training batches.
7. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 6, characterized in that, In step S4, the coefficient regression expert model is trained only on a subset of samples where the pumping power or pumping electricity is greater than zero, in order to avoid interference from a large number of "zero pumping" samples on the learning of regression coefficients, thereby alleviating the zero expansion characteristic of pumping behavior data and improving regression accuracy and stability.
8. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 7, characterized in that, The DM-LSTM of the coefficient regression expert model incorporates a dynamic masking mechanism in the forward propagation, which suppresses the contribution coefficient of energy with output below a threshold to zero in real time during training and inference. In addition, L2 regularization is introduced during the training process, so that the neural network learns the physical constraint of "zero output and zero contribution" and avoids spurious attribution.
9. The pumped storage attribution method based on dynamic constraints and a composite LSTM model according to claim 8, characterized in that, In step S4, during the inference phase, the time window features of the period to be predicted are input into the shared LSTM and the switching expert model to obtain the time. The pumping start probability is determined and a pumping gating factor is formed by thresholding. Simultaneously, the characteristics of the same time window and the output vectors of multiple energy sources are input into the coefficient regression expert model and dynamic masking mechanism to obtain the masked contribution coefficients that meet the "zero output, zero contribution" constraint. These coefficients are then linearly combined with the output of various energy sources to obtain the sub-predicted pumping power. Subsequently, the pumping gating factor modulates the sub-predicted quantity to form the final predicted pumping power. The predicted quantity is then broken down by energy source to obtain the pumping power contribution and contribution rate of each energy source in the target time period, thereby achieving dynamic and quantitative attribution of the source of pumping power.
10. A pumped storage attribution system based on dynamic constraints and a composite LSTM model, characterized in that, The system employs the method described in any one of claims 1 to 9.