Adn early fault detection method based on high-frequency tfm network and application
Patent Information
- Application Number
- CN202211530846.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-01
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-12-01
AI Technical Summary
但是该方法缺乏对三相电压和零序电流时间上建模,缺乏对故障数据时间上相互关系的分析
[0096] 1. The active early fault detection method for distribution networks based on high-frequency feature attention time-frequency memory network proposed in this invention inputs fault data into high-frequency and low-frequency channels composed of wavelet packet transform or wavelet transform, respectively, and performs time-frequency analysis at different scales to obtain the time-frequency features of high-frequency and low-frequency channels composed of high-frequency wavelet coefficients and low-frequency wavelet coefficients, respectively. This realizes multi-scale high-resolution time-frequency analysis of the non-stationary characteristics of early faults, thereby improving the fault detection performance of the model.
Smart Images

Figure CN115963351B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to wavelet and wavelet packet transform techniques, deep learning techniques, attention mechanism techniques, and residual techniques. Specifically, it relates to an active distribution network early fault detection method based on a high-frequency feature attention time-frequency memory network, which is suitable for high-precision detection of early faults in active distribution systems. Background Technology
[0002] A power distribution network is a power transmission system directly connected to users. The operation of distribution network equipment can be categorized into normal state, early fault state, and fault state. Early faults in a distribution network are typically described as intermittent faults with short durations, small fault currents, and self-recovering characteristics. However, if not addressed promptly, they can develop into permanent faults, damaging the network equipment. Therefore, early fault detection systems play a crucial role in maintaining the stability of power equipment.
[0003] Traditional fault identification methods are often used for early fault detection, including state estimation and parameter estimation. These methods extract characteristic quantities from fault voltage and current signals, analyze and calculate them, and compare them with empirically set thresholds or manually defined rules to detect early faults. This method, which involves manually selecting features and then detecting early faults according to rules, requires high feature extraction accuracy, and the threshold setting and discrimination criteria are determined empirically. Therefore, it is not suitable for fault classification with complex waveforms.
[0004] With the rise of artificial intelligence, data-driven methods have been widely applied to fault detection in distribution networks. Due to the complexity of fault causes and mechanisms, it is difficult to establish comprehensive mathematical models. Data-driven methods, however, train and fit large amounts of sampled data to form automated decision-making models, which can be well applied to distribution network fault detection. For example, a deep recurrent neural network architecture using Long Short-Term Memory (LSTM) units can be used to model the fault voltage and current over time, and fault features can be extracted through hidden layers to achieve detection. However, early fault signals have non-stationary characteristics, and LSTM lacks frequency domain analysis, meaning it cannot extract frequency features from fault signals. Therefore, eliminating the influence of non-stationary characteristics of fault signals is a challenge for applying deep learning methods to identify early faults in distribution networks.
[0005] Wang Hongjun from the School of Electrical Engineering and Automation at Tianjin University of Technology proposed a fault detection method for DC microgrids based on an improved VMD-SSA. This method optimizes the selection of the number of mode decomposition levels and the penalty factor by using a sparrow search algorithm combined with minimum envelope entropy as the objective function. However, the threshold criterion in this method needs to be set empirically, making it unsuitable for early-stage faults with limited data samples.
[0006] Zhang Chi from the School of Electrical and Automation Engineering at Jinan University proposed a method for identifying distribution network fault types and ferroresonance based on voltage variation characteristics. This method uses wavelet transform on the three-phase voltage and zero-sequence voltage of the system, and utilizes the wavelet singular entropy values and wavelet energy ratios of the zero-sequence voltage and three-phase voltage to distinguish between phase-to-phase faults, ground faults, and ferroresonance, as well as the fault phases of ground faults and phase-to-phase faults, and single-phase ground faults and power frequency ferroresonance. However, this method lacks temporal modeling of the three-phase voltage and zero-sequence current, and lacks analysis of the temporal interrelationships of fault data. Summary of the Invention
[0007] This invention aims to address the shortcomings of existing technologies by proposing an ADN early fault detection method and its application based on a high-frequency TFM network. The method aims to extract the high- and low-frequency channel time-frequency features of fault data through a dual-channel multi-scale time-frequency memory recursive layer, and to integrate the high-frequency and low-frequency channel features of the fault through a residual-assisted high-frequency feature attention mechanism layer to obtain complete fault time-frequency feature information, thereby achieving high-precision detection of early faults in the distribution network.
[0008] The present invention adopts the following technical solution to solve the technical problem:
[0009] The early fault detection method for ADN based on high-frequency TFM networks of the present invention is characterized by the following steps:
[0010] Step 1: Construct the training set T for the network tr ;
[0011] Step 1.1: Collect three-phase voltage and three-phase current data of the faulty equipment, and construct a fault data classification set, denoted as X = {U, I}, where U represents the three-phase voltage dataset, and U = {U1…U1} k …U K}, U k This represents the three-phase voltage data of the k-th fault data, and U k ={u k,a,1 …u k,a,t …u k,a,T ,u k,b,1 …u k,b,t …u k,b,T ,u k,c,1 …u k,c,t …u k,c,T}, u k,a,t U represents the phase a voltage data at sampling time t of the k-th fault data. k,b,t U represents the phase b voltage data at sampling time t of the k-th fault data. k,c,t Let I represent the c-phase voltage data at sampling time t of the k-th fault data; let I represent the three-phase current dataset, and I = {I1…I2} k…I K} represents the three-phase current dataset of the k-th fault data, and I k ={i k,a,1 …i k,a,t …i k,a,T i k,b,1 …i k,b,t …i k,b,T i k,c,1 …i k,c,t …i k,c,T}, i k,a,t This represents the phase a current data at the t-th sampling time of the k-th fault data, i k,b,t This represents the phase b current data at the t-th sampling time of the k-th fault data, i k,c,t The c-phase current data at the t-th sampling time represents the k-th fault data; 1≤k≤K, where K represents the total number of faults; 1≤t≤T, where T represents the total sampling time;
[0012] Step 1.2: Construct a set of label information for the fault data classification set F, denoted as Y = {y1, ..., y2}. k ,…,y K}, where y k This represents the label value of the kth fault data, and y k It belongs to [1, N], where N is the number of fault types;
[0013] Step 1.3: Randomly shuffle the labeled fault dataset P = (X, Y) and use it as the training set T. tr And T tr ={(x1,y1),(x2,y2),…,(x k ,y k ),…,(x K ,y K )},x k Let x represent the k-th fault data, and x k ={x k,1 ,x k,2 ,…x k,t …,x k,T}, x k,t This represents the three-phase voltage and current data at the t-th sampling time of the k-th fault data.
[0014] Step 2: Construct a high-frequency feature attention-based time-frequency memory network, including: a dual-channel multi-scale time-frequency memory recursive layer, an Attention layer, a residual-assisted high-frequency feature attention mechanism layer, and a Softmax layer;
[0015] Step 2.1: Construct a dual-channel multi-scale time-frequency memory recursive layer, including: a low-frequency channel time-frequency memory unit and a high-frequency channel time-frequency memory unit;
[0016] The kth fault data x k Data at sampling time t x k,t The data is processed in the low-frequency channel time-frequency memory unit to obtain the kth fault data x. k Fault information hiding state H at all time steps in the low-frequency channel k low ;
[0017] The kth fault data x k Data at sampling time t x k,t The data is input into the high-frequency channel time-frequency memory unit for processing to obtain the k-th fault data x. k Fault information hiding state H at all time steps in the high-frequency channel k high ;
[0018] Step 2.2, the Attention layer for H k low and H k high The data is processed separately to obtain the kth fault data point x after weighted averaging. k The low-frequency channel feature vector V k low and high-frequency channel feature vector V k high ;
[0019] Step 2.3, the kth fault data point x after weighted average k The low-frequency channel feature vector V k low The kth fault data after weighted average k High-frequency channel feature vector V k high The data is input into the residual-assisted high-frequency feature attention mechanism layer for processing to obtain the k-th fault data x. k Multi-resolution time-frequency features S k ;
[0020] Step 2.4, the kth fault data x k Multi-resolution time-frequency features S k The data is input into the Softmax layer, and the kth fault data x is obtained using equation (1). k The probability value P(x) corresponding to all fault types k |N);
[0021] P(x k |N)=softmax(W P,k S k +b P,k(1)
[0022] In equation (1), W P,k and b P,k Let x represent the k-th fault data. k Multi-resolution time-frequency features S k The probability weight matrix and probability bias vector; softmax represents the activation function;
[0023] Step 2.5: Construct the cross-entropy loss function L using equation (2). log (y k ,P k,n ):
[0024]
[0025] In equation (2), P k,n This represents the kth fault data point x. k The label value y k The probability of predicting the Nth type of failure;
[0026] Step 2.6: Based on the training set T tr The high-frequency feature attention time-frequency memory network was trained using backpropagation and gradient descent, and the loss function L was calculated. log To update network parameters when the training epoch reaches the maximum number of training epochs, or the loss function L log When the minimum value is reached, training stops, thus obtaining a trained active distribution network for early fault detection, which is used to map the input fault data set to the corresponding fault category label.
[0027] The early fault detection method of ADN based on high-frequency TFM network described in this invention is also characterized in that the low-frequency channel time-frequency memory unit in step 2.1 includes: a low-frequency channel forget gate, a low-frequency channel input gate, a low-frequency channel memory update unit, and a low-frequency channel output gate;
[0028] Step 2.1.1a: The low-frequency channel forget gate uses equation (3) to process the k-th fault data x. k Data at sampling time t x k,t Selective discarding is performed to obtain the k-th fault data x. k,t The fault selection information f at time step t of the low-frequency channel time-frequency memory unit. k,t low :
[0029] f k,t low =sigmoid(W fl,k x k,t +U fl,k hk,t-1 low +b fl,k (3)
[0030] In equation (3), h k,t-1 low This represents the kth fault data point x. k The fault information hiding state at time step t-1 of the low-frequency channel time-frequency memory unit; when t=1, let h k,t-1 low =0; sigmoid live function; W fl,k and U fl,k Let x represent the k-th fault data respectively. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel forget gate weight matrix, b fl,k This represents the kth fault data point x. k The low-frequency channel forget gate bias vector;
[0031] Step 2.1.2a: The low-frequency channel forget gate uses equation (4) to obtain the kth fault data x. k F fault retention information F at time step t in the low-frequency channel time-frequency memory unit k,t low :
[0032] F k,t low =f k,t low ×C k,t-1 low (4)
[0033] In equation (4), × represents the outer product operation, C k,t-1 low It is the kth fault data x k The information stored in the low-frequency channel time-frequency memory unit at time step t-1;
[0034] Step 2.1.3a: The low-frequency channel input gate obtains the k-th fault data x using equations (5)-(7). k The input fault information p at time step t of the low-frequency channel time-frequency memory unit. k,t low and fault modulation information g k,t low ;
[0035] p k,t low =sigmoid(Wpl,k x k,t +U pl,k h k,t-1 low +b pl,k (5)
[0036] g k,t low =tanh(W gl,k x k,t +U gl,k h k,t-1 low +b gl,k (6)
[0037] ig k,t low =p k,t low ⊙g k,t low (7)
[0038] In equations (5)-(6), ig k,t low For the kth fault data x k Fault information to be updated at time step t in the low-frequency channel time-frequency memory unit; W pl,k and U pl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel input weight matrix, b pl,k This represents the kth fault data point x. k The low-frequency channel input deviation vector; W gl,k and U gl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel modulation weight matrix, b gl,k This represents the kth fault data point x. k The low-frequency channel modulation deviation vector; ⊙ represents element-wise multiplication; tanh is the activation function;
[0039] Step 2.1.4a: The low-frequency channel memory update unit obtains the kth fault data x using equations (8)-(11). kInformation C is stored at time step t in the low-frequency channel memory unit. k,t low :
[0040]
[0041]
[0042] in k,t low =[A k,j 1 …A k,j m …A k,j M D k,j (10)
[0043] C k,t low =F k,t low C k,t-1 low +W A,k in k,t low (11)
[0044] In equations (8)-(11), m is the wavelet decomposition level, 1≤m≤M; A k,j m For the kth fault data x k The low-frequency wavelet coefficients, D, at the j-th scale under m-level wavelet decomposition. j,k For the kth fault data x k The high-frequency wavelet coefficients φ at the j-th scale j,k (t) represents the kth fault data x k The scaling function at the j-th scale, ψ j,k (t) represents the kth fault data x k wavelet basis functions at the j-th scale, in k,t low It is the kth fault data x k The time-frequency information at time step t in the low-frequency channel time-frequency memory unit, C k,t low It is the kth fault data x k Information is stored in the low-frequency channel memory unit at time step t-1, W A,k For the kth fault data x k The linear transformation matrix of the low-frequency channel memory update unit;
[0045] Step 2.1.5a: The low-frequency channel output gate uses equation (12) to obtain the kth fault data x. kThe low-frequency channel composite signal o at time step t in the low-frequency channel time-frequency memory unit. k,t low :
[0046] o k,t low =sigmoid(W ol,k x k,t +U ol,k h k,t-1 low +b ol,k (12)
[0047] In equation (12), W ol,k and U ol,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel output weight matrix, b ol,k This represents the kth fault data point x. k The low-frequency channel output deviation vector;
[0048] Step 2.1.6a: The low-frequency channel output gate uses equation (13) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the low-frequency channel time-frequency memory unit k,t low Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the low-frequency channel k low ={h k,1 low ,h k,2 low …h k,t low …h k,T low}:
[0049] h k,t low =o k,t low ⊙tanh(C k,t low (13).
[0050] The high-frequency channel time-frequency memory unit in step 2.1 includes: a high-frequency channel input gate, a high-frequency channel forget gate, a high-frequency channel memory update unit, and a high-frequency channel output gate;
[0051] Step 2.1.1b, the kth fault data x k Data at sampling time t x k,t In the high-frequency channel time-frequency memory unit, the high-frequency channel forget gate performs selective discarding using equation (14) to obtain the k-th fault data x. k,t The fault selection information f at time step t of the high-frequency channel time-frequency memory unit k,t high :
[0052] f k,t high =sigmoid(W fg,k x k,t +U fg,k h k,t-1 high +b fg,k (14)
[0053] In equation (14), h k,t-1 high This represents the kth fault data point x. k The fault information hiding state at time step t-1 of the high-frequency channel time-frequency memory unit; when t=1, let h k,t-1 high =0; sigmoid live function; W fg,k and U fg,k Let x represent the k-th fault data respectively. k Data at time t k,t and the kth fault data x k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t-1 high The high-frequency channel forget gate weight matrix, b fg,k This represents the kth fault data point x. k The high-frequency channel forget gate bias vector;
[0054] Step 2.1.2b: The high-frequency channel forget gate uses equation (15) to obtain the k-th fault data x. k F fault retention information F at time step t in the high-frequency channel time-frequency memory unit k,t high :
[0055] F k,t high =f k,t high ×C k,t-1 high (15)
[0056] In equation (15), C k,t-1 highIt is the kth fault data x k The information stored in the high-frequency channel time-frequency memory unit at time step t-1;
[0057] Step 2.1.3b: The high-frequency channel input gate obtains the k-th fault data x using equations (16)-(17). k The input fault information p at time step t of the high-frequency channel time-frequency memory unit. k,t high and fault modulation information g k,t high ;
[0058] p k,t high =sigmoid(W pg,k x k,t +U pg,k h k,t-1 high +b pg,k (16)
[0059] g k,t high =tanh(W gg,k x k,t +U gg,k h k,t-1 high +b gg,k (17)
[0060] ig k,t high =p k,t high ⊙g k,t high (18)
[0061] In equations (16)-(17), ig k,t high For the kth fault data x k Fault information to be updated at time step t of the high-frequency channel time-frequency memory unit; W pg,k and U pg,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel input weight matrix, b pg,k This represents the kth fault data point x. k The high-frequency channel input deviation vector; W gg,k and U gg,kLet x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel modulation weight matrix, b gg,k This represents the kth fault data point x. k The high-frequency channel modulation deviation vector;
[0062] Step 2.1.4b: The high-frequency channel memory update unit uses equations (18)-(21) to obtain the kth fault data x. k Information C is stored at time step t in the high-frequency channel memory unit. k,t high :
[0063]
[0064] in k,t high =[d l,k j,1 ,d l,k j,2 …d l,k j-a,r (20)
[0065] C k,t high =F k,t high C k,t-1 high +W Wh,k in k,t high (twenty one)
[0066] In equations (19)-(21), j is the scale number, a is the wavelet packet decomposition layer number, r is the number of zero crosses, l is the location parameter, and w r (2 j-a tl) is the wavelet packet function with zero-crossing number r and position parameter l at the j-th scale under the a-th level wavelet packet decomposition in the t-th time step of the high-frequency channel time-frequency memory unit. l,k j-a,r It is the kth fault data x k The fault information to be updated at time step t of the high-frequency channel time-frequency memory unit is ig. k,t high The wavelet packet coefficients at the j-th scale under the a-th level wavelet packet decomposition, with r zero-crossings and l position parameters, are in k,t high It is the kth fault data xk The time-frequency information at time step t in the high-frequency channel time-frequency memory unit, C k,t high This represents the kth fault data point x. k Information is stored in the (t-1)th time step of the frequency channel memory unit, W Wh,k For the kth fault data x k The linear transformation matrix;
[0067] Step 2.1.5b: The high-frequency channel output gate uses equation (22) to obtain the k-th fault data x. k The high-frequency channel composite signal o at time step t in the high-frequency channel time-frequency memory unit. k,t high :
[0068] o k,t high =sigmoid(W og,k x k,t +U og,k h k,t-1 high +b og,k ) (twenty two)
[0069] In equation (22), W og,k and U og,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel output weight matrix, b og,k This represents the kth fault data point x. k The high-frequency channel output deviation vector;
[0070] Step 2.6b: The high-frequency channel output gate uses equation (23) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t high Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the high-frequency channel k high ={h k,1 high ,h k,2 high …h k,t high …h k,T high}:
[0071] h k,t high =o k,t high ⊙tanh(C k,t high ) (twenty three).
[0072] Step 2.2 includes:
[0073] Step 2.2.1: The Attention layer uses equations (24) and (25) to obtain the k-th fault data x. k Fault information hiding state H at all time steps in the low-frequency channel k low The low-frequency channel feature vector u k low ={u k,1 low ,u k,2 low …u k,t low …u k,T low} and the kth fault data x k Fault information hiding state H at all time steps in the high-frequency channel k high High-frequency channel feature vector u k high ={u k,1 high ,u k,2 high …u k,t high …u k,T high}, where u k,t low This represents the kth fault data point x. k The fault feature vector of the low-frequency channel at time step t, u k,t high This represents the kth fault data point x. k The fault feature vector of the high-frequency channel at time step t;
[0074] u k low =W ul,k H k low +b ul,k (twenty four)
[0075] u k high =W ug,k H khigh +b ug,k (25)
[0076] In equations (24)-(25), W ul,k and b ul,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the low-frequency channel k low The time-frequency feature weight matrix and the kth fault data x k The low-frequency channel time-frequency characteristic deviation vector, W ug,k and b ug,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the high-frequency channel k high The time-frequency feature weight matrix and the kth fault data x k The high-frequency channel time-frequency characteristic deviation vector;
[0077] Step 2.2.2: The Attention layer uses equations (26) and (27) to obtain the k-th fault data x. k The fault feature vector u of the low-frequency channel at time step t k,t low Low-frequency channel normalized weight α k,t low and the kth fault data x k The fault feature vector u of the high-frequency channel at time step t k,t high High-frequency channel normalized weight α k,t high :
[0078]
[0079]
[0080] In equations (26) and (27), and Let x represent the k-th fault data. k The fault feature vector u of the low-frequency channel at time step t k,t low and the kth fault data x k The fault feature vector u of the low-frequency channel at time step t k,t high transpose, u w low and u w high This is a random initialization of the overall fault feature vector, and (·)' represents the matrix transpose operation;
[0081] Step 2.2.3: The Attention layer uses equation (28) to obtain the kth fault data x after weighted averaging. k The low-frequency channel feature vector V k low :
[0082]
[0083] Step 2.2.4: The Attention layer uses equation (29) to obtain the kth fault data x after weighted averaging. k High-frequency channel feature vector V k high :
[0084]
[0085] The residual-assisted high-frequency feature attention mechanism layer in step 2.3 uses equations (30)-(35) to obtain the k-th fault data x. k Multi-resolution time-frequency features S k ;
[0086] Q k =w Qh V k high (30)
[0087] V k =w Vl V k low (31)
[0088] Ke k =w Kl V k low (32)
[0089] e k =Q k (K ek )' (33)
[0090]
[0091]
[0092] In equations (30)-(35), Q k V k Ke k The kth fault data point x is the weighted average of the fault data points. k High-frequency channel feature vector V k highThe query value, the kth fault data after weighted average k The low-frequency channel feature vector V k low The true value and the kth fault data after weighted average k The low-frequency channel feature vector V k low Key value; w Qh It is the linear transformation matrix of the query value, w Vl It is the truth-valued linear transformation matrix, w Kl It is the key value linear transformation matrix, where d is the dimension of the linear transformation matrix, 1≤d≤D, e k For k fault data x k Attention score based on time-frequency features; α H For the kth fault data x k The attention weights for time-frequency features.
[0093] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor to execute the ADN early fault detection method, and the processor is configured to execute the program stored in the memory.
[0094] The present invention provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the ADN early fault detection method.
[0095] Compared with existing technologies, the beneficial effects of this invention are reflected in:
[0096] 1. The active early fault detection method for distribution networks based on high-frequency feature attention time-frequency memory network proposed in this invention inputs fault data into high-frequency and low-frequency channels composed of wavelet packet transform or wavelet transform, respectively, and performs time-frequency analysis at different scales to obtain the time-frequency features of high-frequency and low-frequency channels composed of high-frequency wavelet coefficients and low-frequency wavelet coefficients, respectively. This realizes multi-scale high-resolution time-frequency analysis of the non-stationary characteristics of early faults, thereby improving the fault detection performance of the model.
[0097] 2. The active early fault detection method for distribution networks based on high-frequency feature attention time-frequency memory network proposed in this invention, by adding a residual-assisted high-frequency feature attention mechanism layer, focuses the high-frequency and low-frequency channel fault time-frequency features output by the dual-channel multi-scale time-frequency memory recursive layer on the high-frequency channel fault time-frequency features as the key points, and then connects the original high-frequency channel time-frequency features as residuals to obtain a high-precision early fault feature vector, thereby achieving high-precision fault identification. Attached Figure Description
[0098] Figure 1 This is a diagram of the high-frequency feature attention time-frequency memory network structure proposed in this invention;
[0099] Figure 2 This is a diagram of the dual-channel multi-scale time-frequency memory recursive layer structure proposed in this invention;
[0100] Figure 3 This is a layer structure diagram of the high-frequency feature attention mechanism with residual assistance proposed in this invention. Detailed Implementation
[0101] In this embodiment, an early fault detection method for Active Distribution Network (ADN) based on a high-frequency time-frequency memory (TFM) network is proposed. This method utilizes a deep learning network framework and comprehensively considers the characteristics of early faults in the distribution network. A dual-channel, multi-scale time-frequency memory recursive layer extracts the high- and low-frequency channel time-frequency features of the fault signal to obtain multi-scale, multi-resolution fault information hidden state values. Then, an attention layer obtains the weighted average high- and low-frequency channel fault time-frequency features. Next, a residual-assisted high-frequency feature attention mechanism layer combines the fault time-frequency features of the low- and high-frequency channels. Finally, a softmax layer determines the fault type. Figure 1 As shown, the model's input consists of three-phase voltage and three-phase current data. These datasets are fed into a dual-channel multi-scale time-frequency memory recursive layer. This layer generates low-frequency and high-frequency fault signal data. These features are then used as input to an attention layer to obtain a weighted average of the low-frequency and high-frequency fault features. Finally, these features are fed into a residual-assisted high-frequency feature attention mechanism layer to obtain the fault feature vector. The input fault data x is then calculated using a softmax layer. k The probability value P(x) corresponding to all fault types N k |N), to obtain the fault label, specifically, it is done according to the following steps:
[0102] Step 1: Construct the training set T for the network tr ;
[0103] Step 1.1: Collect three-phase voltage and three-phase current data of the faulty equipment. This involves sampling the voltage and current data on the faulty line, normalizing the data, constructing a fault data classification set, and deleting abnormal three-phase voltage and current data. This set is denoted as X = {U, I}, where U represents the three-phase voltage dataset, and U = {U1…U1}. k…U K}, U k This represents the three-phase voltage data of the k-th fault data, and U k ={u k,a,1 …u k,a,t …u k,a,T ,u k,b,1 …u k,b,t …u k,b,T ,u k,c,1 …u k,c,t …u k,c,T}, u k,a,t U represents the phase a voltage data at sampling time t of the k-th fault data. k,b,t U represents the phase b voltage data at sampling time t of the k-th fault data. k,c,t Let I represent the c-phase voltage data at sampling time t of the k-th fault data; let I represent the three-phase current dataset, and I = {I1…I2} k …I K} represents the three-phase current dataset of the k-th fault data, and I k ={i k,a,1 …i k,a,t …i k,a,T i k,b,1 …i k,b,t …i k,b,T i k,c,1 …i k,c,t …i k,c,T}, i k,a,t This represents the phase a current data at the t-th sampling time of the k-th fault data, i k,b,t This represents the phase b current data at the t-th sampling time of the k-th fault data, i k,c,t Let t represent the c-phase current data at the t-th sampling time of the k-th fault data; 1≤k≤K, where K represents the total number of faults; 1≤t≤T, where T represents the total sampling time.
[0104] Step 1.2: Construct a set of label information for the fault data classification set F, denoted as Y = {y1, ..., y2}. k ,…,y K}, where y k This represents the label value of the kth fault data, and y k It belongs to [1, N], where N is the number of fault types.
[0105] Step 1.3: Randomly shuffle the labeled fault dataset P = (X, Y) and use it as the training set T. tr And T tr ={(x1,y1),(x2,y2),…,(x k ,y k ),…,(x K ,yK )},x k Let x represent the k-th fault data, and x k ={x k,1 ,x k,2 ,…x k,t …,x k,T}, x k,t This represents the three-phase voltage and current data at the t-th sampling time of the k-th fault data.
[0106] like Figure 1 As shown, the high-frequency feature attention time-frequency memory network includes: a dual-channel multi-scale time-frequency memory recursive layer, an Attention layer, a residual-assisted high-frequency feature attention mechanism layer, and a Softmax layer;
[0107] Step 2.1 Construct a dual-channel multi-scale time-frequency memory unit, including: a low-frequency channel time-frequency memory unit and a high-frequency channel time-frequency memory unit;
[0108] like Figure 2 As shown, the dual-channel multi-scale time-frequency memory recursive layer includes: a low-frequency channel time-frequency memory unit and a high-frequency channel time-frequency memory unit;
[0109] The low-frequency channel time-frequency memory unit includes: a low-frequency channel forget gate, a low-frequency channel input gate, a low-frequency channel memory update unit, and a low-frequency channel output gate;
[0110] The high-frequency channel time-frequency memory unit includes: a high-frequency channel input gate, a high-frequency channel forget gate, a high-frequency channel memory update unit, and a high-frequency channel output gate.
[0111] Step 2.1.1a, the kth fault data x k Data at sampling time t x k,t In the low-frequency channel time-frequency memory unit, the function of the low-frequency channel forget gate is to determine which information should be discarded or retained. Selective discarding is performed using equation (1) to obtain the k-th fault data x. k,t The fault selection information f at time step t of the low-frequency channel time-frequency memory unit. k,t low :
[0112] f k,t low =sigmoid(W fl,k x k,t +U fl,k h k,t-1 low +b fl,k (1)
[0113] In equation (1), h k,t-1 low This represents the kth fault data point x.k The fault information hiding state at time step t-1 of the low-frequency channel time-frequency memory unit; when t=1, let h k,t-1 low =0; sigmoid live function; W fl,k and U fl,k Let x represent the k-th fault data respectively. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel forget gate weight matrix, b fl,k This represents the kth fault data point x. k The low-frequency channel forget gate bias vector;
[0114] The low-frequency channel forget gate uses equation (2) to obtain the k-th fault data x. k F fault retention information F at time step t in the low-frequency channel time-frequency memory unit k,t low :
[0115] F k,t low =f k,t low ×C k,t-1 low (2)
[0116] In equation (2), × represents the outer product operation, C k,t-1 low It is the kth fault data x k The information stored in the low-frequency channel time-frequency memory unit at time step t-1.
[0117] Step 2.1.2a: The function of the low-frequency channel input gate is to input the fault data to be subjected to wavelet transform, and to obtain the k-th fault data x using equations (3)-(5). k The input fault information p at time step t of the low-frequency channel time-frequency memory unit. k,t low and fault modulation information g k,t low ;
[0118] p k,t low =sigmoid(W pl,k x k,t +U pl,k h k,t-1 low +b pl,k (3)
[0119] g k,t low =tanh(W gl,k x k,t +U gl,k h k,t-1 low +b gl,k (4)
[0120] ig k,t low =p k,t low ⊙g k,t low (5)
[0121] In equations (3)-(5), ig k,t low For the kth fault data x k Fault information to be updated at time step t in the low-frequency channel time-frequency memory unit; W pl,k and U pl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel input weight matrix, b pl,k This represents the kth fault data point x. k The low-frequency channel input deviation vector; W gl,k and U gl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel modulation weight matrix, b gl,k This represents the kth fault data point x. k The low-frequency channel modulation deviation vector; ⊙ represents element-wise multiplication; tanh is the activation function.
[0122] Step 2.1.3a: The function of the low-frequency channel memory update unit is to update the low-frequency channel memory information by taking the output data of the low-frequency channel input gate and the low-frequency channel forget gate, performing wavelet transform, and outputting multi-scale wavelet coefficients. The k-th fault data x is obtained using equations (6)-(9). k Information C is stored at time step t in the low-frequency channel memory unit. k,t low :
[0123]
[0124]
[0125] in k,t low =[A k,j 1 …A k,j m …A k,j M D k,j (8)
[0126] C k,t low =F k,t low C k,t-1 low +W A,k in k,t low (9)
[0127] In equations (6)-(9), m is the wavelet decomposition level, 1≤m≤M; A k,j m For the kth fault data x k The low-frequency wavelet coefficients, D, at the j-th scale under m-level wavelet decomposition. j,k For the kth fault data x k The high-frequency wavelet coefficients φ at the j-th scale j,k (t) represents the kth fault data x k The scaling function at the j-th scale, ψ j,k (t) represents the kth fault data x k wavelet basis functions at the j-th scale, in k,t low It is the kth fault data x k The time-frequency information at time step t in the low-frequency channel time-frequency memory unit, C k,t low It is the kth fault data x k Information is stored in the low-frequency channel memory unit at time step t-1, W A,k For the kth fault data x k Linear transformation matrix of the low-frequency channel memory update unit.
[0128] Step 2.1.4a: The function of the low-frequency channel output gate is to determine the hidden state of the low-frequency channel at the current time step, and to obtain the k-th fault data x using equation (10). k The low-frequency channel composite signal o at time step t in the low-frequency channel time-frequency memory unit. k,tlow :
[0129] o k,t low =sigmoid(W ol,k x k,t +U ol,k h k,t-1 low +b ol,k (10)
[0130] In equation (10), W ol,k and U ol,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel output weight matrix, b ol,k This represents the kth fault data point x. k The low-frequency channel output deviation vector;
[0131] The low-frequency channel output gate uses equation (11) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the low-frequency channel time-frequency memory unit k,t low Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the low-frequency channel k low ={h k,1 low ,h k,2 low …h k,t low …h k,T low}:
[0132] h k,t low =o k,t low ⊙tanh(C k,t low (11).
[0133] Step 2.1.1b, the kth fault data x k Data at sampling time t x k,t In the high-frequency channel time-frequency memory unit, the function of the high-frequency channel forget gate is to determine which information should be discarded or retained. Selective discarding is performed using equation (12) to obtain the k-th fault data x. k,tThe fault selection information f at time step t of the high-frequency channel time-frequency memory unit k,t high :
[0134] f k,t high =sigmoid(W fg,k x k,t +U fg,k h k,t-1 high +b fg,k (12)
[0135] In equation (12), h k,t-1 high This represents the kth fault data point x. k The fault information hiding state at time step t-1 of the high-frequency channel time-frequency memory unit; when t=1, let h k,t-1 high =0; sigmoid live function; W fg,k and U fg,k Let x represent the k-th fault data respectively. k Data at time t k,t and the kth fault data x k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t-1 high The high-frequency channel forget gate weight matrix, b fg,k This represents the kth fault data point x. k The high-frequency channel forget gate bias vector.
[0136] The high-frequency channel forget gate uses equation (13) to obtain the k-th fault data x. k F fault retention information F at time step t in the high-frequency channel time-frequency memory unit k,t high :
[0137] F k,t high =f k,t high ×C k,t-1 high (13)
[0138] In equation (13), C k,t-1 high It is the kth fault data x k The information stored in the high-frequency channel time-frequency memory unit at time step t-1.
[0139] Step 2.1.2b: The function of the high-frequency channel input gate is to input the fault data to be subjected to wavelet packet transform, and to obtain the k-th fault data x using equations (14)-(16). k The input fault information p at time step t of the high-frequency channel time-frequency memory unit. k,t high and fault modulation information g k,t high ;
[0140] p k,t high =sigmoid(W pg,k x k,t +U pg,k h k,t-1 high +b pg,k (14)
[0141] g k,t high =tanh(W gg,k x k,t +U gg,k h k,t-1 high +b gg,k (15)
[0142] ig k,t high =p k,t high ⊙g k,t high (16)
[0143] In equations (14)-(16), ig k,t high For the kth fault data x k Fault information to be updated at time step t of the high-frequency channel time-frequency memory unit; W pg,k and U pg,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel input weight matrix, b pg,k This represents the kth fault data point x. k The high-frequency channel input deviation vector; W gg,k and U gg,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data xk The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel modulation weight matrix, b gg,k This represents the kth fault data point x. k The high-frequency channel modulation deviation vector.
[0144] Step 2.1.3b: The function of the high-frequency channel memory update unit is to update the high-frequency channel memory information by taking the output data of the high-frequency channel input gate and the high-frequency channel forget gate, performing wavelet packet transformation, and outputting multi-scale, multi-resolution wavelet packet coefficients. The k-th fault data x is obtained using equations (17)-(19). k Information C is stored at time step t in the high-frequency channel memory unit. k,t high :
[0145]
[0146] in k,t high =[d l,k j,1 ,d l,k j,2 …d l,k j-a,r (18)
[0147] C k,t high =F k,t high C k,t-1 high +W Wh,k in k,t high (19)
[0148] In equations (17)-(19), j is the scale number, a is the wavelet packet decomposition layer number, r is the number of zero crosses, l is the location parameter, and w r (2 j-a tl) is the wavelet packet function with zero-crossing number r and position parameter l at the j-th scale under the a-th level wavelet packet decomposition in the t-th time step of the high-frequency channel time-frequency memory unit. l,k j-a,r It is the kth fault data x k The fault information to be updated at time step t of the high-frequency channel time-frequency memory unit is ig. k,t high The wavelet packet coefficients at the j-th scale under the a-th level wavelet packet decomposition, with r zero-crossings and l position parameters, are in k,t high It is the kth fault data xk The time-frequency information at time step t in the high-frequency channel time-frequency memory unit, C k,t high This represents the kth fault data point x. k Information is stored in the (t-1)th time step of the frequency channel memory unit, W Wh,k For the kth fault data x k The linear transformation matrix.
[0149] Step 2.1.4b: The function of the high-frequency channel output gate is to determine the hidden state of the high-frequency channel at the current time step, and to obtain the k-th fault data x using equation (20). k The high-frequency channel composite signal o at time step t in the high-frequency channel time-frequency memory unit. k,t high :
[0150] o k,t high =sigmoid(W og,k x k,t +U og,k h k,t-1 high +b og,k (20)
[0151] In equation (20), W og,k and U og,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel output weight matrix, b og,k This represents the kth fault data point x. k The high-frequency channel output deviation vector.
[0152] The high-frequency channel output gate uses equation (21) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t high Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the high-frequency channel k high ={h k,1 high ,h k,2 high …h k,t high …h k,T high}:
[0153] h k,t high =o k,t high ⊙tanh(C k,t high ) (twenty one).
[0154] Step 2.2: The Attention layer's function is to obtain the low-frequency and high-frequency channel fault feature vectors by weighted averaging based on the degree of fault information contained in the hidden state at each time step, and then use equations (22) and (23) to obtain the k-th fault data x. k Fault information hiding state H at all time steps in the low-frequency channel k low ={h k,1 low ,h k,2 low …h k,t low …h k,T low} and the kth fault data x k Fault information hiding state H at all time steps in the high-frequency channel k high ={h k,1 high ,h k,2 high …h k,t high …h k,T high The low-frequency channel feature vector u k low ={u k,1 low ,u k,2 low …u k,t low …u k,T low} and high-frequency channel feature vector u k high ={u k,1 high ,u k,2 high …u k,t high …u k,T high}, where u k,t low This represents the kth fault data point x. k The fault feature vector of the low-frequency channel at time step t, u k,t high This represents the kth fault data point x.k The fault feature vector of the high-frequency channel at time step t;
[0155] u k low =W ul,k H k low +b ul,k (twenty two)
[0156] u k high =W ug,k H k high +b ug,k (twenty three)
[0157] In equations (22)-(23), W ul,k and b ul,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the low-frequency channel k low The time-frequency feature weight matrix and the kth fault data x k The low-frequency channel time-frequency characteristic deviation vector, W ug,k and b ug,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the high-frequency channel k high The time-frequency feature weight matrix and the kth fault data x k The high-frequency channel time-frequency characteristic deviation vector.
[0158] The Attention layer uses equations (24) and (25) to obtain the k-th fault data x. k The fault feature vector u of the low-frequency channel at time step t k,t low Low-frequency channel normalized weight α k,t low and the kth fault data x k The fault feature vector u of the high-frequency channel at time step t k,t high High-frequency channel normalized weight α k,t high :
[0159]
[0160]
[0161] In equations (24) and (25), and Let x represent the k-th fault data. k The fault feature vector u of the low-frequency channel at time step t k,t low and the kth fault data x k The fault feature vector u of the high-frequency channel at time step t k,t high transpose, u w low and u w high It is a random initialization of the overall fault feature vector.
[0162] The Attention layer uses equation (26) to obtain the kth fault data point x after weighted averaging. k The low-frequency channel feature vector V k low :
[0163]
[0164] The Attention layer uses equation (27) to obtain the kth fault data point x after weighted averaging. k High-frequency channel feature vector V k high :
[0165]
[0166] Step 2.3: Construct a high-frequency feature attention mechanism layer with residual assistance.
[0167] like Figure 3 As shown, the high-frequency feature attention mechanism layer structure under residual assistance;
[0168] The kth fault data point after weighted average k The low-frequency channel feature vector V k low The kth fault data after weighted average k High-frequency channel feature vector V k high The input is fed into the residual-assisted high-frequency feature attention mechanism layer. The function of the residual-assisted high-frequency feature attention mechanism layer is to focus the low-frequency feature vector based on the high-frequency channel feature vector, and connect the high-frequency channel feature vector as a residual to obtain the final fault classification feature vector. The k-th fault data x is obtained using equations (28)-(33). k Multi-resolution time-frequency features S k ;
[0169] Q k =w Qh V k high(28)
[0170] V k =w Vl V k low (29)
[0171] Ke k =w Kl V k low (30)
[0172] e k =Q k (K ek (31)
[0173]
[0174]
[0175] In equations (28)-(33), Q k V k Ke k The kth fault data point x is the weighted average of the fault data points. k High-frequency channel feature vector V k high The query value, the kth fault data after weighted average k The low-frequency channel feature vector V k low The true value and the kth fault data after weighted average k The low-frequency channel feature vector V k low Key value; w Qh It is the linear transformation matrix of the query value, w Vl It is the truth-valued linear transformation matrix, w Kl It is the key value linear transformation matrix, where d is the dimension of the linear transformation matrix, 1≤d≤D, e k For k fault data x k Attention score based on time-frequency features; α H For the kth fault data x k The attention weights for time-frequency features.
[0176] Step 2.4, the kth fault data x k Multi-resolution time-frequency features S k The input is the Softmax layer, which calculates the probability of different fault label values corresponding to the classification feature vector. The k-th fault data x is obtained using equation (34). k The probability value P(x) corresponding to all fault types k |N);
[0177] P(x k |N)=softmax(W P,k S k +b P,k (34)
[0178] In equation (34), W P,k and b P,k Let x represent the k-th fault data. k Multi-resolution time-frequency features S k The probability weight matrix and probability bias vector are given; softmax represents the activation function.
[0179] Step 2.5: Construct the cross-entropy loss function L using equation (35). log (y k ,P k,n ):
[0180]
[0181] In equation (35), P k,n This represents the kth fault data point x. k The label value y k The probability of predicting the Nth type of failure.
[0182] Step 2.6, based on training set T tr The high-frequency feature attention time-frequency memory network was trained using backpropagation and gradient descent, and the loss function L was calculated. log To update network parameters when the training epoch reaches the maximum number of training epochs, or the loss function L log When the minimum value is reached, training stops, thus obtaining a trained active distribution network for early fault detection, which is used to map the input fault data set to the corresponding fault category label.
[0183] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the aforementioned ADN early fault detection method, and the processor is configured to execute the program stored in the memory.
[0184] In this embodiment, a computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the aforementioned ADN early fault detection method.
Claims
1. A method for early fault detection in an ADN based on a high-frequency TFM network, characterized in that, The procedure is as follows: Step 1: Construct the training set T for the network tr ; Step 1.1: Collect three-phase voltage and three-phase current data of the faulty equipment, and construct a fault data classification set, denoted as X={U,I}, where U represents the three-phase voltage dataset, and U={U1…U k …U K }, U k This represents the three-phase voltage data of the k-th fault data, and U k ={u k,a,1 …u k,a,t …u k,a,T ,u k,b,1 …u k,b,t …u k,b,T ,u k,c,1 …u k,c,t …u k,c,T }, u k,a,t U represents the phase a voltage data at sampling time t of the k-th fault data. k,b,t U represents the phase b voltage data at sampling time t of the k-th fault data. k,c,t Let I represent the c-phase voltage data at sampling time t of the k-th fault data; I represents the three-phase current dataset, and I = {I1…I2} k …I K } represents the three-phase current dataset of the k-th fault data, and I k ={i k,a,1 …i k,a,t …i k,a,T i k,b,1 …i k,b,t …i k,b,T i k,c,1 …i k,c,t …i k,c,T }, i k,a,t This represents the phase a current data at the t-th sampling time of the k-th fault data, i k,b,t This represents the phase b current data at the t-th sampling time of the k-th fault data, i k,c,t The c-phase current data at the t-th sampling time represents the k-th fault data; 1≤k≤K, where K represents the total number of fault data; 1≤t≤T, where T represents the total sampling time; Step 1.2: Construct a set of label information for the fault data classification set F, denoted as Y={y1,…,y k ,…,y K }, where y k This represents the label value of the kth fault data, and y k It belongs to [1, N], where N is the number of fault types; Step 1.3: Randomly shuffle the labeled fault dataset P=(X,Y) and use it as the training set T. tr And T tr ={(x1,y1), (x2,y2),…, (x k ,y k ),…, (x K ,y K )},x k Let x represent the k-th fault data, and x k ={x k,1 , x k,2 ,…x k,t …,x k,T }, x k,t This represents the three-phase voltage and current data at sampling time t for the k-th fault data. Step 2: Construct a high-frequency feature attention-based time-frequency memory network, including: a dual-channel multi-scale time-frequency memory recursive layer, an Attention layer, a residual-assisted high-frequency feature attention mechanism layer, and a Softmax layer; Step 2.1: Construct a dual-channel multi-scale time-frequency memory recursive layer, including: a low-frequency channel time-frequency memory unit and a high-frequency channel time-frequency memory unit; The kth fault data x k Data at sampling time t x k,t The data is processed in the low-frequency channel time-frequency memory unit to obtain the kth fault data x. k Fault information hiding state H at all time steps in the low-frequency channel k low ; The kth fault data x k Data at sampling time t x k,t The data is input into the high-frequency channel time-frequency memory unit for processing to obtain the k-th fault data x. k Fault information hiding state H at all time steps in the high-frequency channel k high ; Step 2.2, the Attention layer for H k low and H k high The data is processed separately to obtain the kth fault data point x after weighted averaging. k The low-frequency channel feature vector V k low and high-frequency channel feature vector V k high ; Step 2.3, the kth fault data point x after weighted average k The low-frequency channel feature vector V k low The kth fault data after weighted average k High-frequency channel feature vector V k high The data is input into the residual-assisted high-frequency feature attention mechanism layer for processing to obtain the k-th fault data x. k Multi-resolution time-frequency features S k ; The residual-assisted high-frequency feature attention mechanism layer in step 2.3 uses equations (30)-(35) to obtain the k-th fault data x. k Multi-resolution time-frequency features S k ; Q k = w Qh V k high (30) V k = w Vl V k low (31) When k = w Kl V k low (32) e k =Q k (Ke k )' (33) (34) (35) In equations (30)-(35), Q k V k Ke k The kth fault data point x is the weighted average of the fault data points. k High-frequency channel feature vector V k high The query value, the kth fault data after weighted average k The low-frequency channel feature vector V k low The true value and the kth fault data after weighted average k The low-frequency channel feature vector V k low Key value; w Qh It is the linear transformation matrix of the query value, w Vl It is the truth-valued linear transformation matrix, w Kl It is the key value linear transformation matrix, where d is the dimension of the linear transformation matrix, 1≤d≤D, e k For k fault data x k Attention score based on time-frequency features; α H For the kth fault data x k Attention weights for time-frequency features; Step 2.4, the kth fault data x k Multi-resolution time-frequency features S k The data is input into the Softmax layer, and the kth fault data x is obtained using equation (1). k The probability value P(x) corresponding to all fault types k |N); P(x k ∣N) = softmax(W P,k S k + b P,k ) (1) In equation (1), W P,k and b P,k Let x represent the k-th fault data. k Multi-resolution time-frequency features S k The probability weight matrix and probability bias vector; softmax represents the activation function; Step 2.5: Construct the cross-entropy loss function L using equation (2). log (y k ,P k,n ): (2) In equation (2), P k,n This represents the kth fault data point x. k The label value y k The probability of predicting the nth type of failure; Step 2.6: Based on the training set T tr The high-frequency feature attention time-frequency memory network was trained using backpropagation and gradient descent, and the loss function L was calculated. log To update network parameters when the training epoch reaches the maximum number of training epochs, or the loss function L log When the minimum value is reached, training stops, thus obtaining a trained active distribution network for early fault detection, which is used to map the input fault data set to the corresponding fault category label.
2. The method for early fault detection of ADN based on high-frequency TFM network according to claim 1, characterized in that, The low-frequency channel time-frequency memory unit in step 2.1 includes: a low-frequency channel forget gate, a low-frequency channel input gate, a low-frequency channel memory update unit, and a low-frequency channel output gate; Step 2.1.1a: The low-frequency channel forget gate uses equation (3) to process the k-th fault data x. k Data at sampling time t x k,t Selective discarding is performed to obtain the k-th fault data x. k,t The fault selection information f at time step t of the low-frequency channel time-frequency memory unit. k,t low : f k,t low = sigmoid(W fl,k x k,t + U fl,k h k,t-1 low + b fl,k ) (3) In equation (3), h k,t-1 low This represents the kth fault data point x. k The fault information hiding state at time step t-1 of the low-frequency channel time-frequency memory unit; when t=1, let h k,t-1 low =0; sigmoid live function; W fl,k and U fl,k Let x represent the k-th fault data respectively. k Data at time t k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel forget gate weight matrix, b fl,k This represents the kth fault data point x. k The low-frequency channel forget gate bias vector; Step 2.1.2a: The low-frequency channel forget gate uses equation (4) to obtain the kth fault data x. k F fault retention information F at time step t in the low-frequency channel time-frequency memory unit k,t low : F k,t low = f k,t low ×C k,t-1 low (4) In equation (4), × represents the outer product operation, C k,t-1 low It is the kth fault data x k The information stored in the low-frequency channel time-frequency memory unit at time step t-1; Step 2.1.3a: The low-frequency channel input gate obtains the k-th fault data x using equations (5)-(7). k The input fault information p at time step t of the low-frequency channel time-frequency memory unit. k,t low and fault modulation information g k,t low ; p k,t low = sigmoid(W pl,k x k,t + U pl,k h k,t-1 low + b pl,k ) (5) rice k,t low = tanh(W gl,k x k,t U gl,k h k,t-1 low + b gl,k ) (6) until k,t low = p k,t low ⊙ g k,t low (7) In equations (5)-(6), ig k,t low For the kth fault data x k Fault information to be updated at time step t in the low-frequency channel time-frequency memory unit; W pl,k and U pl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel input weight matrix, b pl,k This represents the kth fault data point x. k The low-frequency channel input deviation vector; W gl,k and U gl,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel modulation weight matrix, b gl,k This represents the kth fault data point x. k The low-frequency channel modulation deviation vector; ⊙ represents element-wise multiplication; tanh is the activation function; Step 2.1.4a: The low-frequency channel memory update unit obtains the kth fault data x using equations (8)-(11). k Information C is stored at time step t in the low-frequency channel memory unit. k,t low : (8) (9) in k,t low = [A k,j 1 …A k,j m …A k,j M D k,j ] (10) C k,t low = F k,t low C k,t-1 low + W A,k in k,t low (11) In equations (8)-(11), m is the wavelet decomposition level, 1≤m≤M; A k,j m For the kth fault data x k The low-frequency wavelet coefficients, D, at the j-th scale under m-level wavelet decomposition. j,k For the kth fault data x k The high-frequency wavelet coefficients φ at the j-th scale j,k (t) represents the kth fault data x k The scaling function at the j-th scale, ψ j,k (t) represents the kth fault data x k wavelet basis functions at the j-th scale, in k,t low It is the kth fault data x k The time-frequency information at time step t in the low-frequency channel time-frequency memory unit, C k,t low It is the kth fault data x k Information is stored in the low-frequency channel memory unit at time step t-1, W A,k For the kth fault data x k The linear transformation matrix of the low-frequency channel memory update unit; Step 2.1.5a: The low-frequency channel output gate uses equation (12) to obtain the kth fault data x. k The low-frequency channel composite signal o at time step t in the low-frequency channel time-frequency memory unit. k,t low : o k,t low = sigmoid(W ol,k x k,t + U ol,k h k,t-1 low + b ol,k ) (12) In equation (12), W ol,k and U ol,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the low-frequency channel time-frequency memory unit. k,t-1 low The low-frequency channel output weight matrix, b ol,k This represents the kth fault data point x. k The low-frequency channel output deviation vector; Step 2.1.6a: The low-frequency channel output gate uses equation (13) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the low-frequency channel time-frequency memory unit k,t low Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the low-frequency channel k low = {h k,1 low , h k,2 low …h k,t low …h k,T low }: h k,t low = o k,t low ⊙ tanh(C k,t low ) (13).
3. The method for early fault detection of ADN based on high-frequency TFM network according to claim 1, characterized in that, The high-frequency channel time-frequency memory unit in step 2.1 includes: a high-frequency channel input gate, a high-frequency channel forget gate, a high-frequency channel memory update unit, and a high-frequency channel output gate; Step 2.1.1b, the kth fault data x k Data at sampling time t x k,t In the high-frequency channel time-frequency memory unit, the high-frequency channel forget gate performs selective discarding using equation (14) to obtain the k-th fault data x. k,t The fault selection information f at time step t of the high-frequency channel time-frequency memory unit k,t high : f k,t high =sigmoid(W fg,k x k,t + U fg,k h k,t-1 high + b fg,k ) (14) In equation (14), h k,t-1 high This represents the kth fault data point x. k The fault information hiding state at time step t-1 of the high-frequency channel time-frequency memory unit; when t=1, let h k,t-1 high =0; sigmoid live function; W fg,k and U fg,k Let x represent the k-th fault data respectively. k Data at time t k,t and the kth fault data x k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t-1 high The high-frequency channel forget gate weight matrix, b fg,k This represents the kth fault data point x. k The high-frequency channel forget gate bias vector; Step 2.1.2b: The high-frequency channel forget gate uses equation (15) to obtain the k-th fault data x. k F fault retention information F at time step t in the high-frequency channel time-frequency memory unit k,t high : F k,t high =f k,t high ×C k,t-1 high (15) In equation (15), C k,t-1 high It is the kth fault data x k The information stored in the high-frequency channel time-frequency memory unit at time step t-1; Step 2.1.3b: The high-frequency channel input gate obtains the k-th fault data x using equations (16)-(17). k The input fault information p at time step t of the high-frequency channel time-frequency memory unit. k,t high and fault modulation information g k,t high ; p k,t high =sigmoid(W pg,k x k,t + U pg,k h k,t-1 high + b pg,k ) (16) rice k,t high =tanh(W gg,k x k,t U gg,k h k,t-1 high + b gg,k ) (17) until k,t high = p k,t high ⊙ g k,t high (18) In equations (16)-(17), ig k,t high For the kth fault data x k Fault information to be updated at time step t of the high-frequency channel time-frequency memory unit; W pg,k and U pg,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel input weight matrix, b pg,k This represents the kth fault data point x. k The high-frequency channel input deviation vector; W gg,k and U gg,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel modulation weight matrix, b gg,k This represents the kth fault data point x. k The high-frequency channel modulation deviation vector; Step 2.1.4b: The high-frequency channel memory update unit uses equations (18)-(21) to obtain the kth fault data x. k Information C is stored at time step t in the high-frequency channel memory unit. k,t high : (19) in k,t high = [d l,k j,1 , d l,k j,2 …d l,k j-a,r ] (20) C k,t high = F k,t high C k,t-1 high + W Wh,k in k,t high (21) In equations (19)-(21), j is the scale number, a is the wavelet packet decomposition layer number, r is the number of zero crosses, l is the location parameter, and w r (2 j-a tl) is the wavelet packet function with zero-crossing number r and position parameter l at the j-th scale under the a-th level wavelet packet decomposition in the t-th time step of the high-frequency channel time-frequency memory unit. l,k j-a,r It is the kth fault data x k The fault information to be updated at time step t of the high-frequency channel time-frequency memory unit is ig. k,t high The wavelet packet coefficients at the j-th scale under the a-th level wavelet packet decomposition, with r zero-crossings and l position parameters, are in k,t high It is the kth fault data x k The time-frequency information at time step t in the high-frequency channel time-frequency memory unit, C k,t high This represents the kth fault data point x. k Information is stored in the (t-1)th time step of the frequency channel memory unit, W Wh,k For the kth fault data x k The linear transformation matrix; Step 2.1.5b: The high-frequency channel output gate uses equation (22) to obtain the k-th fault data x. k The high-frequency channel composite signal o at time step t in the high-frequency channel time-frequency memory unit. k,t high : o k,t high = sigmoid(W og,k x k,t + U og,k h k,t-1 high + b og,k ) (22) In equation (22), W og,k and U og,k Let x represent the k-th fault data. k Data at sampling time t x k,t and the kth fault data x k The fault information hiding state h at time step t-1 of the high-frequency channel time-frequency memory unit. k,t-1 high The high-frequency channel output weight matrix, b og,k This represents the kth fault data point x. k The high-frequency channel output deviation vector; Step 2.6b: The high-frequency channel output gate uses equation (23) to obtain the k-th fault data x. k The fault information hiding state h at time step t in the high-frequency channel time-frequency memory unit k,t high Thus, the kth fault data x is obtained. k Fault information hiding state H at all time steps in the high-frequency channel k high = {h k,1 high , h k,2 high …h k,t high …h k,T high }: h k,t high = o k,t high ⊙ tanh(C k,t high ) (23).
4. The method for early fault detection of ADN based on high-frequency TFM network according to claim 1, characterized in that, Step 2.2 includes: Step 2.2.1: The Attention layer uses equations (24) and (25) to obtain the k-th fault data x. k Fault information hiding state H at all time steps in the low-frequency channel k low Low-frequency channel feature vector u k low = {u k,1 low , u k,2 low …u k,t low …u k,T low } and the kth fault data x k Fault information hiding state H at all time steps in the high-frequency channel k high High-frequency channel feature vector u k high = {u k,1 high , u k,2 high …u k,t high …u k,T high }, where u k,t low This represents the kth fault data point x. k The fault feature vector of the low-frequency channel at time step t, u k,t high This represents the kth fault data point x. k The fault feature vector of the high-frequency channel at time step t; u k low = W ul,k H k low + b ul,k (24) u k high = W ug,k H k high + b ug,k (25) In equations (24)-(25), W ul,k and b ul,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the low-frequency channel k low The time-frequency feature weight matrix and the kth fault data x k The low-frequency channel time-frequency characteristic deviation vector, W ug,k and b ug,k Let x represent the k-th fault data. k Fault information hiding state H at all time steps in the high-frequency channel k high The time-frequency feature weight matrix and the kth fault data x k The high-frequency channel time-frequency characteristic deviation vector; Step 2.2.2: The Attention layer uses equations (26) and (27) to obtain the k-th fault data x. k The fault feature vector u of the low-frequency channel at time step t k,t low Low-frequency channel normalized weight α k,t low and the kth fault data x k The fault feature vector u of the high-frequency channel at time step t k,t high High-frequency channel normalized weight α k,t high : (26) (27) In equations (26) and (27), and Let x represent the k-th fault data. k The fault feature vector u of the low-frequency channel at time step t k,t low and the kth fault data x k The fault feature vector u of the high-frequency channel at time step t k,t high transpose, u w low and u w high It is a random initialization of the overall fault feature vector, (•) ’ This represents the matrix transpose operation; Step 2.2.3: The Attention layer uses equation (28) to obtain the kth fault data x after weighted averaging. k The low-frequency channel feature vector V k low : (28) Step 2.2.4: The Attention layer uses equation (29) to obtain the kth fault data x after weighted averaging. k High-frequency channel feature vector V k high : (29)。 5. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing any of the ADN early fault detection methods of claims 1-4, and the processor is configured to execute the program stored in the memory.
6. A computer-readable storage medium storing a computer program, characterized in that, The computer program, when run by a processor, performs the steps of any of the ADN early fault detection methods described in claims 1-4.
Citation Information
Patent Citations
Devices, systems, and methods for adaptive RF sensing in arc fault detection
CA2659699A1
Power distribution network initial fault identification method of time-frequency memory neural network based on adaptive wavelet and attention mechanism
CN114781458A