Rapid online detection and timing method for direct-driven wind session hyper-synchronous oscillation, electronic equipment and storage medium
By employing the CWT and Patchtst methods for sliding window data acquisition and time-frequency analysis in a novel power system, and combining them with a convolutional neural network, rapid and accurate oscillation detection and timing were achieved. This solved the problem of oscillation judgment in the novel power system and improved the accuracy and efficiency of oscillation suppression measures.
Patent Information
- Application Number
- CN202511215358.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-12-09
AI Technical Summary
Existing technologies make it difficult to quickly and accurately determine whether subsynchronous/supersynchronous oscillations occur and when they occur in new power systems, leading to malfunctions or delays in oscillation suppression measures.
The method based on CWT and Patchtst is adopted to extract time-frequency features through sliding window data acquisition and time-frequency analysis. A pre-trained oscillation detection model is used to determine whether oscillation occurs, and the oscillation occurrence time is determined by an oscillation timing model. Finally, a convolutional neural network is used for feature fusion and classification.
It enables rapid and accurate oscillation detection and timing in new power systems, improves the accuracy and computational efficiency of online detection, and is applicable to oscillation identification and suppression measures in complex power systems.
Smart Images

Figure CN121097651A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power systems and their automation, specifically to a method for rapid online detection and timing of subsynchronous oscillations in direct-drive wind farms, electronic equipment, and storage medium. Background Technology
[0002] Under the backdrop of "high energy consumption and high pollution," the grid-connected capacity of new energy power generation is continuously increasing, the degree of power electronics in the system is deepening, and the system inertia is decreasing. This makes the subsynchronous / supersynchronous oscillation problem caused by the dynamic interaction between various system components increasingly prominent. Rapid and accurate online detection of subsynchronous / supersynchronous oscillations is a key step in achieving rapid oscillation suppression.
[0003] Existing research typically equates the oscillation detection problem to the identification of parameters such as oscillation frequency, using the presence of oscillatory harmonics in the signal as a criterion for detecting oscillation. Corresponding oscillation detection methods are mainly divided into spectral analysis methods and non-spectral analysis methods. Spectral analysis methods establish oscillation detection systems based on the Fast Fourier Transform (FFT) and have integrated synchronous phasor measurement units (PMUs) and control devices, promoting the practical application of FFT technology in engineering. The shortest sampling window length for this type of method is currently 2 seconds, but it still cannot reflect the characteristics of novel oscillations propagating and diverging within hundreds of milliseconds. Non-spectral methods include the Prony algorithm, eigenvalue solving, and trajectory fitting algorithms. These methods can significantly shorten the sampling window length compared to spectral methods, but they face difficulties in parameter tuning and require precise modeling, making them less suitable for increasingly complex new power systems.
[0004] Machine learning algorithms, with their advantages of not requiring precise modeling and fast response speed, offer new approaches to solving oscillation detection problems and have made some progress in oscillation parameter identification. Existing research can analyze data from the initial stage of oscillation occurrence, reducing the sampling window length to 0.2s, significantly decreasing the time required from oscillation occurrence to oscillation identification. However, machine learning algorithms are built upon datasets after oscillation has occurred; therefore, online applications of such algorithms require accurate determination of whether oscillation has occurred. After determining oscillation has occurred, waveform analysis is necessary to ensure the consistency of distribution between online and offline training data, thus guaranteeing the accuracy of online algorithm applications. Due to the generalization performance constraints of machine learning algorithms, feeding data from when oscillation has not occurred into the algorithm may result in an incorrect output of an oscillation frequency, causing subsequent oscillation suppression measures to malfunction.
[0005] Therefore, it is urgent to study how to quickly and accurately determine whether oscillations have occurred and to obtain the specific time when oscillations occur, so as to provide discrimination conditions for machine learning oscillation identification algorithms and subsequent suppression measures during online processes. Summary of the Invention
[0006] The purpose of this invention is to address the problem that existing technologies are poorly applicable to increasingly complex new power systems, and to provide a method for rapid online detection and timing of subsynchronous oscillations in direct-drive wind farms, an electronic device, and a storage medium.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A rapid online detection and timing method for subsynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, characterized by comprising:
[0009] Acquire power system operation data, generate sliding window samples by sliding window movement, and extract the time-frequency features of the sliding window samples using time-frequency analysis methods;
[0010] The time-frequency features are input into a pre-trained oscillation detection model to determine whether the sliding window sample oscillates.
[0011] If the oscillation detection model determines that an oscillation has occurred, the time-frequency features are input into the pre-trained oscillation timing model to determine the time of oscillation in the sliding window sample;
[0012] Output the oscillation judgment result of the oscillation detection model and the oscillation occurrence time of the oscillation timing model.
[0013] As a preferred technical solution:
[0014] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind farms based on CWT and Patchtst includes the following steps: acquiring power system operating data, generating sliding window samples through sliding window movement, and extracting the time-frequency features of the sliding window samples using time-frequency analysis.
[0015] For the A-phase current data in the power system operation data, data is collected using a preset sliding window length and sliding window movement step size to generate the sliding window sample;
[0016] The sliding window samples are subjected to time-frequency analysis using the continuous wavelet transform method to generate a time-frequency matrix.
[0017] The time-frequency matrix is divided into frequency bands to obtain feature data for multiple frequency bands;
[0018] The feature data of the frequency band is normalized to generate the time-frequency features suitable for neural networks.
[0019] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein the step of performing time-frequency analysis on the sliding window samples using continuous wavelet transform to generate a time-frequency matrix includes:
[0020] The sliding window samples are subjected to continuous wavelet transform using the complex Morlet wavelet function to generate the initial time-frequency matrix.
[0021] The time-frequency matrix is generated by extracting data from the middle time period of the initial time-frequency matrix to avoid interference from boundary effects.
[0022] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein the time-frequency matrix is divided into frequency bands to obtain feature data for multiple frequency bands, including:
[0023] The time-frequency matrix is divided into multiple preset frequency bands, and all frequency bands together cover the frequency range of sub / supersynchronous oscillations.
[0024] For each frequency band, the average value of the elements within the same time step is calculated to generate the feature data of the frequency band.
[0025] As described above, a fast online detection and timing method for supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein the step of inputting the time-frequency features into a pre-trained oscillation detection model to determine whether the sliding window sample oscillates includes:
[0026] The time-frequency features are divided into multiple univariate sequences according to frequency bands;
[0027] The univariate sequence is divided into multiple non-overlapping segments according to a preset period;
[0028] For each segment, a sinusoidal position code is embedded and then input into a Transformer encoder to extract global feature dependencies;
[0029] The global feature dependencies are fused using a convolutional neural network to generate an oscillation judgment result.
[0030] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein the step of inputting the time-frequency features into a pre-trained oscillation timing model to determine the oscillation occurrence time in the sliding window sample includes:
[0031] The time-frequency features are divided into multiple univariate sequences according to frequency bands;
[0032] The univariate sequence is divided into multiple non-overlapping segments according to a preset period;
[0033] For each segment, a sinusoidal position code is embedded and then input into a Transformer encoder to extract global feature dependencies;
[0034] The global feature dependencies are fused using a convolutional neural network to generate channel features;
[0035] By fusing the channel features, a global feature is generated, and the oscillation occurrence time is determined.
[0036] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein the oscillation judgment result is generated by fusing the global feature dependencies through a convolutional neural network, includes:
[0037] For the segment features of each frequency band, the first convolutional neural network captures the periodic feature relationship between segments and generates the corresponding channel features;
[0038] A second convolutional neural network is used to capture the frequency band feature relationships between the channel features to generate global features;
[0039] The global features are input into the binary classification output layer to generate the oscillation judgment result.
[0040] The above-described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, wherein fusing the channel features to generate global features and determining the oscillation occurrence time includes:
[0041] For the segment features of each frequency band, the first convolutional neural network captures the periodic feature relationship between segments and generates the corresponding channel features;
[0042] A second convolutional neural network is used to capture the frequency band feature relationships between the channel features to generate global features;
[0043] The global features are input to fit the output layer to generate the oscillation occurrence time.
[0044] Another objective of this invention is to provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst.
[0045] Another objective of this invention is to provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor runs the computer program to enable the electronic device to perform the described method for rapid online detection and timing of supersynchronous oscillations in direct-drive wind farms based on CWT and Patchtst.
[0046] The present invention provides a rapid online detection and timing method for subsynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, which has the following advantages:
[0047] (I) This invention proposes an online oscillation detection and timing method based on short-time sliding window movement. By continuously collecting online sliding window data and sending it to machine learning algorithm analysis, it is possible to efficiently and quickly determine whether online oscillation has occurred and accurately obtain the oscillation occurrence time.
[0048] (II) The present invention constructs a time-frequency feature extraction process based on the CWT algorithm, which effectively improves the difference between steady-state window samples and oscillating window samples, which is beneficial to machine learning algorithm learning.
[0049] (III) This invention constructs a neural network model suitable for online oscillation detection based on the Patchtst neural network, which has high oscillation detection and timing accuracy, while the computation is more lightweight. Attached Figure Description
[0050] Figure 1 A schematic diagram of the online real-time detection and timing data sliding window for subsynchronous / supersynchronous oscillations in this invention.
[0051] Figure 2 Flowchart of the oscillation detection and timing CWT feature extraction method of the present invention.
[0052] Figure 3 The result of CWT feature extraction for steady-state samples in this invention.
[0053] Figure 4 A schematic diagram of the Patchtst model of this invention.
[0054] Figure 5 Flowchart of the online oscillation detection and timing algorithm application of this invention.
[0055] Figure 6 This invention provides a flowchart of a rapid online detection and timing method for subsynchronous oscillations in direct-drive wind fields based on CWT and Patchtst.
[0056] Figure 7 The topology diagram of four wind farms connected to a weak AC network in this embodiment of the invention.
[0057] Figure 8 The distribution diagram of oscillation and steady-state sample characteristics before and after CWT in this embodiment of the invention. Detailed Implementation
[0058] The present invention will be further described below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.
[0059] This invention provides a rapid online detection and timing method for supersynchronous oscillations in direct-drive wind farms based on CWT and Patchtst. It can quickly and accurately determine whether oscillations have occurred and obtain the specific time of oscillation occurrence, providing discrimination conditions for machine learning oscillation identification algorithms and subsequent suppression measures during the online process.
[0060] The technical solutions of the embodiments of the present invention will be clearly and thoroughly described below with reference to the accompanying drawings. The described embodiments are merely some embodiments of the present invention.
[0061] This embodiment provides a rapid online detection and timing method for supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, referencing... Figure 6 This includes the following steps:
[0062] Step 1: Acquire power system operation data, generate sliding window samples by sliding window movement, and extract the time-frequency features of the sliding window samples using time-frequency analysis methods;
[0063] Step 2: Input the time-frequency features into the pre-trained oscillation detection model to determine whether the sliding window sample oscillates;
[0064] Step 3: If the oscillation detection model determines that oscillation has occurred, the time-frequency features are input into the pre-trained oscillation timing model to determine the time of oscillation in the sliding window sample;
[0065] Step 4: Output the oscillation judgment result of the oscillation detection model and the oscillation occurrence time of the oscillation timing model.
[0066] For example.
[0067] Step one involves acquiring power system operation data, generating sliding window samples through sliding window movement, and extracting the time-frequency features of the sliding window samples using time-frequency analysis. Specifically, this includes:
[0068] To accurately determine whether oscillations occur during online operation and precisely obtain the timing of oscillation occurrences, this invention proposes an online oscillation detection and timing method based on short-time sliding window movement. During online operation, the A-phase current I is continuously sampled via sliding window. a Running data (such as) Figure 1As shown), the data is fed into a machine learning algorithm for analysis to complete two tasks. The first task is to analyze whether oscillations occur within the window, which this invention refers to as the "oscillation detection task." The second task is initiated when oscillations occur within the window, analyzing the specific time the oscillations occur within the window (e.g., ...). Figure 1 The time interval t is referred to in this invention as the "oscillation timing task".
[0069] To meet the requirements of real-time and rapid detection, the present invention designs the sliding window length l1 to be 0.24s and the sliding window movement step l2 to be 0.2s each time.
[0070] For ease of explanation, this invention refers to the sliding window in which no oscillation occurs as a "steady-state window sample" and the sliding window in which oscillation occurs as an "oscillating window sample".
[0071] Signal Time-Frequency Feature Extraction Based on Continuous Wavelet Transform (CWT)
[0072] CWT is a time-frequency joint analysis method that performs multi-scale analysis on signals by dynamically adjusting the scale and position of wavelet functions, thereby accurately extracting the local time-frequency features of the signal. It is very suitable for capturing the time-frequency change features of signals before and after oscillations occur.
[0073] The core idea of CWT lies in using a scaled and translated wavelet function to perform convolution operations with the signal to obtain the local characteristics of the signal in time and frequency. For a signal x(t), the CWT formula can be expressed as:
[0074]
[0075] Where a is the scaling parameter of the wavelet function, which controls the scaling of the wavelet and is inversely proportional to the output frequency; b is the time-domain shift parameter of the wavelet function; ψ(t) represents the wavelet function, and ψ*(t) represents the complex conjugate of the wavelet function ψ(t).
[0076] Complex Morlet Wavelet (cmor) introduces the concept of complex numbers into the basic Morlet function, allowing for the simultaneous extraction of amplitude and phase information of a signal, making it highly suitable for analyzing oscillating signals. The cmor wavelet function can be expressed as:
[0077]
[0078] Among them, F b It is a bandwidth parameter that controls the time-frequency resolution of the wavelet; F c The center frequency parameter controls the dominant frequency of the wavelet.
[0079] Based on the CWT method, this invention constructs a process for extracting time-frequency features of oscillation signals for oscillation detection and timing problems, as follows: Figure 2 As shown:
[0080] The oscillation feature extraction method based on CWT designed in this invention mainly includes three steps:
[0081] Step 1-1: For example Figure 2 (a) shows the electrical runtime sequence data, which undergoes CWT transformation. In this invention, F in the cmor wavelet function... b The value is 0.5, F c A value of 1 corresponds to a CWT conversion frequency range of 4-100Hz, which corresponds to the subsynchronous / supersynchronous oscillation frequency range. The converted result is as follows: Figure 2 As shown in (b).
[0082] Steps 1-2: CWT results exhibit boundary effects. When the convolution position is near the beginning and end of the signal, the wavelet function range may exceed the signal boundary, causing distortion at the boundary. Figure 2 (b) The region outside the white line. When the signal oscillates at the boundary, the boundary effect can mask the true characteristics, making it difficult to accurately extract the oscillation information. To avoid boundary effect interference, this invention only extracts... Figure 2 (b) The middle time period inside the white line is used as the subject of subsequent analysis, such as Figure 2 As shown in (c). The present invention designs the sliding window length l1 to be 0.24s, and extracts the feature in the middle of the window for 0.2s. Therefore, the sliding window movement step size l2 is designed to be 0.2s each time, thereby ensuring that the oscillation that occurs at any time during the sliding window sampling can be located within the middle segment, avoiding the omission of time periods.
[0083] Steps 1-3: After CWT transformation, the data scale is very large. In order to improve the efficiency of subsequent neural network calculations, the data is reduced in dimensionality.
[0084] First, frequency bands are divided. The average value of elements at the same time step within each frequency band can be represented as:
[0085]
[0086] Where x(t,f) represents the value at time step t and frequency f in the CWT result; x (1) (t,B i ) indicates that after dimensionality reduction, at time step t and frequency band B i Value at location; B i For the i-th frequency band, the frequency bands are designed to be {4-14Hz, 15-24Hz, 25-34Hz, 35-44Hz, 45-54Hz, 55-64Hz, 65-74Hz, 75-84Hz, 85-100Hz}; N iIndicates frequency band B i The number of frequencies included.
[0087] Subsequently, to eliminate the influence of different magnitudes, the values of all time steps in each frequency band were normalized, resulting in the following final result: Figure 2 As shown in (d). The normalization process can be expressed as:
[0088]
[0089] Where, x (2) (t,B i ) indicates that after normalization, at time step t and frequency band B i value; max(x) (1) (B i min(x) (1) (B i )) represent frequency band B after frequency band division. i The maximum and minimum values in.
[0090] Figure 2 This displays the CWT feature extraction results for samples from oscillating windows. Figure 3 The results of CWT feature extraction for steady-state window samples are shown. Comparing the two figures reveals that the waveforms of the two types of sample data are not significantly different. However, after CWT extraction, the differences in features between the two types of samples are very significant. The steady-state window samples exhibit a certain periodicity, while the oscillating window samples show significant differences in features before and after the oscillation occurs. The significant differences in features between the two types of samples are more conducive to neural network learning and classification, and the differences in oscillating window samples before and after the oscillation are helpful for identifying the timing of the oscillation.
[0091] Further, in step two of this embodiment of the invention, the time-frequency features are input into a pre-trained oscillation detection model to determine whether the sliding window sample oscillates, specifically including:
[0092] Oscillation detection and modeling based on the Patch-based Time Series Transformer (Patchtst) model.
[0093] The Patchtst model, based on the Transformer model, introduces channel independence and segmentation, making computation more lightweight and suitable for online oscillation detection and timing tasks. This invention designs a Patchtst neural network model structure as follows: Figure 4 As shown:
[0094] (1) Channel allocation for CWT result frequency band
[0095] This invention uses the time-frequency matrix obtained after CWT feature extraction. As input features to the Patchtst algorithm, B and T represent the number of frequency bands and the total number of time steps, respectively. For input feature X, it is first divided into channels according to frequency bands, forming B univariate sequences. i∈1,2,…B. By making the channels independent, interference between frequency bands is isolated, while reducing computational complexity.
[0096] (2) Segmentation for CWT result timing
[0097] Each frequency band univariate sequence X i Divided into n segments Where L is the segment length. This invention divides segments into non-overlapping regions, with segment length L = T / n. The CWT analysis window length of this invention is 0.2s, corresponding to 10 fundamental frequency (50Hz) cycles. This invention divides segments according to the fundamental frequency cycle, i.e., n = 10.
[0098] (3) Feature extraction based on Transformer
[0099] After the segmentation is completed, the feature X of each segment is... i,j Mapped to a d-dimensional feature space. To preserve the relative positional information between features, each segment is embedded with a positional encoding, specifically a sinusoidal positional encoding. After positional embedding, all segments are fed into a Transformer encoder, which uses a multi-head attention mechanism to capture global feature dependencies, performing efficient feature extraction to form the output segment feature Y. i,j .
[0100] (4) Segment / channel interaction and output based on convolutional networks
[0101] After passing through the Transformer module, the Y segment features of each channel are... i,j The features are then fused using a convolutional neural network to capture the relationship between the periodic features of each segment, forming corresponding channel features. Afterwards, all channel features pass through another convolutional layer to capture the feature relationships between each frequency band, forming the extracted global feature Y; feature Y enters the output layer to obtain the final output.
[0102] After extracting oscillation time-frequency features using CWT, this invention constructs an oscillation detection model based on a Patchtst neural network to determine whether oscillations occur within a sliding window. The oscillation detection model is a binary classification model with two neurons in the output layer. During model training, the model uses the cross-entropy function as the loss function (loss1) and employs both oscillating window samples and stable window samples as training samples.
[0103]
[0104] In the formula, y i To determine whether an oscillation occurs within the i-th sample window, p i Here, n represents the predicted probability of the model, and n is the total number of samples.
[0105] Further, in step three: if the oscillation detection model determines that an oscillation has occurred, the time-frequency features are input into the pre-trained oscillation timing model to determine the time of oscillation in the sliding window sample.
[0106] Similar to the oscillation detection model described above, this invention constructs another oscillation timing model based on the Patchtst network structure to identify the occurrence time of oscillations in the sliding window samples. Compared to the oscillation detection model, the oscillation timing model differs only in the number of neurons in the output layer; the rest of the structure remains the same.
[0107] The oscillation timing model is introduced when oscillations occur within the judgment window of the first oscillation timing model. It is used to fit the specific time of oscillation occurrence within the output window and is a fitting model with only one neuron in the output layer. During the model training phase, the model uses the mean absolute percentage error function as the loss function loss2, and the training samples are only taken from the oscillation window.
[0108]
[0109] In the formula, y i Let y' be the actual value of the oscillation time of the i-th sample. i This is the predicted time of oscillation for the i-th sample.
[0110] Oscillation problems exhibit strong periodic temporal characteristics. The Transformer model models oscillation signals through a self-attention mechanism, using dot product to realize the interaction between features at different locations, effectively capturing global periodic features and making it suitable for analyzing oscillation-related problems. However, because the Transformer involves matrix dot product operations, when the sampling frequency of temporal data is high, the matrix operation scale is large, requiring a long computation time, which is difficult to meet the requirements of online speed. Patchtst reduces the dimension of the input matrix for dot product operations by using channel independence and segment partitioning, improving the computation speed and making it more suitable for online oscillation detection. Furthermore, dividing the channels by frequency band can effectively preserve the temporal characteristics of each frequency band while avoiding interference from irrelevant features between different frequency bands; and dividing the segments according to the 50Hz fundamental frequency period can effectively capture the characteristics of oscillation within each power frequency cycle, which is beneficial for oscillation detection and timing.
[0111] Further, step four: Output the oscillation judgment result of the oscillation detection model and the oscillation occurrence time of the oscillation timing model. Specifically, this includes:
[0112] The application process of the online oscillation detection method designed in this invention is as follows: Figure 5 As shown, it is divided into two parts: "offline training" and "online application".
[0113] (1) Offline training phase:
[0114] An offline training sample set is constructed using historical oscillation data or simulated oscillation data. For each set of oscillation data, a sampling frequency of 2kHz and a sampling window length of 0.24s are set. The start time of the sampling window is continuously changed to obtain steady-state and oscillation sample sets. Time-frequency features are extracted from both types of samples using a CWT (Continuous Time-to-Weight) process. The oscillation detection network is trained using the CWT results of the steady-state and oscillation window samples, and the oscillation timing network is trained using the CWT results of the oscillation window samples. Gradient updates are performed on both networks through continuous iteration.
[0115] Oscillation detection model with prediction accuracy A cc As a performance evaluation index, it is shown in Equation (7).
[0116]
[0117] Where T is the total number of samples, TP is the number of samples where both the model prediction and the actual label are in a steady state, and TN is the number of samples where both the model prediction and the actual label are oscillating.
[0118] The oscillation timing model predicts the oscillation occurrence time t'. i With respect to the actual time t of the oscillation i The mean absolute error (MAE) between the two is used as an evaluation index, as shown in equation (8):
[0119]
[0120] (2) "Online Application" stage:
[0121] During the online operation of the power system, operational data is collected in real time through sliding window movement, and the data undergoes CWT time-frequency feature extraction. First, the CWT result is sent to the oscillation detection model. If no oscillation is determined to have occurred, sliding window sampling continues; if oscillation is determined to have occurred, it is sent to the oscillation timing model, which outputs a prediction of the oscillation occurrence time.
[0122] Example 1
[0123] This embodiment provides specific examples to illustrate the method of the present invention.
[0124] refer to Figure 7Four wind farms were connected to a weak AC grid topology. In the simulation example, the output of each station was continuously adjusted (0.8-1.0 pu) to operate the system under different conditions. Under different conditions, within the simulation time range of 1.2s-1.22s (simulating oscillations starting at different phases), random time settings were used to change the station parameters, triggering subsynchronous / supersynchronous oscillations. A total of 324 subsynchronous / supersynchronous oscillation scenarios were constructed, all originating from natural resonance. The cause of the oscillations was energy exchange between the control loop or the system's capacitors / inductors. The frequency range of the subsynchronous / supersynchronous oscillations was 5-12Hz / 88-95Hz.
[0125] The analysis focuses on the operational data of the A-phase current at the outlet of a single power station. However, given the large number of power stations in the system, it is difficult to construct a sample that covers all stations, and training a model for each station individually is costly. Therefore, a general oscillation detection model for the system's power stations is constructed using data from a local branch of the system. The trained model can then be directly applied to data from other power stations.
[0126] (1) Training sample generation: Select A-phase current data from the outlets of station 1 and station 2 ( Figure 7 Samples (I1 and I2) were used for network training. The sampling frequency was set to 2kHz, and the sampling window length to 0.24s. For each oscillation scenario, different sampling window start times were set multiple times to obtain different steady-state and oscillation samples. For I1 and I2, 960 steady-state window samples and 1728 oscillation window samples were obtained respectively, with oscillation times covering the range of 0.02s-0.22s within the window. All samples were randomly divided into test and validation sets in a 7:3 ratio for neural network training and evaluation.
[0127] (2) Generation of general test samples for other stations: Select A-phase current data from the outlets of stations 3 and 4 ( Figure 7 I3 and I4 are used to test the model's general applicability to data from other stations in the system. Similar to the training samples, different sampling window start times were set multiple times for each oscillation scenario to obtain different steady-state and oscillation occurrence samples. The I3 and I4 variable sample distributions are the same as the training samples.
[0128] During training, the learning rates for the detection and timing models were 0.002 and 0.001, respectively, with 50 iterations and a batch size. After training, the model achieved a detection accuracy (Acc) of 99.75% on the validation set and a timing task accuracy (MAE) of 0.0155s, with the time error limited to one power frequency cycle. This demonstrates that the algorithm can effectively perform oscillation detection and timing tasks.
[0129] Table 1 shows the computation time required for the proposed algorithm in online application, including data reading (.npy file), CWT feature extraction, and computation of the detection model and timing model. The computation program was built using Python based on the PyTorch framework, and the computer processor was an Intel(R) Core(TM) i7-8700 CPU@3.20GHz. As shown in Table 1, the total computation time of the proposed algorithm is 0.1585s, which is 0.2s less than the designed sliding window step size, and can meet the time requirements for online sliding window analysis. In contrast, the Transformer algorithm struggles to meet the sliding window time requirements. This demonstrates that the Patchtst model is more computationally lightweight than the Transformer model and better meets the requirements for online timeliness.
[0130] Table 1 Computation time required for online applications
[0131]
[0132] To verify the effectiveness of the proposed CWT time-frequency feature extraction process, a comparative experiment was conducted using an algorithm without a CWT process, where the running data is directly detected and timed through the Patchtst model. The input to the comparative experiment was one-dimensional time-series data, without channel partitioning or channel interaction; the rest of the structure was the same as the proposed algorithm. The comparison results are shown in Table 2. It can be seen that, through the CWT process, the detection accuracy A... cc The accuracy was improved by 9.73%, and the timing MAE error was reduced by 0.0057s, which proves that the CWT process has a strong ability to improve the accuracy of detection and timing tasks.
[0133] Table 2 Comparison of timing accuracy with and without CWT process detection
[0134]
[0135] To further verify the effectiveness of the CWT process for oscillation detection, the t-SNE algorithm was used to visualize and analyze the sample distribution of oscillation occurrence window and steady-state window before and after the CWT process.
[0136] Figure 8 (a) shows the characteristic distribution of the original oscillation and steady-state data without CWT process. Figure 8 (b) shows the feature distribution of oscillating and steady-state samples after the CWT transformation. The comparison reveals that without the CWT process, the waveform data distributions of oscillating and steady-state samples are relatively dispersed, with significant overlap. After the CWT process, the distributions of oscillating and steady-state samples form more compact clusters, and the overlap is reduced. The results indicate that CWT can improve the difference between oscillating and steady-state samples, which is more beneficial for subsequent neural network classification.
[0137] To verify the detection and timing performance of the Patchtst neural network, Deep Belief Network (DBN) and Transformer network were designed as comparison neural networks. Experiments with and without CWT were conducted for the three models. Table 3 compares the detection and timing accuracy of the six experiments. As shown in Table 3, except for the detection accuracy being on par with Experiment 4, the proposed algorithm (Experiment 6) has the highest detection and timing accuracy compared to other algorithms. Furthermore, comparing experiments 1, 3, and 5, and experiments 2, 4, and 6 separately, it can be found that regardless of whether CWT is present, the applied Patchtst neural network maintains the highest accuracy compared to the DBN and Transformer models. This proves that the proposed Patchtst can perform oscillation detection and timing tasks with higher performance. In addition, comparing experiments with and without CWT under the three network structures, it can be found that the CWT feature extraction process can improve the accuracy of detection and timing tasks under all three network structures.
[0138] Table 3 Comparison of Detection and Timing Accuracy of Different Algorithms
[0139]
[0140] Sample A-phase current windows were constructed for sampling at the outlets of stations 3 and 4 to test the versatility of the model trained on local station data for other station data. Table 4 shows the detection and timing accuracy of the different trained models in Table 3 when processing the test samples. As can be seen from Table 4, the model trained on the proposed algorithm (Experiment 6) maintains a detection accuracy of 98.75% and a timing MAE error of 0.0162s when processing the universal test samples of stations 3 and 4. Except for the detection accuracy being on par with Experiment 4, the detection and timing accuracy of the proposed algorithm are higher than those of other algorithms, demonstrating better versatility for other stations.
[0141] Table 4 Comparison of the universality of different models at other sites
[0142]
[0143] In real-world engineering projects, renewable energy power plants may be disconnected from the system due to maintenance or malfunctions. In such cases, the oscillation detection timing model should still remain applicable. Therefore, to verify that the trained model still possesses universality under the condition of a power plant being disconnected, a disconnection design was implemented. Figure 7In the case of station 4, oscillations were induced using the method described above, resulting in 48 oscillation scenarios. Window sampling was performed for I1, I2, and I3, yielding 240 steady-state window samples and 432 oscillation occurrence window samples for each. Table 5 shows the detection and timing accuracy of different trained models in Table 3 when handling these samples. As can be seen from Table 5, although the detection and timing accuracy of the proposed algorithm model decreased slightly when facing robustness test samples, it was still higher than other models, demonstrating better versatility under station relocation conditions.
[0144] Table 5 Comparison of the universality of different models in the case of station resection
[0145]
[0146]
[0147] Example 2
[0148] This embodiment presents an electronic device and storage device for rapid online detection and timing of supersynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, comprising:
[0149] One or more processors on which one or more programs run;
[0150] A storage device on which one or more programs are stored;
[0151] When the one or more programs are executed by the one or more processors, the one or more processors implement the fast online detection and timing method for supersynchronous oscillations of direct-drive wind farms based on CWT and Patchtst; the memory is used to store the computer program for the fast online detection and timing method for supersynchronous oscillations of direct-drive wind farms based on CWT and Patchtst.
[0152] Alternatively, the aforementioned electronic device may be a server.
[0153] Embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0154] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0155] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0156] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0157] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.
Claims
1. A rapid online detection and timing method for subsynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, characterized in that, include: Acquire power system operation data, generate sliding window samples by sliding window movement, and extract the time-frequency features of the sliding window samples using time-frequency analysis methods; The time-frequency features are input into a pre-trained oscillation detection model to determine whether the sliding window sample oscillates. If the oscillation detection model determines that an oscillation has occurred, the time-frequency features are input into the pre-trained oscillation timing model to determine the time of oscillation in the sliding window sample; Output the oscillation judgment result of the oscillation detection model and the oscillation occurrence time when oscillation occurs.
2. The method as described in claim 1, characterized in that, The process of acquiring power system operation data, generating sliding window samples through sliding window movement, and extracting the time-frequency features of the sliding window samples using time-frequency analysis methods includes: For the A-phase current data in the power system operation data, data is collected using a preset sliding window length and sliding window movement step size to generate the sliding window sample; The sliding window samples are subjected to time-frequency analysis using the continuous wavelet transform method to generate a time-frequency matrix. The time-frequency matrix is divided into frequency bands to obtain feature data for multiple frequency bands; The feature data of the frequency band is normalized to generate the time-frequency features suitable for neural networks.
3. The method as described in claim 2, characterized in that, The step of performing time-frequency analysis on the sliding window samples using the continuous wavelet transform method to generate a time-frequency matrix includes: The sliding window samples are subjected to continuous wavelet transform using the complex Morlet wavelet function to generate the initial time-frequency matrix. The time-frequency matrix is generated by extracting data from the middle time period of the initial time-frequency matrix.
4. The method as described in claim 2, characterized in that, The step of dividing the time-frequency matrix into frequency bands to obtain feature data for multiple frequency bands includes: The time-frequency matrix is divided into multiple preset frequency bands, and all frequency bands together cover the frequency range of sub / supersynchronous oscillations. For each frequency band, the average value of the elements within the same time step is calculated to generate the feature data of the frequency band.
5. The method as described in claim 1, characterized in that, The time-frequency features are input into a pre-trained oscillation detection model to determine whether the sliding window sample oscillates, including: The time-frequency features are divided into multiple univariate sequences according to frequency bands; The univariate sequence is divided into multiple non-overlapping segments according to a preset period; For each segment, a sinusoidal position code is embedded and then input into a Transformer encoder. A multi-head attention mechanism is used to capture global feature dependencies, and feature extraction is performed on the global feature dependencies to obtain segment features. The fragment features are fused by a convolutional neural network to generate global features. These global features are then input into the output layer of the oscillation detection model to obtain the oscillation judgment result.
6. The method as described in claim 1, characterized in that, The step of inputting the time-frequency features into a pre-trained oscillation timing model to determine the oscillation occurrence time in the sliding window sample includes: The time-frequency features are divided into multiple univariate sequences according to frequency bands; The univariate sequence is divided into multiple non-overlapping segments according to a preset period; For each segment, a sinusoidal position code is embedded and then input into a Transformer encoder. The global feature dependency is captured through a multi-head attention mechanism, and feature extraction is performed on the global feature dependency to obtain the segment features. The fragment features are fused by a convolutional neural network to generate global features. These global features are then input into the output layer of the oscillation timing model to obtain the oscillation time.
7. The method as described in claim 5, characterized in that, The step of fusing the global feature dependencies through a convolutional neural network to generate an oscillation judgment result includes: For the segment features of each frequency band, the first convolutional neural network captures the periodic feature relationship between segments and generates the corresponding channel features; A second convolutional neural network is used to capture the frequency band feature relationships between the channel features to generate global features; The global features are input into the binary classification output layer to generate the oscillation judgment result.
8. The method as described in claim 6, characterized in that, The process of fusing the channel features to generate global features and determining the oscillation occurrence time includes: For the segment features of each frequency band, the first convolutional neural network captures the periodic feature relationship between segments and generates the corresponding channel features; A second convolutional neural network is used to capture the frequency band feature relationships between the channel features to generate global features; The global features are input to fit the output layer to generate the oscillation occurrence time.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for rapid online detection and timing of subsynchronous oscillations in direct-drive wind fields based on CWT and Patchtst, as described in any one of claims 1-8.
10. An electronic device, comprising a memory and a processor, wherein the memory stores a computer program and the processor runs the computer program to cause the electronic device to perform the fast online detection and timing method for supersynchronous oscillations of direct-drive wind fields based on CWT and Patchtst as described in any one of claims 1-8.