Generator fault detection method based on hybrid attention mechanism
By adopting a long-term short-term memory self-coding network model with a hybrid attention mechanism in generator fault detection, the depth characteristics of the generator are extracted and the status indicators are constructed, and the problem of difficulty in accurately distinguishing faults and operating conditions under time-varying conditions in the prior art is solved, and higher fault detection accuracy and lower false alarm rate are achieved.
Patent Information
- Application Number
- CN202210511221.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-05-12
AI Technical Summary
The prior art is difficult to accurately distinguish the monitoring data changes caused by generator failure and operating conditions under time-varying conditions, resulting in low fault detection accuracy and high false alarm rate.
A long-term and short-term memory self-coding network model based on a hybrid attention mechanism is adopted, combined with the spatial attention mechanism and the temporal attention mechanism, the depth characteristics of the multi-dimensional state variable of the generator are extracted, the status indicators are constructed and filtered to improve the accuracy of fault detection.
It improves the accuracy of generator fault detection, reduces the false alarm rate caused by operating conditions, can more accurately identify early abnormal signs of generators, and initially diagnose the cause of failure.
Smart Images

Figure CN114841580B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of wind turbine fault detection and relates to a generator fault detection method based on a hybrid attention mechanism. Background Art
[0002] The development of the wind power renewable energy industry has entered the "double-speed stage", and the development of wind power enterprises is facing both opportunities and challenges. The double-fed induction generator has been identified as the main energy conversion system of wind turbines, and is the key to whether wind turbines can obtain efficient and high-quality power output. Therefore, real-time monitoring of the operating status of the generator, early detection of potential faults, and elimination of hidden faults are of great significance to ensure the safe and reliable operation of wind turbines.
[0003] Due to the scarcity of historical fault samples of wind turbines, a normal state model of the generator is usually established based on the normal operating data in the wind farm SCADA system. The difference between the predicted value and the measured value of the generator monitoring data is compared, and the predicted residual is used as a state indicator to measure the health status of the generator, thereby achieving early fault detection. When a generator fails, the SCADA monitoring data will change, but the change in monitoring data does not necessarily mean that the generator has failed. Time-varying operating conditions are one of the important factors that affect the change of generator monitoring data. How to distinguish the monitoring data exceeding the limit caused by time-varying operating conditions and generator failures, and identify generator failures in the early stage of abnormal conditions are key issues worthy of study.
[0004] Most studies achieve fault detection of generators by focusing on the changing behavior of a single key monitoring data. However, the method of using a single monitoring data prediction value is often difficult to fully and effectively characterize the operating status of the generator. Since the stable relationship between the monitoring data will change significantly when the equipment fails, some scholars compare the difference between the multivariate prediction value and the measured value based on the stable relationship between multiple variables when the system is operating normally, and achieve early weak fault detection of the generator under variable conditions. Existing fault detection models usually assume that the change of generator operating conditions has a clear state boundary. However, in actual wind farms, the operating conditions of the unit gradually change over time, which is nonlinear and dynamic, making it challenging to model the dynamic impact of the operating conditions on the fault through some specific models. The time-varying environment and load have a great impact on the mining of the real law of the unit operating data, the correlation relationship of the characteristic parameters, and other information. The changes in the abnormal state of the unit are often easily masked by the fluctuation of the operating conditions, and it is impossible to distinguish the impact of the potential fault of the generator and the change of the operating conditions on the dynamic behavior of the generator. How to make full use of the characteristics of multivariate SCADA data, analyze the correlation between the monitoring data in the generator components and the time dimension, identify the early abnormal signs of the generator, improve the accuracy of fault warning, and provide a reliable basis for predictive maintenance of the generator is a research hotspot worthy of attention. Summary of the invention
[0005] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a wind turbine generator fault status detection method that mixes spatial attention mechanism and temporal attention mechanism, aiming to improve the generator fault detection accuracy and reduce the false alarm rate caused by changes in operating conditions.
[0006] To achieve the above object, the technical solution adopted by the present invention is as follows: a generator fault detection method based on a hybrid attention mechanism, comprising the following steps:
[0007] S1. Obtain training data set;
[0008] S1.1 For the wind turbine generator monitoring data collected by the SCADA system, remove the monitoring data corresponding to the ambient wind speed being less than the cut-in wind speed and greater than the cut-out wind speed, including the operating variables and state variables of the generator during normal operation;
[0009] S1.2 normalizes the operating variables and state variables of the wind turbine generator collected by the SCADA system during normal operation to obtain normalized monitoring data of the generator under normal operation;
[0010] S1.3 Obtain training data set: X = (x 1 , x 2 , ..., x n ) T ∈R T represents an n-dimensional training data set with a time length of T, where the first 4-dimensional variables represent the working conditions and the last n-4-dimensional variables represent the generator status; represents the monitoring variable with a time length of T, represents the n monitoring variables input at time t;
[0011] S2. Construct a long short-term memory autoencoding network model based on a hybrid attention mechanism;
[0012] S2.1 builds a long short-term memory encoder with spatial attention mechanism, references the hidden state and cell state of the previous step in the encoder LSTM unit, extracts the attention weight of each variable at each time step, forms a new input sequence and serves as the input of the encoder;
[0013] S2.2 builds a long short-term memory decoder with a temporal attention mechanism, and calculates the attention weight of the hidden state at the current time step based on the hidden state of the previous step;
[0014] S3, training the long short-term memory autoencoder network model based on the hybrid attention mechanism;
[0015] S3.1 uses the training data set as the input of the LSTM model and calculates the attention weight of the monitoring variable k at time t according to the spatial attention calculation formula (1): and the network parameters that need to be learned;
[0016]
[0017] Among them, v e ∈R T , W e ∈R T×2m , U e ∈R T×T are the parameters that the network needs to learn respectively; in formula (1), the correlation weight is calculated by the current value and recent value of the monitoring variable k, and the recent value is calculated by the hidden state h of the previous time step in the encoder t-1 and cell states t-1 To express;
[0018] S3.2 According to formula (2), the softmax function is used to normalize the correlation weights of all monitoring variables of the generator, and finally the attention weight of variable k at time t is obtained
[0019]
[0020] S3.3 calculates the weighted output vector of each dimensional variable through the spatial attention mechanism, and adaptively selects the input of the autoencoder at time t according to formula (3):
[0021] S3.4 Based on the hidden state d of the decoder at time t-1 t-1 ∈R p , and the memory cell state s′ t-1 ∈R p , calculate the attention weight of the encoder at time t′ to the hidden state at time t, as shown in the following formula (4);
[0022]
[0023] Where [d t-1 ;s′ t-1 ]∈R 2p Respectively represent the hidden state and memory state of the decoder LSTM unit in the previous time step; v d ∈R T , W d ∈R T×2m , U d ∈R T×T are the network model parameters obtained through training;
[0024] S3.5 According to formula (5), the correlation weight calculated by the softmax function is normalized to finally obtain the attention weight of the encoder hidden state at time t′:
[0025] S3.6 takes the minimum prediction error of the generator temperature variable as the optimization goal, trains the autoencoder network, and obtains the network parameters;
[0026] S3.7 According to the weighted summation formula (6), all encoder hidden states {h1, h2, ..., h T}Weighted summation obtains the deep feature vector of the generator state:
[0027] S4, constructing a generator fault detection model;
[0028] S4.1 extracts the deep feature vector of the generator state based on the training data set according to formula (6), and uses the deep feature sequence as the output of the autoencoder network;
[0029] S4.2 Constructing the generator state index: Calculate the average value of the deep features of the training sample, then the state index B of the training sample at time t t It can be expressed as the Mahalanobis distance between the depth feature value and the average value of the sample at that moment. The calculation formula is shown in (7):
[0030] In the formula, c t is the state feature of the training sample at time t, u is the mean vector of the state feature of the training sample, Cov -1 is the inverse matrix of the covariance matrix of the training samples;
[0031] S4.3 Constructing the generator state reference space: According to formula (7), the state indicators of all training samples are calculated to form the generator state reference space {B1, ..., B t , ..., B T}∈R A*T ,A is the depth feature dimension, T is the time length of the training data set;
[0032] S4.4 a. If the smoothed state indicator sequence is verified to be inconsistent with the normal distribution, the kernel density estimation method is used to calculate the threshold of the state indicator; the probability density function of the normal state indicator is The probability density function based on kernel density estimation is shown in formula (8):
[0033] In the formula, h is the bandwidth, and K(.) is the Gaussian kernel function as shown in formula (9):
[0034]
[0035] Assuming the confidence level is α, the generator state indicator threshold is td as shown in formula (10):
[0036]
[0037] b. If the smoothed state indicator sequence is verified to conform to the normal distribution, the threshold td of the state indicator is calculated using the 3σ principle: td = μ ± 3σ (11)
[0038] In the formula, μ and σ are the mean and variance of the deep features of the training samples respectively;
[0039] S4.5 calculates the state index of the test data set according to formula (7), and compares the state index of the test data set with the state index threshold of the training data set. If the state index of the test data set exceeds the state index threshold of the training data set, it is considered that the generator state is abnormal and triggers an early warning.
[0040] As a preferred solution, after step S4.3, the state index sequence in the generator state reference space is filtered and smoothed using an autoregressive moving average model and an exponential smoothing algorithm EWMA; the calculation formula of EWMA is shown in (A):
[0041] Z t =λB t +(1-λ)B t-1 (A)
[0042] In the formula, B t and B t-1 are the state indicators of the generator at time t and time t-1, respectively, t is the generator state index after smoothing, λ∈(0,1] is the smoothing coefficient; when setting the initial value, let Z1=B1;
[0043] In step S4.5, after calculating the state index of the test data set according to formula (7), the state index sequence of the test data set is filtered and smoothed according to formula (A), and the state index of the processed test data set is compared with the state index threshold of the training data set. If the state index of the test data set exceeds the state index threshold of the training data set, it is regarded as an abnormal generator state and an early warning is triggered.
[0044] Compared with the prior art, the present invention has the following advantages:
[0045] First, when extracting the deep features of the multidimensional state variables of the generator, the present invention constructs a long short-term memory autoencoder network model based on the hybrid attention mechanism, adds a spatial attention mechanism to the encoder to analyze the mutual influence between different state variables, and adds a temporal attention mechanism to the decoder to analyze the weight changes of each state variable at different times, extracts more representative deep features, and improves the accuracy of generator fault detection.
[0046] Second, the traditional fault detection method uses reconstructed residuals to construct state indicators. The reconstructed residual sequence produces large noise under the influence of time-varying working conditions, making it difficult to ensure the state detection accuracy of the generator. The present invention constructs the state indicator of the generator by calculating the Mahalanobis distance of each deep feature. The state indicator is not affected by time-varying working conditions, thereby improving the robustness of the fault detection results to time-varying working conditions and avoiding the drawbacks of establishing fault detection models separately under different working conditions.
[0047] Third, when analyzing the state indicator threshold of the training data set, the present invention first verifies the probability distribution of the state indicator, and adopts different threshold calculation methods under different probability distribution conditions, so that the calculated threshold result is more in line with actual needs.
[0048] Fourth, the generator fault detection method proposed in the present invention has higher detection accuracy than the fault detection method without attention mechanism, and can reduce the mean absolute error and root mean square error.
[0049] Fifth, the hybrid attention mechanism in the present invention can preliminarily diagnose the cause of the generator failure. The maintenance personnel can focus on the parameters with larger weights by observing the attention weight map, which provides certain guidance for the maintenance work of the generator. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a flow chart for implementing the present invention.
[0051] Figure 2 It is the probability distribution and threshold diagram of the state indicator sequence of the training set.
[0052] Figure 3 Schematic diagram of the temporal attention weights before and after a failure.
[0053] Figure 4 Schematic diagram of spatial attention weights before and after failure.
[0054] Figure 5 This is a schematic diagram of fault detection comparison results.
[0055] Figure 6 This is a trend chart of ambient wind speed and temperature changes.
[0056] Figure 7 This is a trend diagram of active power and rotor speed. DETAILED DESCRIPTION
[0057] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0058] This embodiment uses a wind turbine with a rated power of 2MW in a wind farm in Xinjiang, and the generator monitoring data recorded by the data acquisition and monitoring control system, i.e., the SCADA system from January to December 2018 as experimental data, and the system sampling frequency is once every 15 minutes. The monitoring data of the generator during normal operation of the unit from January to June 2018 is used as the training set, and the monitoring data containing the generator early warning records from July to December 2018 is used as the test set. The double-fed asynchronous generator model of the selected wind turbine is FDYS2.0-4KS, with a rated active power of 2150kw, a cut-in wind speed of 3m / s, a cut-out wind speed of 25m / s, a rated wind speed of 10.9m / s, a generator speed of 1755 rpm, a rated voltage of 690V, and a rated current of 1750A.
[0059] Reference Figure 1 The generator fault detection method based on the hybrid attention mechanism of this embodiment specifically includes the following steps:
[0060] S1. Get the training data set:
[0061] S1.1 For the wind turbine generator monitoring data collected by the SCADA system, remove the monitoring data corresponding to the ambient wind speed being less than the cut-in wind speed and greater than the cut-out wind speed, including the operating variables and state variables of the generator during normal operation;
[0062] S1.2 normalizes the operating variables and state variables of the wind turbine generator collected by the SCADA system during normal operation to obtain normalized monitoring data of the generator under normal operation;
[0063] S1.3 Obtain training data set: The 10-dimensional generator monitoring variables from January to June 2018 are used as the training data set, where the first 4-dimensional data represent the working conditions, including ambient wind speed, ambient temperature, active power and speed, and the last 5-dimensional data represent the generator status, including generator temperature and torque. At time t, the input of the long short-term memory encoder model based on the hybrid attention mechanism is the 10-dimensional monitoring variables, as shown in Table 1;
[0064] Table 1 Sensor variables of doubly-fed asynchronous generator
[0065]
[0066] According to the alarm log recorded by the SCADA system of the wind farm in 2018, the generator alarm record of unit #22 was selected to verify the effectiveness of the proposed abnormal state identification method. The alarm record of unit #22 is shown in Table 2.
[0067] Table 2 Sample alarm record of unit #22
[0068]
[0069] From 23:45 on December 18, 2018 to 00:19 on December 19, 2018, the SCADA system repeatedly reported that the power curve of the generator of unit #22 was below the lower limit. After 34 minutes, the operation and maintenance personnel took remote shutdown operations. Later, during the maintenance, it was found that the blades of the generator cooling fan were damaged, causing the cooling water to overheat, and ultimately causing the heat dissipation performance of the generator to decline. The wind turbine control system triggered the self-protection mechanism and was in a limited power operation state. The maintenance personnel replaced the generator cooling fan and finally resolved the fault.
[0070] S2. Construct a long short-term memory autoencoder network model based on a hybrid attention mechanism:
[0071] S2.1 builds a long short-term memory encoder with spatial attention mechanism, references the hidden state and memory unit state of the previous step in the encoder LSTM unit, extracts the attention weight of each variable at each time step, forms a new input sequence and serves as the input of the encoder;
[0072] S2.2 builds a long short-term memory decoder with a temporal attention mechanism, and calculates the attention weight of the hidden state at the current time step based on the hidden state of the previous step;
[0073] S3. Training the long short-term memory autoencoder network model based on the hybrid attention mechanism:
[0074] S3.1 uses the training data set as the input of the LSTM model and calculates the attention weight of the monitoring variable k at time t according to the spatial attention calculation formula (1): and the network parameters that need to be learned;
[0075]
[0076] Among them, v e ∈R T , W e ∈R T×2m , U e ∈R T×Tare the parameters that the network needs to learn. In formula (1), the correlation weight is calculated by the current value and recent value of the monitoring variable k, and the recent value is calculated by the hidden state h of the previous time step in the encoder. t-1 and cell states t-1 To express.
[0077] S3.2 According to formula (2), the softmax function is used to normalize the correlation weights of all monitoring variables of the generator, and finally the attention weight of variable k at time t is obtained
[0078]
[0079] S3.3 calculates the weighted output vector of each dimensional variable through the spatial attention mechanism, and adaptively selects the input of the autoencoder at time t according to formula (3):
[0080] S3.4 Based on the hidden state d of the decoder at time t-1 t-1 ∈R p , and the memory cell state s′ t-1 ∈R p , calculate the attention weight of the encoder at time t′ to the hidden state at time t, as shown in the following formula (4);
[0081]
[0082] Where [d t-1 ;s′ t-1 ]∈R 2p Represent the hidden state and memory cell state of the decoder LSTM unit in the previous time step respectively; v d ∈R T , W d ∈R T×2m , U d ∈R T×T are the network model parameters obtained through training;
[0083] S3.5 According to formula (5), the correlation weight calculated by the softmax function is normalized to finally obtain the attention weight of the encoder hidden state at time t′:
[0084] S3.6 takes the minimum prediction error of the generator temperature variable as the optimization goal, trains the autoencoder network, and obtains the network parameters; as shown in Table 2;
[0085] Table 2 Model parameter settings
[0086]
[0087] S3.7 According to formula (6), for all encoder hidden states {h1, h2, ..., h T}Weighted summation obtains the deep feature vector of the generator state:
[0088] S4. Constructing a generator fault detection model:
[0089] S4.1 Based on the training data set: extract the deep features of the generator state according to formula (6), and use the deep feature sequence as the output of the autoencoder network;
[0090] S4.2 Constructing the generator state index: Calculate the average value of each deep feature in the deep feature sequence, then the state index B of any training sample t It can be expressed as the Mahalanobis distance between the depth feature value and the average value of the sample at that moment. The calculation formula is shown in (7):
[0091] In the formula, c t is the state feature of the training sample at time t, u is the mean vector of the state feature of the training sample, Cov -1 is the inverse matrix of the covariance matrix of the training samples;
[0092] S4.3 Constructing the generator state reference space: According to formula (7), the state indicators of all training samples are calculated to form the generator state reference space {B1, ..., B t , ..., B T}∈R A*T ,A is the depth feature dimension, T is the time length of the training data set;
[0093] The autoregressive moving average model and exponential smoothing algorithm (EWMA) are used to filter and smooth the state index sequence in the generator state reference space. The calculation formula of EWMA is shown in (A).
[0094] Z t =λB t +(1-λ)B t-1 (A)
[0095] In the formula, B t and B t-1 are the state indicators of the generator at time t and time t-1, respectively, t is the generator state index after smoothing, and λ∈(0,1] is the smoothing coefficient. When λ=1, it means no smoothing, and when λ→0, it means that the peak value in the state index sequence gradually weakens and the change trend becomes more obvious. In this study, λ is set to 0.15. When setting the initial value, let Z1=B1;
[0096] S4.4 a. If the smoothed state indicator sequence is verified to be inconsistent with the normal distribution, the kernel density estimation method is used to calculate the threshold of the state indicator; the probability density function of the normal state indicator is The probability density function based on kernel density estimation is shown in formula (8):
[0097] In the formula, h is the bandwidth, and K(.) is the Gaussian kernel function as shown in formula (9):
[0098]
[0099] Assuming the confidence level is α, the generator state indicator threshold is td as shown in formula (10):
[0100]
[0101] b. If the smoothed state indicator sequence is verified to conform to the normal distribution, the threshold td of the state indicator is calculated using the 3σ principle: td = μ ± 3σ (11)
[0102] In the formula, μ and σ are the mean and variance of the deep features of the training samples respectively;
[0103] The probability distribution of the generator state index sequence is as follows: Figure 2 The distribution is skewed. The generator state threshold is calculated using kernel density estimation to be 21.96.
[0104] Figure 3 and Figure 4 They are the temporal attention weight map and spatial attention weight map of the monitoring variables of the generator at each time step during the fault period, respectively.
[0105] S4.5 After calculating the state index of the test data set according to formula (7), the state index sequence of the test data set is filtered and smoothed according to formula (A), and the state index of the processed test data set is compared with the state index threshold of the training data set. If the state index of the test data set exceeds the state index threshold of the training data set, it is considered that the generator state is abnormal and an early warning is triggered. The fault detection results of the test data set are as follows: Figure 5 As shown in Figure 2, and compared with the LSTM autoencoder network without attention mechanism; the working conditions in the same time period are as follows Figure 6 and Figure 7 shown.
[0106] The performance of the present invention is verified by comparative experiments. Figure 5The fault detection results of the AM-LSTM-MD model and the LSTM-MD model without attention mechanism are shown respectively. The generator fault shutdown recorded by the SCADA system occurred at the 458th time point. The generator power curve repeatedly crossed the threshold and continued for 34 minutes before shutting down for maintenance. After eliminating the fault, the unit was restarted. The state indicator sequence during the shutdown period has been deleted in the figure. The AM-LSTM-MD model first detected that the generator state indicator exceeded the threshold at the 424th time point, and the LSTM-MD detected that the generator state indicator exceeded the threshold at the 165th, 175th and 436th time points respectively.
[0107] from Figure 3 and Figure 4 It can be seen from the attention weight diagram that the weight of the generator active power near the 165th time point is much greater than the weight of the generator temperature, indicating that the warning at this point is caused by a change in the working condition rather than an abnormality in the generator state itself. Figure 7 The active power of the generator around the 165th and 175th time points in the image shows a sudden change, which coincides with the maximum active power weight value in the spatial attention weight map during this period. Comprehensive analysis shows that the warnings of LSTM-MD at time points 165 and 175 are false alarms.
[0108] After the AM-LSTM-MD model first detected the fault at the 424th time point, the state indicator repeatedly crossed the threshold and continued until the remote shutdown at the 458th time point. The time step attention in the corresponding time attention weight map gradually increased during this period, and the cooling water temperature weight value in the space attention weight map was the largest. Taking into account the spatiotemporal attention weights, it can be preliminarily judged that a fault is about to occur during this period, and the cause of the fault is caused by the excessively high cooling water temperature. This inference is consistent with the fault and its cause at point 458 of the generator. The AM-LSTM-MD model proposed in the present invention detects the early fault of the generator 8.5 hours ahead of the real alarm of the SCADA system, and avoids false alarms caused by time-varying working conditions based on the spatiotemporal attention mechanism, and preliminarily diagnoses the cause of the fault. LSTM-MD also successfully detected the generator fault at the 436th time point, but detected the fault 1 hour later than the AM-LSTM-MD model, and generated false alarms when the working conditions suddenly changed in the early stage.
[0109] The technical effects of the present invention are described in detail below in conjunction with simulation experiments.
[0110] The present invention uses mean absolute error and root mean square error to evaluate the reconstruction effect of the autoencoder network, wherein the expressions of mean absolute error and root mean square error are respectively formula (12) and formula (13):
[0111]
[0112]
[0113] In the formula, x i is the actual value of the multidimensional state variable of the i-th sample, y i is the multidimensional state variable prediction residual of the i-th sample, and m is the number of samples in the test data set.
[0114] Table 2 Model prediction residual results
[0115] Model MAE RMSE AM-LSTM-MD 1.714 2.173 LSTM-MD 1.792 2.264
[0116] Analyzing Table 2, it can be seen from the comparison between AM-LSTM-MD and LSTM-MD that the prediction model proposed in the patent of this invention has higher accuracy and is more robust to disturbances of time-varying working conditions.
[0117] The above-mentioned embodiments are only illustrative of the principles and effects of the invention, as well as some embodiments of its application, and are not intended to limit the invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the invention, and all of these belong to the protection scope of the invention.
Claims
1. A generator fault detection method based on a hybrid attention mechanism, comprising the following steps: S1. Obtain training data set; S1.1 For the wind turbine generator monitoring data collected by the SCADA system, remove the monitoring data corresponding to the ambient wind speed being less than the cut-in wind speed and greater than the cut-out wind speed, including the operating variables and state variables of the generator during normal operation; S1.2 normalizes the operating variables and state variables of the wind turbine generator collected by the SCADA system during normal operation to obtain normalized monitoring data of the generator under normal operation; S1.3 Obtain training data set: X = (x 1 , x 2 , ..., x n ) T ∈R T represents an n-dimensional training data set of time length T, where The first 4-dimensional variables represent the operating conditions, and the last n-4-dimensional variables represent the generator status; represents the monitoring variable with a time length of T, represents the n monitoring variables input at time t; S2. Construct a long short-term memory autoencoding network model based on a hybrid attention mechanism; S2.1 builds a long short-term memory encoder with spatial attention mechanism, references the hidden state and cell state of the previous step in the encoder LSTM unit, extracts the attention weight of each variable at each time step, forms a new input sequence and serves as the input of the encoder; S2.2 builds a long short-term memory decoder with a temporal attention mechanism, and calculates the attention weight of the hidden state at the current time step based on the hidden state of the previous step; S3, training the long short-term memory autoencoder network model based on the hybrid attention mechanism; S3.1 uses the training data set as the input of the LSTM model and calculates the attention weight of the monitoring variable k at time t according to the spatial attention calculation formula (1): and the network parameters that need to be learned; Among them, v e ∈R T , W e ∈R T×2m , U e ∈R T×T are the parameters that the network needs to learn respectively; in formula (1), the correlation weight is calculated by the current value and recent value of the monitoring variable k, and the recent value is calculated by the hidden state h of the previous time step in the encoder. t-1 and cell states t-1 To express; S3.2 According to formula (2), the softmax function is used to normalize the correlation weights of all monitoring variables of the generator, and finally the attention weight of variable k at time t is obtained S3.3 calculates the weighted output vector of each dimensional variable through the spatial attention mechanism, and adaptively selects the input of the autoencoder at time t according to formula (3): S3.4 Based on the hidden state d of the decoder at time t-1 t-1 ∈R p , and the memory cell state s′ t-1 ∈R p , calculate the attention weight of the encoder at time t′ to the hidden state at time t, as shown in the following formula (4); Where [d t-1 ;s′ t-1 ]∈R 2p Represent the hidden state and memory cell state of the decoder LSTM unit in the previous time step respectively; v d ∈R T , W d ∈R T×2m , U d ∈R T×T are the network model parameters obtained through training; S3.5 According to formula (5), the correlation weight calculated by the softmax function is normalized to finally obtain the attention weight of the encoder hidden state at time t′: S3.6 takes the minimum prediction error of the generator temperature variable as the optimization goal, trains the autoencoder network, and obtains the network parameters; S3.7 According to the weighted summation formula (6), all encoder hidden states {h1, h2, ..., h T }Weighted summation obtains the deep feature vector of the generator state: S4, constructing a generator fault detection model; S4.1 extracts the deep feature vector of the generator state based on the training data set according to formula (6), and uses the deep feature sequence as the output of the autoencoder network; S4.2 Constructing the generator state index: Calculate the average value of the deep features of the training sample, then the state index B of the training sample at time t t It can be expressed as the Mahalanobis distance between the depth feature value and the average value of the sample at that moment. The calculation formula is shown in (7): In the formula, c t is the state feature of the training sample at time t, u is the mean vector of the state feature of the training sample, Cov -1 is the inverse matrix of the covariance matrix of the training samples; S4.3 Constructing the generator state reference space: According to formula (7), the state indicators of all training samples are calculated to form the generator state reference space {B1, ..., B t , ..., B T }∈R A*T ,A is the depth feature dimension, T is the time length of the training data set; S4.4 a. If the smoothed state indicator sequence is verified to be inconsistent with the normal distribution, the kernel density estimation method is used to calculate the threshold of the state indicator; the probability density function of the normal state indicator is The probability density function based on kernel density estimation is shown in formula (8): In the formula, h is the bandwidth, and K(.) is the Gaussian kernel function as shown in formula (9): Assuming the confidence level is α, the generator state indicator threshold is td as shown in formula (10): b. If the smoothed state indicator sequence is verified to conform to the normal distribution, the threshold t of the state indicator is calculated using the 3σ principle. d :t d =μ±3σ (11) In the formula, μ and σ are the mean and variance of the deep features of the training samples respectively; S4.5 calculates the state index of the test data set according to formula (7), and compares the state index of the test data set with the state index threshold of the training data set. If the state index of the test data set exceeds the state index threshold of the training data set, it is considered that the generator state is abnormal and triggers an early warning.
2. A generator fault detection method based on a hybrid attention mechanism as claimed in claim 1, characterized in that: After step S4.3, the state index sequence in the generator state reference space is filtered and smoothed using the autoregressive moving average model and exponential smoothing algorithm EWMA; the calculation formula of EWMA is shown in (A): Z t =λB t +(1-λ)B t-1 (A) In the formula, B t and B t-1 are the state indicators of the generator at time t and time t-1, respectively, t is the generator state index after smoothing, λ∈(0,1] is the smoothing coefficient; when setting the initial value, let Z1=B1; In step S4.5, after calculating the state index of the test data set according to formula (7), the state index sequence of the test data set is filtered and smoothed according to formula (A), and the state index of the processed test data set is compared with the state index threshold of the training data set. If the state index of the test data set exceeds the state index threshold of the training data set, it is regarded as an abnormal generator state and an early warning is triggered.
Citation Information
Patent Citations
Wind power ultra-short-term prediction method of improved bidirectional long-short-term memory network
CN112949945A
Predicted forecast offset from remote location sensor
US20210326723A1