A power equipment identification method and device based on multi-dimensional time-frequency feature gated fusion
By using a multi-dimensional time-frequency feature gating fusion method, the problem of capturing subtle differences between devices in power equipment identification is solved, improving the identification accuracy and stability, optimizing computational efficiency, and making it suitable for power monitoring scenarios.
Patent Information
- Application Number
- CN202611213294.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-11-27
AI Technical Summary
Existing methods struggle to effectively capture subtle differences between power equipment, resulting in low equipment identification accuracy. Furthermore, low-frequency identification features are easily masked by high-frequency background noise, affecting the stability and accuracy of equipment identification.
A multi-dimensional time-frequency feature gating fusion method is adopted, which generates a time-domain time-series feature map, a global frequency domain distribution map, and a Mel spectrogram by mapping the time domain, frequency domain, and time-frequency domain. Combined with a hierarchical attention mechanism and a gating network, the method extracts and weights the fusion of identification feature vectors, prunes redundant features, and outputs the device type identification result.
It improves the accuracy and anti-interference ability of power equipment identification, optimizes model calculation overhead, and meets the real-time and low-latency requirements of power monitoring scenarios.
Smart Images

Figure CN123179063A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart grid technology, and in particular to a method and apparatus for identifying power equipment based on multi-dimensional time-frequency feature gating fusion. Background Technology
[0002] With the deepening of the digital transformation of the power system, the number and types of power equipment connected to the network, such as intelligent electronic devices, remote terminal units, and smart meters, have increased dramatically. Accurate identification and management of these network devices has become a crucial foundation for ensuring the safe operation of the power monitoring system and achieving refined asset management. Device fingerprinting technology distinguishes device types and models by analyzing the inherent behavioral characteristics exhibited by devices in network communication. Existing methods typically convert the collected raw network traffic packets into a fixed-length one-dimensional byte sequence, then fold and reconstruct this one-dimensional sequence into a two-dimensional grayscale image according to specific rules. Subsequently, deep learning models such as convolutional neural networks are used to extract and classify spatial features from the grayscale image, thereby achieving the identification of different power equipment.
[0003] In power systems, devices of the same type or with similar protocols often exhibit highly similar communication traffic patterns in the time domain. Feature extraction based solely on a single two-dimensional grayscale image is insufficient to capture subtle but discriminative differences between similar devices, leading to overlap and aliasing in the feature space and impacting the accuracy of refined device classification. Furthermore, during normal operation, the communication energy generated by core interactions such as heartbeat messages and status polling is highly concentrated in the low-frequency band. Existing methods give equal attention to all frequency bands, lacking targeted enhancement of low-frequency fingerprint information. This causes the inherent low-frequency discriminative features of devices to be easily masked by high-frequency background noise, resulting in technical problems of low stability and accuracy in device identification. Summary of the Invention
[0004] This application provides a power equipment identification method and apparatus based on multi-dimensional time-frequency feature gating fusion, which is used to solve the technical problem of low equipment classification accuracy caused by insufficient representation capability of single features.
[0005] The first aspect of this application provides a method for identifying power equipment based on multi-dimensional time-frequency feature gating fusion, including: Acquire raw network packet data from the power system and convert the raw network packet data into a standard byte sequence; The standard byte sequence is mapped in the time domain, frequency domain, and time-frequency domain to obtain a time-domain timing feature map, a global frequency domain distribution map, and a Mel spectrum map. Among them, the time-frequency domain mapping uses a Mel filter bank to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. The time-domain time-series feature map, global frequency domain distribution map, and Mel spectrogram are subjected to hierarchical attention feature extraction based on window partitioning to obtain the corresponding discriminative feature vectors; All the discriminative feature vectors are concatenated, and corresponding dynamic weights are generated through a gating network. The discriminative feature vectors are then weighted and fused using the dynamic weights to obtain a comprehensive feature vector. The comprehensive feature vector is subjected to dynamic pruning based on the channel attention mechanism to obtain a sparse feature vector; The sparse feature vector is input into the classification layer, and the power equipment type identification result corresponding to the current message sequence is output.
[0006] Optionally, converting the original network packet data into a standard byte sequence specifically includes: The original network packet data is time-series sliced and cleaned to obtain cleaned payload data; The cleaned payload data is then sequentially spliced to obtain a standard byte sequence.
[0007] Optionally, the time-domain mapping specifically includes: The standard byte sequence is subjected to temporal-space reconstruction processing to obtain a two-dimensional sequence matrix; The two-dimensional sequence matrix is normalized to obtain a time-domain time-series feature map that retains the temporal adjacency relationship and abrupt change information of the messages.
[0008] Optionally, the frequency domain mapping specifically includes: Perform a discrete Fourier transform on the standard byte sequence to obtain the frequency domain amplitude spectrum; The global frequency distribution information of the message is extracted from the frequency domain amplitude spectrum and reconstructed to obtain a global frequency domain distribution map that can characterize the frequency distribution of the original network message data signal in the global range.
[0009] Optionally, the time-frequency domain mapping specifically includes: The standard byte sequence is divided into frames using a sliding window to obtain multiple frame byte sequences. Perform a short-time Fourier transform on each frame byte sequence to obtain the complex spectrum corresponding to each frame byte sequence, and calculate the power spectrum corresponding to each frame byte sequence based on the complex spectrum. A set of Mel filter banks with equal intervals on the Mel scale is constructed. The power spectrum corresponding to each frame byte sequence is non-uniformly sampled and logarithmically compressed using the Mel filter banks to obtain a Mel spectrum map that enhances the low-frequency communication components of power equipment.
[0010] Optionally, the step of performing hierarchical attention feature extraction based on window partitioning on the temporal-domain time-series feature map to obtain the corresponding discriminative feature vector specifically includes: The time-domain time series feature map is divided into multiple local time-domain feature windows by uniformly dividing it into windows. Window self-attention calculation is performed on each local temporal domain feature window to extract temporal change correlation features within each window; By fusing the temporal variation associated features of all local temporal feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the temporal series feature map is obtained.
[0011] Optionally, the step of performing hierarchical attention feature extraction based on window partitioning on the global frequency domain distribution map to obtain the corresponding discriminative feature vector specifically includes: The global frequency domain distribution map is divided into uniform blocks based on windows to obtain multiple local frequency domain feature windows; Window self-attention calculation is performed on each local frequency domain feature window to extract the local correlation features of frequency energy distribution within each window; By fusing the local correlation features of all local frequency domain feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the global frequency domain distribution map is obtained.
[0012] Optionally, the step of performing hierarchical attention feature extraction based on window partitioning on the Mel spectrogram to obtain the corresponding discriminative feature vector specifically includes: The Mel spectrogram is divided into multiple local time-frequency feature windows by uniformly dividing it into window-based blocks. Window self-attention calculation is performed on each local time-frequency feature window to extract key local time-frequency features within each window; By fusing the key local time-frequency features of all local time-frequency feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the Mel spectrogram is obtained.
[0013] Optionally, the step of concatenating all the discriminative feature vectors, generating corresponding dynamic weights through a gating network, and then using the dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain a comprehensive feature vector specifically includes: All discriminative feature vectors are concatenated to obtain joint features; The joint features are input into a gating network, which adaptively learns the differences in classification contribution of features of different modalities to obtain the dynamic weight coefficients corresponding to all discriminative feature vectors. Based on the dynamic weight coefficients, all discriminative feature vectors are adaptively weighted to obtain the weighted discriminative feature vectors. By fusing all weighted and assigned identification feature vectors, a comprehensive feature vector that can dynamically adapt to the time-varying power network environment is obtained.
[0014] The second aspect of this application provides a power equipment identification device based on multi-dimensional time-frequency feature gating fusion, comprising: A standard byte sequence determination module is used to acquire raw network packet data in the power system and convert the raw network packet data into a standard byte sequence. The time-domain, frequency-domain, and time-frequency-domain mapping module is used to perform time-domain, frequency-domain, and time-frequency-domain mapping on the standard byte sequence to obtain a time-domain timing feature map, a global frequency-domain distribution map, and a Mel spectrum map; wherein, during time-frequency-domain mapping, a Mel filter bank is used to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. The discriminant feature vector determination module is used to perform hierarchical attention feature extraction based on window partitioning on the time-domain time-series feature map, global frequency domain distribution map and Mel spectrogram respectively to obtain the corresponding discriminant feature vector; The comprehensive feature vector determination module is used to concatenate all the discriminative feature vectors, generate corresponding dynamic weights through a gating network, and use the dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain a comprehensive feature vector. The sparse feature vector determination module is used to perform dynamic pruning processing on the comprehensive feature vector based on the channel attention mechanism to obtain sparse feature vectors. The power equipment type identification result output module is used to input the sparse feature vector into the classification layer and output the power equipment type identification result corresponding to the current message sequence.
[0015] As can be seen from the above technical solutions, this application has the following advantages: This application synchronously maps standard byte sequences to three independent physical spaces: the time domain, the frequency domain, and the time-frequency domain, generating a time-domain time-series feature map, a global frequency domain distribution map, and a Mel spectrogram, respectively. These three feature maps characterize device communication behavior from complementary perspectives: instantaneous morphology, global frequency distribution, and time-varying frequency details, providing a richer and more comprehensive input representation for subsequent classification and effectively reducing overlap and aliasing of similar devices in the feature space. By employing a Mel filter bank for non-uniform sampling of the power spectrum, the application selectively amplifies the low-frequency components concentrated in core interactive behaviors such as heartbeat messages and status polling of power equipment, while compressing high-frequency noise. Furthermore, it utilizes a sliding partition-based hierarchical structure... The attention mechanism extracts discriminative features from feature maps of each dimension, effectively capturing local details and long-range dependencies at different scales in device communication traffic. A gating network generates dynamic weights for the concatenated multi-dimensional feature vectors and performs weighted fusion. The gating network adaptively adjusts the fusion weights of each dimension based on the real-time feature response intensity of the current input message, enhancing the model's robustness in complex dynamic network environments. Dynamic pruning based on a channel attention mechanism is applied to the comprehensive feature vector, automatically evaluating and eliminating redundant feature channels with low contribution, compressing feature dimensions while retaining core discriminative information, and reducing the computational parameters of subsequent classification layers. In summary, this application effectively improves the accuracy and anti-interference capability of refined identification of power equipment, while optimizing model computational overhead, meeting the practical requirements of real-time performance and low latency in power monitoring scenarios. Attached Figure Description
[0016] Figure 1 A flowchart illustrating a power equipment identification method based on multi-dimensional time-frequency feature gating fusion provided in this application; Figure 2 A schematic diagram of the time-frequency domain feature mapping process provided in this application; Figure 3 A flowchart illustrating the temporal feature mapping process provided in this application; Figure 4 A flowchart illustrating the frequency domain feature mapping process provided in this application; Figure 5 A flowchart illustrating the Mel spectrogram provided in this application; Figure 6 A flowchart for determining the comprehensive feature vector provided in this application. Detailed Implementation
[0017] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding to,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0018] The implementation method in this embodiment can be implemented in a system, on a server, or on a terminal; no specific limitation is made. The method in this application will be described below from the perspective of system implementation. Please refer to... Figure 1 The power equipment identification method based on multi-dimensional time-frequency feature gating fusion provided in this application includes the following steps: S1. Obtain raw network packet data from the power system and convert the raw network packet data into a standard byte sequence, including the following: Specifically, at key network nodes such as communication gateways or aggregation switches in the power system, raw network traffic is passively and non-intrusively collected through methods such as port mirroring or network splitters, capturing the raw network packet data transmitted within it. The raw network packet data includes communication packets generated by various connected power devices during network communication, and the communication traffic packets carry underlying fingerprint information that is highly related to the device's hardware characteristics and operating status.
[0019] Converting raw network packet data into a standard byte sequence includes the following: 1. Perform time-series slicing and data cleaning on the raw network packet data to obtain the cleaned payload data; 2. The cleaned payload data is spliced together in time sequence to obtain a standard byte sequence.
[0020] First, set a fixed time window. For continuously arriving raw network packet data, it is divided into time windows. Time-series slicing is performed to extract the packet payload byte values within each time window. The packet payload byte value refers to the byte value corresponding to the actual data load portion of the packet, excluding header control information. Data cleaning and anonymization are performed on the packet payload byte values within each slice. Specifically, the IP address and MAC address fields in the packet are uniformly overwritten with 0x00 to eliminate environmental feature interference unrelated to the device's inherent communication mode, while retaining the underlying fingerprint information highly related to the device's hardware and operating status. After time-series slicing and data cleaning, the cleaned payload data is obtained. The cleaned payload data refers to the packet payload sequence after removing environmental variable information such as IP addresses and MAC addresses, retaining only byte values related to the device's inherent communication mode. Then, all the cleaned payload byte values are concatenated sequentially according to time to form a continuous long packet sequence. A long packet sequence is a one-dimensional byte sequence composed of the payload byte values of multiple packets connected end-to-end in arrival time order. Secondly, to adapt to the fixed-dimensional input requirements of deep learning models, a standard truncation length is preset by statistically analyzing the average and median lengths of historical message sequences. Cut-off length This refers to a fixed length value determined through statistical analysis, used to unify variable-length message sequences to a uniform dimension. It is also used for concatenated sequences that are too short. The message sequence is padded with 0x00 at the end to make the sequence length reach [the specified value]. For spliced lengths exceeding If the message sequence is too long, the tail is truncated directly, retaining only the beginning. The first byte value is discarded, and any bytes exceeding this limit are removed. After the above timing concatenation and length normalization processes, a standard byte sequence is obtained. A standard byte sequence refers to a sequence of length [missing information]. After cleaning and anonymization, the one-dimensional discrete byte sequence can be directly input into the subsequent multidimensional spatial mapping module. This standard byte sequence serves as the reference input vector for the subsequent multidimensional spatial mapping module.
[0021] S2. Perform time-domain, frequency-domain, and time-frequency-domain mapping on the standard byte sequence to obtain a time-domain timing feature map, a global frequency-domain distribution map, and a Mel spectrum map; wherein, during time-frequency-domain mapping, a Mel filter bank is used to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. In this embodiment, the time-domain feature mapping stage includes the following: 1. Perform temporal-space reconstruction processing on the standard byte sequence to obtain a two-dimensional sequence matrix; 2. The two-dimensional sequence matrix is normalized to obtain a time-domain time-series feature map that retains the temporal adjacency relationship and abrupt change information of the messages.
[0022] First, let the length of the standard byte sequence be... , according to a fixed step size, the length is Standard byte sequence folding and reconstruction into size Two-dimensional sequence matrix ,satisfy During the folding and reconstruction process, byte values from the standard byte sequence are sequentially filled into the corresponding positions of the two-dimensional sequence matrix, either row-wise or column-wise, so that spatially adjacent byte values in the matrix correspond to temporally adjacent byte values in the original sequence. The two-dimensional sequence matrix is a two-dimensional data array reconstructed from the standard byte sequence according to spatial arrangement rules, preserving the temporal adjacency relationships between the original message bytes. Then, each element in the two-dimensional sequence matrix undergoes linear normalization, generating a time-domain timing feature map. The time-domain timing feature map is a two-dimensional grayscale image obtained by spatially folding and numerically normalizing the one-dimensional standard byte sequence. The formula for normalizing the two-dimensional sequence matrix, which fully preserves the temporal adjacency relationship between the original message bytes and the local mutation information in the sequence, is as follows: In the formula: The maximum value of a byte within a two-dimensional matrix; It represents the minimum byte value within a two-dimensional matrix.
[0023] In this embodiment, the frequency domain feature mapping stage includes the following: 1. Perform a discrete Fourier transform on the standard byte sequence to obtain the frequency domain amplitude spectrum; 2. Extract the global frequency distribution information of the message from the frequency domain amplitude spectrum and reconstruct it to obtain a global frequency domain distribution map that can characterize the frequency distribution of the original network message data signal in the global range.
[0024] First, a Discrete Fourier Transform (DFT) is performed on the standard byte sequence of length L to transform the time-domain signal to the frequency domain, obtaining the complex spectrum corresponding to each frequency component. The DFT is a mathematical method for transforming a discrete time-domain signal into a discrete frequency-domain representation; the complex spectrum represents the amplitude and phase information of each frequency component in complex form. The amplitude values of each frequency component are calculated based on the complex spectrum to obtain the frequency-domain amplitude spectrum. The frequency-domain amplitude spectrum is a one-dimensional distribution sequence of the amplitude values of each frequency component as a function of frequency, representing the energy strength of each frequency component in the standard byte sequence. Then, the amplitude values of each frequency component in the frequency-domain amplitude spectrum are folded and reconstructed into a two-dimensional matrix form with a fixed step size, generating a global frequency-domain distribution map. The global frequency-domain distribution map is a two-dimensional spectral image formed by spatially reconstructing the one-dimensional frequency-domain amplitude spectrum, representing the frequency energy distribution pattern of the original network message data signal in a global range, serving as input for subsequent frequency-domain branch feature extraction. The formula used for performing the DFT on the standard byte sequence is: In the formula: It serves as a time-domain sampling index for standard byte sequences, which can characterize the temporal position of message bytes; For the first byte in the standard byte sequence Bit-normalized payload byte value; This is a discrete frequency index, corresponding to the position of different frequency components in the frequency domain; It is the imaginary unit, used to construct the complex frequency domain space.
[0025] Please see Figure 2 The time-frequency domain feature mapping includes the following: S21. The standard byte sequence is divided into frames using a sliding window to obtain multiple frame byte sequences; Set frame shift step size and window length By using a sliding window to slide frame by frame along the standard byte sequence, the standard byte sequence is divided into multiple frame byte sequences. A frame byte sequence is a truncated portion of the standard byte sequence of length... Local subsequences, with adjacent frames determined by the frame shift step size. Controlling the degree of overlap. Frame segmentation divides long-term non-stationary sequences into short-term approximately stationary segments, providing input for frame-by-frame frequency domain analysis.
[0026] S22. Perform short-time Fourier transform on each frame byte sequence to obtain the complex spectrum corresponding to each frame byte sequence, and calculate the power spectrum corresponding to each frame byte sequence based on the complex spectrum; The formula for calculating the short-time Fourier transform is: In the formula: For frame index, For frequency index, For the first byte in the standard byte sequence Frame number The byte value at each position, For window functions, For the first Frame number Complex spectrum of each frequency component.
[0027] Calculate the power spectrum for each frame based on the complex spectrum: In the formula: For the first Frame number Power spectral values of each frequency component The amplitude of the complex spectrum.
[0028] S23. Construct a set of Mel filter banks that are equally spaced on the Mel scale. Use the Mel filter banks to perform non-uniform sampling and logarithmic compression on the power spectrum corresponding to each frame byte sequence to obtain a Mel spectrum that enhances the low-frequency communication components of power equipment.
[0029] The Mel frequency mapping function is: In the formula: Physical frequency, Using the Mel frequency, a nonlinear transformation is achieved by dense sampling at low frequencies and sparse sampling at high frequencies. The Mel filter bank is densely distributed in the low-frequency region and sparsely distributed in the high-frequency region, realizing non-uniform sampling of the power spectrum.
[0030] The bandwidth energy of each filter is calculated by performing a frequency domain inner product on the power spectrum of each frame using the Mel filter bank. In the formula: For filter index, For the first The frequency response of a Mel filter For the first Frame number The frequency band energy value of each filter.
[0031] Logarithmic compression of the energy in each frequency band is performed to generate a Mel spectrum: In the formula: To prevent small constants from overflowing in logarithmic operations, For the first in the Mel spectrum Frame number The pixel values of each frequency band are used. Logarithmic compression relatively amplifies weak low-frequency features. The generated Mel spectrogram has the horizontal axis representing the time frame number and the vertical axis representing the Mel filter number. It enhances the low-frequency components concentrated by the periodic interactions of power equipment while suppressing high-frequency noise, serving as the input for subsequent time-frequency domain branch feature extraction.
[0032] S3. Perform hierarchical attention feature extraction based on window partitioning on the time-domain time series feature map, global frequency domain distribution map and Mel spectrogram respectively to obtain the corresponding discriminative feature vector; Three identical branch networks with independent weight parameters are constructed to extract deep discriminative feature vectors in parallel from the temporal-domain feature map, the global frequency domain distribution map, and the Mel spectrogram, respectively. All three branch networks employ a window-based hierarchical attention architecture, and the specific processing steps of each branch are as follows: Please see Figure 3 The time-domain time series feature maps include the following: S311. The time-domain time series feature map is uniformly divided into windows to obtain multiple local time-domain feature windows; The input temporal feature map is uniformly divided into multiple non-overlapping local temporal feature windows according to a set window size. Each local temporal feature window contains byte value information of each pixel position within the window, preserving the temporal adjacency relationship of the original message bytes in the local space. Uniform window segmentation decomposes the global feature map into a set of local regions, constraining subsequent attention calculations within each local window to control computational complexity.
[0033] S312. Perform window self-attention calculation on each local temporal domain feature window, and extract the temporal change correlation features within each window; For each image patch within a local temporal feature window, calculate its query matrix. Key matrix Sum matrix Suppose the current local window contains There are image patches, and the dimension of single-head attention is... ,but Introducing a relative position offset matrix The self-attention calculation within a local window is defined as the relative spatial relationship between image blocks within the encoding window. In the formula: To query the matrix product of the key matrix and the transpose of the key matrix, representing the correlation strength between the features of each image patch within the window; This is a scaling factor used to prevent the softmax gradient from vanishing due to excessively large vector dot product values. The relative position bias matrix provides prior information on the relative positions between image patches; the Softmax function normalizes the correlation scores into an attention weight distribution. For the value matrix, the attention weights and The weighted summation outputs the temporal variation correlation features of each image patch within the window. These temporal variation correlation features refer to the temporal dependencies and local mutation patterns between byte positions within the window, captured through a self-attention mechanism.
[0034] S313. By fusing the temporal change association features of all local temporal feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the temporal feature map is obtained.
[0035] As the network depth increases, spatial downsampling of the feature maps is performed through block merging layers. Features from adjacent 2×2 local windows are concatenated and then subjected to dimensionality reduction via linear layers, halving the spatial resolution and doubling the channel dimension layer by layer. In consecutive two-layer window attention modules, multi-head self-attention based on standard window partitioning and multi-head self-attention based on offset window partitioning are alternately used to establish information exchange between adjacent windows. After multi-layer encoding, global average pooling is performed on the feature tensor in the last layer of the branch network, compressing the high-level features of all local temporal feature windows into a one-dimensional vector, outputting a temporal discriminative feature vector.
[0036] Please see Figure 4 The specific global frequency domain distribution diagram is as follows: S321. Perform window-based uniform block division on the global frequency domain distribution map to obtain multiple local frequency domain feature windows; The input global frequency domain distribution map is uniformly divided into multiple non-overlapping local frequency domain feature windows with the same window size as the time domain branch. Each local frequency domain feature window contains the energy value information of each frequency component within the window, preserving the energy distribution relationship of the message signal within the local frequency band.
[0037] S322. Perform window self-attention calculation on each local frequency domain feature window to extract the local correlation features of frequency energy distribution within each window; For image patches within each local frequency domain feature window, the same window self-attention calculation method as the time domain branch is used, through a query matrix. Key matrix Sum matrix Calculate the attention weights between frequency components within the window, and combine them with the relative position bias matrix. Extract local correlation features of frequency energy distribution within a window. These local correlation features refer to the correlation of energy strength and spectral structure patterns between frequency components within the window, captured through a self-attention mechanism.
[0038] S323. By fusing the local correlation features of all local frequency domain feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the global frequency domain distribution map is obtained.
[0039] Similar to the time-domain branch, the hierarchical processing flow involves dimensionality reduction through block merging layers and cross-window information interaction through alternating standard and offset window attention. Finally, the frequency domain discriminative feature vector is output through global average pooling.
[0040] Please see Figure 5 The specific details regarding the Mel spectrogram are as follows: S331. Perform window-based uniform block division on the Mel spectrogram to obtain multiple local time-frequency feature windows; The input Mel spectrogram is uniformly divided into multiple non-overlapping local time-frequency feature windows with the same window size as the time-domain branch. The horizontal axis of the Mel spectrogram represents the time frame number, and the vertical axis represents the Mel filter number. Each local time-frequency feature window contains local information in both the time and frequency dimensions, preserving the joint time-frequency characteristics of the message signal within a local time period and local frequency band.
[0041] S332. Perform window self-attention calculation on each local time-frequency feature window to extract the key local time-frequency features within each window; For image patches within each local time-frequency feature window, the same window self-attention calculation method as the time domain branch is used to extract the joint time-frequency key features between the time frame and the Mel frequency band within the window. These local time-frequency key features refer to the energy distribution patterns between specific time periods and specific frequency bands within the window captured by the self-attention mechanism. These patterns reflect subtle discriminative information about the periodic interaction behavior of the device in the joint time-frequency domain.
[0042] S333. By fusing the key local time-frequency features of all local time-frequency feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the Mel spectrogram is obtained.
[0043] The same hierarchical processing flow as the time-domain branch is used to achieve cross-window information interaction through block merging layer-by-layer dimensionality reduction and alternating standard window and offset window attention. Finally, the time-frequency domain discriminative feature vector is output through global average pooling.
[0044] The three branch networks ultimately output temporal discriminative feature vectors independently. Frequency domain discrimination feature vector and time-frequency domain discriminative feature vector This serves as the high-level semantic input for subsequent cross-dimensional feature fusion.
[0045] S4. Concatenate all discriminative feature vectors, generate corresponding dynamic weights through a gating network, and use the dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain a comprehensive feature vector, including the following: Please see Figure 6 The specific implementation of this step is as follows: S41. Concatenate all the discriminative feature vectors to obtain joint features; The time-domain discriminative feature vector output by S3 Frequency domain discrimination feature vector and time-frequency domain discriminative feature vector A concatenation operation is performed along the channel dimension to generate a joint feature vector. The joint feature vector is a single high-dimensional vector formed by concatenating three independent discriminative feature vectors end-to-end. It retains complete initial high-order information across the time, frequency, and time-frequency domains, serving as input to the subsequent gating network. The three discriminative feature vectors, after their respective global average pooling, have the same feature dimension and can be directly concatenated along the channel dimension.
[0046] S42. Input the joint features into the gated network, adaptively learn the differences in classification contribution of features of different modalities, and obtain the dynamic weight coefficients corresponding to all discriminative feature vectors; A gated weight allocation network based on a multilayer perceptron is constructed. This network consists of two fully connected layers alternating with nonlinear activation functions. The first fully connected layer combines the ReLU activation function to perform joint feature allocation. Spatial dimensionality reduction and nonlinear mapping are performed to extract implicit cross-dimensional interaction information; the second fully connected layer maps the hidden features to a 3-dimensional output space. A Softmax activation function is applied to the output of the gated network to calculate the dynamic weight coefficients for the three discriminative feature vectors. , and The forward computation process of the gated network is as follows: In the formula: The joint feature vector is composed of three discriminative feature vectors concatenated together. is the learnable weight matrix of the first fully connected layer, used to map joint features to the hidden layer space; This is the bias vector of the first fully connected layer; ReLU activation function is used to introduce non-linear expressive power into the network; This is the learnable weight matrix for the second fully connected layer, used to map hidden layer features to the three-dimensional output space; This represents the bias vector for the second fully connected layer; the Softmax function normalizes the 3D output to a probability distribution. Three dynamic weight coefficients are generated. , and The fusion weights, corresponding to the discriminative feature vectors in the time domain, frequency domain, and time-frequency domain respectively, are strictly constrained within the interval (0,1) and satisfy the following conditions: The normalization conditions.
[0047] Gated networks can adaptively learn the differences in the contribution of each dimension of features to the classification task based on the joint features of the current input, and dynamically adjust the fusion weights of each dimension. When the feature quality of a certain dimension of the message signal deteriorates due to network jitter or background noise, the gated network will automatically reduce the weight coefficient of that dimension and correspondingly increase the weights of other dimensions, thereby achieving efficient scheduling of features across all dimensions.
[0048] S43. Adaptively weight all discriminative feature vectors according to the dynamic weight coefficients to obtain the weighted discriminative feature vectors; The dynamic weight coefficients output by the gating network , and Each with the corresponding original discriminative feature vector , and Scalar multiplication is performed to obtain weighted discriminative feature vectors in the time domain, frequency domain, and time-frequency domain. Weighting involves multiplying all elements of each feature vector by its corresponding weight coefficient, thereby scaling the contribution of each feature dimension to the fusion process according to its weight.
[0049] S44. Fuse all weighted and assigned identification feature vectors to obtain a comprehensive feature vector that can dynamically adapt to the time-varying power network environment.
[0050] The three weighted discriminative feature vectors are then summed element-wise at their corresponding channel positions to generate a comprehensive feature vector. Fusion computing is defined as: This gating fusion mechanism enables the network to adaptively allocate weights based on the real-time feature response strength of the current input message sequence in each physical dimension. In complex real-world power monitoring scenarios, when a certain dimension of the input message signal is subjected to sudden interference, the gating module automatically reduces the fusion weight of that dimension and correspondingly increases the weights of other anti-interference dimensions, thereby ensuring the stability and high discriminative power of the comprehensive feature vector.
[0051] S5. Perform dynamic pruning on the comprehensive feature vector based on channel attention mechanism to obtain sparse feature vectors; including the following: 1. Use a channel attention network to evaluate the channel contribution of the comprehensive feature vector and obtain the contribution score of each channel.
[0052] Construct a lightweight channel attention network to process the comprehensive feature vector output by S4. The nonlinear interaction and feature recalibration between channels are performed. The channel attention network consists of two fully connected layers alternating with activation functions; the first fully connected layer performs dimensionality reduction projection on the comprehensive feature vector, with a compression ratio of [value missing]. Channel dimensions From compression to Subsequently, a nonlinearity is introduced through the ReLU activation function; the second fully connected layer restores the compressed features to the original channel dimension. Finally, the output is mapped to the (0,1) interval by the Sigmoid activation function to obtain the contribution score vector of each channel. Channel contribution score The calculation process is as follows: In the formula: This is a dimension-reducing projection matrix used to compress channel dimensions to aggregate global information; This is the channel compression ratio coefficient; The ReLU activation function is used to introduce nonlinearity into the dimensionality-reduced features. To restore the dimension-upgraded matrix, the compressed features are restored to the original channel dimension; The Sigmoid activation function normalizes the output to the (0,1) interval. The channel contribution score vector is... The value of the nth element represents the nth element in the comprehensive feature vector. The contribution of each feature channel to the device recognition task. 2. Generate a pruning mask based on the contribution score, and perform dynamic pruning on the comprehensive feature vector to obtain a sparse feature vector.
[0053] Set channel retention threshold Contribution score vector Scores and thresholds for each channel Compare scores. For scores greater than or equal to... Channels with high scores are identified as high-value feature channels, and their corresponding mask elements are set to 1 to retain them; for channels with scores less than 1, the corresponding mask elements are set to 1 to retain them. Channels deemed to be low-contribution redundant channels that provide no effective discrimination information in the time, frequency, and time-frequency domains are removed by setting their corresponding mask elements to 0. This leads to the construction of a binary pruning mask vector with the same dimension as the comprehensive feature vector. Pruning mask Compared with the original integrated feature vector Perform element-wise Hadamard product operations to obtain the pruned sparse feature vector. : In the formula: This represents element-wise multiplication. Sparse eigenvectors are eigenvectors that, after being filtered by a mask, retain only the high-contribution channels while setting the low-contribution channels to zero.
[0054] The channel attention pruning mechanism physically truncates the subsequent feature transmission of redundant channels through a mask. While preserving the core fingerprint information of the message, it effectively compresses the feature dimension, reduces the input dimension and computational parameters of the subsequent classification layer, and optimizes the model inference efficiency while maintaining recognition accuracy.
[0055] S6. Input the sparse feature vector into the classification layer and output the power equipment type identification result corresponding to the current message sequence.
[0056] The sparse feature vector output by S5 The input is fed into a fully connected classification layer. This fully connected classification layer linearly maps the high-dimensional sparse features to a dimension of 1. The discrete label space, where This represents the total number of known power equipment categories within the system's monitoring range. The Softmax function then calculates the probability distribution vector of the current input sequence belonging to each type of power equipment. : In the formula: This is the learnable weight matrix for the fully connected classification layer, used to map sparse features to the class space; This is the bias vector; the Softmax function converts the linear mapping output into normalized probability values for each class. Probability distribution vector. The The element value indicates that the current input message sequence belongs to the th element. The probability of electrical equipment.
[0057] Finally, extract the probability distribution vector. The index corresponding to the maximum value is used as the power equipment type identification result for the current message sequence and is output. The power equipment type identification result refers to the specific model or category identifier of the equipment determined by the system based on the input message sequence.
[0058] An embodiment of a power equipment identification device based on multi-dimensional time-frequency feature gating fusion, as described in this application, includes the following: The standard byte sequence determination module is used to acquire raw network packet data in the power system and convert the raw network packet data into a standard byte sequence. The time-domain, frequency-domain, and time-frequency-domain mapping modules are used to perform time-domain, frequency-domain, and time-frequency-domain mapping on standard byte sequences to obtain a time-domain timing feature map, a global frequency-domain distribution map, and a Mel spectrum map. Among them, the time-frequency-domain mapping uses a Mel filter bank to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. The discriminant feature vector determination module is used to perform hierarchical attention feature extraction based on window partitioning on the time-domain time-series feature map, the global frequency domain distribution map, and the Mel spectrogram, respectively, to obtain the corresponding discriminant feature vectors; The comprehensive feature vector determination module is used to concatenate all the discriminative feature vectors, generate corresponding dynamic weights through a gating network, and use the dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain the comprehensive feature vector. The sparse feature vector determination module is used to perform dynamic pruning on the comprehensive feature vector based on the channel attention mechanism to obtain sparse feature vectors. The power equipment type identification result output module is used to input sparse feature vectors into the classification layer and output the power equipment type identification result corresponding to the current message sequence.
[0059] For specific limitations regarding the device, please refer to the limitations of the method above, which will not be repeated here. Each module in the above device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0060] It is understood that those skilled in the art can combine various implementation methods in the above embodiments under the guidance of the above examples to obtain technical solutions with multiple implementation methods.
[0061] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for identifying power equipment based on multi-dimensional time-frequency feature gating fusion, characterized in that, Includes the following steps: Acquire raw network packet data from the power system and convert the raw network packet data into a standard byte sequence; The standard byte sequence is mapped in the time domain, frequency domain, and time-frequency domain to obtain a time-domain timing feature map, a global frequency domain distribution map, and a Mel spectrum map. Among them, the time-frequency domain mapping uses a Mel filter bank to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. The time-domain time-series feature map, global frequency domain distribution map, and Mel spectrogram are subjected to hierarchical attention feature extraction based on window partitioning to obtain the corresponding discriminative feature vectors; All the discriminative feature vectors are concatenated, and corresponding dynamic weights are generated through a gating network. The discriminative feature vectors are then weighted and fused using the dynamic weights to obtain a comprehensive feature vector. The comprehensive feature vector is subjected to dynamic pruning based on the channel attention mechanism to obtain a sparse feature vector; The sparse feature vector is input into the classification layer, and the power equipment type identification result corresponding to the current message sequence is output.
2. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 1, characterized in that, The step of converting the original network packet data into a standard byte sequence specifically includes: The original network packet data is time-series sliced and cleaned to obtain cleaned payload data; The cleaned payload data is then sequentially spliced to obtain a standard byte sequence.
3. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 1, characterized in that, The time-domain mapping specifically includes: The standard byte sequence is subjected to temporal-space reconstruction processing to obtain a two-dimensional sequence matrix; The two-dimensional sequence matrix is normalized to obtain a time-domain time-series feature map that retains the temporal adjacency relationship and abrupt change information of the messages.
4. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 1, characterized in that, The frequency domain mapping specifically includes: Perform a discrete Fourier transform on the standard byte sequence to obtain the frequency domain amplitude spectrum; The global frequency distribution information of the message is extracted from the frequency domain amplitude spectrum and reconstructed to obtain a global frequency domain distribution map that can characterize the frequency distribution of the original network message data signal in the global range.
5. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 1, characterized in that, The time-frequency domain mapping specifically includes: The standard byte sequence is divided into frames using a sliding window to obtain multiple frame byte sequences. Perform a short-time Fourier transform on each frame byte sequence to obtain the complex spectrum corresponding to each frame byte sequence, and calculate the power spectrum corresponding to each frame byte sequence based on the complex spectrum. A set of Mel filter banks with equal intervals on the Mel scale is constructed. The power spectrum corresponding to each frame byte sequence is non-uniformly sampled and logarithmically compressed using the Mel filter banks to obtain a Mel spectrum map that enhances the low-frequency communication components of power equipment.
6. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 3, characterized in that, The step of performing hierarchical attention feature extraction based on window partitioning on the temporal-domain time-series feature map to obtain the corresponding discriminative feature vector specifically includes: The time-domain time series feature map is divided into multiple local time-domain feature windows by uniformly dividing it into windows. Window self-attention calculation is performed on each local temporal domain feature window to extract temporal change correlation features within each window; By fusing the temporal variation associated features of all local temporal feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the temporal series feature map is obtained.
7. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 4, characterized in that, The step of extracting hierarchical attention features from the global frequency domain distribution map based on window partitioning to obtain the corresponding discriminative feature vector specifically includes: The global frequency domain distribution map is divided into uniform blocks based on windows to obtain multiple local frequency domain feature windows; Window self-attention calculation is performed on each local frequency domain feature window to extract the local correlation features of frequency energy distribution within each window; By fusing the local correlation features of all local frequency domain feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the global frequency domain distribution map is obtained.
8. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 5, characterized in that, The step of extracting hierarchical attention features from the Mel spectrogram based on window partitioning to obtain the corresponding discriminative feature vector specifically includes: The Mel spectrogram is divided into multiple local time-frequency feature windows by uniformly dividing it into window-based blocks. Window self-attention calculation is performed on each local time-frequency feature window to extract key local time-frequency features within each window; By fusing the key local time-frequency features of all local time-frequency feature windows through hierarchical window attention and completing hierarchical encoding, the discriminative feature vector corresponding to the Mel spectrogram is obtained.
9. The power equipment identification method based on multi-dimensional time-frequency feature gating fusion according to claim 1, characterized in that, The process of concatenating all the discriminative feature vectors, generating corresponding dynamic weights through a gating network, and then using these dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain a comprehensive feature vector specifically includes: All discriminative feature vectors are concatenated to obtain joint features; The joint features are input into a gating network, which adaptively learns the differences in the classification contributions of features of different modalities to obtain the dynamic weight coefficients corresponding to all discriminative feature vectors. Based on the dynamic weight coefficients, all discriminative feature vectors are adaptively weighted to obtain the weighted discriminative feature vectors. By fusing all weighted and assigned identification feature vectors, a comprehensive feature vector that can dynamically adapt to the time-varying power network environment is obtained.
10. A power equipment identification device based on multi-dimensional time-frequency feature gating fusion, characterized in that, include: A standard byte sequence determination module is used to acquire raw network packet data in the power system and convert the raw network packet data into a standard byte sequence. The time-domain, frequency-domain, and time-frequency-domain mapping module is used to perform time-domain, frequency-domain, and time-frequency-domain mapping on the standard byte sequence to obtain a time-domain timing feature map, a global frequency-domain distribution map, and a Mel spectrum map; wherein, during time-frequency-domain mapping, a Mel filter bank is used to perform non-uniform sampling of the power spectrum to enhance the low-frequency components during power equipment communication. The discriminant feature vector determination module is used to perform hierarchical attention feature extraction based on window partitioning on the time-domain time-series feature map, global frequency domain distribution map and Mel spectrogram respectively to obtain the corresponding discriminant feature vector; The comprehensive feature vector determination module is used to concatenate all the discriminative feature vectors, generate corresponding dynamic weights through a gating network, and use the dynamic weights to perform weighted fusion of the discriminative feature vectors to obtain a comprehensive feature vector. The sparse feature vector determination module is used to perform dynamic pruning processing on the comprehensive feature vector based on the channel attention mechanism to obtain sparse feature vectors. The power equipment type identification result output module is used to input the sparse feature vector into the classification layer and output the power equipment type identification result corresponding to the current message sequence.
