Power grid abnormal situation awareness method and system
By constructing a two-layer gated recurrent neural network model based on attention mechanism, the accuracy problem of grid situation prediction is solved, and higher prediction accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202411728223.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
AI Technical Summary
It is difficult for the prior art to accurately predict the operating trend of the power grid, especially when the uncertainty and volatility caused by new energy access increases, it is difficult for traditional prediction models to obtain accurate results.
Using a deep learning framework, a prediction model of a two-layer gated recurrent neural network based on attention mechanism is constructed. By obtaining power grid data in real time, situation evaluation indicators are calculated, abnormal indicators are empowered and corrected, and the model is trained to predict future situation evaluation values.
It improves the accuracy and reliability of grid situation prediction, can more effectively capture the contribution of input features, dynamically adjust the weight of important features, and thus achieve accurate prediction of the future grid situation.
Smart Images

Figure CN119669965A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grids, and in particular to a method and system for sensing abnormal situations in power grids. Background Art
[0002] Against the backdrop of the rapid development of global information technology and industrial technology, power grids are widely present in the form of Internet data grids. The new power system based on new energy has become the main direction of transformation and upgrading of my country's power system. However, the new power grid based on new energy has brought significant uncertainty and volatility to the power grid due to the large-scale access of wind power and photovoltaic power. At the same time, the interconnection of global power grids has also increased the abnormal risks in operation, bringing challenges to the safe and stable operation of the power grid.
[0003] Grid situation awareness is one of the important factors to ensure the safe operation of the power system. It is usually divided into three stages: situation awareness, situation understanding, and situation prediction. Situation awareness refers to the collection and analysis of information such as power load, voltage, and current in the distribution network. Situation understanding refers to the analysis and diagnosis of the operation and problems of the distribution network, such as power failures and load imbalance, based on situation awareness. Situation prediction refers to the prediction of future power demand and power failures based on situation understanding by using machine learning, data mining and other technologies.
[0004] The abnormal situation awareness of power grid detects the system operation status parameters in real time and conducts comprehensive analysis and evaluation of the data to predict and handle abnormal conditions that may occur in the future, ensuring the safe and stable operation of the power system. Although domestic and foreign scholars have conducted a lot of research on the real-time operation status evaluation index system of power grids, some index systems are out of touch with reality and difficult to apply. A reasonable situation evaluation index structure is the key to the effectiveness of the evaluation system. Otherwise, it may lead to incorrect status evaluation. Therefore, it is urgent to propose a reasonable index structure system.
[0005] The operation status of the power grid is highly random and uncertain, and many factors often affect the results of the status assessment, which makes it difficult to obtain accurate prediction results using traditional prediction models. Therefore, it is urgent to propose an effective model for predicting the operation status of the power grid to achieve accurate prediction of abnormal power grid status. Summary of the invention
[0006] The technical problem to be solved by the present invention is as follows: In view of the above-mentioned problems in the prior art, a method and system for perceiving abnormal power grid situations are provided. By using a deep learning framework, a model for predicting power grid operation situations is constructed based on a double-layer gated recurrent neural network with an attention mechanism, thereby achieving better prediction effects and higher accuracy.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0008] A method for sensing abnormal power grid situation, comprising the following steps:
[0009] Acquire power grid data in real time and calculate different power grid situation assessment indicators;
[0010] Each power grid situation assessment indicator is weighted, and the weight of the abnormal indicator is corrected, and then all power grid situation assessment indicators are linearly weighted to obtain the situation assessment value;
[0011] Constructing a prediction model of a double-layer gated recurrent neural network based on an attention mechanism, the prediction model includes a cascaded first gated recurrent neural network, a second gated recurrent neural network, an attention layer, and an output layer, the prediction model takes historical data of power grid situation assessment indicators as input, and outputs a future situation assessment prediction value;
[0012] The prediction model is trained, and new historical data of the power grid situation assessment index is input into the trained prediction model to obtain corresponding future situation assessment prediction values, and the future situation assessment prediction values are matched with the pre-divided safety levels to determine whether an abnormality will occur.
[0013] Furthermore, the power grid situation assessment indicators include equipment safety indicators, specifically including:
[0014] Line load factor, expressed as follows:
[0015]
[0016] Where P i is the active power flow of line i, S i is the maximum transmission capacity of line i, n is the total number of lines, x 11,thre is the abnormal threshold value of line load rate;
[0017] Transformer load factor, expressed as follows:
[0018]
[0019] Where P a For the power system a The active power output of each transformer, S a For the a The rated capacity of each transformer, n0 is the total number of transformers in the system, x 12,thre is the abnormal threshold value of transformer load rate;
[0020] The line power flow margin is expressed as follows:
[0021]
[0022] In the formula, I iis the current value of line i, I i,lim is the thermal stability limit of line i, n is the total number of lines, x 13,thre is the abnormal threshold value of line power flow margin;
[0023] The stable section flow margin is expressed as follows:
[0024]
[0025] Where P s is the cross-sectional transmission power, P s,lim is the cross-sectional transmission limit, n s is the number of sections, n s It is the abnormal threshold value of the stable section tidal margin.
[0026] Furthermore, the power grid situation assessment indicators include system status indicators, specifically including:
[0027] Voltage margin, the expression is as follows:
[0028]
[0029] In the formula, m is the total number of buses in the system, U k,max is the maximum voltage allowed on the system bus k, U k,min is the minimum voltage allowed on the system bus k, U k is the current operating voltage of the system bus k. k is the voltage margin index value of bus k, x 21,thre is the voltage margin abnormal threshold value;
[0030] Frequency safety deviation rate, the expression is as follows:
[0031]
[0032] Where, f is the current operating frequency of the system, f N is the system rated frequency, Δf max is the maximum frequency deviation of the system operation;
[0033] Active reserve rate, the expression is as follows:
[0034]
[0035] Where P SR,lim Indicates the minimum limit of the system's active spinning reserve capacity, P SR is the total spinning reserve capacity of the system;
[0036] The abnormal load change rate is expressed as follows:
[0037]
[0038] Where η is the load abnormal change rate factor, P d-peak is the load peak value, V rise / drop Indicates the rate at which the load increases or decreases.
[0039] Furthermore, the power grid situation assessment indicators include power grid economic indicators, specifically including:
[0040] Line loss rate, the expression is as follows:
[0041]
[0042] Where P g is the active power generated by generator g, Q g is the reactive power generated by generator g, n5 is the total number of generators, P j is the active power flow of line j, Q j is the reactive power flow of line j, n is the total number of lines.
[0043] Furthermore, when weighting each power grid situation assessment indicator, the Critic objective weighting method is used to weight each power grid situation assessment indicator.
[0044] Furthermore, when correcting the weight of the abnormal indicator, it includes:
[0045] If the value of the current power grid situation assessment index exceeds the upper threshold or is lower than the lower threshold, the weight of the current power grid situation assessment index is corrected, and the expression is as follows:
[0046]
[0047] Among them, w i0 represents the objective weight value assigned to the current power grid situation assessment index using the Critic objective weighting method, x i It represents the dimensionless value of the current power grid situation assessment index.
[0048] Furthermore, the forward calculation formulas of the first gated recurrent neural network and the second gated recurrent neural network are as follows:
[0049] r t =σ(W r ·[h t-1 ,x t ])
[0050] z t =σ(W z ·[h t-1 ,x t ])
[0051]
[0052] In the formula, x t is the input of the current gated recurrent neural network; z t is the update gate; r t It is the reset gate; is the hidden layer state; h t is the hidden layer output, W r ,W z ,W h are the weight matrices corresponding to the reset gate, update gate, and hidden layer, respectively. σ and tanh are the sigmoid activation function and the hyperbolic tangent activation function respectively.
[0053] Furthermore, the attention layer takes the hidden layer output vector of the second gated recurrent neural network as input, first calculates the attention score formula to obtain the score at each moment, then uses the Softmax function to normalize the attention score to obtain the attention weight; then multiplies the attention weight at each moment by the hidden variable at the original moment to obtain the context vector at that moment; finally, the context vectors at each moment are concatenated and activated with the tanh function to obtain and output the attention vector, which is the probability distribution value of the attention mechanism for the hidden layer output vector.
[0054] Furthermore, when training the prediction model, the mean square error function is used as the loss function, and the Adam optimizer is used to train the model so that the loss function reaches the optimal solution.
[0055] The present invention also proposes a power grid abnormal situation awareness system, comprising a microprocessor and a computer-readable storage medium connected to each other, wherein the microprocessor is programmed or configured to execute any one of the power grid abnormal situation awareness methods.
[0056] Compared with the prior art, the advantages of the present invention are:
[0057] The present invention utilizes a deep learning framework to construct a model for predicting the operation status of a power grid based on a double-layer gated recurrent (GRU) neural network of an attention mechanism (Attention). The useful information in the input variables can be better utilized through the Attention mechanism to achieve a better prediction effect of the model, and the GRU reduces the input gates, forget gates, and output gates of the LSTM to two gates, namely, update gates and reset gates, so the GRU has fewer parameters and a faster convergence speed than the LSTM, and is easier to train. Therefore, the model constructed by the present invention uses a double-layer GRU model on the one hand to utilize the inherent connection between multi-step prediction tasks to improve the accuracy, and on the other hand, the features in the situation assessment system are selected based on the attention mechanism, so that the model can dynamically capture the contribution of each input feature and give higher weights to important features. Thus, the features in the power grid situation assessment index can be effectively learned to obtain its internal information and change rules, and the accuracy of predicting the future situation assessment value of the power grid is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 The figure is a flow chart of a method according to an embodiment of the present invention.
[0059] Figure 2 Schematic diagram of situation assessment security level classification in an embodiment of the present invention.
[0060] Figure 3 This is a model structure diagram of a double-layer gated recurrent neural network based on an attention mechanism in an embodiment of the present invention.
[0061] Figure 4 This is the structural diagram of the gated recurrent neural network.
[0062] Figure 5 This is the structural diagram of the attention mechanism. DETAILED DESCRIPTION
[0063] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0064] Before introducing the specific embodiments of the present invention, related concepts and terms are first explained.
[0065] Bucket effect: As long as there is an individual with an abnormal indicator in the operation of the power grid, the indicator depends on the most abnormal individual;
[0066] Average effect: When there are no abnormalities in all individual indicators in the power grid, the average value of the indicator is used to describe the corresponding indicator of the power grid.
[0067] Embodiment 1
[0068] This embodiment proposes a method for sensing abnormal power grid conditions, such as Figure 1 As shown, the following steps are included:
[0069] S1) Acquire power grid data in real time and calculate different power grid situation assessment indicators;
[0070] S2) weighting each power grid situation assessment indicator, correcting the weight of the abnormal indicator, and then linearly weighting all power grid situation assessment indicators to obtain a situation assessment value;
[0071] S3) constructing a prediction model of a double-layer gated recurrent neural network based on an attention mechanism, comprising a cascaded first gated recurrent neural network, a second gated recurrent neural network, an attention layer, and an output layer, wherein the prediction model takes historical data of power grid situation assessment indicators as input and outputs a future situation assessment prediction value;
[0072] S4) training the prediction model, and inputting new historical data of the power grid situation assessment index into the trained prediction model to obtain corresponding future situation assessment prediction values, and matching the future situation assessment prediction values with the pre-divided safety levels to determine whether an abnormality will occur.
[0073] Through the above steps, the present invention performs linear weighting on each indicator to obtain a situation evaluation based on the constructed power grid situation evaluation index system and corrects the weights of certain abnormal indicators. At the same time, a deep learning framework is used to construct a model for predicting the power grid operation situation based on a double-layer gated recurrent neural network with an attention mechanism. The future situation evaluation value is predicted through the historical data of the power grid situation evaluation index, and whether an abnormality will occur is determined according to the safety level of the future situation evaluation value, thereby achieving accurate prediction of abnormal power grid situation.
[0074] Each step is described in detail below.
[0075] In this embodiment, before step S1, a power grid situation assessment index system has been constructed based on 9 indicators in three aspects, namely, equipment safety, system status, and power grid economy, and the barrel effect and average effect criteria are followed to ensure the rationality of the structure, where:
[0076] 1. Equipment safety indicators include line load rate, transformer load rate, line power flow margin, and stable section power flow margin. Specifically:
[0077] The line load factor expression is as follows:
[0078]
[0079] Where P i is the active power flow of line i, S iis the maximum transmission capacity of line i, n is the total number of lines, x 11,thre It is the abnormal threshold value of line load rate. The larger the index value, the worse the security;
[0080] The transformer load factor expression is as follows:
[0081]
[0082] Where P a For the power system a The active power output of each transformer, S a For the a The rated capacity of each transformer, n0 is the total number of transformers in the system, x 12,thre It is the abnormal threshold value of transformer load rate. The larger the index value, the worse the safety;
[0083] The line power flow margin expression is as follows:
[0084]
[0085] In the formula, I i is the current value of line i, I i,lim is the thermal stability limit of line i, n is the total number of lines, x 13,thre is the abnormal threshold value of the line power flow margin. The larger the index value, the worse the safety;
[0086] The expression of stable section power flow margin is as follows:
[0087]
[0088] Where P s is the cross-sectional transmission power, P s,lim is the cross-sectional transmission limit, n s is the number of sections, n s It is the abnormal threshold value of the stable section tidal margin. The larger the index value, the worse the safety.
[0089] 2. System status indicators include voltage margin, frequency safety deviation rate, active reserve rate, and load abnormal change rate. Specifically:
[0090] Voltage margin can reflect the node reactive power reserve capacity of the overall static voltage safety level of the system, and the expression is as follows:
[0091]
[0092] In the formula, m is the total number of buses in the system, U k,max is the maximum voltage allowed on the system bus k, U k,minis the minimum voltage allowed on the system bus k, U k is the current operating voltage of the system bus k. k is the voltage margin index value of bus k, x 21,thre is the voltage margin abnormal threshold value;
[0093] The frequency safety deviation rate expression is as follows:
[0094]
[0095] Where, f is the current operating frequency of the system, f N is the system rated frequency, Δf max The maximum frequency deviation of the system operation is 0.2Hz in this embodiment. When the system receives disturbance, the frequency will deviate, which will affect the safety of the system operation. The larger the index, the worse the system safety;
[0096] The active reserve rate expression is as follows:
[0097]
[0098] Where P SR,lim represents the minimum limit of the system active spinning reserve capacity, which is taken as 10% of the system maximum load in this embodiment. SR The total rotating reserve capacity of the system. The active power in the system should retain an appropriate margin to ensure that the voltage and frequency of each central point can be maintained within the normal range under normal conditions and after an accident. The larger the index, the better the safety and stability of the system;
[0099] The expression of abnormal load change rate is as follows:
[0100]
[0101] Where η is the load abnormal change rate factor, P d-peak is the load peak value, V rise / drop Indicates the rate of load increase or decrease. The larger the index is, the greater the fluctuation of the system flow is, and the poorer the security of the system is.
[0102] 3. The power grid economic indicators specifically include one indicator, line loss rate, which is expressed as follows:
[0103]
[0104] Where P g is the active power generated by generator g, Q g is the reactive power generated by generator g, n5 is the total number of generators, P j is the active power flow of line j, Q j is the reactive power flow of line j, nis the total number of lines. The larger the index, the worse the economy.
[0105] Therefore, in step S1 of this embodiment, when acquiring power grid data in real time and calculating different power grid situation assessment indicators, the relevant parameter data in the aforementioned formulas are acquired in real time, and the indicator values of 9 indicators in three aspects, namely, equipment safety, system status, and power grid economy, are calculated according to the corresponding calculation formulas.
[0106] In step S2 of this embodiment, when weighting each power grid situation assessment indicator, specifically, the Critic objective weighting method is used to weight each power grid situation assessment indicator. Compared with traditional subjective weighting methods such as the analytic hierarchy process, the Critic objective weighting method is completely based on data calculation, does not require expert participation in weighting, and avoids errors caused by subjective preferences. The abnormal situation perception of the distribution network requires the analysis of data such as voltage, current, and power. The Critic objective weighting method measures the objective weight of the indicator by analyzing the comparative strength and conflict of different evaluation indicators. This makes the perception system more scientific when weighing the impact of multiple indicators and avoids distortion of abnormal situation perception results. When using the Critic objective weighting method to weight each power grid situation assessment indicator, the following steps are included:
[0107] S31) constructs the original indicator matrix. Assuming there are p evaluation indicators in total and each indicator has n data samples, the original indicator matrix is formed as follows:
[0108]
[0109] Among them, x np Represents the nth data sample of the pth indicator;
[0110] S32) Each indicator is dimensionally processed. The indicators defined in this embodiment are all cost indicators. After the indicator system indicators are calculated, the expression for dimensionally processing them is as follows:
[0111]
[0112] In the formula, x represents the current index, u represents the variance of the indicator, x m represents the mean value of the indicator;
[0113] S33) Express the indicator variability in the form of standard deviation:
[0114] The comparison strength between indicators is measured by standardized deviation, which is the difference in the values of the same indicator taken by each scheme. The larger the standard deviation corresponding to the indicator, the greater the change in its value, indicating that the indicator can reflect more information, the higher the indicator score, and the indicator should be given more weight.
[0115]
[0116] In the formula, S j represents the standard deviation of the j-th indicator, x ij Represents the i-th data sample of the j-th indicator.
[0117] S34) Calculation of index conflict:
[0118] The conflict between indicators is a kind of indicator conflict based on the correlation between indicators. If there is a strong positive correlation between two indicators, it means that the conflict between the two indicators is small. If the correlation between an indicator and other indicators is strong, it means that the inconsistency between it and other indicators is small, and it can reflect more information. To a certain extent, the evaluation strength of the indicator will be weakened, and the weight assigned should be reduced.
[0119]
[0120] In the formula, r ij Represents the correlation coefficient between evaluation indicators i and j.
[0121] S35) Information volume calculation:
[0122] The amount of information is determined by multiplying the indicator variability and the indicator conflict. The value obtained shows the importance of the evaluation indicator. The expression is as follows:
[0123]
[0124] S36) Objective weight calculation:
[0125] The specific values obtained by calculating the amount of information are used to obtain the objective weights of different indicators. The expression is as follows:
[0126]
[0127] Where W j Represents the objective weight of indicator j.
[0128] When some indicators of the power grid exceed the limit, that is, a certain abnormal state occurs, the weight of the indicator determined by the Critic objective weighting method may be small, and the abnormal information is masked in the overall situation assessment value X, making it difficult for the dispatcher to identify current or future abnormalities, which poses a hidden danger to the safety of the power grid. Therefore, in step S2 of this embodiment, when correcting the weight of the abnormal indicator, it includes:
[0129] If the value of the current power grid situation assessment index exceeds the upper threshold or is lower than the lower threshold, the weight of the current power grid situation assessment index is corrected, and the expression is as follows:
[0130]
[0131] Among them, w i represents the corrected weight of the current power grid situation assessment index, w i0 represents the objective weight value assigned to the current power grid situation assessment index using the Critic objective weighting method, x i It represents the dimensionless value of the current power grid situation assessment index.
[0132] In step S2 of this embodiment, when linear weighting is performed on all power grid situation assessment indicators to obtain a situation assessment value, the expression is as follows:
[0133]
[0134] In the formula, w i is the weight of the ith indicator, x i is the value of the i-th indicator after the above processing.
[0135] Since the weights of abnormal indicators have been corrected in step S2, the sum of the weights may be greater than 1, but this adjustment is reasonable. The substantial increase in the weights of abnormal indicators has a greater impact on the overall situation assessment of the system, thereby effectively discovering the abnormal state of the system. At the same time, it is ensured that the abnormal indicator value is proportional to the situation assessment value. When the number of abnormal indicators is small and the abnormal value is small, the assessment value is slightly greater than 1; conversely, the situation assessment value is larger. In this embodiment, 1 is used as the abnormal threshold value of the abnormality. If the situation assessment value is greater than 1, there is an abnormality.
[0136] In step S2 of this embodiment, the security level of the situation assessment value is also divided, such as Figure 2 As shown, the situation assessment value of 0-0.75 is the safe zone, 0.75-1 is the early warning zone, and greater than 1 is the abnormal zone. This embodiment mainly sets three scale points for the comprehensive situation assessment value of the power grid, namely 0, the early warning threshold value of 0.75 and the abnormal threshold value of 1. 0 is the lowest limit of the situation assessment, and 0 represents the safest state of the power grid. When it is in the range of 0 to 0.75, the power grid is in the safe zone, and no abnormal conditions occur. When the power grid situation assessment value exceeds the early warning threshold value of 0.75 but does not exceed 1, the power grid enters the early warning zone. At this time, the power grid dispatcher needs to pay attention to the situation changes of the power grid to prevent it from entering the abnormal zone. When the situation assessment value exceeds the abnormal threshold value of 1 and enters the abnormal zone, it is considered that the power grid is abnormal. The more it exceeds 1, the more serious the abnormal condition of the power grid is, and the power grid staff needs to deal with it as soon as possible.
[0137] Step S3 of this embodiment is to build a model for predicting the operation status of the power grid based on a double-layer gated recurrent neural network with an attention mechanism by using a deep learning framework on the basis of step S2. Figure 3As shown, the prediction model in this embodiment includes:
[0138] ① Input layer. The input layer uses the historical data of the index values of the power grid situation assessment index system constructed in the previous article as the input of the prediction model. The index data of a certain sequence length is preprocessed and then input into the prediction model.
[0139] ② GRU layer. The GRU layer in this embodiment includes a cascaded first gated recurrent neural network and a second gated recurrent neural network. This layer constructs a double-layer GRU structure to effectively learn the input features of the input layer to obtain its internal information and change rules.
[0140] ③ Attention layer. The input of this layer is the output hidden layer vector of the GRU layer. It assigns weights to each feature according to the weight allocation mechanism of the attention mechanism, and continuously updates the optimal probability distribution matrix through training.
[0141] ④ Output layer. The input of this layer is the output of the attention mechanism, and the future situation assessment value is calculated through the fully connected layer. In this embodiment, the activation function of the Dense layer selects Relu.
[0142] It can be seen that the four-layer deep learning framework of the prediction model of this embodiment uses the GRU model to utilize the intrinsic connection between multi-step prediction tasks to improve the accuracy, and on the other hand, selects features in the situation assessment system based on the attention mechanism, so that the model can dynamically capture the contribution of each input feature and give higher weights to important features.
[0143] In this embodiment, the structures of the first gated recurrent neural network and the second gated recurrent neural network are as follows: Figure 4 As shown in the figure, the gated recurrent neural network reduces the input gate, forget gate, and output gate of LSTM to two gates, namely the update gate and the reset gate. Therefore, compared with LSTM, it has fewer parameters and faster convergence speed, and is easier to train. The forward calculation formula of the first gated recurrent neural network and the second gated recurrent neural network is as follows:
[0144] r t =σ(W r ·[h t-1 ,x t ])
[0145] z t =σ(W z ·[h t-1 ,x t ])
[0146]
[0147] In the formula, x tis the input of the current gated recurrent neural network; z t is the update gate; r t It is the reset gate; is the hidden layer state; h t is the hidden layer output, W r ,W z ,W h are the weight matrices corresponding to the reset gate, update gate and hidden layer, σ and tanh are the sigmoid activation function and hyperbolic tangent activation function, respectively.
[0148] In this embodiment, the structure of the attention layer is as follows: Figure 5 As shown in the figure, the hidden layer output vector of the second gated recurrent neural network is used as input. First, the attention score formula is calculated to obtain the score at each moment. Then, the attention score is normalized using the Softmax function to obtain the attention weight. Then, the attention weight at each moment is multiplied by the hidden variable at the original moment to obtain the context vector at that moment. Finally, the context vector at each moment is concatenated and activated with the tanh function to obtain the attention vector and output it. The attention vector is the probability distribution value of the attention mechanism for the hidden layer output vector. The attention mechanism can better utilize the useful information in the input variables to achieve a better prediction effect of the model. The calculation process is as follows:
[0149]
[0150] a t =f(c t ,h t )=tanh(W c [c t ;h t ])
[0151] In the formula, is the attention weight score; α ts is the attention weight; c t is the context vector, α t is the attention vector, which is the probability distribution value of the attention mechanism for the GRU layer output; h t is the hidden variable at the current moment, corresponding to the hidden layer output obtained through the GRU layer.
[0152] In step S4 of this embodiment, when training the prediction model, the historical data of the indicator value in a certain time window in the past is used as the training data, the actual situation evaluation value in a certain period after the input data window is used as the training label, and the mean square error function is used as the loss function to measure the difference between the model prediction value and the actual label, and the Adam optimizer is used to train the model so that the loss function reaches the optimal solution. The loss function expression is as follows:
[0153]
[0154] In the formula, n is the number of samples, The future situation evaluation prediction value output by the model, y i The actual situation assessment value corresponding to the future situation assessment prediction value.
[0155] Based on the above configuration, during the training process, by inputting historical indicator data, the model learns the mapping relationship between it and the actual situation assessment value of the subsequent time period. After the training is completed, the model can predict the future situation assessment value based on the given historical indicator data sequence.
[0156] Embodiment 2
[0157] This embodiment provides a power grid abnormal situation awareness system, including a microprocessor and a computer-readable storage medium connected to each other, wherein the microprocessor is programmed or configured to execute the power grid abnormal situation awareness method described in the first embodiment.
[0158] In summary, the present invention proposes a method and system for perceiving abnormal power grid situations. First, a total of 9 indicators in three aspects, namely, equipment safety, system status, and power grid economy, are proposed, and a power grid situation evaluation indicator system is constructed based on the barrel effect and average effect criteria. Next, based on the Critic objective weighting method, each indicator is linearly weighted to obtain a situation evaluation, the weights of certain abnormal indicators are corrected, and the power grid situation is divided into safety levels. Then, a deep learning framework is used to construct a model for predicting the operation status of a power grid based on a double-layer gated recurrent neural network with an attention mechanism. Finally, the mean square error function is selected as the loss function of the model, and the Adam optimizer is used to train the model so that the loss function reaches the optimal solution. The present invention proposes an effective model for predicting the operation status of a power grid to achieve accurate prediction of abnormal power grid situations.
[0159] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for sensing abnormal power grid situation, characterized in that: The following steps are involved: Acquire power grid data in real time and calculate different power grid situation assessment indicators; Each power grid situation assessment indicator is weighted, and the weight of the abnormal indicator is corrected, and then all power grid situation assessment indicators are linearly weighted to obtain the situation assessment value; Constructing a prediction model of a double-layer gated recurrent neural network based on an attention mechanism, the prediction model includes a cascaded first gated recurrent neural network, a second gated recurrent neural network, an attention layer, and an output layer, the prediction model takes historical data of power grid situation assessment indicators as input, and outputs a future situation assessment prediction value; The prediction model is trained, and new historical data of the power grid situation assessment index is input into the trained prediction model to obtain corresponding future situation assessment prediction values, and the future situation assessment prediction values are matched with the pre-divided safety levels to determine whether an abnormality will occur.
2. The method for sensing abnormal power grid situation according to claim 1, characterized in that: The power grid situation assessment indicators include equipment safety indicators, specifically including: Line load factor, expressed as follows: Where P i is the active power flow of line i, S i is the limit transmission capacity of line i, n is the total number of lines, x 11,thre is the abnormal threshold value of line load rate; Transformer load factor, expressed as follows: Where P a For the power system a The active power output of each transformer, S a For the a The rated capacity of each transformer, n0 is the total number of transformers in the system, x 12,thre is the abnormal threshold value of transformer load rate; The line power flow margin is expressed as follows: In the formula, I i is the current value of line i, I i,lim is the thermal stability limit of line i, n is the total number of lines, x 13,thre is the abnormal threshold value of line power flow margin; The stable section flow margin is expressed as follows: Where P s is the cross-sectional transmission power, P s,lim is the cross-sectional transmission limit, n s is the number of sections, n s It is the abnormal threshold value of the stable section tidal margin.
3. The method for sensing abnormal power grid situation according to claim 1, characterized in that: The power grid situation assessment indicators include system status indicators, specifically including: Voltage margin, the expression is as follows: In the formula, m is the total number of buses in the system, U k,max is the maximum voltage allowed on the system bus k, U k,min is the minimum voltage allowed on the system bus k, U k is the current operating voltage of the system bus k, R k is the voltage margin index value of bus k, x 21,thre is the voltage margin abnormal threshold value; Frequency safety deviation rate, the expression is as follows: Where, f is the current operating frequency of the system, f N is the system rated frequency, Δf max is the maximum frequency deviation of the system operation; Active reserve rate, the expression is as follows: Where P SR,lim Indicates the minimum limit of the system's active spinning reserve capacity, P SR is the total spinning reserve capacity of the system; The abnormal load change rate is expressed as follows: Where η is the load abnormal change rate factor, P d-peak is the load peak value, V rise / drop Indicates the rate at which the load increases or decreases.
4. The method for sensing abnormal power grid situation according to claim 1, characterized in that: The power grid situation assessment indicators include power grid economic indicators, specifically including: Line loss rate, the expression is as follows: Where P g is the active power generated by generator g, Q g is the reactive power generated by generator g, n5 is the total number of generators, P j is the active power flow of line j, Q j is the reactive power flow of line j, n is the total number of lines.
5. The method for sensing abnormal power grid situation according to claim 1, characterized in that: When weighting each power grid situation assessment indicator, the Critic objective weighting method is used to weight each power grid situation assessment indicator.
6. The method for sensing abnormal power grid situation according to claim 1, characterized in that: When correcting the weight of abnormal indicators, include: If the value of the current power grid situation assessment index exceeds the upper threshold or is lower than the lower threshold, the weight of the current power grid situation assessment index is corrected, and the expression is as follows: Among them, w i0 represents the objective weight value assigned to the current power grid situation assessment index using the Critic objective weighting method, x i It represents the dimensionless value of the current power grid situation assessment index.
7. The method for sensing abnormal power grid situation according to claim 1, characterized in that: The forward calculation formulas of the first gated recurrent neural network and the second gated recurrent neural network are as follows: r t =σ(W r ·[h t-1 ,x t ]) z t =σ(W z ·[h t-1 ,x t ]) In the formula, x t is the input of the current gated recurrent neural network; z t is the update gate; r t It is the reset gate; is the hidden layer state; h t is the hidden layer output, W r ,W z ,W h are the weight matrices corresponding to the reset gate, update gate, and hidden layer, respectively. σ and tanh are the sigmoid activation function and the hyperbolic tangent activation function respectively.
8. The method for sensing abnormal power grid situation according to claim 1, characterized in that: The attention layer takes the hidden layer output vector of the second gated recurrent neural network as input, first calculates the attention score formula to obtain the score at each moment, and then uses the Softmax function to normalize the attention score to obtain the attention weight; Then, the attention weight at each moment is multiplied by the hidden variable at the original moment to obtain the context vector at that moment; finally, the context vectors at each moment are concatenated and activated with the tanh function to obtain the attention vector and output it. The attention vector is the probability distribution value of the attention mechanism for the hidden layer output vector.
9. The method for sensing abnormal power grid situation according to claim 1, characterized in that: When training the prediction model, specifically, the mean square error function is used as the loss function, and the model is trained using the Adam optimizer so that the loss function reaches the optimal solution.
10. A power grid abnormal situation awareness system, comprising a microprocessor and a computer-readable storage medium connected to each other, characterized in that: The microprocessor is programmed or configured to execute the abnormal situation awareness method for power grid according to any one of claims 1 to 9.
Citation Information
Cited By
Split direct current charging multi-split group charging and group control system
CN120756333A
Data processing method for intelligently controlling sea cucumber processing system
CN120805013A
SVG power grid construction and situation awareness method supporting multi-source data fusion
CN120955665A