Wide-area broadband oscillation positioning traceability method based on causal relationship
By calculating the propagation entropy and causal relationships of power system nodes, the propagation path of the oscillation source is determined, solving the problem of inaccurate oscillation source location in traditional methods. This enables precise location and suppression of the oscillation source, ensuring the stability of the power system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHWEST BRANCH OF STATE GRID POWER GRID CO
- Filing Date
- 2026-01-13
- Publication Date
- 2026-04-21
AI Technical Summary
In scenarios where new energy sources converge, traditional methods struggle to accurately distinguish the oscillation source of broadband oscillations, leading to the accidental disconnection of normal generating units or the complete shutdown of the entire station, resulting in unnecessary power loss and affecting the safe and stable operation of the power system.
By calculating the transfer entropy between the power parameters of each node in the power system, the causal relationship is determined. The nodes with causal relationships are connected to form a directed graph, and the propagation path of the oscillation is determined, thereby accurately locating the oscillation source.
It achieves precise suppression of oscillation sources, ensures the safe and stable operation of the power system, avoids accidental disconnection of generating units, and improves the operating efficiency of the power system.
Smart Images

Figure CN121906444A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, and in particular to a wide-area broadband oscillation location and source tracing method based on causal relationships. Background Technology
[0002] The construction of new power systems is accelerating, with the proportion of new energy power generation, represented by wind and solar power, continuing to rise, and the scale of high-voltage direct current (HVDC) transmission expanding. With the large-scale grid connection of new energy sources, the formation of HVDC transmission networks, and the commissioning of power electronic loads, modern power systems exhibit the characteristics of a high proportion of renewable energy and a high proportion of power electronic equipment (referred to as "dual high"). The interaction between power electronic equipment and the power grid in "dual high" power systems can cause broadband oscillations in the frequency range of several Hz to several kiloHz. These broadband oscillations can damage power equipment, leading to the shutdown of new energy generating units, seriously affecting equipment safety and threatening the stable operation of the system, thus becoming a significant factor restricting the efficient absorption of new energy.
[0003] In renewable energy aggregation scenarios, there are often dozens or even hundreds of renewable energy converters from the same manufacturer, model, and with the same parameters. These units are connected to the grid through collector lines with extremely short electrical distances, forming a highly homogeneous and strongly coupled system. Once oscillation occurs, energy will rapidly spread throughout the entire field via the low-impedance network, causing synchronous resonance of all units. At this time, the port voltage and current waveforms of all units are highly similar in amplitude and phase, exhibiting a phenomenon of "synchronous oscillation across the entire field." Traditional methods based on amplitude comparison or phase lead-lag cannot effectively distinguish which unit is actively causing the disturbance (oscillation source) and which units are passively disturbed when facing this highly homogeneous resonance scenario. This can easily lead to the erroneous disconnection of normal units or the complete shutdown of the entire station, resulting in unnecessary power loss.
[0004] Therefore, determining the oscillation source of broadband oscillations is a crucial technical problem that needs to be solved to achieve precise oscillation suppression and ensure the safe and stable operation of the power system. Summary of the Invention
[0005] The purpose of this invention is to provide a causal-based method for locating and tracing the source of wide-area broadband oscillations, so as to accurately determine the oscillation source, achieve precise oscillation suppression, and ensure the safe and stable operation of the power system. The specific technical solution is as follows:
[0006] A first aspect of this application provides a wide-area broadband oscillation localization and tracing method based on causal relationships, the method comprising:
[0007] When a systemic oscillation is detected in the power system, the transfer entropy between the power parameters of each node in the power system is calculated.
[0008] Based on the transfer entropy, the causal relationship between the power parameters of each node is determined;
[0009] By connecting the nodes where the causal relationship exists between the power parameters in the order of cause and effect, the propagation path of the systemic oscillation in the power system can be obtained.
[0010] Based on the propagation path, the oscillation source of the systemic oscillation is determined.
[0011] In one possible implementation, the method further includes:
[0012] If an oscillation is detected in the power system, the node where the oscillation occurs is identified as the target node;
[0013] In the power system, nodes whose electrical distance from the target node meets a preset nearest neighbor condition are identified as neighbor nodes;
[0014] Calculate the consistency between the power parameters of the target node and the oscillation modes of each of the neighboring nodes;
[0015] If the consistency is higher than a preset consistency threshold, it is determined that a systemic oscillation has been detected in the power system.
[0016] In one possible implementation, the oscillation mode includes: an oscillation envelope and an oscillation phase, and the calculation of the consistency between the power parameters of the target node and the oscillation modes of each of the neighboring nodes includes:
[0017] For each neighboring node, calculate the correlation between the oscillating envelope of the target node and the oscillating envelope of the neighboring nodes;
[0018] For each neighboring node, the difference between the actual phase shift and the expected phase shift is calculated. The actual phase shift is the offset of the oscillation phase of the target node relative to the oscillation phase of the neighboring node, and the expected phase shift is the phase shift expected to be caused by the impedance between the target node and the neighboring node.
[0019] The similarity between the power parameters of the target node and the power parameters of each of the neighboring nodes is calculated, wherein the similarity is positively correlated with the correlation and negatively correlated with the difference.
[0020] The proportion of neighboring nodes whose similarity is higher than a preset similarity threshold is statistically obtained and used as the consistency between the power parameters of the target node and the oscillation modes of each neighboring node.
[0021] In one possible implementation, the oscillation mode further includes an oscillation master frequency, and the difference between the oscillation master frequency of the target node and the oscillation master frequency of the neighboring node is referred to as the oscillation master frequency difference;
[0022] The degree of similarity is also negatively correlated with the difference in the dominant oscillation frequency.
[0023] In one possible implementation, the node's power parameters are obtained in the following way:
[0024] The parameters detected by the measurement units set at each node of the power system are obtained and used as the detection parameters of each node.
[0025] An objective function is constructed based on the detection parameters of each node. The independent variable of the objective function is the clock offset of each measurement unit, and the dependent variable is positively correlated with the difference between the detection parameters and expected parameters of each node. The expected parameters are the parameters that the measurement unit is expected to detect in the presence of the clock offset.
[0026] The independent variables that make the dependent variable of the objective function satisfy the preset conditions are calculated and used as the predicted clock offset of each measurement unit.
[0027] Each of the aforementioned detection parameters is then reverse-compensated to offset the predicted clock offset, thereby obtaining the power parameters of each node.
[0028] In one possible implementation, determining the oscillation source of the systemic oscillation based on the propagation path includes:
[0029] Calculate the energy flow of each node during the occurrence of the systemic oscillation, and use it as the wide-area dissipated energy flow of each node;
[0030] The oscillation source of the systemic oscillation is determined based on the wide-area dissipated energy flow and the propagation path of each node.
[0031] In one possible implementation, calculating the energy flow of each node during the occurrence of the systemic oscillation, as the wide-area dissipated energy flow of each node, includes:
[0032] The energy flow of each node during the occurrence of the systemic oscillation is calculated according to the following formula, which serves as the wide-area dissipated energy flow of each node:
[0033]
[0034] Among them, W diss For wide-area dissipative energy flow, t start t endLet P(t) represent the start and end times of the systemic oscillation period, respectively, and let δ(t) represent the active power of the node at time t, and let δ(t) represent the voltage phase angle of the node at time t. ss and δ ss These are the steady-state operating point values of the nodes.
[0035] In one possible implementation, determining the oscillation source of the systemic oscillation based on the wide-area dissipated energy flow and the propagation path of each of the nodes includes:
[0036] The node features of each node are extracted, wherein the node features include four components, which are used to characterize the wide-area dissipated energy flow of the node, the topological position of the node in the propagation path, the oscillation amplitude of the node, and the short-circuit ratio of the node, respectively.
[0037] The node features of each node are input into a graph neural network with a multi-head attention mechanism to obtain the oscillation source of the systemic oscillation output by the graph neural network. The multi-head attention mechanism is used to adjust the degree of influence of the four components on the output of the graph neural network based on the knowledge learned during the training phase.
[0038] In one possible implementation, the attention score in the attention mechanism is negatively correlated with the electrical distance between nodes.
[0039] In one possible implementation, determining the oscillation source of the systemic oscillation based on the wide-area dissipated energy flow and the propagation path of each of the nodes includes:
[0040] The wide-area dissipated energy flow and the propagation path of each node are input into a graph neural network to obtain the oscillation source of the systemic oscillation output by the graph neural network.
[0041] The graph neural network is pre-trained on a sample dataset, which includes sample data under conditions of forced oscillation, negative damped oscillation, and parameter-coupled oscillation.
[0042] In one possible implementation, determining the causal relationship between the electrical parameters of each of the nodes based on the transfer entropy includes:
[0043] Let the electrical parameters of the first node and the second node be denoted as X and Y, respectively, and let the transfer entropy from X to Y be denoted as TE. X→Y Let TE denote the transitive entropy from Y to X. Y→X Wherein, the first node and the second node are any two nodes among the nodes;
[0044] If TEX→Y -TE Y→X If the difference is greater than ε, then a causal relationship is determined between X and Y, with X being the cause and Y being the effect, where ε is a preset difference threshold.
[0045] In one possible implementation, the electrical parameters of the two nodes are denoted as A and B, respectively, and the transfer entropy from A to B is calculated using the following formula:
[0046]
[0047] in, Represents the probability distribution function. Represents the target node exist The state at any given moment, express The length is Historical state sequence, express The length is The historical state sequence.
[0048] A second aspect of this application provides a wide-area broadband oscillation coordination method, the method comprising:
[0049] Obtain the oscillation source determined by the causal-based wide-area broadband oscillation localization and tracing method described in the first aspect above;
[0050] Based on the oscillation source and the oscillation frequency band of the systemic oscillation, determine and implement oscillation response strategies.
[0051] In one possible implementation, determining the oscillation response strategy based on the oscillation source and the oscillation frequency band of the systemic oscillation includes:
[0052] If the oscillation frequency band is 0–0.1 Hz, and the oscillation source is a thermal power unit, then the oscillation response strategy is determined as follows: reduce the output of the oscillation source, and disable the automatic power generation control or primary frequency regulation function of the oscillation source; or,
[0053] If the oscillation frequency band is 0.1–2.5 Hz and the oscillation source is in range mode, then the oscillation response strategy is determined to be: reduce the power flow at the tie-line end face or increase the voltage; or,
[0054] If the oscillation frequency band is 2.5 to 100 Hz and the oscillation source is in range mode, then the oscillation response strategy is determined to be: adjust the power.
[0055] A third aspect of this application provides a wide-area broadband oscillation collaborative defense system, the system comprising:
[0056] Intelligent analysis unit and decision control unit;
[0057] The intelligent analysis unit is used to determine the oscillation source in accordance with any of the methods described in the first aspect above when a systemic oscillation occurs in the power system.
[0058] The decision control unit is used to determine and execute the oscillation response strategy for the systemic oscillation according to the method of the second aspect mentioned above.
[0059] In one possible implementation, the system further includes a data front-end unit;
[0060] The data front-end unit is used to acquire and cache the detection parameters detected by the measurement units set at each node of the power system; if the acquisition rate of the detection data in any time window reaches a preset acquisition rate threshold, the unit predicts the unacquired detection data in the same time window based on the acquired detection data in that time window; and sends the acquired detection data in that time window and the predicted detection data to the intelligent analysis unit.
[0061] The intelligent analysis unit is further configured to determine the power parameters used in determining the oscillation source according to any of the methods described in the first aspect, based on the detection data sent by the data front-end unit.
[0062] A fourth aspect of the embodiments of this application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0063] Memory, used to store computer programs;
[0064] When a processor executes a program stored in memory, it implements the steps of the method described in either the first or second aspect described above.
[0065] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in either the first or second aspect described above.
[0066] Beneficial effects of the embodiments in this application:
[0067] This application provides a method for locating and tracing wide-area broadband oscillations based on causal relationships. When a systemic oscillation is detected in a power system, the method calculates the transfer of power parameters between nodes in the power system. Since transfer entropy is a metric that quantifies the predictive information of one time series on another, a larger transfer entropy between the power parameters of two nodes indicates a strong causal influence between them. Furthermore, if the transfer entropy between the power parameters of node 1 and node 2 is greater than the transfer entropy between the power parameters of node 2 and node 1, then a causal relationship exists between node 1 and node 2. In other words, by calculating the transfer entropy of the power parameters of different nodes, the causal direction of each node can be determined. By treating each node as a vertex and the causal relationship as directed edges, nodes with causal relationships are connected in a cause-and-effect order to form a directed graph. Since the oscillation source is usually the starting point of multiple propagation paths in the oscillation propagation path, the oscillation source can be accurately determined based on the propagation path, facilitating appropriate measures to suppress the oscillation and ensure the safe and stable operation of the power system.
[0068] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0070] Figure 1 A first schematic diagram of a wide-area broadband oscillation localization and tracing method based on causality provided in an embodiment of this application;
[0071] Figure 2 A schematic diagram of the transfer entropy and causal network provided in the embodiments of this application;
[0072] Figure 3 A second schematic diagram of the wide-area broadband oscillation localization and tracing method based on causality provided in the embodiments of this application;
[0073] Figure 4 A schematic diagram for determining the oscillation type provided in the embodiments of this application;
[0074] Figure 5 A third schematic diagram of the wide-area broadband oscillation localization and tracing method based on causality provided in the embodiments of this application;
[0075] Figure 6for Figure 5 A schematic diagram of a specific implementation of step S142;
[0076] Figure 7 A schematic diagram illustrating the principle of determining oscillation sources based on graph neural networks, provided for embodiments of this application;
[0077] Figure 8 A schematic diagram illustrating the process of fusing features of each node using a multi-head attention mechanism provided in this application embodiment;
[0078] Figure 9 A flowchart for obtaining power parameters provided in an embodiment of this application;
[0079] Figure 10 A schematic diagram of clock compensation provided for an embodiment of this application;
[0080] Figure 11 A schematic diagram illustrating the process of a measurement unit detecting parameters provided in an embodiment of this application;
[0081] Figure 12 A schematic diagram illustrating the wide-area broadband oscillation decision method provided in an embodiment of this application;
[0082] Figure 13 A schematic diagram illustrating the suppression strategy for the oscillation source at different oscillation frequencies provided in the embodiments of this application;
[0083] Figure 14 Flowcharts of the wide-area broadband oscillation localization and tracing method and the wide-area broadband oscillation coordination method based on causality provided in the embodiments of this application;
[0084] Figure 15 This is a schematic diagram of the wide-area broadband oscillation collaborative defense system architecture provided in the embodiments of this application. Detailed Implementation
[0085] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.
[0086] In related technologies, the dissipative energy flow method is commonly used to locate oscillation sources, based on the assumption that "the source emits energy and the load consumes energy." However, in actual renewable energy aggregation networks, due to extremely low line impedance and complex oscillation frequency components, oscillation energy often exhibits high-frequency throughput and frequent interaction between the generating unit and the grid, causing the energy flow direction to potentially reverse or become ambiguous (with the integral value approaching zero) within a short period. Furthermore, for self-excited oscillations caused by negative damping, the energy flow criterion often fails, failing to provide a clear directionality. Therefore, this method cannot accurately determine the oscillation source.
[0087] To accurately determine the oscillation source, a first aspect of this application provides a wide-area broadband oscillation localization and source tracing method based on causal relationships, such as... Figure 1 The diagram shown is a first embodiment of the wide-area broadband oscillation localization and tracing method based on causality provided in this application. The method includes the following steps:
[0088] Step S11: When a systemic oscillation is detected in the power system, calculate the transfer entropy between the power parameters of each node in the power system.
[0089] Step S12: Determine the causal relationship between the power parameters of each node based on the transfer entropy;
[0090] Step S13: Connect the nodes with causal relationships between the power parameters in the order of cause to effect to obtain the propagation path of the systemic oscillation in the power system.
[0091] Step S14: Determine the oscillation source of the systemic oscillation based on the propagation path.
[0092] In this embodiment of the application, when a systemic oscillation is detected in the power system, the transfer entropy between the power parameters of each node in the power system is calculated. Since transfer entropy is a theoretical metric that quantifies the predictive information of one time series on another, a larger transfer entropy between the power parameters of two nodes indicates a strong causal influence between them. Furthermore, if the transfer entropy between the power parameters of node 1 and node 2 is greater than the transfer entropy between the power parameters of node 2 and node 1, then a causal relationship between node 1 and node 2 can be considered. In other words, by calculating the transfer entropy of the power parameters of different nodes, the causal direction of each node can be determined. By using each node as a vertex and the causal relationship as a directed edge, nodes with causal relationships are connected in a cause-and-effect order to form a directed graph. Since the oscillation source is usually the starting point of multiple propagation paths in the oscillation propagation path, the oscillation source can be accurately determined based on the propagation path, facilitating the implementation of corresponding measures to suppress the oscillation and ensure the safe and stable operation of the power system.
[0093] For example, suppose there are 50 nodes in a power system, namely nodes 1 to 50. Suppose that according to the method of this application, there is a causal relationship between nodes 1 to 5, and the transfer entropy of node 1 to node 2 is greater than that of node 2 to node 1, the transfer entropy of node 2 to node 3 is greater than that of node 3 to node 2, the transfer entropy of node 3 to node 4 is greater than that of node 4 to node 3, and the transfer entropy of node 4 to node 5 is greater than that of node 5 to node 4. Then the propagation path of the systemic oscillation can be determined as node 1 → node 2 → node 3 → node 4 → node 5. The oscillation source can then be determined based on this propagation path.
[0094] The following is a detailed explanation of steps S11 to S14:
[0095] In step S11 above, systemic oscillation refers to oscillations that accompany the propagation of energy in the electrical connection network, and whose waveforms at neighboring nodes exhibit strong correlation, such as broadband oscillations. A node is a location in a power system where current converges or branches connect; the power system collects, distributes, and transforms electrical energy at nodes. The operating state (or electrical state) of each node is typically described by three parameters: voltage amplitude, voltage phase angle, active power, and reactive power.
[0096] Power parameters include one or more of parameters such as voltage, frequency, and power. This application does not specifically limit the power parameters.
[0097] Transmission entropy measures how much uncertainty can be reduced in predicting the future state of a known variable by incorporating its historical information, given the variable's own historical information. The transmission entropy between the power parameters of each node is calculated using existing transmission entropy calculation methods, and this application does not limit this calculation.
[0098] In step S12 above, determining the causal relationship between the power parameters of each node based on the transfer entropy means calculating the transfer entropy between each node and determining whether a causal relationship exists between the nodes based on the transfer entropy value. It can be understood that if the transfer entropy value of the power parameters of two nodes is greater than 0, it indicates that a causal relationship exists between the two nodes.
[0099] Since the causal relationship between the two nodes is directed, let the electrical parameters of the first and second nodes be denoted as X and Y respectively, and let the transfer entropy from X to Y be denoted as TE. X→Y Let TE denote the transitive entropy from Y to X. Y→X These two transfer entropies are different. If the transfer entropy TE X→Y Greater than the transitive entropy TE Y→XIf X is the cause and Y is the effect, then X is considered the cause and Y the effect; conversely, if Y is the cause and X is the effect, then Y is considered the cause and X the effect. Therefore, the causal direction of two nodes with a causal relationship can also be determined by transitive entropy.
[0100] It is understandable that if the transitive entropy TE X→Y With transfer entropy TE Y→X When the values are close, nodes X and Y may not have a causal relationship. In this case, if we still rely on the transitive entropy TE... X→Y With transfer entropy TE Y→X Determining causality based solely on relative magnitudes may lead to incorrect causal relationships. Therefore, to improve the accuracy of causal relationship determination, in one possible implementation, after calculating the two transit entropies between two nodes, the difference between the two transit entropies is calculated. If the difference is greater than a preset difference threshold, a causal relationship is determined between the two nodes. For example, if TE X→Y -TE Y→X If the difference is greater than ε, then a causal relationship is determined between X and Y, with X being the cause and Y being the effect. Here, ε is a preset difference threshold, the specific value of which is set based on experience and requirements, and this embodiment does not limit it. In this document, the difference between the propagation entropy of two nodes is referred to as the net information flow.
[0101] In one possible implementation, the transfer entropy can be calculated based on the Shannon entropy. For example, suppose... and These are the power or voltage time series of two nodes (such as wind farm A and collection station B) in a wide area network. First, the Shannon entropy is defined as: ,in, The probability density can be estimated using the histogram method; then, the conditional entropy is defined as: , indicating that only using The past A historical state Predicting the future The remaining uncertainty at that time. Next, the calculation introduces... historical status Conditional entropy after: .
[0102] Transmission Entropy (TE) X→Y This is the difference between the two conditional entropies mentioned above: See also Figure 2 In this formula Indicates using Figure 2 In the left half of the middle part, t < t current Partial prediction of Y(t) t>t current The uncertainty of part of Y(t), This means that when t < t currentBased on the part of Y(t), an additional t < t is added. current Partial prediction of X(t) t>t current The uncertainty of part of Y(t). It is understandable that if... Less than This indicates that the additional t < t current The part of X(t) can reduce the prediction of t>t. current The uncertainty of Y(t) at part time, according to common sense in information theory, can be considered to have an additional t < t. current The part of X(t) points to t>t current The partial information flow of Y(t) (i.e.) Figure 2 The information flow shown in the figure), and the information content of the information flow and the transmission entropy TE X→Y Positive correlation. Therefore, transitivity can be considered as... Figure 2 The information content of the information flow shown is illustrated. Therefore, causal relationships can be determined based on the transmission entropy, that is, when the information flow is transmitted from source node A to node B, node A is the cause and node B is the effect, and the net information flow Tn between node A and node B is... et >ε.
[0103] In one possible implementation, the above formula for transfer entropy can be expanded into a probability distribution form to calculate the transfer entropy. The transfer entropy between the power parameters of each node can then be calculated quickly and accurately using the following formula:
[0104]
[0105] in, Represents the probability distribution function. Represents the target node exist The state at any given moment, express The length is Historical state sequence, express The length is The historical state sequence.
[0106] Since data in actual power grids are usually continuous variables with high dimensionality, using the histogram method to estimate probability density is inefficient and has large errors, which in turn leads to low efficiency and accuracy in calculating transfer entropy.
[0107] To improve the efficiency and accuracy of propagation entropy calculation, another possible implementation can use the k-nearest neighbor algorithm to calculate the propagation entropy between the power parameters of each node. The specific process is as follows:
[0108] Step 1, Spatial Reconstruction: Mapping the time series to a high-dimensional state space ;
[0109] Step 2, Neighborhood search: For each point in the space, find its k-th nearest neighbor and calculate the spatial distance α between the point and each nearest neighbor.
[0110] Step 3: Count the number of points within radius α in the edit space. ;
[0111] Step 4: Estimate the propagation entropy between this point and each nearest neighbor using the following formula:
[0112]
[0113] in, For the Digamma function, This indicates taking the average.
[0114] It is understandable that, since the oscillation source is usually the starting point of multiple propagation paths in the propagation path of the oscillation, after obtaining the propagation path of the systemic oscillation in the power system through step S13, the oscillation source can be determined according to the propagation path in step S14.
[0115] It is understandable that single-unit characteristic tests, such as those on frequency regulation and excitation systems, are frequently conducted in power systems. These tests can cause local power or voltage fluctuations, leading to local oscillations. Related technologies often misinterpret these local oscillations as systemic oscillations and issue alarms, affecting the accuracy of decision-making.
[0116] To address the problem of false alarms caused by local oscillations, in one possible implementation, when the system oscillates, the type of oscillation can be determined as a systemic oscillation in the following way.
[0117] See Figure 3 , Figure 3 This is a second schematic diagram of a causal-based wide-area broadband oscillation localization and tracing method provided in an embodiment of this application. The method includes the following steps:
[0118] Step S21: If oscillation is detected in the power system, identify the node where the oscillation is occurring as the target node.
[0119] Step S22: In the power system, identify nodes whose electrical distance from the target node meets the preset nearest neighbor condition and designate them as neighbor nodes.
[0120] Step S23: Calculate the consistency between the power parameters of the target node and the oscillation modes of each neighboring node;
[0121] Step S24: If the consistency is higher than the preset consistency threshold, it is determined that a systemic oscillation has been detected in the power system.
[0122] Step S11: When a systemic oscillation is detected in the power system, calculate the transfer entropy between the power parameters of each node in the power system.
[0123] Step S12: Determine the causal relationship between the power parameters of each node based on the transfer entropy;
[0124] Step S13: Connect the nodes with causal relationships between the power parameters in the order of cause to effect to obtain the propagation path of the systemic oscillation in the power system.
[0125] Step S14: Determine the oscillation source of the systemic oscillation based on the propagation path.
[0126] Steps S11 to S14 are described above and will not be repeated here. Steps S21 to S24 are explained below.
[0127] In step S21 above, detecting whether the power system is oscillating can be done by observing whether the power of the tie line or key section fluctuates, or by observing whether the frequency of the power system fluctuates, or by observing whether the voltage phase angle difference of multiple nodes fluctuates. If fluctuation occurs, the power system is considered to be oscillating. Alternatively, multiple of the above three methods can be used simultaneously to determine whether the power system is oscillating. This application embodiment does not limit this.
[0128] After determining that the power system is oscillating, the Prony algorithm (a method that uses a linear combination of a set of exponential terms to fit equally spaced sampled data, from which information such as signal amplitude, phase, damping factor, and frequency can be analyzed) or HT (Hilbert transform) can be used to perform real-time analysis of the voltage, current, and power signals of the entire network, and extract the instantaneous amplitude A(t), instantaneous frequency f(t), and instantaneous phase φ(t).
[0129] It is understandable that the detection of oscillations is usually performed by a detection device set up by a certain node. Therefore, after an oscillation is detected, the node that set up the detection device will trigger an oscillation alarm. In other words, the node that causes the oscillation is the node that triggers the oscillation alarm.
[0130] In another possible implementation, the node experiencing oscillation can also be determined by detecting fluctuations in electrical parameters such as power and voltage at each node.
[0131] In step S22 above, the preset nearest neighbor condition can be a preset number of nodes that are electrically closest, nodes whose electrical distance is less than a preset distance threshold, or other conditions related to electrical distance. This application embodiment does not limit this. For example, assuming the preset nearest neighbor condition is the K nodes that are electrically closest, the electrical distance between each node and the target node is calculated, and the K nodes that are closest to the target node are determined as neighbor nodes.
[0132] In step S23, the oscillation mode of a neighboring node refers to the electrical quantity fluctuation characteristics observed at the neighboring node. The oscillation mode of a neighboring node can be determined by performing modal analysis on the power or frequency signals of the neighboring node. The consistency between the power parameters of the target node and the oscillation modes of each neighboring node can be calculated by introducing concepts such as correlation coefficient, correlation, or similarity.
[0133] Taking the correlation calculation of the consistency between the power parameters of the target node and the oscillation modes of each neighboring node as an example, in one possible implementation, the oscillation mode includes an oscillation envelope and an oscillation phase. For each neighboring node, the correlation between the oscillation envelope of the target node and the oscillation envelope of the neighboring nodes can be calculated. For each neighboring node, the difference between the actual phase shift and the expected phase shift can be calculated. The actual phase shift is the offset of the oscillation phase of the target node relative to the oscillation phase of the neighboring nodes, and the expected phase shift is the phase shift caused by the expected impedance between the target node and the neighboring nodes. Then, the similarity between the power parameters of the target node and the power parameters of each neighboring node is calculated. The similarity is positively correlated with the correlation and negatively correlated with the difference. Finally, the proportion of neighboring nodes with a similarity higher than a preset similarity threshold is statistically obtained as the consistency between the power parameters of the target node and the oscillation modes of each neighboring node.
[0134] The preset similarity threshold is set based on actual needs and experience. For example, if the preset similarity threshold is 0.85, then the proportion of neighboring nodes with a similarity higher than 0.85 with the target node will be used as the consistency between the power parameters of the target node and the oscillation modes of each neighboring node.
[0135] In another possible implementation, the oscillation mode may also include the oscillation master frequency, and the difference between the oscillation master frequency of the target node and the oscillation master frequency of the neighboring nodes is called the oscillation master frequency difference.
[0136] In this case, when calculating the similarity between the power parameters of the target node and the power parameters of each neighboring node, it is also necessary to calculate based on the difference in the oscillation main frequency between each neighboring node and the target node. The similarity is negatively correlated with the difference in the oscillation main frequency.
[0137] The following section uses the oscillation mode, including the oscillation envelope, oscillation phase, and oscillation dominant frequency, as an example to illustrate the process of calculating the consistency between the power parameters of the target node and the oscillation modes of its neighboring nodes:
[0138] Assuming the target node is i, the set Ω consists of nodes that satisfy the preset nearest neighbor condition. i Neighboring node j∈Ω i The oscillation mode similarity S between target node i and its neighbor node j is defined by the following formula. ij :
[0139]
[0140] in, For nodes The oscillating envelope, For nodes The oscillating envelope, For nodes With nodes The Pearson correlation coefficient of the oscillating envelope of the target node and its neighboring nodes approaches 1 if the oscillations of the target node and its neighboring nodes rise and fall together. For nodes The oscillation main frequency, For nodes The oscillation main frequency, For nodes With nodes The difference in the oscillation main frequency is such that if the target node and the neighboring node oscillate in the same mode, then the oscillation main frequencies of the two nodes are highly consistent, and the difference in the oscillation main frequencies approaches 0. For nodes phase, For nodes phase, The theoretical transmission phase shift, calculated based on line impedance, is used to verify whether the phase difference conforms to the physical laws of transmission. Represents a node With nodes Phase consistency. , and The value is a weighting coefficient, and its specific value is set based on experience and requirements. This application does not limit this.
[0141] Then determine the set Ω i In the middle, satisfy > The percentage of nodes, of which, A preset similarity threshold is set. Assuming the preset similarity threshold is 0.85, and the preset nearest neighbor condition is the K nodes with the closest electrical distance, the proportion of neighbor nodes with a similarity higher than the preset similarity threshold is calculated using the following formula. :
[0142]
[0143] In step S24 above, the preset consistency threshold is set based on experience and needs, and this application embodiment does not limit it. If the consistency is higher than the preset consistency threshold, systemic oscillations may occur in the power system. For example, assuming the preset consistency threshold is 0.6, the proportion of neighboring nodes with a similarity higher than the preset similarity threshold... A value greater than 0.6 indicates that the power system is experiencing systemic oscillations; conversely, a value less than 0.6 indicates that the power system is not experiencing systemic oscillations. For example, ... Figure 4 As shown, node i is the node that triggers the alarm. Node i is topologically connected to nodes j1, j2, and j3. The similarity between the power parameters of node i and the oscillation mode of node j1 is S. ij1 The similarity between the electrical parameters of node i and the oscillation mode of node j2 is S. ij2 The similarity between the electrical parameters of node i and the oscillation mode of node j3 is S. ij3 If the similarity R i If the value is greater than 0.6, the oscillation occurring at node i is a systematic oscillation (i.e., the systematic oscillation in the figure); otherwise, the oscillation occurring at node i is a local oscillation (i.e., the local pseudo-oscillation in the figure).
[0144] In another possible implementation, the proportion of neighboring nodes with a similarity level higher than a preset similarity threshold is considered. If the similarity is not greater than a preset consistency threshold, it can be further determined based on the proportion of neighboring nodes whose similarity is higher than a preset similarity threshold. Determine whether the oscillations occurring in the power system are local oscillations. Specifically, this involves considering the proportion of neighboring nodes with a similarity level exceeding a preset similarity threshold. If the similarity is less than a preset minimum consistency threshold, the oscillation in the power system is considered a local oscillation. The percentage of neighboring nodes with a similarity higher than a preset similarity threshold is also considered. If the oscillation falls between the preset minimum consistency threshold and the preset consistency threshold, other methods can be used to further determine whether the oscillation occurring in the power system is a systemic oscillation, a local oscillation, or another type of oscillation.
[0145] To make the identified oscillation source more accurate, in one possible implementation, the dissipative energy flow method can be combined with transfer entropy to determine the oscillation source.
[0146] Based on this, see Figure 5, Figure 5 This is a third schematic diagram of a causal-based wide-area broadband oscillation localization and tracing method provided in an embodiment of this application. The method includes the following steps:
[0147] Step S11: When a systemic oscillation is detected in the power system, calculate the transfer entropy between the power parameters of each node in the power system.
[0148] Step S12: Determine the causal relationship between the power parameters of each node based on the transfer entropy;
[0149] Step S13: Connect the nodes with causal relationships between the power parameters in the order of cause to effect to obtain the propagation path of the systemic oscillation in the power system.
[0150] Step S141: Calculate the energy flow of each node during the occurrence of systemic oscillation, and use it as the wide-area dissipated energy flow of each node;
[0151] Step S142: Determine the oscillation source of the systemic oscillation based on the wide-area dissipated energy flow and propagation path of each node.
[0152] Steps S11 to S13 are described above and will not be repeated here. Steps S141 and S142 are specific implementations of step S14. The following is an explanation of steps S141 and S142:
[0153] In step S141 above, calculating the energy flow of each node during system oscillation means calculating the energy flowing into the node and the energy flowing into the power system during system oscillation.
[0154] Understandably, if the energy flowing to the power system from a node during an oscillation is less than the energy flowing into that node, then that node cannot be the source of the oscillation. Conversely, if the energy flowing to the power system from a node during an oscillation is greater than the energy flowing into that node, then that node may be the source of the oscillation.
[0155] For example, taking the aforementioned propagation path as node 1→node 2→node 3→node 4→node 5 as an example, after calculating the wide-area dissipated energy flow of nodes 1 to 5, if the energy flowing to the power system from node 1 during the oscillation is greater than the energy flowing into the node, then node 1 can be determined as the oscillation source.
[0156] To calculate the wide-area dissipated energy flow of each node more quickly, in one possible implementation, the wide-area dissipated energy flow W of each node can be calculated using the following formula. diss :
[0157]
[0158] Among them, t start t end Let P(t) represent the start and end times of the systemic oscillation period, respectively. Let P(t) be the active power of the node at time t, and δ(t) be the voltage phase angle of the node at time t. ss and δ ss These represent the steady-state operating point values of the nodes. It can be understood that the start time of the systemic oscillation period can be the initial moment of the systemic oscillation, a time after a preset duration following the oscillation, or a time before a preset duration following the oscillation. Similarly, the end time can be the end time of the systemic oscillation, a time after a preset duration following the end of the oscillation, or a time between a preset duration following and following the oscillation.
[0159] When dealing with broadband oscillations in power systems, especially in areas with abundant renewable energy sources, oscillations often occur simultaneously at multiple points. In such cases, the voltage, current, and power waveforms of both the source and affected units are highly similar in amplitude and phase. If a single-head attention mechanism is used, it tends to assign average weights to highly similar input characteristics, making it impossible to distinguish between the driving and affected sources, and thus failing to determine the source of the vibration.
[0160] Based on this, in one possible implementation, a graph neural network with a multi-head attention mechanism can be used to determine the oscillation source of the systemic oscillation. Specifically, see... Figure 6 , Figure 6 for Figure 5 A schematic diagram of a specific implementation of step S142 is shown, including the following steps:
[0161] Step S1421: Extract the node features of each node;
[0162] Step S1422: Input the node features of each node into a graph neural network with a multi-head attention mechanism to obtain the oscillation source of the systemic oscillation output by the graph neural network;
[0163] The node features include four components, which are used to characterize the wide-area dissipated energy flow of the node, the topological position of the node in the propagation path, the oscillation amplitude of the node, and the short-circuit ratio of the node, respectively. The multi-head attention mechanism is used to adjust the influence of the four components on the output of the graph neural network based on the knowledge learned during the training phase.
[0164] Specifically, node characteristics may include net information flow, energy flow, short-circuit ratio, and oscillation amplitude. Net information flow can characterize the topological position of a node in the propagation path. In one possible implementation, node characteristics may also include node type, such as wind power, photovoltaic, thermal power, or load node.
[0165] In this case, such as Figure 7 As shown, for each node in the power grid (taking nodes 1 to 4 in the figure as examples), the node characteristics of each node can be represented by the vector x. i =[Net Information Flow, Energy Flow, Short-Circuit Ratio, Oscillation Amplitude, Node Type] represents the input sequence of a graph neural network model. After the node features of each node are input into the model through its input layer, the input sequence is converted into a fixed-dimensional vector by the model's embedding layer and spatially encoded. Then, a multi-head attention mechanism captures global dependencies, and a feedforward network performs non-linear feature transformation. Finally, the probability that each node is an oscillation source is output (i.e., the probability of each node being an oscillation source). Figure 7 The node with the highest probability is identified as the oscillation source (based on the source probability in the equation).
[0166] In one possible implementation, each node also has edge features. For a line connecting node i and node j, its edge features can be represented by a vector x. ij =[resistance, reactance, power flow value] represents.
[0167] It is understood that the graph neural network is obtained through pre-training, and the training process of the graph neural network will not be described in detail in the embodiments of this application.
[0168] By employing the embodiments of this application and introducing a graph neural network with a multi-head attention mechanism, the graph neural network can learn during the training phase the importance of the four feature components for oscillation source localization under different oscillation states. This allows for dynamic adjustment of the influence of each feature on the final decision during the actual determination of the oscillation source. Furthermore, the four feature components can reflect the node state from different perspectives. When a feature is distorted due to measurement noise or accidental interference, other features can still provide reliable clues, ensuring the stability of the overall system judgment and improving robustness.
[0169] In one possible implementation, since the propagation of power grid oscillations is essentially along the path with the minimum electrical distance, and the oscillations attenuate during propagation, electrical distance can also be introduced into the attention mechanism described above. In the attention mechanism, the attention score is negatively correlated with the electrical distance between nodes. In this way, the model can also learn the degree of influence of electrical distance on the final decision, so that the graph neural network can pay more attention to the interaction between nodes with closer electrical distance when determining the final decision, thereby more accurately identifying the oscillation source and reducing misjudgments caused by irrelevant nodes.
[0170] In other words, the input to a graph neural network model consists of two types of data: dynamic node feature data and static topological data, and the output is the probability distribution of oscillation sources. The input and output will be explained in detail below.
[0171] Input A: Node feature tensor
[0172] Dimensions: [1, N, F] (Batch = 1, N = number of nodes, F = feature dimension)
[0173] Source: Real-time waveforms collected by the WAMS system, calculated by the algorithm in process_data.py (an algorithm script).
[0174] The specific meaning of this feature (taking F=3 as an example):
[0175] Feature 0: Net Information Flow T net , is a data-driven metric that represents the causal driving force of node i on PCC (Point of Common Coupling).
[0176] Feature 1: Energy dissipation W diss , is a physical driving index that indicates whether node i is emitting energy (negative damping) or consuming energy.
[0177] Feature 2: Amplitude fluctuation A mag , is an auxiliary indicator that represents the intensity of oscillation at node i.
[0178] (Optional extensions): Short-circuit ratio, equipment type code (wind / solar).
[0179] Input B: Spatial distance matrix
[0180] Dimensions: [N,N]
[0181] Source: Obtained from network topology analysis applications of SCADA (Supervisory Control And Data Acquisition) systems or EMS (Energy Management System).
[0182] Specific meaning: Record the electrical distance (shortest path steps or impedance-weighted distance) between any two nodes i and j.
[0183] Output: Oscillation source probability distribution
[0184] Dimensions: [1, N]
[0185] Specific meaning: Output a vector of length N, where each element has a value between 0 and 1, and the sum is 1.i This indicates the probability that Unit i is the dominant source of this broadband oscillation. For example, assuming the output vector P3=[0.01,0.02,0.95,0.01,0.01], it means that the model has a 95% confidence in determining that Unit 3 is the oscillation source.
[0186] The graph neural network model consists of an input layer, a multi-head attention layer, and an output layer. The input layer takes node features or node and edge features as input. The multi-head attention layer consists of a 6-layer Transformer encoder (a type of deep learning model). The output of the multi-head attention layer is normalized after passing through a fully connected layer in the output layer, and outputs the probability that each node is an oscillator.
[0187] In one possible implementation, electrical distance can be represented by spatial location coding, which is introduced when calculating attention scores using the following formula:
[0188]
[0189] Where Q, K, and V are the query, key, and value matrices, respectively. This is a spatial bias term based on the shortest electrical distance between nodes vi and vj in the power grid topology.
[0190] See Figure 8 After introducing spatial location encoding, the multi-head attention mechanism fuses the features of each node as follows: Figure 8 As shown, in the multi-head attention mechanism, each head receives different types of target node features, neighbor node features, and spatial location encoding tables in parallel. Each head then applies the target node features through a weight matrix W. Q A linear transformation is performed to generate a query vector Q, and the features of each neighbor node are weighted by a weight matrix W. K and W V A linear transformation is performed to generate the corresponding key vector K and value vector V. Then, the correlation between the target node's Q and the K of each neighbor node is calculated. The similarity obtained in the previous step is added to the distance bias obtained from the spatial location encoding table. The weighted score is normalized (usually using Softmax) to transform it into a probability distribution, i.e., the attention weight of each neighbor node. Then, the calculated weights are used to perform a weighted summation on the transformed value vector V of the neighbor nodes, thus obtaining the single-head context. Since N parallel heads will independently generate N different single-head contexts, each head learns with a different focus. The N single-head contexts are concatenated and linearly projected to obtain the final node fusion feature.
[0191] In another possible implementation, graph neural networks can be directly used to determine the oscillation source of the systemic oscillation. Based on this, one possible implementation is... Figure 5 A schematic diagram of another specific implementation of step S142 is shown, including the following steps:
[0192] Step S1423: Input the wide-area dissipated energy flow and propagation path of each node into the graph neural network to obtain the oscillation source of the systemic oscillation output by the graph neural network;
[0193] The graph neural network is pre-trained on a sample dataset, which includes sample data under conditions of forced oscillation, negative damped oscillation, and parameter-coupled oscillation.
[0194] It is understandable that timing alignment is difficult due to potential systematic deviations in the positioning and timing signals of different power plants. To address this timing alignment issue, one possible implementation involves obtaining the power parameters of each node through the following steps: Figure 9 As shown, Figure 9 The flowchart for obtaining power parameters provided in this application embodiment includes the following steps:
[0195] Step S601: Obtain the parameters detected by the measurement units set at each node of the power system, and use them as the detection parameters of each node.
[0196] Step S602: Construct an objective function based on the detection parameters of each node;
[0197] Step S603: Calculate the independent variable that makes the dependent variable of the objective function satisfy the preset conditions, and use it as the predicted clock offset of each measurement unit.
[0198] Step S604: Perform reverse compensation on each detection parameter to offset the predicted clock offset, and obtain the power parameters of each node.
[0199] The measurement unit of each node can be a PMU (Power Management Unit) or other measurement units; this application embodiment does not limit this. The parameters detected by the detection unit can be voltage, current, frequency, phase angle, etc.; this application embodiment does not limit this. For example, the measurement unit of each node can be a synchronous phasor measurement device and a broadband measurement device for the entire main network and the new energy aggregation area.
[0200] An objective function is constructed based on the detection parameters of each node, the clock offset of each measurement unit, and the expected parameters of each node. The independent variable of the objective function is the clock offset of each measurement unit, and the dependent variable is positively correlated with the difference between the detection parameters and expected parameters of each node. The expected parameters are the parameters that the measurement unit is expected to detect in the presence of clock offset.
[0201] The preset condition can be the minimum value of the dependent variable, the value of the dependent variable being less than a preset threshold value, or other conditions. This application does not limit these conditions.
[0202] Taking the preset condition of minimizing the dependent variable as an example, when calculating the predicted clock offset of each measurement unit, the independent variable that minimizes the dependent variable of the objective function is calculated and used as the predicted clock offset of each measurement unit.
[0203] Under steady-state operation of a power system, the phase angle difference between the two connected transmission lines should conform to the power flow equations. If a substation clock has a deviation... Then its measured phase angle A fixed offset will be produced. Therefore, when performing reverse compensation for each detection parameter, compensation can be performed by calculating the difference or sum between the measured phase angle and the fixed offset.
[0204] Understandably, if the predicted clock offset is small, its impact on the phase offset is minimal, and therefore its influence can be ignored, meaning no reverse compensation is performed on the detection parameters. Conversely, if the predicted clock offset has a significant impact, reverse compensation is required for the detection parameters. In one possible implementation, reverse compensation can be performed on the detection parameters when the predicted clock offset exceeds a preset offset threshold, and otherwise, no compensation is performed.
[0205] In one possible implementation, the objective function can be expressed by the following formula:
[0206]
[0207] in, These are the detection parameters detected by each detection unit. For the measurement equation, For the first The clock deviation of each plant station. By solving this equation, the clock deviation of each measurement unit can be calculated in real time. .
[0208] Under the premise that the dependent variable is minimized, the objective function can be expressed by the following formula:
[0209]
[0210] When | When | is greater than r, the power system automatically performs reverse compensation on all phase data of the station during the data preprocessing stage:
[0211] ;
[0212] in, For the compensated phase data, The phase data detected by the measurement unit is r, which is a preset offset threshold set based on experience and requirements.
[0213] For example, such as Figure 10 As shown, the clock of node A is t, and the clock of node B is t. This means that there is a clock offset between node A and node B. Then the measured phase angle between the two nodes will produce a fixed offset. The clock deviation is obtained after clock correction. Then, the phase data is reverse compensated according to the above reverse compensation formula.
[0214] By using the embodiments of this application, it can be ensured that in subsequent causal analysis, the “leading” or “lagging” of the waveform of the non-node is a real physical phenomenon, rather than an illusion caused by timing errors, thereby improving the reliability of causal analysis.
[0215] Furthermore, since servers in related technologies typically employ a "whole-second packet grouping" strategy with a 1-second cycle, that is, they wait for all data from all plants to arrive within 1 second before processing them uniformly. This results in a fixed latency of at least 1 second, which cannot meet the millisecond-level control requirements of wideband oscillations (such as subsynchronous oscillations above 20Hz).
[0216] To address the issue of whole-second waiting delay, in one possible implementation, the process of the measurement unit probing parameters at each node in step S601 above is as follows: Figure 11 As shown in the figure, a micro-time window (i.e., the sliding window in the figure) is preset. The size of the time window can be set according to requirements, such as a micro time window. =20ms. This way, when the measurement unit probes parameters, it no longer waits for whole seconds, but instead uses time windows as the granularity. Once the arrival rate of data frames within that time window in the buffer exceeds a preset acquisition rate threshold, the "micro-batch processing task" of the micro-batch processor is immediately triggered. For the remaining data that has not arrived, there is no blocking or waiting; instead, the linear prediction value from the previous moment is used to fill in the gaps and marked as interpolated data.
[0217] If the data flow of the i-th channel at time t is The system bus bandwidth limit is The micro-batch processor controls the inbound rate through the following logic: If If this happens, a jitter buffer is activated, postponing the data entry task for non-critical nodes (such as voltage monitoring points in non-oscillation areas). The process is executed periodically, prioritizing real-time throughput of data in the oscillation alarm area; otherwise, the data is stored.
[0218] Understandably, once the oscillation source is identified, corresponding strategies can be employed to suppress the oscillation. However, since the oscillation frequency bands are different, the strategies employed may also differ.
[0219] Based on this, a second aspect of the embodiments of this application provides a wide-area broadband oscillation decision method, see [link to relevant documentation]. Figure 12 , Figure 12 A schematic diagram of the wide-area broadband oscillation decision method provided in the embodiments of this application includes the following steps:
[0220] Step S1201: Obtain the oscillation source;
[0221] The oscillation source was determined using the causal-based wide-area broadband oscillation localization and tracing method described in the first aspect above. The specific acquisition process is detailed above and will not be repeated here.
[0222] Step S1202: Determine and execute the oscillation response strategy based on the oscillation source and the oscillation frequency band of the systemic oscillation.
[0223] In this embodiment of the application, when a systemic oscillation is detected in the power system, the transfer of power parameters between nodes in the power system is calculated. Since transfer entropy is a theoretical measure that quantifies the predictive information of one time series on another, a larger transfer entropy between the power parameters of two nodes indicates a strong causal influence between them. Furthermore, if the transfer entropy between the power parameters of node 1 and node 2 is greater than the transfer entropy between the power parameters of node 2 and node 1, then a causal relationship between node 1 and node 2 can be considered. In other words, by calculating the transfer entropy of the power parameters of different nodes, the causal direction of each node can be determined. By treating each node as a vertex and the causal relationship as directed edges, nodes with causal relationships are connected in a cause-and-effect order to form a directed graph. Since the oscillation source is usually the starting point of multiple propagation paths in the oscillation propagation path, the oscillation source can be accurately determined based on the propagation path. Therefore, appropriate strategies can be adopted for the oscillation source based on the oscillation source and the oscillation frequency of the systemic oscillation to suppress the oscillation and ensure the safe and stable operation of the power system.
[0224] The following is combined with Figure 13 The suppression strategies for the oscillation source at different oscillation frequencies are explained:
[0225] like Figure 13As shown, the oscillation frequency band is ultra-low frequency, specifically 0–0.1 Hz (or 0.02–0.1 Hz), and the oscillation source is a thermal power unit. Therefore, the oscillation response strategy is determined to be: reduce the output of the oscillation source and disable the automatic generation control or primary frequency regulation function of the oscillation source. In this oscillation frequency band, the cause of oscillation is usually improper parameters of the thermal power unit's speed governor; therefore, the strategy logic could be: disable automatic generation control or disable primary frequency regulation.
[0226] If the oscillation frequency band is low, i.e., 0.1–2.5 Hz, and the oscillation source is in range mode, then the oscillation response strategy is determined to be: reduce the power flow at the tie line end face or increase the voltage. In this oscillation frequency band, the cause of oscillation is usually insufficient damping in the inter-region tie line; therefore, the strategy logic is: increase system damping. Specific strategies could be: reducing tie line power, or: initiating DC line power modulation, reducing the power flow at the tie line end face, or increasing the voltage.
[0227] If the oscillation frequency band is the subsynchronous / supersynchronous band, i.e., the oscillation frequency band is 2.5~100Hz, and the oscillation source is a new energy mode, then the oscillation response strategy can be: disconnecting the collector line of the new energy power station at the source, or adjusting the power. This oscillation frequency can be further subdivided into 2.5~45Hz and 45~100Hz. When the oscillation frequency is 2.5~45Hz, the causes of oscillation are usually the excessively high bandwidth of the new energy PLL (Phase Locked Loop) and the series compensation line SSR (Subsynchronous Resonance). Therefore, the strategy logic is: to disrupt the resonance condition. Specific strategies can be to implement virtual inertia damping control of the wind farm, disconnect the end collector line, etc. When the oscillation frequency is 45~100Hz, the causes of oscillation are usually the high-frequency resonance of the flexible DC system and filter amplification. Therefore, the strategy logic is: to adjust the switching frequency / filter. Specific strategies can be: to adjust the carrier frequency of the flexible DC converter valve, disconnect a certain sub-high-pass filter, etc.
[0228] If the oscillation frequency band is high, i.e., the oscillation frequency band is greater than 100Hz, then the strategy is to adjust the control loop parameters.
[0229] In one possible implementation, after suppressing the oscillations, the data related to the actual oscillations can be used as new samples to incrementally learn the graph neural network model, continuously improving its adaptability to power grid characteristics. To more clearly illustrate the causal-based wide-area broadband oscillation localization and tracing method and collaborative defense method provided in this application, specific embodiments are described below.
[0230] Assume a new energy collection station connects to 5 wind farms (W1-W5) and 3 photovoltaic power stations (PV1-PV3). W1 and W2 are units of the same manufacturer and model, collected via a short circuit, with a system short-circuit ratio of approximately 1.8. At T=0 seconds, a continuous divergent oscillation of the collection station bus voltage is detected at a frequency of 23.5Hz. At T=100 milliseconds, data is entered into the database, and the oscillation detection module triggers an alarm. At T=200 milliseconds, the system calculates that the oscillation mode similarity of W1, W2, W3, and the collection station bus is greater than 0.9, classifying it as a regional oscillation. Simultaneously, the alarm for PV1 is removed because, although PV1 fluctuates, its phase is incoherent with the dominant mode (the oscillation mode similarity between PV1 and the collection station bus is less than 0.4), indicating that PV1 is affected by the disturbance, not a participating station.
[0231] By calculating the energy flow direction, it was found that the energy flow from the collecting station bus is towards W1 and W2, but the energy exchange between W1 and W2 is extremely intense and the direction repeatedly reverses. The integral value... When the value is close to 0, it is impossible to determine whether W1 or W2 is the source. Using the method described in this application, the transfer entropy between W1, W2, and PCC is first calculated to determine: (Strong drive) (Passive response), and, This indicates that the oscillation information is transmitted from W1 to W2. Then, the energy flow (W1 and W2 are both 0), the causal relationship (W1 flows out), and the short-circuit ratio (1.8) are input into the graph neural network model. The model assigns high weights to the causal relationship through the attention mechanism, such as 90%. Finally, the model outputs that the probability of W1 being the oscillation source is 0.92 and the probability of W2 being the oscillation source is 0.08.
[0232] The power system automatically identified wind farm W1 as the oscillation source, a subsynchronous oscillation of fault type, and generated a strategy: disconnect the #1 and #2 collector lines of wind farm W1. At T=500 milliseconds, the corresponding command was automatically issued after safety verification; at T=1.5 seconds, after the partial disconnection of W1, the oscillations of W2 and the main grid decayed to disappear within 2 seconds, and the power system returned to stability.
[0233] If the method of this application is not adopted, and it is impossible to determine which of W1 and W2 is the oscillation source, the traditional disconnection strategy of simultaneously disconnecting both W1 and W2 would result in an additional loss of 300MW of output. Therefore, the method of this application can recover the power generation loss of W2 and shorten the fault handling time.
[0234] Based on the above, the flowcharts of the wide-area broadband oscillation localization and tracing method and the wide-area broadband oscillation coordination method based on causality provided in this application are as follows: Figure 14 As shown, Figure 14The flowcharts for the causal-based wide-area broadband oscillation localization and tracing method and the wide-area broadband oscillation coordination method provided in the embodiments of this application include the following steps:
[0235] Step S1: Wide-area broadband data synchronous acquisition and management;
[0236] Specifically, at the control master station, data from synchronous phasor measurement devices and broadband measurement devices of the entire main network and new energy aggregation areas are collected through the Wide Area Measurement System (WAMS).
[0237] Step S2: Oscillation detection and regional consistency strategy;
[0238] Specifically, the collected data is monitored for oscillation across the entire frequency band. When an oscillation signal is detected, multi-device correlation analysis is performed based on the power grid topology to calculate the regional consistency index of the oscillation mode and eliminate local pseudo-oscillations caused by abnormalities of a single device or in-station commissioning.
[0239] Step S3: Wide-area spatiotemporal causal interaction computation;
[0240] Specifically, for events identified as systemic oscillations, especially homogeneous groups of units with similar waveform characteristics, key observation nodes are selected in a wide area, the transfer entropy and net information flow between nodes are calculated, and a directed causal network reflecting the propagation path of oscillation energy is constructed to identify the driving source of oscillations.
[0241] Step S4: Location of oscillation sources in physical-data fusion;
[0242] Specifically, the physical indices of wide-area dissipative energy flow of each node are calculated, and combined with the causal network obtained in step S3, the pre-trained graph neural network model is input. The time-varying characteristics of oscillations are captured through the attention mechanism, and the probability score of each node as the dominant oscillation source is output.
[0243] Step S5: Assisted decision generation.
[0244] Specifically, based on the positioning results and oscillation frequency characteristics, a hierarchical control strategy is automatically generated, including disconnecting the unit, exiting automatic generation control or primary frequency regulation, and DC power modulation.
[0245] Wherein, step S1 corresponds to the process of the measurement unit detecting parameters in step S601, step S2 corresponds to steps S21 to S24, step S3 corresponds to steps S11 to S14, step S4 corresponds to steps S141 to S142, and step S5 corresponds to step S1202.
[0246] To illustrate this application more clearly, the internal processing flow of the WAMS system when an oscillation occurs is described below:
[0247] Phase 1: Real-time monitoring and triggering (T=0ms)
[0248] Data access: The WAMS front-end receives PMU data from the entire network in 20ms windows through a micro-batch packet grouping mechanism;
[0249] Start-up trigger: The "oscillation detection module" scans the bus voltage in real time (corresponding to steps S21 to S24).
[0250] Judgment: The 750kV bus voltage was found to be oscillating continuously at 23Hz with an amplitude exceeding 2%, and the regional consistency index R>0.6;
[0251] Action: Immediately trigger the "Source Analysis" task and capture a data window from the past 2 seconds to the current moment.
[0252] Phase 2: Feature Engineering Calculation (T+200ms)
[0253] Parallel processing on edge computing nodes or high-performance servers: 1. Topology snapshot: Immediately read the current circuit breaker status and generate the spatial distance matrix at this moment (because the power grid operation mode may change at any time, the topology must be updated in real time); 2. Feature calculation: Quickly calculate the W of each renewable energy power station for the captured 2-second window of data. diss and T net Generate the input tensor X.
[0254] Phase 3: Model Inference (T+250ms)
[0255] Loading the model: The input tensor X and distance matrix G are fed into the trained graph neural network model;
[0256] Forward propagation: The multi-head attention mechanism within the model begins to work: Head 1 detects wind turbine T (number 3). net Significantly positive; the first two points indicate that wind turbine #3 is located at the end of the network; the first three points indicate that although the energy flow W... diss It's ambiguous, but overall the judgment leans towards number 3.
[0257] Output: The model outputs a probability vector, indicating that wind turbine #3 is locked (98% probability).
[0258] Phase 4: Decision Support and Control (T+500ms)
[0259] Based on the reasoning results, the system combines the "strategy knowledge base" (i.e. Figure 13(Suppression strategy for oscillation source at different oscillation frequencies), generating control commands: 1. Look up table: Oscillation frequency 23Hz (subsynchronous) + source is wind turbine. 2. Generate strategy: Preferred: Activate virtual damping control on the collector line of wind turbine No. 3 (if available); Alternative: Disconnect the #2 collector line where wind turbine No. 3 is located. 3. Human-machine interaction / automatic execution: An alarm box pops up on the dispatcher workstation: "Subsynchronous oscillation detected, source: XX wind farm #2 line, confidence level 98%. Suggested operation: Reduce or disconnect the output of this feeder."
[0260] Phase 5: Oscillation Subsidence and Feedback (T+2s)
[0261] Effectiveness verification: WAMS continued to monitor after the excision operation was performed.
[0262] Closed loop: If the oscillation decays and disappears within 1-2 seconds, mark this tracing as "successful".
[0263] Online learning: Store the "raw data + successfully located label (wind turbine No. 3)" of this event in the historical database for future incremental training of the model.
[0264] It is evident that the solution proposed in this application, by utilizing pattern recognition capabilities and combining them with power grid topology constraints, provides precise cut-off suggestions, thus avoiding the risks of extensive and disorderly actions.
[0265] In one possible implementation, simulation software can be used to simulate oscillations and obtain relevant data. The following details the specific steps for simulating data acquisition and building the model:
[0266] Part 1: Constructing automated simulation data to generate a massive amount of data points covering various operating conditions and containing clearly labeled (oscillation sources, disturbance sources). This includes the following steps:
[0267] 1. PSCAD (Power Systems Computer Aided Design, an electromagnetic transient simulation software) model building standards (benchmark environment)
[0268] Unit scale: Construct a collection station model containing 10-15 new energy units (wind / solar hybrid).
[0269] Understandably, too few units (2-3) cannot demonstrate the complexity of "homogeneous resonance"; too many (>20) result in slow simulation speed, or even cause PSCAD to crash. Ten units are sufficient to form complex interference fringes.
[0270] Topology: It adopts a hybrid structure of "chain + radial".
[0271] For example, four wind turbines are connected in series on one collector line (simulating a long chain), and six photovoltaic units are connected in parallel on another collector line (simulating a cluster). The key point is the inclusion of cables of varying lengths (simulating different impedance distances), which is crucial for training the model to learn "spatial location encoding."
[0272] Control Model: A simple current source model cannot be used; a detailed electromagnetic transient model (EMT Model) is required. This model must include: a PLL (Phase-Locked Loop), an inner current loop, an outer voltage loop, and dynamic DC-Link capacitor settings. This is because the root cause of broadband oscillations is often the coupling between the PLL bandwidth and the weak grid impedance, or improper inner loop parameter settings. Without these control details, there will be no oscillation.
[0273] 2. Harmonic Sources and Fault Settings
[0274] Three core datasets need to be created:
[0275] Combination A: Parametric Instability (Negative Damped Oscillation) – Simulating "Internal Factors"
[0276] Setup method: Modify the control parameters instead of adding external interference.
[0277] Operation: Randomly select a unit (e.g., wind turbine #3) and gradually increase its PLL proportional gain K_p from the default value (e.g., 60) to the critical value (e.g., 120).
[0278] Phenomenon: Oscillation starts from divergence, and the frequency is usually between 10-40Hz (subsynchronous).
[0279] Tag: Oscillation source = Fan #3.
[0280] Combination B: Forced Oscillation Type (External Disturbance) – Simulating “External Factors”
[0281] Setup method (adding a harmonic source): Connect a controlled current source I_inj=Asin(2πft) in parallel at the grid connection point of a certain unit (such as photovoltaic #5).
[0282] Operation: Python (a computer programming language) scripts control f to sweep the frequency between 0.1Hz and 100Hz.
[0283] Phenomenon: The entire network oscillates continuously with the same amplitude, and the frequency is equal to the injection frequency.
[0284] Tag: Oscillation source = Photovoltaic #5.
[0285] Combination C: Power Grid Event Type (Negative Samples) – Simulating “Non-Oscillation”
[0286] Setup method: Adjust the power grid background without modifying the unit parameters.
[0287] operate:
[0288] Switching capacitor banks (generating transient impacts);
[0289] A short circuit fault on the remote line (causing a voltage dip);
[0290] Sudden changes in wind speed / light intensity (power fluctuations).
[0291] Phenomenon: The waveform fluctuates, but it decays rapidly (positive damping).
[0292] Tag: Oscillation source = None (or marked as safe).
[0293] 3. Python automation script implementation (batch production line)
[0294] Use Python to call the PSCAD automation interface.
[0295] The above explains the specific steps for simulating data and building a model. The following explains the process of writing code using Python:
[0296] Step 1: Preparations on the PSCAD Model Side
[0297] In order for Python to find control points, the PSCAD model needs to be modified:
[0298] 1. Expose control variables:
[0299] Within the wind turbine control module (such as the PLL module), find the proportional coefficient K_p.
[0300] Instead of entering numbers directly, connect an Import signal component (an input terminal from the component library).
[0301] Give this signal a globally unique name, such as Wind1_PLL_Kp.
[0302] Key step: In PSCAD's Project Settings -> Runtime, ensure that "EnableExternal Control" is checked.
[0303] 2. Set up the harmonic injection source:
[0304] Connect a current source in parallel at point PCC.
[0305] Connect a switch in series.
[0306] Set the frequency and amplitude of the current source, and the state (0 / 1) of the switch as variables, such as Inj_Freq, Inj_Mag, Inj_Enable.
[0307] 3. Configure the output channel:
[0308] Ensure that the P, Q, V, and I of all critical nodes are connected to the Output Channel component.
[0309] In Project Settings, set the output format to CSV (for easy reading by Python).
[0310] Step 2: Python automation control script
[0311] Create a file named generate_data.py. This script is responsible for: launching PSCAD -> modifying parameters -> running -> renaming and saving the results.
[0312] """PSCAD Automated Data Generation Script Dependencies: mhi.pscad, pandas, numpy, shutil"""import osimport timeimport randomimport shutilimport pandas aspdimport numpy as np# --- 1. Import PSCAD Automation Library---# Usually located in C:\Program Files(x86)\Manitoba Hydro International\PSCAD\Automatortry: from mhi.pscad importPSCAD from mhi.pscad.utilities.file import File except ImportError: print("Error: mhi.pscad library not found. Please check the PSCAD installation path and Python environment configuration.") exit()#--- 2. Configure Paths and Parameters---WORK_DIR = r"D:\Oscillation_Project\Simulations" # Simulation working directory MODEL_PATH = r"D:\Oscillation_Project\Model\My_Wind_Farm.pscx" #PSCAD model file OUTPUT_DIR = r"D:\Oscillation_Project\Dataset" # Result save directory PROJECT_NAME = "My_Wind_Farm" # Project name (the name displayed in PSCAD) # Define the number of samples to generate NUM_SAMPLES = 1000 def launch_pscad(): """Start PSCAD and load the project""" print("Starting PSCAD...") pscad = PSCAD() pscad.silence = True # Silent mode, no pop-up pscad.load(MODEL_PATH) return pscad def run_single_simulation(pscad, project,case_id, config): """ Run a single simulation config: A dictionary containing the parameters for this simulation""" # 1.Setting parameters # Note: The variable name must be consistent with the Signal Name set in the PSCAD model. for param_name, value in config['params'].items(): # Syntax: project.parameters(component name)['parameter name'] = value # For global variables, usually you can directly use navigate to find the component on the Canvas. # Here we assume that the Import component is used, and you can set it directly through the Canvas. # Example: Setting the PLL parameter of wind turbine 1 # This needs to be written according to the specific hierarchical structure of the model, such as "Main:WindFarm:Unit1" try:project.user_canvas.set_parameter(param_name, value) except Exception as e:print(f"Parameter {param_name} failed to be set: {e}") # 2. Run simulation print(f"[{case_id}] Start simulation... Mode: {config['type']}") project.run() # 3. Move and rename the result file # PSCAD defaults to outputting .out or .csv files in the same folder as the project. src_file = os.path.join(WORK_DIR, f"{PROJECT_NAME}.gf42", f"{PROJECT_NAME}_01.csv") dst_file =os.path.join(OUTPUT_DIR, f"raw_data_{case_id}.csv") # Wait for the file to finish writing time.sleep(1) if os.path.exists(src_file): shutil.move(src_file, dst_file) else: print(f"Warning: Result file {src_file} not found") # 4. Save the labels (Meta Data) # Save the labels (who is the source) of this simulation label_info = { "id": case_id, "source_label": config['label'], # 0=None, 1=Wind Turbine 1, 2=Photovoltaic 1..."oscillation_type":config['type'], # 'Negative_Damping' or 'Forced' "params": config['params']}return label_infodef generate_dataset(): # Initialize environment if not os.path.exists(OUTPUT_DIR): os.makedirs(OUTPUT_DIR) pscad = launch_pscad() project =pscad.project(PROJECT_NAME) labels_list = [] for i in range(NUM_SAMPLES):case_config = {} # Randomly determine scenario type scenario = random.choices(['Normal', 'PLL_Instability', 'Forced_Osc'], weights=[0.2, 0.4, 0.4])[0] if scenario == 'Normal': # Normal operation, random fluctuation of load case_config = { 'type': 'Normal', 'label': 0, # No oscillation source 'params': { 'Wind1_PLL_Kp': 60.0, # Normal value 'Inj_Enable': 0 # Disable harmonic source}} elif scenario == 'PLL_Instability': # Scenario A: Internal factor - Randomly select a wind turbine to increase PLL target_unit = random.randint(1, 5) # Assume there are 5 wind turbines kp_val = random.uniform(100.0, 150.0) # Set a range that can cause oscillation case_config= { 'type': 'Negative_Damping', 'label': target_unit, # The label is the unit number 'params': { f'Wind{target_unit}_PLL_Kp': kp_val, 'Inj_Enable': 0}} elifscenario == 'Forced_Osc': # Scenario B: External Factors - Forced Oscillation target_loc = random.randint(1, 5) freq = random.uniform(10.0, 45.0) # Subsynchronous band case_config = { 'type':'Forced', 'label': target_loc, 'params': { 'Wind1_PLL_Kp': 60.0, # Keep parameters normal 'Inj_Enable': 1, # Enable interference 'Inj_Loc': target_loc, # Interference location 'Inj_Freq':freq}} # Execute simulation meta = run_single_simulation(pscad, project, i, case_config) labels_list.append(meta) # Save label index every 100 times to prevent loss in case of crash if i% 100 == 0: pd.DataFrame(labels_list).to_csv(os.path.join(OUTPUT_DIR, "labels.csv"), index=False) # End pscad.quit() print("Data generation complete!") if __name__ == "__main__": generate_dataset().
[0313] Step 3: Feature Calculation and Dataset Creation
[0314] After receiving a massive amount of CSV files, you can't simply feed them into the model. You must perform calculations. (Net Information Flow) and (Energy dissipation).
[0315] Create a process_data.py file:
[0316] import pandas as pd import numpy as np import os from scipy.signal import hilbert # Assuming sampling rate FS = 1000 def calc_dissipating_energy(v_arr, i_arr): """ Calculate the dissipated energy W_diss Formula: Integral (Delta_P d_Delta_Theta) is simplified here to: Integral (P - P_ss) dt """ # 1. Calculate instantaneous power p_inst = v_arr i_arr #2. Filter out the DC component (steady-state value) and keep only the fluctuation component p_mean = np.mean(p_inst) p_osc = p_inst - p_mean # 3. Energy integration (simple accumulation) w_diss = np.cumsum(p_osc) # Take the energy value at the final moment as the feature return w_diss[-1] def calc_transfer_entropy(source_seq,target_seq): """ Calculate the transfer entropy Note: The actual TE calculation is very slow. Here we use a simplified version: Granger causality or the idtxl library. In order to demonstrate that the code can run, a simplified version based on lag correlation is used here. The actual project uses the idtxl library """ # Simplified logic: If the historical correlation of the source and the future correlation of the target are greater than the inverse correlation lag = 5 # Lag by 5 points # X -> Y corr_xy = np.corrcoef(source_seq[:-lag], target_seq[lag:])[0,1] # Y -> X corr_yx = np.corrcoef(target_seq[:-lag], source_seq[lag:])[0,1] # Net information flow approximation t_net = corr_xy - corr_yx return t_netdef build_training_set(raw_data_dir, label_file): """ Convert the raw CSV waveform to the feature matrix required by Graphormer""" labels_df = pd.read_csv(label_file) dataset_X = [] # Features dataset_Y = [] # Labels for idx, row in labels_df.iterrows():file_path = os.path.join(raw_data_dir, f"raw_data_{row['id']}.csv") if notos.path.exists(file_path): continue df = pd.read_csv(file_path) # Assuming there are 5 nodes node_features = [] for node_id in range(1, 6): # Traverse the 5 nodes # Read the voltage and current of the node (PSCAD output column names must correspond) v = df[f"Node{node_id}_V"].values i = df[f"Node{node_id}_I"].values pcc_v = df["PCC_V"].values # PCC point voltage as reference #--- Calculate features--- # 1. Physical features: Dissipated energy w_diss = calc_dissipating_energy(v,i) # 2. Causal features: Net information flow from node to PCC t_net = calc_transfer_entropy(v,pcc_v) # 3. Auxiliary features: Amplitude amp = np.max(v) - np.min(v) # Construct the feature vector of the node[T_net, W_diss, Amp] node_features.append([t_net, w_diss, amp]) # Store all node features of a sample into dataset_X.append(node_features) dataset_Y.append(row['source_label']) # Save as NumPy format for PyTorch loading np.save("X_train.npy",np.array(dataset_X)) np.save("Y_train.npy", np.array(dataset_Y)) print(f"Training set construction complete, shape: {np.array(dataset_X).shape}")if __name__ == "__main__":build_training_set(r"D:\Oscillation_Project\Dataset", r"D:\Oscillation_Project\Dataset\labels.csv").
[0317] Step 4: Graphormer model training code
[0318] import torch import torch.nn as nn import torch.optim as optim from torch.utils.data import TensorDataset, DataLoader class SpatialGraphormer(nn.Module): def __init__(self, num_nodes, input_dim, d_model=64, nhead=4, num_layers=3): super().__init__() # 1. Node feature embedding layer (transforming physical features from 3D to 64D) self.embedding = nn.Linear(input_dim, d_model) # 2. Spatial location encoding # Simplified here: assuming the distance matrix is fixed, learn as a bias self.spatial_bias = nn.Parameter(torch.randn(num_nodes, num_nodes)) # 3. Transformer Encoder encoder_layer = nn.TransformerEncoderLayer(d_model=d_model, nhead=nhead, batch_first=True) self.transformer = nn.TransformerEncoder(encoder_layer, num_layers=num_layers) # 4. Output classification layer (determine which node is the source) self.classifier = nn.Linear(d_model, 1) # Output score def forward(self, x): # x shape: [Batch, Num_Nodes,Input_Dim] # Embedding h = self.embedding(x) # [B, N, 64] # Graphormer core: adding spatial bias to Attention # Since it is not easy to directly insert bias in the standard PyTorch Transformer, # a simplified addition method is used to simulate it: the position information is directly added to the Feature (simplified implementation) # a rigorous implementation requires rewriting the Attention Layer # pass in Transformer # Note: here we use the Mask mechanism or direct addition to simulate the influence of graph structure h = self.transformer(h) # classification logits = self.classifier(h).squeeze(-1) # [B, N] return logitsdef train_model(): # 1. Load data X = torch.FloatTensor(np.load("X_train.npy")) # [Sample, 5, 3] Y = torch.LongTensor(np.load("Y_train.npy")) # [Sample] (0-5, 0 indicates no source) # simple processing: if Y=0 (No source), ignored in Loss, or treated as class 0 # Here we assume only training on the case with source, or treating 0 as a class dataset = TensorDataset(X, Y) dataloader = DataLoader(dataset,batch_size=32, shuffle=True) # 2. Initialize the model model = SpatialGraphormer(num_nodes=5, input_dim=3) optimizer = optim.Adam(model.parameters(), lr=0.001)criterion = nn.CrossEntropyLoss() # Multi-class problem (who is the source) # 3. Training loop forepoch in range(50): total_loss = 0 for batch_x, batch_y in dataloader:optimizer.zero_grad() # Forward propagation output = model(batch_x) # [B, 5] # Calculate Loss (Note: CrossEntropy requires target to be a class index) # batch_y stores 1, 2, 3, 4, 5. Need to subtract 1 to become 0-4 index, or handle the case without a source # Here is a simplified processing: assume the label is 0~4 loss =criterion(output, batch_y) loss.backward() optimizer.step() total_loss += loss.item() print(f"Epoch {epoch}, Loss: {total_loss / len(dataloader)}") # Save the model torch.save(model.state_dict(), "oscillation_model.pth") print("Model training completed and saved!") if __name__ == "__main__": train_model().
[0319] Corresponding to the first and second aspects mentioned above, a third aspect of the embodiments of this application provides a wide-area broadband oscillation collaborative defense system, the system comprising: an intelligent analysis unit and a decision control unit;
[0320] The intelligent analysis unit is used to determine the source of oscillation in the event of systemic oscillation in the power system, according to any of the methods described in the first aspect above.
[0321] The decision control unit is used to determine and execute oscillation response strategies for systemic oscillations in accordance with the method described in the second aspect above.
[0322] In this embodiment of the application, when a systemic oscillation is detected in the power system, the transfer of power parameters between nodes in the power system is calculated. Since transfer entropy is a theoretical measure that quantifies the predictive information of one time series on another, a larger transfer entropy between the power parameters of two nodes indicates a strong causal influence between them. Furthermore, if the transfer entropy between the power parameters of node 1 and node 2 is greater than the transfer entropy between the power parameters of node 2 and node 1, then a causal relationship between node 1 and node 2 can be considered. In other words, by calculating the transfer entropy of the power parameters of different nodes, the causal direction of each node can be determined. By treating each node as a vertex and the causal relationship as directed edges, nodes with causal relationships are connected in a cause-and-effect order to form a directed graph. Since the oscillation source is usually the starting point of multiple propagation paths in the oscillation propagation path, the oscillation source can be accurately determined based on the propagation path. Therefore, appropriate strategies can be adopted for the oscillation source based on the oscillation source and the oscillation frequency of the systemic oscillation to suppress the oscillation and ensure the safe and stable operation of the power system.
[0323] In one possible implementation, the system further includes a data front-end unit;
[0324] The data front-end unit is used to acquire and cache the detection parameters detected by the measurement units set at each node of the power system; if the acquisition rate of the detection data in any time window reaches the preset acquisition rate threshold, the acquisition data in the time window that has not been acquired is predicted based on the acquisition data already acquired in that time window; and the acquisition data in that time window and the predicted data are sent to the intelligent analysis unit.
[0325] The process of the data front-end unit acquiring power parameters is described above and will not be repeated here.
[0326] The intelligent analysis unit is also used to determine the power parameters used in determining the oscillation source according to any of the methods in the first aspect, based on the probe data sent by the data front-end unit.
[0327] By employing the embodiments of this application, the delay problem caused by waiting for whole seconds can be solved.
[0328] Based on the above, the architecture of the wide-area broadband oscillation collaborative defense system provided in this application embodiment can be as follows: Figure 15As shown, it includes a data front-end layer, a time-series database layer, an intelligent analysis layer, and a decision control layer. The data front-end layer includes a micro-batch scheduler (i.e., the micro-batch processor mentioned earlier) and a time alignment module. The micro-batch processor is used for micro-batch processing tasks, and the time alignment module is used for time-series alignment. The time-series database layer is used for high-compression storage and historical playback. The intelligent analysis layer includes a causal computation engine and a graph neural network engine. The causal computation engine is used to calculate the causal relationships between nodes, and the graph neural network engine is used to determine the oscillation source. The decision control layer is used to provide a policy library (i.e., the decision library mentioned earlier) and control command generation.
[0329] A fourth aspect of the embodiments of this application also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0330] Memory, used to store computer programs;
[0331] When a processor executes a program stored in memory, it implements any of the steps described in the first aspect above.
[0332] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in either the first or second aspect described above.
[0333] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0334] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0335] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0336] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0337] In another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, the computer program implements the steps of any of the above-described causal-based wide-area broadband oscillation localization and tracing methods and wide-area broadband oscillation collaborative defense methods.
[0338] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the causal-based wide-area broadband oscillation localization and tracing methods and the wide-area broadband oscillation collaborative defense method described in the above embodiments.
[0339] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0340] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0341] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0342] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A wide-area broadband oscillation localization and source tracing method based on causal relationships, characterized in that, The method includes: When a systemic oscillation is detected in the power system, the transfer entropy between the power parameters of each node in the power system is calculated. Based on the transfer entropy, the causal relationship between the power parameters of each node is determined; By connecting the nodes where the causal relationship exists between the power parameters in the order of cause and effect, the propagation path of the systemic oscillation in the power system can be obtained. Based on the propagation path, the oscillation source of the systemic oscillation is determined.
2. The method according to claim 1, characterized in that, The method further includes: If an oscillation is detected in the power system, the node where the oscillation occurs is identified as the target node; In the power system, nodes whose electrical distance from the target node meets a preset nearest neighbor condition are identified as neighbor nodes; Calculate the consistency between the power parameters of the target node and the oscillation modes of each of the neighboring nodes; If the consistency is higher than a preset consistency threshold, it is determined that a systemic oscillation has been detected in the power system.
3. The method according to claim 2, characterized in that, The oscillation mode includes: an oscillation envelope and an oscillation phase. The calculation of the consistency between the power parameters of the target node and the oscillation modes of each neighboring node includes: For each neighboring node, calculate the correlation between the oscillating envelope of the target node and the oscillating envelope of the neighboring nodes; For each neighboring node, the difference between the actual phase shift and the expected phase shift is calculated. The actual phase shift is the offset of the oscillation phase of the target node relative to the oscillation phase of the neighboring node, and the expected phase shift is the phase shift expected to be caused by the impedance between the target node and the neighboring node. The similarity between the power parameters of the target node and the power parameters of each of the neighboring nodes is calculated, wherein the similarity is positively correlated with the correlation and negatively correlated with the difference. The proportion of neighboring nodes whose similarity is higher than a preset similarity threshold is statistically obtained and used as the consistency between the power parameters of the target node and the oscillation modes of each neighboring node.
4. The method according to claim 3, characterized in that, The oscillation mode also includes the oscillation master frequency, and the difference between the oscillation master frequency of the target node and the oscillation master frequency of the neighboring node is called the oscillation master frequency difference; The degree of similarity is also negatively correlated with the difference in the dominant oscillation frequency.
5. The method according to claim 1 or 2, characterized in that, The node's power parameters are obtained in the following ways: The parameters detected by the measurement units set at each node of the power system are obtained and used as the detection parameters of each node. An objective function is constructed based on the detection parameters of each node. The independent variable of the objective function is the clock offset of each measurement unit, and the dependent variable is positively correlated with the difference between the detection parameters and expected parameters of each node. The expected parameters are the parameters that the measurement unit is expected to detect in the presence of the clock offset. The independent variables that make the dependent variable of the objective function satisfy the preset conditions are calculated and used as the predicted clock offset of each measurement unit. Each of the aforementioned detection parameters is then reverse-compensated to offset the predicted clock offset, thereby obtaining the power parameters of each node.
6. The method according to claim 1, characterized in that, Determining the oscillation source of the systemic oscillation based on the propagation path includes: Calculate the energy flow of each node during the occurrence of the systemic oscillation, and use it as the wide-area dissipated energy flow of each node; The oscillation source of the systemic oscillation is determined based on the wide-area dissipated energy flow and the propagation path of each node.
7. The method according to claim 6, characterized in that, The calculation of the energy flow of each node during the occurrence of the systemic oscillation, as the wide-area dissipated energy flow of each node, includes: The energy flow of each node during the occurrence of the systemic oscillation is calculated according to the following formula, which serves as the wide-area dissipated energy flow of each node: ; Among them, W diss For wide-area dissipative energy flow, t start t end Let P(t) represent the start and end times of the systemic oscillation period, respectively, where P(t) is the active power of the node at time t, and δ(t) is the voltage phase angle of the node at time t. ss and δ ss These are the steady-state operating point values of the nodes.
8. The method according to claim 6, characterized in that, The step of determining the oscillation source of the systemic oscillation based on the wide-area dissipated energy flow and the propagation path of each node includes: The node features of each node are extracted, wherein the node features include four components, which are used to characterize the wide-area dissipated energy flow of the node, the topological position of the node in the propagation path, the oscillation amplitude of the node, and the short-circuit ratio of the node, respectively. The node features of each node are input into a graph neural network with a multi-head attention mechanism to obtain the oscillation source of the systemic oscillation output by the graph neural network. The multi-head attention mechanism is used to adjust the degree of influence of the four components on the output of the graph neural network based on the knowledge learned during the training phase.
9. The method according to claim 8, characterized in that, In the attention mechanism, the attention score is negatively correlated with the electrical distance between nodes.
10. The method according to claim 6, characterized in that, The step of determining the oscillation source of the systemic oscillation based on the wide-area dissipated energy flow and the propagation path of each node includes: The wide-area dissipated energy flow and the propagation path of each node are input into a graph neural network to obtain the oscillation source of the systemic oscillation output by the graph neural network. The graph neural network is pre-trained on a sample dataset, which includes sample data under conditions of forced oscillation, negative damped oscillation, and parameter-coupled oscillation.
11. The method according to claim 1, characterized in that, Determining the causal relationship between the power parameters of each node based on the transfer entropy includes: Let the electrical parameters of the first node and the second node be denoted as X and Y, respectively, and let the transfer entropy from X to Y be denoted as TE. X→Y Let TE denote the transitive entropy from Y to X. Y→X Wherein, the first node and the second node are any two nodes among the nodes; If TE X→Y -TE Y→X If the difference is greater than ε, then a causal relationship is determined between X and Y, with X being the cause and Y being the effect, where ε is a preset difference threshold.
12. The method according to claim 1 or 11, characterized in that, Let the electrical parameters of the two nodes be A and B, respectively. The transfer entropy from A to B can be calculated using the following formula: ; in, Represents the probability distribution function. Represents the target node exist The state at any given moment, express The length is Historical state sequence, express The length is The historical state sequence.
13. A wide-area broadband oscillation decision-making method, characterized in that, The method includes: Obtain the oscillation source determined by the causal-based wide-area broadband oscillation localization and tracing method according to any one of claims 1-12; Based on the oscillation source and the oscillation frequency band of the systemic oscillation, determine and implement oscillation response strategies.
14. The method according to claim 13, characterized in that, The determination of oscillation response strategies based on the oscillation source and the oscillation frequency band of the systemic oscillation includes: If the oscillation frequency band is 0–0.1 Hz, and the oscillation source is a thermal power unit, then the oscillation response strategy is determined as follows: reduce the output of the oscillation source, and disable the automatic power generation control or primary frequency regulation function of the oscillation source; or, If the oscillation frequency band is 0.1–2.5 Hz and the oscillation source is in range mode, then the oscillation response strategy is determined to be: reduce the power flow at the tie-line end face or increase the voltage; or, If the oscillation frequency band is 2.5 to 100 Hz and the oscillation source is in range mode, then the oscillation response strategy is determined to be: adjust the power.
15. A wide-area broadband oscillation cooperative defense system, characterized in that, The system includes: Intelligent analysis unit and decision control unit; The intelligent analysis unit is used to determine the oscillation source according to any one of claims 1-12 when a systemic oscillation occurs in the power system. The decision control unit is used to determine and execute the oscillation response strategy for the systemic oscillation according to the method of claim 13 or 14.
16. The system according to claim 15, characterized in that, The system also includes a data front-end unit; The data front-end unit is used to acquire and cache the detection parameters detected by the measurement units set at each node of the power system. If the acquisition rate of the probe data within any time window reaches the preset acquisition rate threshold, then based on the acquired probe data within that time window, the unacquired probe data within that time window is predicted. The acquired detection data and predicted detection data within the time window are then sent to the intelligent analysis unit. The intelligent analysis unit is further configured to determine the power parameters used in determining the oscillation source according to the method described in any one of claims 1-12, based on the detection data sent by the data front-end unit.
17. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-14.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-14.